380dec4d3ed1b6f12606968e16e3fca278788f83
[dpdk.git] / drivers / net / bnxt / hsi_struct_def_dpdk.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2014-2022 Broadcom Inc.
3  * All rights reserved.
4  *
5  * DO NOT MODIFY!!! This file is automatically generated.
6  */
7
8 #ifndef _HSI_STRUCT_DEF_DPDK_H_
9 #define _HSI_STRUCT_DEF_DPDK_H_
10
11 /* This is the HWRM command header. */
12 /* hwrm_cmd_hdr (size:128b/16B) */
13 struct hwrm_cmd_hdr {
14         /* The HWRM command request type. */
15         uint16_t        req_type;
16         /*
17          * The completion ring to send the completion event on. This should
18          * be the NQ ID returned from the `nq_alloc` HWRM command.
19          */
20         uint16_t        cmpl_ring;
21         /*
22          * The sequence ID is used by the driver for tracking multiple
23          * commands. This ID is treated as opaque data by the firmware and
24          * the value is returned in the `hwrm_resp_hdr` upon completion.
25          */
26         uint16_t        seq_id;
27         /*
28          * The target ID of the command:
29          * * 0x0-0xFFF8 - The function ID
30          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31          * * 0xFFFD - Reserved for user-space HWRM interface
32          * * 0xFFFF - HWRM
33          */
34         uint16_t        target_id;
35         /*
36          * A physical address pointer pointing to a host buffer that the
37          * command's response data will be written. This can be either a host
38          * physical address (HPA) or a guest physical address (GPA) and must
39          * point to a physically contiguous block of memory.
40          */
41         uint64_t        resp_addr;
42 } __rte_packed;
43
44 /* This is the HWRM response header. */
45 /* hwrm_resp_hdr (size:64b/8B) */
46 struct hwrm_resp_hdr {
47         /* The specific error status for the command. */
48         uint16_t        error_code;
49         /* The HWRM command request type. */
50         uint16_t        req_type;
51         /* The sequence ID from the original command. */
52         uint16_t        seq_id;
53         /* The length of the response data in number of bytes. */
54         uint16_t        resp_len;
55 } __rte_packed;
56
57 /*
58  * TLV encapsulated message. Use the TLV type field of the
59  * TLV to determine the type of message encapsulated.
60  */
61 #define CMD_DISCR_TLV_ENCAP UINT32_C(0x8000)
62 #define CMD_DISCR_LAST     CMD_DISCR_TLV_ENCAP
63
64
65 /* HWRM request message */
66 #define TLV_TYPE_HWRM_REQUEST                    UINT32_C(0x1)
67 /* HWRM response message */
68 #define TLV_TYPE_HWRM_RESPONSE                   UINT32_C(0x2)
69 /* RoCE slow path command */
70 #define TLV_TYPE_ROCE_SP_COMMAND                 UINT32_C(0x3)
71 /* RoCE slow path command to query CC Gen1 support. */
72 #define TLV_TYPE_QUERY_ROCE_CC_GEN1              UINT32_C(0x4)
73 /* RoCE slow path command to modify CC Gen1 support. */
74 #define TLV_TYPE_MODIFY_ROCE_CC_GEN1             UINT32_C(0x5)
75 /* Engine CKV - The Alias key EC curve and ECC public key information. */
76 #define TLV_TYPE_ENGINE_CKV_ALIAS_ECC_PUBLIC_KEY UINT32_C(0x8001)
77 /* Engine CKV - Initialization vector. */
78 #define TLV_TYPE_ENGINE_CKV_IV                   UINT32_C(0x8003)
79 /* Engine CKV - Authentication tag. */
80 #define TLV_TYPE_ENGINE_CKV_AUTH_TAG             UINT32_C(0x8004)
81 /* Engine CKV - The encrypted data. */
82 #define TLV_TYPE_ENGINE_CKV_CIPHERTEXT           UINT32_C(0x8005)
83 /* Engine CKV - Supported host_algorithms. */
84 #define TLV_TYPE_ENGINE_CKV_HOST_ALGORITHMS      UINT32_C(0x8006)
85 /* Engine CKV - The Host EC curve name and ECC public key information. */
86 #define TLV_TYPE_ENGINE_CKV_HOST_ECC_PUBLIC_KEY  UINT32_C(0x8007)
87 /* Engine CKV - The ECDSA signature. */
88 #define TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE      UINT32_C(0x8008)
89 /* Engine CKV - The firmware EC curve name and ECC public key information. */
90 #define TLV_TYPE_ENGINE_CKV_FW_ECC_PUBLIC_KEY    UINT32_C(0x8009)
91 /* Engine CKV - Supported firmware algorithms. */
92 #define TLV_TYPE_ENGINE_CKV_FW_ALGORITHMS        UINT32_C(0x800a)
93 #define TLV_TYPE_LAST \
94         TLV_TYPE_ENGINE_CKV_FW_ALGORITHMS
95
96
97 /* tlv (size:64b/8B) */
98 struct tlv {
99         /*
100          * The command discriminator is used to differentiate between various
101          * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
102          * command messages as well as newer TLV encapsulated HWRM commands.
103          *
104          * For TLV encapsulated messages this field must be 0x8000.
105          */
106         uint16_t        cmd_discr;
107         uint8_t reserved_8b;
108         uint8_t flags;
109         /*
110          * Indicates the presence of additional TLV encapsulated data
111          * follows this TLV.
112          */
113         #define TLV_FLAGS_MORE         UINT32_C(0x1)
114         /* Last TLV in a sequence of TLVs. */
115         #define TLV_FLAGS_MORE_LAST      UINT32_C(0x0)
116         /* More TLVs follow this TLV. */
117         #define TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
118         /*
119          * When an HWRM receiver detects a TLV type that it does not
120          * support with the TLV required flag set, the receiver must
121          * reject the HWRM message with an error code indicating an
122          * unsupported TLV type.
123          */
124         #define TLV_FLAGS_REQUIRED     UINT32_C(0x2)
125         /* No */
126         #define TLV_FLAGS_REQUIRED_NO    (UINT32_C(0x0) << 1)
127         /* Yes */
128         #define TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
129         #define TLV_FLAGS_REQUIRED_LAST TLV_FLAGS_REQUIRED_YES
130         /*
131          * This field defines the TLV type value which is divided into
132          * two ranges to differentiate between global and local TLV types.
133          * Global TLV types must be unique across all defined TLV types.
134          * Local TLV types are valid only for extensions to a given
135          * HWRM message and may be repeated across different HWRM message
136          * types. There is a direct correlation of each HWRM message type
137          * to a single global TLV type value.
138          *
139          * Global TLV range: `0 - (63k-1)`
140          *
141          * Local TLV range: `63k - (64k-1)`
142          */
143         uint16_t        tlv_type;
144         /*
145          * Length of the message data encapsulated by this TLV in bytes.
146          * This length does not include the size of the TLV header itself
147          * and it must be an integer multiple of 8B.
148          */
149         uint16_t        length;
150 } __rte_packed;
151
152 /* Input */
153 /* input (size:128b/16B) */
154 struct input {
155         /*
156          * This value indicates what type of request this is.  The format
157          * for the rest of the command is determined by this field.
158          */
159         uint16_t        req_type;
160         /*
161          * This value indicates the what completion ring the request will
162          * be optionally completed on.  If the value is -1, then no
163          * CR completion will be generated.  Any other value must be a
164          * valid CR ring_id value for this function.
165          */
166         uint16_t        cmpl_ring;
167         /* This value indicates the command sequence number. */
168         uint16_t        seq_id;
169         /*
170          * Target ID of this command.
171          *
172          * 0x0 - 0xFFF8 - Used for function ids
173          * 0xFFF8 - 0xFFFE - Reserved for internal processors
174          * 0xFFFF - HWRM
175          */
176         uint16_t        target_id;
177         /*
178          * This is the host address where the response will be written
179          * when the request is complete.  This area must be 16B aligned
180          * and must be cleared to zero before the request is made.
181          */
182         uint64_t        resp_addr;
183 } __rte_packed;
184
185 /* Output */
186 /* output (size:64b/8B) */
187 struct output {
188         /*
189          * Pass/Fail or error type
190          *
191          * Note: receiver to verify the in parameters, and fail the call
192          * with an error when appropriate
193          */
194         uint16_t        error_code;
195         /* This field returns the type of original request. */
196         uint16_t        req_type;
197         /* This field provides original sequence number of the command. */
198         uint16_t        seq_id;
199         /*
200          * This field is the length of the response in bytes.  The
201          * last byte of the response is a valid flag that will read
202          * as '1' when the command has been completely written to
203          * memory.
204          */
205         uint16_t        resp_len;
206 } __rte_packed;
207
208 /* Short Command Structure */
209 /* hwrm_short_input (size:128b/16B) */
210 struct hwrm_short_input {
211         /*
212          * This field indicates the type of request in the request buffer.
213          * The format for the rest of the command (request) is determined
214          * by this field.
215          */
216         uint16_t        req_type;
217         /*
218          * This field indicates a signature that is used to identify short
219          * form of the command listed here. This field shall be set to
220          * 17185 (0x4321).
221          */
222         uint16_t        signature;
223         /* Signature indicating this is a short form of HWRM command */
224         #define HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD UINT32_C(0x4321)
225         #define HWRM_SHORT_INPUT_SIGNATURE_LAST \
226                 HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD
227         /* The target ID of the command */
228         uint16_t        target_id;
229         /* Default target_id (0x0) to maintain compatibility with old driver */
230         #define HWRM_SHORT_INPUT_TARGET_ID_DEFAULT UINT32_C(0x0)
231         /* Reserved for user-space HWRM interface */
232         #define HWRM_SHORT_INPUT_TARGET_ID_TOOLS   UINT32_C(0xfffd)
233         #define HWRM_SHORT_INPUT_TARGET_ID_LAST \
234                 HWRM_SHORT_INPUT_TARGET_ID_TOOLS
235         /* This value indicates the length of the request. */
236         uint16_t        size;
237         /*
238          * This is the host address where the request was written.
239          * This area must be 16B aligned.
240          */
241         uint64_t        req_addr;
242 } __rte_packed;
243
244 /*
245  * Command numbering
246  * # NOTE - definitions already in hwrm_req_type, in hwrm_types.yaml
247  * #        So only structure definition is provided here.
248  */
249 /* cmd_nums (size:64b/8B) */
250 struct cmd_nums {
251         /*
252          * This version of the specification defines the commands listed in
253          * the table below. The following are general implementation
254          * requirements for these commands:
255          *
256          * # All commands listed below that are marked neither
257          * reserved nor experimental shall be implemented by the HWRM.
258          * # A HWRM client compliant to this specification should not use
259          * commands outside of the list below.
260          * # A HWRM client compliant to this specification should not use
261          * command numbers marked reserved below.
262          * # A command marked experimental below may not be implemented
263          * by the HWRM.
264          * # A command marked experimental may change in the
265          * future version of the HWRM specification.
266          * # A command not listed below may be implemented by the HWRM.
267          * The behavior of commands that are not listed below is outside
268          * the scope of this specification.
269          */
270         uint16_t        req_type;
271         #define HWRM_VER_GET                              UINT32_C(0x0)
272         #define HWRM_FUNC_ECHO_RESPONSE                   UINT32_C(0xb)
273         #define HWRM_ERROR_RECOVERY_QCFG                  UINT32_C(0xc)
274         #define HWRM_FUNC_DRV_IF_CHANGE                   UINT32_C(0xd)
275         #define HWRM_FUNC_BUF_UNRGTR                      UINT32_C(0xe)
276         #define HWRM_FUNC_VF_CFG                          UINT32_C(0xf)
277         /* Reserved for future use. */
278         #define HWRM_RESERVED1                            UINT32_C(0x10)
279         #define HWRM_FUNC_RESET                           UINT32_C(0x11)
280         #define HWRM_FUNC_GETFID                          UINT32_C(0x12)
281         #define HWRM_FUNC_VF_ALLOC                        UINT32_C(0x13)
282         #define HWRM_FUNC_VF_FREE                         UINT32_C(0x14)
283         #define HWRM_FUNC_QCAPS                           UINT32_C(0x15)
284         #define HWRM_FUNC_QCFG                            UINT32_C(0x16)
285         #define HWRM_FUNC_CFG                             UINT32_C(0x17)
286         #define HWRM_FUNC_QSTATS                          UINT32_C(0x18)
287         #define HWRM_FUNC_CLR_STATS                       UINT32_C(0x19)
288         #define HWRM_FUNC_DRV_UNRGTR                      UINT32_C(0x1a)
289         #define HWRM_FUNC_VF_RESC_FREE                    UINT32_C(0x1b)
290         #define HWRM_FUNC_VF_VNIC_IDS_QUERY               UINT32_C(0x1c)
291         #define HWRM_FUNC_DRV_RGTR                        UINT32_C(0x1d)
292         #define HWRM_FUNC_DRV_QVER                        UINT32_C(0x1e)
293         #define HWRM_FUNC_BUF_RGTR                        UINT32_C(0x1f)
294         #define HWRM_PORT_PHY_CFG                         UINT32_C(0x20)
295         #define HWRM_PORT_MAC_CFG                         UINT32_C(0x21)
296         /* Experimental */
297         #define HWRM_PORT_TS_QUERY                        UINT32_C(0x22)
298         #define HWRM_PORT_QSTATS                          UINT32_C(0x23)
299         #define HWRM_PORT_LPBK_QSTATS                     UINT32_C(0x24)
300         /* Experimental */
301         #define HWRM_PORT_CLR_STATS                       UINT32_C(0x25)
302         /* Experimental */
303         #define HWRM_PORT_LPBK_CLR_STATS                  UINT32_C(0x26)
304         #define HWRM_PORT_PHY_QCFG                        UINT32_C(0x27)
305         #define HWRM_PORT_MAC_QCFG                        UINT32_C(0x28)
306         /* Experimental */
307         #define HWRM_PORT_MAC_PTP_QCFG                    UINT32_C(0x29)
308         #define HWRM_PORT_PHY_QCAPS                       UINT32_C(0x2a)
309         #define HWRM_PORT_PHY_I2C_WRITE                   UINT32_C(0x2b)
310         #define HWRM_PORT_PHY_I2C_READ                    UINT32_C(0x2c)
311         #define HWRM_PORT_LED_CFG                         UINT32_C(0x2d)
312         #define HWRM_PORT_LED_QCFG                        UINT32_C(0x2e)
313         #define HWRM_PORT_LED_QCAPS                       UINT32_C(0x2f)
314         #define HWRM_QUEUE_QPORTCFG                       UINT32_C(0x30)
315         #define HWRM_QUEUE_QCFG                           UINT32_C(0x31)
316         #define HWRM_QUEUE_CFG                            UINT32_C(0x32)
317         #define HWRM_FUNC_VLAN_CFG                        UINT32_C(0x33)
318         #define HWRM_FUNC_VLAN_QCFG                       UINT32_C(0x34)
319         #define HWRM_QUEUE_PFCENABLE_QCFG                 UINT32_C(0x35)
320         #define HWRM_QUEUE_PFCENABLE_CFG                  UINT32_C(0x36)
321         #define HWRM_QUEUE_PRI2COS_QCFG                   UINT32_C(0x37)
322         #define HWRM_QUEUE_PRI2COS_CFG                    UINT32_C(0x38)
323         #define HWRM_QUEUE_COS2BW_QCFG                    UINT32_C(0x39)
324         #define HWRM_QUEUE_COS2BW_CFG                     UINT32_C(0x3a)
325         #define HWRM_QUEUE_DSCP_QCAPS                     UINT32_C(0x3b)
326         #define HWRM_QUEUE_DSCP2PRI_QCFG                  UINT32_C(0x3c)
327         #define HWRM_QUEUE_DSCP2PRI_CFG                   UINT32_C(0x3d)
328         #define HWRM_VNIC_ALLOC                           UINT32_C(0x40)
329         #define HWRM_VNIC_FREE                            UINT32_C(0x41)
330         #define HWRM_VNIC_CFG                             UINT32_C(0x42)
331         #define HWRM_VNIC_QCFG                            UINT32_C(0x43)
332         #define HWRM_VNIC_TPA_CFG                         UINT32_C(0x44)
333         /* Experimental */
334         #define HWRM_VNIC_TPA_QCFG                        UINT32_C(0x45)
335         #define HWRM_VNIC_RSS_CFG                         UINT32_C(0x46)
336         #define HWRM_VNIC_RSS_QCFG                        UINT32_C(0x47)
337         #define HWRM_VNIC_PLCMODES_CFG                    UINT32_C(0x48)
338         #define HWRM_VNIC_PLCMODES_QCFG                   UINT32_C(0x49)
339         #define HWRM_VNIC_QCAPS                           UINT32_C(0x4a)
340         /* Updates specific fields in RX VNIC structure */
341         #define HWRM_VNIC_UPDATE                          UINT32_C(0x4b)
342         #define HWRM_RING_ALLOC                           UINT32_C(0x50)
343         #define HWRM_RING_FREE                            UINT32_C(0x51)
344         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS        UINT32_C(0x52)
345         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS     UINT32_C(0x53)
346         #define HWRM_RING_AGGINT_QCAPS                    UINT32_C(0x54)
347         #define HWRM_RING_SCHQ_ALLOC                      UINT32_C(0x55)
348         #define HWRM_RING_SCHQ_CFG                        UINT32_C(0x56)
349         #define HWRM_RING_SCHQ_FREE                       UINT32_C(0x57)
350         #define HWRM_RING_RESET                           UINT32_C(0x5e)
351         #define HWRM_RING_GRP_ALLOC                       UINT32_C(0x60)
352         #define HWRM_RING_GRP_FREE                        UINT32_C(0x61)
353         #define HWRM_RING_CFG                             UINT32_C(0x62)
354         #define HWRM_RING_QCFG                            UINT32_C(0x63)
355         /* Reserved for future use. */
356         #define HWRM_RESERVED5                            UINT32_C(0x64)
357         /* Reserved for future use. */
358         #define HWRM_RESERVED6                            UINT32_C(0x65)
359         #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC            UINT32_C(0x70)
360         #define HWRM_VNIC_RSS_COS_LB_CTX_FREE             UINT32_C(0x71)
361         #define HWRM_QUEUE_MPLS_QCAPS                     UINT32_C(0x80)
362         #define HWRM_QUEUE_MPLSTC2PRI_QCFG                UINT32_C(0x81)
363         #define HWRM_QUEUE_MPLSTC2PRI_CFG                 UINT32_C(0x82)
364         #define HWRM_QUEUE_VLANPRI_QCAPS                  UINT32_C(0x83)
365         #define HWRM_QUEUE_VLANPRI2PRI_QCFG               UINT32_C(0x84)
366         #define HWRM_QUEUE_VLANPRI2PRI_CFG                UINT32_C(0x85)
367         #define HWRM_QUEUE_GLOBAL_CFG                     UINT32_C(0x86)
368         #define HWRM_QUEUE_GLOBAL_QCFG                    UINT32_C(0x87)
369         #define HWRM_CFA_L2_FILTER_ALLOC                  UINT32_C(0x90)
370         #define HWRM_CFA_L2_FILTER_FREE                   UINT32_C(0x91)
371         #define HWRM_CFA_L2_FILTER_CFG                    UINT32_C(0x92)
372         #define HWRM_CFA_L2_SET_RX_MASK                   UINT32_C(0x93)
373         #define HWRM_CFA_VLAN_ANTISPOOF_CFG               UINT32_C(0x94)
374         #define HWRM_CFA_TUNNEL_FILTER_ALLOC              UINT32_C(0x95)
375         #define HWRM_CFA_TUNNEL_FILTER_FREE               UINT32_C(0x96)
376         /* Experimental */
377         #define HWRM_CFA_ENCAP_RECORD_ALLOC               UINT32_C(0x97)
378         /* Experimental */
379         #define HWRM_CFA_ENCAP_RECORD_FREE                UINT32_C(0x98)
380         #define HWRM_CFA_NTUPLE_FILTER_ALLOC              UINT32_C(0x99)
381         #define HWRM_CFA_NTUPLE_FILTER_FREE               UINT32_C(0x9a)
382         #define HWRM_CFA_NTUPLE_FILTER_CFG                UINT32_C(0x9b)
383         /* Experimental */
384         #define HWRM_CFA_EM_FLOW_ALLOC                    UINT32_C(0x9c)
385         /* Experimental */
386         #define HWRM_CFA_EM_FLOW_FREE                     UINT32_C(0x9d)
387         /* Experimental */
388         #define HWRM_CFA_EM_FLOW_CFG                      UINT32_C(0x9e)
389         #define HWRM_TUNNEL_DST_PORT_QUERY                UINT32_C(0xa0)
390         #define HWRM_TUNNEL_DST_PORT_ALLOC                UINT32_C(0xa1)
391         #define HWRM_TUNNEL_DST_PORT_FREE                 UINT32_C(0xa2)
392         #define HWRM_STAT_CTX_ENG_QUERY                   UINT32_C(0xaf)
393         #define HWRM_STAT_CTX_ALLOC                       UINT32_C(0xb0)
394         #define HWRM_STAT_CTX_FREE                        UINT32_C(0xb1)
395         #define HWRM_STAT_CTX_QUERY                       UINT32_C(0xb2)
396         #define HWRM_STAT_CTX_CLR_STATS                   UINT32_C(0xb3)
397         #define HWRM_PORT_QSTATS_EXT                      UINT32_C(0xb4)
398         #define HWRM_PORT_PHY_MDIO_WRITE                  UINT32_C(0xb5)
399         #define HWRM_PORT_PHY_MDIO_READ                   UINT32_C(0xb6)
400         #define HWRM_PORT_PHY_MDIO_BUS_ACQUIRE            UINT32_C(0xb7)
401         #define HWRM_PORT_PHY_MDIO_BUS_RELEASE            UINT32_C(0xb8)
402         #define HWRM_PORT_QSTATS_EXT_PFC_WD               UINT32_C(0xb9)
403         /* Reserved. */
404         #define HWRM_RESERVED7                            UINT32_C(0xba)
405         #define HWRM_PORT_TX_FIR_CFG                      UINT32_C(0xbb)
406         #define HWRM_PORT_TX_FIR_QCFG                     UINT32_C(0xbc)
407         #define HWRM_PORT_ECN_QSTATS                      UINT32_C(0xbd)
408         #define HWRM_FW_LIVEPATCH_QUERY                   UINT32_C(0xbe)
409         #define HWRM_FW_LIVEPATCH                         UINT32_C(0xbf)
410         #define HWRM_FW_RESET                             UINT32_C(0xc0)
411         #define HWRM_FW_QSTATUS                           UINT32_C(0xc1)
412         #define HWRM_FW_HEALTH_CHECK                      UINT32_C(0xc2)
413         #define HWRM_FW_SYNC                              UINT32_C(0xc3)
414         #define HWRM_FW_STATE_QCAPS                       UINT32_C(0xc4)
415         #define HWRM_FW_STATE_QUIESCE                     UINT32_C(0xc5)
416         #define HWRM_FW_STATE_BACKUP                      UINT32_C(0xc6)
417         #define HWRM_FW_STATE_RESTORE                     UINT32_C(0xc7)
418         /* Experimental */
419         #define HWRM_FW_SET_TIME                          UINT32_C(0xc8)
420         /* Experimental */
421         #define HWRM_FW_GET_TIME                          UINT32_C(0xc9)
422         /* Experimental */
423         #define HWRM_FW_SET_STRUCTURED_DATA               UINT32_C(0xca)
424         /* Experimental */
425         #define HWRM_FW_GET_STRUCTURED_DATA               UINT32_C(0xcb)
426         /* Experimental */
427         #define HWRM_FW_IPC_MAILBOX                       UINT32_C(0xcc)
428         #define HWRM_FW_ECN_CFG                           UINT32_C(0xcd)
429         #define HWRM_FW_ECN_QCFG                          UINT32_C(0xce)
430         #define HWRM_FW_SECURE_CFG                        UINT32_C(0xcf)
431         #define HWRM_EXEC_FWD_RESP                        UINT32_C(0xd0)
432         #define HWRM_REJECT_FWD_RESP                      UINT32_C(0xd1)
433         #define HWRM_FWD_RESP                             UINT32_C(0xd2)
434         #define HWRM_FWD_ASYNC_EVENT_CMPL                 UINT32_C(0xd3)
435         #define HWRM_OEM_CMD                              UINT32_C(0xd4)
436         /* Tells the fw to run PRBS test on a given port and lane. */
437         #define HWRM_PORT_PRBS_TEST                       UINT32_C(0xd5)
438         #define HWRM_PORT_SFP_SIDEBAND_CFG                UINT32_C(0xd6)
439         #define HWRM_PORT_SFP_SIDEBAND_QCFG               UINT32_C(0xd7)
440         #define HWRM_FW_STATE_UNQUIESCE                   UINT32_C(0xd8)
441         /* Tells the fw to collect dsc dump on a given port and lane. */
442         #define HWRM_PORT_DSC_DUMP                        UINT32_C(0xd9)
443         #define HWRM_PORT_EP_TX_QCFG                      UINT32_C(0xda)
444         #define HWRM_PORT_EP_TX_CFG                       UINT32_C(0xdb)
445         #define HWRM_TEMP_MONITOR_QUERY                   UINT32_C(0xe0)
446         #define HWRM_REG_POWER_QUERY                      UINT32_C(0xe1)
447         #define HWRM_CORE_FREQUENCY_QUERY                 UINT32_C(0xe2)
448         #define HWRM_REG_POWER_HISTOGRAM                  UINT32_C(0xe3)
449         #define HWRM_WOL_FILTER_ALLOC                     UINT32_C(0xf0)
450         #define HWRM_WOL_FILTER_FREE                      UINT32_C(0xf1)
451         #define HWRM_WOL_FILTER_QCFG                      UINT32_C(0xf2)
452         #define HWRM_WOL_REASON_QCFG                      UINT32_C(0xf3)
453         /* Experimental */
454         #define HWRM_CFA_METER_QCAPS                      UINT32_C(0xf4)
455         /* Experimental */
456         #define HWRM_CFA_METER_PROFILE_ALLOC              UINT32_C(0xf5)
457         /* Experimental */
458         #define HWRM_CFA_METER_PROFILE_FREE               UINT32_C(0xf6)
459         /* Experimental */
460         #define HWRM_CFA_METER_PROFILE_CFG                UINT32_C(0xf7)
461         /* Experimental */
462         #define HWRM_CFA_METER_INSTANCE_ALLOC             UINT32_C(0xf8)
463         /* Experimental */
464         #define HWRM_CFA_METER_INSTANCE_FREE              UINT32_C(0xf9)
465         /* Experimental */
466         #define HWRM_CFA_METER_INSTANCE_CFG               UINT32_C(0xfa)
467         /* Experimental */
468         #define HWRM_CFA_VFR_ALLOC                        UINT32_C(0xfd)
469         /* Experimental */
470         #define HWRM_CFA_VFR_FREE                         UINT32_C(0xfe)
471         /* Experimental */
472         #define HWRM_CFA_VF_PAIR_ALLOC                    UINT32_C(0x100)
473         /* Experimental */
474         #define HWRM_CFA_VF_PAIR_FREE                     UINT32_C(0x101)
475         /* Experimental */
476         #define HWRM_CFA_VF_PAIR_INFO                     UINT32_C(0x102)
477         /* Experimental */
478         #define HWRM_CFA_FLOW_ALLOC                       UINT32_C(0x103)
479         /* Experimental */
480         #define HWRM_CFA_FLOW_FREE                        UINT32_C(0x104)
481         /* Experimental */
482         #define HWRM_CFA_FLOW_FLUSH                       UINT32_C(0x105)
483         /* Experimental */
484         #define HWRM_CFA_FLOW_STATS                       UINT32_C(0x106)
485         /* Experimental */
486         #define HWRM_CFA_FLOW_INFO                        UINT32_C(0x107)
487         /* Experimental */
488         #define HWRM_CFA_DECAP_FILTER_ALLOC               UINT32_C(0x108)
489         /* Experimental */
490         #define HWRM_CFA_DECAP_FILTER_FREE                UINT32_C(0x109)
491         #define HWRM_CFA_VLAN_ANTISPOOF_QCFG              UINT32_C(0x10a)
492         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC       UINT32_C(0x10b)
493         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE        UINT32_C(0x10c)
494         /* Experimental */
495         #define HWRM_CFA_PAIR_ALLOC                       UINT32_C(0x10d)
496         /* Experimental */
497         #define HWRM_CFA_PAIR_FREE                        UINT32_C(0x10e)
498         /* Experimental */
499         #define HWRM_CFA_PAIR_INFO                        UINT32_C(0x10f)
500         /* Experimental */
501         #define HWRM_FW_IPC_MSG                           UINT32_C(0x110)
502         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO        UINT32_C(0x111)
503         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE       UINT32_C(0x112)
504         /* Experimental */
505         #define HWRM_CFA_FLOW_AGING_TIMER_RESET           UINT32_C(0x113)
506         /* Experimental */
507         #define HWRM_CFA_FLOW_AGING_CFG                   UINT32_C(0x114)
508         /* Experimental */
509         #define HWRM_CFA_FLOW_AGING_QCFG                  UINT32_C(0x115)
510         /* Experimental */
511         #define HWRM_CFA_FLOW_AGING_QCAPS                 UINT32_C(0x116)
512         /* Experimental */
513         #define HWRM_CFA_CTX_MEM_RGTR                     UINT32_C(0x117)
514         /* Experimental */
515         #define HWRM_CFA_CTX_MEM_UNRGTR                   UINT32_C(0x118)
516         /* Experimental */
517         #define HWRM_CFA_CTX_MEM_QCTX                     UINT32_C(0x119)
518         /* Experimental */
519         #define HWRM_CFA_CTX_MEM_QCAPS                    UINT32_C(0x11a)
520         /* Experimental */
521         #define HWRM_CFA_COUNTER_QCAPS                    UINT32_C(0x11b)
522         /* Experimental */
523         #define HWRM_CFA_COUNTER_CFG                      UINT32_C(0x11c)
524         /* Experimental */
525         #define HWRM_CFA_COUNTER_QCFG                     UINT32_C(0x11d)
526         /* Experimental */
527         #define HWRM_CFA_COUNTER_QSTATS                   UINT32_C(0x11e)
528         /* Experimental */
529         #define HWRM_CFA_TCP_FLAG_PROCESS_QCFG            UINT32_C(0x11f)
530         /* Experimental */
531         #define HWRM_CFA_EEM_QCAPS                        UINT32_C(0x120)
532         /* Experimental */
533         #define HWRM_CFA_EEM_CFG                          UINT32_C(0x121)
534         /* Experimental */
535         #define HWRM_CFA_EEM_QCFG                         UINT32_C(0x122)
536         /* Experimental */
537         #define HWRM_CFA_EEM_OP                           UINT32_C(0x123)
538         /* Experimental */
539         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS              UINT32_C(0x124)
540         /* Experimental - DEPRECATED */
541         #define HWRM_CFA_TFLIB                            UINT32_C(0x125)
542         /* Experimental */
543         #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR            UINT32_C(0x126)
544         /* Experimental */
545         #define HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR          UINT32_C(0x127)
546         /* Experimental */
547         #define HWRM_CFA_TLS_FILTER_ALLOC                 UINT32_C(0x128)
548         /* Experimental */
549         #define HWRM_CFA_TLS_FILTER_FREE                  UINT32_C(0x129)
550         /* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */
551         #define HWRM_ENGINE_CKV_STATUS                    UINT32_C(0x12e)
552         /* Engine CKV - Add a new CKEK used to encrypt keys. */
553         #define HWRM_ENGINE_CKV_CKEK_ADD                  UINT32_C(0x12f)
554         /* Engine CKV - Delete a previously added CKEK. */
555         #define HWRM_ENGINE_CKV_CKEK_DELETE               UINT32_C(0x130)
556         /* Engine CKV - Add a new key to the key vault. */
557         #define HWRM_ENGINE_CKV_KEY_ADD                   UINT32_C(0x131)
558         /* Engine CKV - Delete a key from the key vault. */
559         #define HWRM_ENGINE_CKV_KEY_DELETE                UINT32_C(0x132)
560         /* Engine CKV - Delete all keys from the key vault. */
561         #define HWRM_ENGINE_CKV_FLUSH                     UINT32_C(0x133)
562         /* Engine CKV - Get random data. */
563         #define HWRM_ENGINE_CKV_RNG_GET                   UINT32_C(0x134)
564         /* Engine CKV - Generate and encrypt a new AES key. */
565         #define HWRM_ENGINE_CKV_KEY_GEN                   UINT32_C(0x135)
566         /* Engine CKV - Configure a label index with a label value. */
567         #define HWRM_ENGINE_CKV_KEY_LABEL_CFG             UINT32_C(0x136)
568         /* Engine CKV - Query a label */
569         #define HWRM_ENGINE_CKV_KEY_LABEL_QCFG            UINT32_C(0x137)
570         /* Engine - Query the available queue groups configuration. */
571         #define HWRM_ENGINE_QG_CONFIG_QUERY               UINT32_C(0x13c)
572         /* Engine - Query the queue groups assigned to a function. */
573         #define HWRM_ENGINE_QG_QUERY                      UINT32_C(0x13d)
574         /* Engine - Query the available queue group meter profile configuration. */
575         #define HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY UINT32_C(0x13e)
576         /* Engine - Query the configuration of a queue group meter profile. */
577         #define HWRM_ENGINE_QG_METER_PROFILE_QUERY        UINT32_C(0x13f)
578         /* Engine - Allocate a queue group meter profile. */
579         #define HWRM_ENGINE_QG_METER_PROFILE_ALLOC        UINT32_C(0x140)
580         /* Engine - Free a queue group meter profile. */
581         #define HWRM_ENGINE_QG_METER_PROFILE_FREE         UINT32_C(0x141)
582         /* Engine - Query the meters assigned to a queue group. */
583         #define HWRM_ENGINE_QG_METER_QUERY                UINT32_C(0x142)
584         /* Engine - Bind a queue group meter profile to a queue group. */
585         #define HWRM_ENGINE_QG_METER_BIND                 UINT32_C(0x143)
586         /* Engine - Unbind a queue group meter profile from a queue group. */
587         #define HWRM_ENGINE_QG_METER_UNBIND               UINT32_C(0x144)
588         /* Engine - Bind a queue group to a function. */
589         #define HWRM_ENGINE_QG_FUNC_BIND                  UINT32_C(0x145)
590         /* Engine - Query the scheduling group configuration. */
591         #define HWRM_ENGINE_SG_CONFIG_QUERY               UINT32_C(0x146)
592         /* Engine - Query the queue groups assigned to a scheduling group. */
593         #define HWRM_ENGINE_SG_QUERY                      UINT32_C(0x147)
594         /* Engine - Query the configuration of a scheduling group's meter profiles. */
595         #define HWRM_ENGINE_SG_METER_QUERY                UINT32_C(0x148)
596         /* Engine - Configure a scheduling group's meter profiles. */
597         #define HWRM_ENGINE_SG_METER_CONFIG               UINT32_C(0x149)
598         /* Engine - Bind a queue group to a scheduling group. */
599         #define HWRM_ENGINE_SG_QG_BIND                    UINT32_C(0x14a)
600         /* Engine - Unbind a queue group from its scheduling group. */
601         #define HWRM_ENGINE_QG_SG_UNBIND                  UINT32_C(0x14b)
602         /* Engine - Query the Engine configuration. */
603         #define HWRM_ENGINE_CONFIG_QUERY                  UINT32_C(0x154)
604         /* Engine - Configure the statistics accumulator for an Engine. */
605         #define HWRM_ENGINE_STATS_CONFIG                  UINT32_C(0x155)
606         /* Engine - Clear the statistics accumulator for an Engine. */
607         #define HWRM_ENGINE_STATS_CLEAR                   UINT32_C(0x156)
608         /* Engine - Query the statistics accumulator for an Engine. */
609         #define HWRM_ENGINE_STATS_QUERY                   UINT32_C(0x157)
610         /* Engine - Query statistics counters for continuous errors from all CDDIP Engines. */
611         #define HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR  UINT32_C(0x158)
612         /* Engine - Allocate an Engine RQ. */
613         #define HWRM_ENGINE_RQ_ALLOC                      UINT32_C(0x15e)
614         /* Engine - Free an Engine RQ. */
615         #define HWRM_ENGINE_RQ_FREE                       UINT32_C(0x15f)
616         /* Engine - Allocate an Engine CQ. */
617         #define HWRM_ENGINE_CQ_ALLOC                      UINT32_C(0x160)
618         /* Engine - Free an Engine CQ. */
619         #define HWRM_ENGINE_CQ_FREE                       UINT32_C(0x161)
620         /* Engine - Allocate an NQ. */
621         #define HWRM_ENGINE_NQ_ALLOC                      UINT32_C(0x162)
622         /* Engine - Free an NQ. */
623         #define HWRM_ENGINE_NQ_FREE                       UINT32_C(0x163)
624         /* Engine - Set the on-die RQE credit update location. */
625         #define HWRM_ENGINE_ON_DIE_RQE_CREDITS            UINT32_C(0x164)
626         /* Engine - Query the engine function configuration. */
627         #define HWRM_ENGINE_FUNC_QCFG                     UINT32_C(0x165)
628         /* Experimental */
629         #define HWRM_FUNC_RESOURCE_QCAPS                  UINT32_C(0x190)
630         /* Experimental */
631         #define HWRM_FUNC_VF_RESOURCE_CFG                 UINT32_C(0x191)
632         /* Experimental */
633         #define HWRM_FUNC_BACKING_STORE_QCAPS             UINT32_C(0x192)
634         /* Experimental */
635         #define HWRM_FUNC_BACKING_STORE_CFG               UINT32_C(0x193)
636         /* Experimental */
637         #define HWRM_FUNC_BACKING_STORE_QCFG              UINT32_C(0x194)
638         /* Configures the BW of any VF */
639         #define HWRM_FUNC_VF_BW_CFG                       UINT32_C(0x195)
640         /* Queries the BW of any VF */
641         #define HWRM_FUNC_VF_BW_QCFG                      UINT32_C(0x196)
642         /* Queries pf ids belong to specified host(s) */
643         #define HWRM_FUNC_HOST_PF_IDS_QUERY               UINT32_C(0x197)
644         /* Queries extended stats per function */
645         #define HWRM_FUNC_QSTATS_EXT                      UINT32_C(0x198)
646         /* Queries extended statistics context */
647         #define HWRM_STAT_EXT_CTX_QUERY                   UINT32_C(0x199)
648         /* Configure SoC packet DMA settings */
649         #define HWRM_FUNC_SPD_CFG                         UINT32_C(0x19a)
650         /* Query SoC packet DMA settings */
651         #define HWRM_FUNC_SPD_QCFG                        UINT32_C(0x19b)
652         /* PTP - Queries configuration of timesync IO pins. */
653         #define HWRM_FUNC_PTP_PIN_QCFG                    UINT32_C(0x19c)
654         /* PTP - Configuration of timesync IO pins. */
655         #define HWRM_FUNC_PTP_PIN_CFG                     UINT32_C(0x19d)
656         /* PTP - Configuration for disciplining PHC. */
657         #define HWRM_FUNC_PTP_CFG                         UINT32_C(0x19e)
658         /* PTP - Queries for PHC timestamps. */
659         #define HWRM_FUNC_PTP_TS_QUERY                    UINT32_C(0x19f)
660         /* PTP - Extended PTP configuration. */
661         #define HWRM_FUNC_PTP_EXT_CFG                     UINT32_C(0x1a0)
662         /* PTP - Query extended PTP configuration. */
663         #define HWRM_FUNC_PTP_EXT_QCFG                    UINT32_C(0x1a1)
664         /* The command is used to allocate KTLS or QUIC key contexts. */
665         #define HWRM_FUNC_KEY_CTX_ALLOC                   UINT32_C(0x1a2)
666         /* The is the new API to configure backing stores. */
667         #define HWRM_FUNC_BACKING_STORE_CFG_V2            UINT32_C(0x1a3)
668         /* The is the new API to query backing store configurations. */
669         #define HWRM_FUNC_BACKING_STORE_QCFG_V2           UINT32_C(0x1a4)
670         /* To support doorbell pacing configuration. */
671         #define HWRM_FUNC_DBR_PACING_CFG                  UINT32_C(0x1a5)
672         /* To query doorbell pacing configuration. */
673         #define HWRM_FUNC_DBR_PACING_QCFG                 UINT32_C(0x1a6)
674         /*
675          * To broadcast the doorbell event to the drivers to
676          * initiate pacing of doorbells.
677          */
678         #define HWRM_FUNC_DBR_PACING_BROADCAST_EVENT      UINT32_C(0x1a7)
679         /* The is the new API to query backing store capabilities. */
680         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2          UINT32_C(0x1a8)
681         /* Experimental */
682         #define HWRM_SELFTEST_QLIST                       UINT32_C(0x200)
683         /* Experimental */
684         #define HWRM_SELFTEST_EXEC                        UINT32_C(0x201)
685         /* Experimental */
686         #define HWRM_SELFTEST_IRQ                         UINT32_C(0x202)
687         /* Experimental */
688         #define HWRM_SELFTEST_RETRIEVE_SERDES_DATA        UINT32_C(0x203)
689         /* Experimental */
690         #define HWRM_PCIE_QSTATS                          UINT32_C(0x204)
691         /* Experimental */
692         #define HWRM_MFG_FRU_WRITE_CONTROL                UINT32_C(0x205)
693         /* Returns the current value of a free running counter from the device. */
694         #define HWRM_MFG_TIMERS_QUERY                     UINT32_C(0x206)
695         /* Experimental */
696         #define HWRM_MFG_OTP_CFG                          UINT32_C(0x207)
697         /* Experimental */
698         #define HWRM_MFG_OTP_QCFG                         UINT32_C(0x208)
699         /*
700          * Tells the fw to run the DMA read from the host and DMA write
701          * to the host test.
702          */
703         #define HWRM_MFG_HDMA_TEST                        UINT32_C(0x209)
704         /* Tells the fw to program the fru memory */
705         #define HWRM_MFG_FRU_EEPROM_WRITE                 UINT32_C(0x20a)
706         /* Tells the fw to read the fru memory */
707         #define HWRM_MFG_FRU_EEPROM_READ                  UINT32_C(0x20b)
708         /* Used to provision SoC software images */
709         #define HWRM_MFG_SOC_IMAGE                        UINT32_C(0x20c)
710         /* Retrieves the SoC status and image provisioning information */
711         #define HWRM_MFG_SOC_QSTATUS                      UINT32_C(0x20d)
712         /* Tells the fw to program the seeprom memory */
713         #define HWRM_MFG_PARAM_SEEPROM_SYNC               UINT32_C(0x20e)
714         /* Tells the fw to read the seeprom memory */
715         #define HWRM_MFG_PARAM_SEEPROM_READ               UINT32_C(0x20f)
716         /* Tells the fw to get the health of seeprom data */
717         #define HWRM_MFG_PARAM_SEEPROM_HEALTH             UINT32_C(0x210)
718         /*
719          * The command is used for certificate provisioning to export a
720          * Certificate Signing Request (CSR) from the device.
721          */
722         #define HWRM_MFG_PRVSN_EXPORT_CSR                 UINT32_C(0x211)
723         /*
724          * The command is used for certificate provisioning to import a
725          * CA-signed certificate chain to the device.
726          */
727         #define HWRM_MFG_PRVSN_IMPORT_CERT                UINT32_C(0x212)
728         /*
729          * The command is used for certificate provisioning to query the
730          * provisioned state.
731          */
732         #define HWRM_MFG_PRVSN_GET_STATE                  UINT32_C(0x213)
733         /*
734          * The command is used to get the hash of the NVM configuration that is
735          * calculated during firmware boot.
736          */
737         #define HWRM_MFG_GET_NVM_MEASUREMENT              UINT32_C(0x214)
738         /* Retrieves the PSOC status and provisioning information. */
739         #define HWRM_MFG_PSOC_QSTATUS                     UINT32_C(0x215)
740         /*
741          * This command allows manufacturing tool to determine which selftests
742          * are available to be run.
743          */
744         #define HWRM_MFG_SELFTEST_QLIST                   UINT32_C(0x216)
745         /*
746          * This command allows manufacturing tool to request which selftests
747          * to run.
748          */
749         #define HWRM_MFG_SELFTEST_EXEC                    UINT32_C(0x217)
750         /* Experimental */
751         #define HWRM_TF                                   UINT32_C(0x2bc)
752         /* Experimental */
753         #define HWRM_TF_VERSION_GET                       UINT32_C(0x2bd)
754         /* Experimental */
755         #define HWRM_TF_SESSION_OPEN                      UINT32_C(0x2c6)
756         /* Experimental */
757         #define HWRM_TF_SESSION_ATTACH                    UINT32_C(0x2c7)
758         /* Experimental */
759         #define HWRM_TF_SESSION_REGISTER                  UINT32_C(0x2c8)
760         /* Experimental */
761         #define HWRM_TF_SESSION_UNREGISTER                UINT32_C(0x2c9)
762         /* Experimental */
763         #define HWRM_TF_SESSION_CLOSE                     UINT32_C(0x2ca)
764         /* Experimental */
765         #define HWRM_TF_SESSION_QCFG                      UINT32_C(0x2cb)
766         /* Experimental */
767         #define HWRM_TF_SESSION_RESC_QCAPS                UINT32_C(0x2cc)
768         /* Experimental */
769         #define HWRM_TF_SESSION_RESC_ALLOC                UINT32_C(0x2cd)
770         /* Experimental */
771         #define HWRM_TF_SESSION_RESC_FREE                 UINT32_C(0x2ce)
772         /* Experimental */
773         #define HWRM_TF_SESSION_RESC_FLUSH                UINT32_C(0x2cf)
774         /* Experimental */
775         #define HWRM_TF_SESSION_RESC_INFO                 UINT32_C(0x2d0)
776         /* Experimental */
777         #define HWRM_TF_TBL_TYPE_GET                      UINT32_C(0x2da)
778         /* Experimental */
779         #define HWRM_TF_TBL_TYPE_SET                      UINT32_C(0x2db)
780         /* Experimental */
781         #define HWRM_TF_TBL_TYPE_BULK_GET                 UINT32_C(0x2dc)
782         /* Experimental */
783         #define HWRM_TF_CTXT_MEM_ALLOC                    UINT32_C(0x2e2)
784         /* Experimental */
785         #define HWRM_TF_CTXT_MEM_FREE                     UINT32_C(0x2e3)
786         /* Experimental */
787         #define HWRM_TF_CTXT_MEM_RGTR                     UINT32_C(0x2e4)
788         /* Experimental */
789         #define HWRM_TF_CTXT_MEM_UNRGTR                   UINT32_C(0x2e5)
790         /* Experimental */
791         #define HWRM_TF_EXT_EM_QCAPS                      UINT32_C(0x2e6)
792         /* Experimental */
793         #define HWRM_TF_EXT_EM_OP                         UINT32_C(0x2e7)
794         /* Experimental */
795         #define HWRM_TF_EXT_EM_CFG                        UINT32_C(0x2e8)
796         /* Experimental */
797         #define HWRM_TF_EXT_EM_QCFG                       UINT32_C(0x2e9)
798         /* Experimental */
799         #define HWRM_TF_EM_INSERT                         UINT32_C(0x2ea)
800         /* Experimental */
801         #define HWRM_TF_EM_DELETE                         UINT32_C(0x2eb)
802         /* Experimental */
803         #define HWRM_TF_EM_HASH_INSERT                    UINT32_C(0x2ec)
804         /* Experimental */
805         #define HWRM_TF_EM_MOVE                           UINT32_C(0x2ed)
806         /* Experimental */
807         #define HWRM_TF_TCAM_SET                          UINT32_C(0x2f8)
808         /* Experimental */
809         #define HWRM_TF_TCAM_GET                          UINT32_C(0x2f9)
810         /* Experimental */
811         #define HWRM_TF_TCAM_MOVE                         UINT32_C(0x2fa)
812         /* Experimental */
813         #define HWRM_TF_TCAM_FREE                         UINT32_C(0x2fb)
814         /* Experimental */
815         #define HWRM_TF_GLOBAL_CFG_SET                    UINT32_C(0x2fc)
816         /* Experimental */
817         #define HWRM_TF_GLOBAL_CFG_GET                    UINT32_C(0x2fd)
818         /* Experimental */
819         #define HWRM_TF_IF_TBL_SET                        UINT32_C(0x2fe)
820         /* Experimental */
821         #define HWRM_TF_IF_TBL_GET                        UINT32_C(0x2ff)
822         /* Experimental */
823         #define HWRM_SV                                   UINT32_C(0x400)
824         /* Experimental */
825         #define HWRM_DBG_READ_DIRECT                      UINT32_C(0xff10)
826         /* Experimental */
827         #define HWRM_DBG_READ_INDIRECT                    UINT32_C(0xff11)
828         /* Experimental */
829         #define HWRM_DBG_WRITE_DIRECT                     UINT32_C(0xff12)
830         /* Experimental */
831         #define HWRM_DBG_WRITE_INDIRECT                   UINT32_C(0xff13)
832         #define HWRM_DBG_DUMP                             UINT32_C(0xff14)
833         /* Experimental */
834         #define HWRM_DBG_ERASE_NVM                        UINT32_C(0xff15)
835         /* Experimental */
836         #define HWRM_DBG_CFG                              UINT32_C(0xff16)
837         /* Experimental */
838         #define HWRM_DBG_COREDUMP_LIST                    UINT32_C(0xff17)
839         /* Experimental */
840         #define HWRM_DBG_COREDUMP_INITIATE                UINT32_C(0xff18)
841         /* Experimental */
842         #define HWRM_DBG_COREDUMP_RETRIEVE                UINT32_C(0xff19)
843         /* Experimental */
844         #define HWRM_DBG_FW_CLI                           UINT32_C(0xff1a)
845         /*  */
846         #define HWRM_DBG_I2C_CMD                          UINT32_C(0xff1b)
847         /*  */
848         #define HWRM_DBG_RING_INFO_GET                    UINT32_C(0xff1c)
849         /* Experimental */
850         #define HWRM_DBG_CRASHDUMP_HEADER                 UINT32_C(0xff1d)
851         /* Experimental */
852         #define HWRM_DBG_CRASHDUMP_ERASE                  UINT32_C(0xff1e)
853         /* Send driver debug information to firmware */
854         #define HWRM_DBG_DRV_TRACE                        UINT32_C(0xff1f)
855         /* Query debug capabilities of firmware */
856         #define HWRM_DBG_QCAPS                            UINT32_C(0xff20)
857         /* Retrieve debug settings of firmware */
858         #define HWRM_DBG_QCFG                             UINT32_C(0xff21)
859         /* Set destination parameters for crashdump medium */
860         #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG             UINT32_C(0xff22)
861         /* Experimental */
862         #define HWRM_DBG_USEQ_ALLOC                       UINT32_C(0xff23)
863         /* Experimental */
864         #define HWRM_DBG_USEQ_FREE                        UINT32_C(0xff24)
865         /* Experimental */
866         #define HWRM_DBG_USEQ_FLUSH                       UINT32_C(0xff25)
867         /* Experimental */
868         #define HWRM_DBG_USEQ_QCAPS                       UINT32_C(0xff26)
869         /* Experimental */
870         #define HWRM_DBG_USEQ_CW_CFG                      UINT32_C(0xff27)
871         /* Experimental */
872         #define HWRM_DBG_USEQ_SCHED_CFG                   UINT32_C(0xff28)
873         /* Experimental */
874         #define HWRM_DBG_USEQ_RUN                         UINT32_C(0xff29)
875         /* Experimental */
876         #define HWRM_DBG_USEQ_DELIVERY_REQ                UINT32_C(0xff2a)
877         /* Experimental */
878         #define HWRM_DBG_USEQ_RESP_HDR                    UINT32_C(0xff2b)
879         #define HWRM_NVM_DEFRAG                           UINT32_C(0xffec)
880         #define HWRM_NVM_REQ_ARBITRATION                  UINT32_C(0xffed)
881         /* Experimental */
882         #define HWRM_NVM_FACTORY_DEFAULTS                 UINT32_C(0xffee)
883         #define HWRM_NVM_VALIDATE_OPTION                  UINT32_C(0xffef)
884         #define HWRM_NVM_FLUSH                            UINT32_C(0xfff0)
885         #define HWRM_NVM_GET_VARIABLE                     UINT32_C(0xfff1)
886         #define HWRM_NVM_SET_VARIABLE                     UINT32_C(0xfff2)
887         #define HWRM_NVM_INSTALL_UPDATE                   UINT32_C(0xfff3)
888         #define HWRM_NVM_MODIFY                           UINT32_C(0xfff4)
889         #define HWRM_NVM_VERIFY_UPDATE                    UINT32_C(0xfff5)
890         #define HWRM_NVM_GET_DEV_INFO                     UINT32_C(0xfff6)
891         #define HWRM_NVM_ERASE_DIR_ENTRY                  UINT32_C(0xfff7)
892         #define HWRM_NVM_MOD_DIR_ENTRY                    UINT32_C(0xfff8)
893         #define HWRM_NVM_FIND_DIR_ENTRY                   UINT32_C(0xfff9)
894         #define HWRM_NVM_GET_DIR_ENTRIES                  UINT32_C(0xfffa)
895         #define HWRM_NVM_GET_DIR_INFO                     UINT32_C(0xfffb)
896         #define HWRM_NVM_RAW_DUMP                         UINT32_C(0xfffc)
897         #define HWRM_NVM_READ                             UINT32_C(0xfffd)
898         #define HWRM_NVM_WRITE                            UINT32_C(0xfffe)
899         #define HWRM_NVM_RAW_WRITE_BLK                    UINT32_C(0xffff)
900         #define HWRM_LAST                                HWRM_NVM_RAW_WRITE_BLK
901         uint16_t        unused_0[3];
902 } __rte_packed;
903
904 /* Return Codes */
905 /* ret_codes (size:64b/8B) */
906 struct ret_codes {
907         uint16_t        error_code;
908         /* Request was successfully executed by the HWRM. */
909         #define HWRM_ERR_CODE_SUCCESS                      UINT32_C(0x0)
910         /* The HWRM failed to execute the request. */
911         #define HWRM_ERR_CODE_FAIL                         UINT32_C(0x1)
912         /*
913          * The request contains invalid argument(s) or input
914          * parameters.
915          */
916         #define HWRM_ERR_CODE_INVALID_PARAMS               UINT32_C(0x2)
917         /*
918          * The requester is not allowed to access the requested
919          * resource. This error code shall be provided in a
920          * response to a request to query or modify an existing
921          * resource that is not accessible by the requester.
922          */
923         #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED       UINT32_C(0x3)
924         /*
925          * The HWRM is unable to allocate the requested resource.
926          * This code only applies to requests for HWRM resource
927          * allocations.
928          */
929         #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR         UINT32_C(0x4)
930         /*
931          * Invalid combination of flags is specified in the
932          * request.
933          */
934         #define HWRM_ERR_CODE_INVALID_FLAGS                UINT32_C(0x5)
935         /*
936          * Invalid combination of enables fields is specified in
937          * the request.
938          */
939         #define HWRM_ERR_CODE_INVALID_ENABLES              UINT32_C(0x6)
940         /*
941          * Request contains a required TLV that is not supported by
942          * the installed version of firmware.
943          */
944         #define HWRM_ERR_CODE_UNSUPPORTED_TLV              UINT32_C(0x7)
945         /*
946          * No firmware buffer available to accept the request. Driver
947          * should retry the request.
948          */
949         #define HWRM_ERR_CODE_NO_BUFFER                    UINT32_C(0x8)
950         /*
951          * This error code is only reported by firmware when some
952          * sub-option of a supported HWRM command is unsupported.
953          */
954         #define HWRM_ERR_CODE_UNSUPPORTED_OPTION_ERR       UINT32_C(0x9)
955         /*
956          * This error code is only reported by firmware when the specific
957          * request is not able to process when the HOT reset in progress.
958          */
959         #define HWRM_ERR_CODE_HOT_RESET_PROGRESS           UINT32_C(0xa)
960         /*
961          * This error code is only reported by firmware when the registered
962          * driver instances are not capable of hot reset.
963          */
964         #define HWRM_ERR_CODE_HOT_RESET_FAIL               UINT32_C(0xb)
965         /*
966          * This error code is only reported by the firmware when during
967          * flow allocation when a request for a flow counter fails because
968          * the number of flow counters are exhausted.
969          */
970         #define HWRM_ERR_CODE_NO_FLOW_COUNTER_DURING_ALLOC UINT32_C(0xc)
971         /*
972          * This error code is only reported by firmware when the registered
973          * driver instances requested to offloaded a flow but was unable to because
974          * the requested key's hash collides with the installed keys.
975          */
976         #define HWRM_ERR_CODE_KEY_HASH_COLLISION           UINT32_C(0xd)
977         /*
978          * This error code is only reported by firmware when the registered
979          * driver instances requested to offloaded a flow but was unable to because
980          * the same key has already been installed.
981          */
982         #define HWRM_ERR_CODE_KEY_ALREADY_EXISTS           UINT32_C(0xe)
983         /*
984          * Generic HWRM execution error that represents an
985          * internal error.
986          */
987         #define HWRM_ERR_CODE_HWRM_ERROR                   UINT32_C(0xf)
988         /*
989          * Firmware is unable to service the request at the present time. Caller
990          * may try again later.
991          */
992         #define HWRM_ERR_CODE_BUSY                         UINT32_C(0x10)
993         /*
994          * This error code is reported by Firmware when an operation requested
995          * by the host is not allowed due to a secure lock violation.
996          */
997         #define HWRM_ERR_CODE_RESOURCE_LOCKED              UINT32_C(0x11)
998         /*
999          * This error code is reported by Firmware when an operation requested
1000          * by a VF cannot be forwarded to the parent PF as required, either
1001          * because the PF is down or otherwise doesn't have an appropriate
1002          * async completion ring or associated forwarding buffers configured.
1003          */
1004         #define HWRM_ERR_CODE_PF_UNAVAILABLE               UINT32_C(0x12)
1005         /*
1006          * This value indicates that the HWRM response is in TLV format and
1007          * should be interpreted as one or more TLVs starting with the
1008          * hwrm_resp_hdr TLV. This value is not an indication of any error
1009          * by itself, just an indication that the response should be parsed
1010          * as TLV and the actual error code will be in the hwrm_resp_hdr TLV.
1011          */
1012         #define HWRM_ERR_CODE_TLV_ENCAPSULATED_RESPONSE    UINT32_C(0x8000)
1013         /* Unknown error */
1014         #define HWRM_ERR_CODE_UNKNOWN_ERR                  UINT32_C(0xfffe)
1015         /* Unsupported or invalid command */
1016         #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED            UINT32_C(0xffff)
1017         #define HWRM_ERR_CODE_LAST \
1018                 HWRM_ERR_CODE_CMD_NOT_SUPPORTED
1019         uint16_t        unused_0[3];
1020 } __rte_packed;
1021
1022 /* Output */
1023 /* hwrm_err_output (size:128b/16B) */
1024 struct hwrm_err_output {
1025         /*
1026          * Pass/Fail or error type
1027          *
1028          * Note: receiver to verify the in parameters, and fail the call
1029          * with an error when appropriate
1030          */
1031         uint16_t        error_code;
1032         /* This field returns the type of original request. */
1033         uint16_t        req_type;
1034         /* This field provides original sequence number of the command. */
1035         uint16_t        seq_id;
1036         /*
1037          * This field is the length of the response in bytes.  The
1038          * last byte of the response is a valid flag that will read
1039          * as '1' when the command has been completely written to
1040          * memory.
1041          */
1042         uint16_t        resp_len;
1043         /* debug info for this error response. */
1044         uint32_t        opaque_0;
1045         /* debug info for this error response. */
1046         uint16_t        opaque_1;
1047         /*
1048          * In the case of an error response, command specific error
1049          * code is returned in this field.
1050          */
1051         uint8_t cmd_err;
1052         /*
1053          * This field is used in Output records to indicate that the output
1054          * is completely written to RAM.  This field should be read as '1'
1055          * to indicate that the output has been completely written.
1056          * When writing a command completion or response to an internal processor,
1057          * the order of writes has to be such that this field is written last.
1058          */
1059         uint8_t valid;
1060 } __rte_packed;
1061 /*
1062  * Following is the signature for HWRM message field that indicates not
1063  * applicable (All F's). Need to cast it the size of the field if needed.
1064  */
1065 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
1066 /* hwrm_func_buf_rgtr */
1067 #define HWRM_MAX_REQ_LEN 128
1068 /* hwrm_cfa_flow_info */
1069 #define HWRM_MAX_RESP_LEN 704
1070 /* 7 bit indirection table index. */
1071 #define HW_HASH_INDEX_SIZE 0x80
1072 #define HW_HASH_KEY_SIZE 40
1073 /* valid key for HWRM response */
1074 #define HWRM_RESP_VALID_KEY 1
1075 /* Reserved for BONO processor */
1076 #define HWRM_TARGET_ID_BONO 0xFFF8
1077 /* Reserved for KONG processor */
1078 #define HWRM_TARGET_ID_KONG 0xFFF9
1079 /* Reserved for APE processor */
1080 #define HWRM_TARGET_ID_APE 0xFFFA
1081 /*
1082  * This value will be used by tools for User-space HWRM Interface.
1083  * When tool execute any HWRM command with this target_id, firmware
1084  * will copy the response and/or data payload via register space instead
1085  * of DMAing it.
1086  */
1087 #define HWRM_TARGET_ID_TOOLS 0xFFFD
1088 #define HWRM_VERSION_MAJOR 1
1089 #define HWRM_VERSION_MINOR 10
1090 #define HWRM_VERSION_UPDATE 2
1091 /* non-zero means beta version */
1092 #define HWRM_VERSION_RSVD 83
1093 #define HWRM_VERSION_STR "1.10.2.83"
1094
1095 /****************
1096  * hwrm_ver_get *
1097  ****************/
1098
1099
1100 /* hwrm_ver_get_input (size:192b/24B) */
1101 struct hwrm_ver_get_input {
1102         /* The HWRM command request type. */
1103         uint16_t        req_type;
1104         /*
1105          * The completion ring to send the completion event on. This should
1106          * be the NQ ID returned from the `nq_alloc` HWRM command.
1107          */
1108         uint16_t        cmpl_ring;
1109         /*
1110          * The sequence ID is used by the driver for tracking multiple
1111          * commands. This ID is treated as opaque data by the firmware and
1112          * the value is returned in the `hwrm_resp_hdr` upon completion.
1113          */
1114         uint16_t        seq_id;
1115         /*
1116          * The target ID of the command:
1117          * * 0x0-0xFFF8 - The function ID
1118          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
1119          * * 0xFFFD - Reserved for user-space HWRM interface
1120          * * 0xFFFF - HWRM
1121          */
1122         uint16_t        target_id;
1123         /*
1124          * A physical address pointer pointing to a host buffer that the
1125          * command's response data will be written. This can be either a host
1126          * physical address (HPA) or a guest physical address (GPA) and must
1127          * point to a physically contiguous block of memory.
1128          */
1129         uint64_t        resp_addr;
1130         /*
1131          * This field represents the major version of HWRM interface
1132          * specification supported by the driver HWRM implementation.
1133          * The interface major version is intended to change only when
1134          * non backward compatible changes are made to the HWRM
1135          * interface specification.
1136          */
1137         uint8_t hwrm_intf_maj;
1138         /*
1139          * This field represents the minor version of HWRM interface
1140          * specification supported by the driver HWRM implementation.
1141          * A change in interface minor version is used to reflect
1142          * significant backward compatible modification to HWRM
1143          * interface specification.
1144          * This can be due to addition or removal of functionality.
1145          * HWRM interface specifications with the same major version
1146          * but different minor versions are compatible.
1147          */
1148         uint8_t hwrm_intf_min;
1149         /*
1150          * This field represents the update version of HWRM interface
1151          * specification supported by the driver HWRM implementation.
1152          * The interface update version is used to reflect minor
1153          * changes or bug fixes to a released HWRM interface
1154          * specification.
1155          */
1156         uint8_t hwrm_intf_upd;
1157         uint8_t unused_0[5];
1158 } __rte_packed;
1159
1160 /* hwrm_ver_get_output (size:1408b/176B) */
1161 struct hwrm_ver_get_output {
1162         /* The specific error status for the command. */
1163         uint16_t        error_code;
1164         /* The HWRM command request type. */
1165         uint16_t        req_type;
1166         /* The sequence ID from the original command. */
1167         uint16_t        seq_id;
1168         /* The length of the response data in number of bytes. */
1169         uint16_t        resp_len;
1170         /*
1171          * This field represents the major version of HWRM interface
1172          * specification supported by the HWRM implementation.
1173          * The interface major version is intended to change only when
1174          * non backward compatible changes are made to the HWRM
1175          * interface specification.
1176          * A HWRM implementation that is compliant with this
1177          * specification shall provide value of 1 in this field.
1178          */
1179         uint8_t hwrm_intf_maj_8b;
1180         /*
1181          * This field represents the minor version of HWRM interface
1182          * specification supported by the HWRM implementation.
1183          * A change in interface minor version is used to reflect
1184          * significant backward compatible modification to HWRM
1185          * interface specification.
1186          * This can be due to addition or removal of functionality.
1187          * HWRM interface specifications with the same major version
1188          * but different minor versions are compatible.
1189          * A HWRM implementation that is compliant with this
1190          * specification shall provide value of 2 in this field.
1191          */
1192         uint8_t hwrm_intf_min_8b;
1193         /*
1194          * This field represents the update version of HWRM interface
1195          * specification supported by the HWRM implementation.
1196          * The interface update version is used to reflect minor
1197          * changes or bug fixes to a released HWRM interface
1198          * specification.
1199          * A HWRM implementation that is compliant with this
1200          * specification shall provide value of 2 in this field.
1201          */
1202         uint8_t hwrm_intf_upd_8b;
1203         uint8_t hwrm_intf_rsvd_8b;
1204         /*
1205          * This field represents the major version of HWRM firmware.
1206          * A change in firmware major version represents a major
1207          * firmware release.
1208          */
1209         uint8_t hwrm_fw_maj_8b;
1210         /*
1211          * This field represents the minor version of HWRM firmware.
1212          * A change in firmware minor version represents significant
1213          * firmware functionality changes.
1214          */
1215         uint8_t hwrm_fw_min_8b;
1216         /*
1217          * This field represents the build version of HWRM firmware.
1218          * A change in firmware build version represents bug fixes
1219          * to a released firmware.
1220          */
1221         uint8_t hwrm_fw_bld_8b;
1222         /*
1223          * This field is a reserved field. This field can be used to
1224          * represent firmware branches or customer specific releases
1225          * tied to a specific (major,minor,update) version of the
1226          * HWRM firmware.
1227          */
1228         uint8_t hwrm_fw_rsvd_8b;
1229         /*
1230          * This field represents the major version of mgmt firmware.
1231          * A change in major version represents a major release.
1232          */
1233         uint8_t mgmt_fw_maj_8b;
1234         /*
1235          * This field represents the minor version of mgmt firmware.
1236          * A change in minor version represents significant
1237          * functionality changes.
1238          */
1239         uint8_t mgmt_fw_min_8b;
1240         /*
1241          * This field represents the build version of mgmt firmware.
1242          * A change in update version represents bug fixes.
1243          */
1244         uint8_t mgmt_fw_bld_8b;
1245         /*
1246          * This field is a reserved field. This field can be used to
1247          * represent firmware branches or customer specific releases
1248          * tied to a specific (major,minor,update) version
1249          */
1250         uint8_t mgmt_fw_rsvd_8b;
1251         /*
1252          * This field represents the major version of network
1253          * control firmware.
1254          * A change in major version represents a major release.
1255          */
1256         uint8_t netctrl_fw_maj_8b;
1257         /*
1258          * This field represents the minor version of network
1259          * control firmware.
1260          * A change in minor version represents significant
1261          * functionality changes.
1262          */
1263         uint8_t netctrl_fw_min_8b;
1264         /*
1265          * This field represents the build version of network
1266          * control firmware.
1267          * A change in update version represents bug fixes.
1268          */
1269         uint8_t netctrl_fw_bld_8b;
1270         /*
1271          * This field is a reserved field. This field can be used to
1272          * represent firmware branches or customer specific releases
1273          * tied to a specific (major,minor,update) version
1274          */
1275         uint8_t netctrl_fw_rsvd_8b;
1276         /*
1277          * This field is used to indicate device's capabilities and
1278          * configurations.
1279          */
1280         uint32_t        dev_caps_cfg;
1281         /*
1282          * If set to 1, then secure firmware update behavior
1283          * is supported.
1284          * If set to 0, then secure firmware update behavior is
1285          * not supported.
1286          */
1287         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED \
1288                 UINT32_C(0x1)
1289         /*
1290          * If set to 1, then firmware based DCBX agent is supported.
1291          * If set to 0, then firmware based DCBX agent capability
1292          * is not supported on this device.
1293          */
1294         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED \
1295                 UINT32_C(0x2)
1296         /*
1297          * If set to 1, then HWRM short command format is supported.
1298          * If set to 0, then HWRM short command format is not supported.
1299          */
1300         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED \
1301                 UINT32_C(0x4)
1302         /*
1303          * If set to 1, then HWRM short command format is required.
1304          * If set to 0, then HWRM short command format is not required.
1305          */
1306         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED \
1307                 UINT32_C(0x8)
1308         /*
1309          * If set to 1, then the KONG host mailbox channel is supported.
1310          * If set to 0, then the KONG host mailbox channel is not supported.
1311          * By default, this flag should be 0 for older version of core firmware.
1312          */
1313         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_KONG_MB_CHNL_SUPPORTED \
1314                 UINT32_C(0x10)
1315         /*
1316          * If set to 1, then the 64bit flow handle is supported in addition to the
1317          * legacy 16bit flow handle. If set to 0, then the 64bit flow handle is not
1318          * supported. By default, this flag should be 0 for older version of core firmware.
1319          */
1320         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_HANDLE_64BIT_SUPPORTED \
1321                 UINT32_C(0x20)
1322         /*
1323          * If set to 1, then filter type can be provided in filter_alloc or filter_cfg
1324          * filter types like L2 for l2 traffic and ROCE for roce & l2 traffic.
1325          * If set to 0, then filter types not supported.
1326          * By default, this flag should be 0 for older version of core firmware.
1327          */
1328         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_L2_FILTER_TYPES_ROCE_OR_L2_SUPPORTED \
1329                 UINT32_C(0x40)
1330         /*
1331          * If set to 1, firmware is capable to support virtio vSwitch offload model.
1332          * If set to 0, firmware can't supported virtio vSwitch offload model.
1333          * By default, this flag should be 0 for older version of core firmware.
1334          */
1335         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_VIRTIO_VSWITCH_OFFLOAD_SUPPORTED \
1336                 UINT32_C(0x80)
1337         /*
1338          * If set to 1, firmware is capable to support trusted VF.
1339          * If set to 0, firmware is not capable to support trusted VF.
1340          * By default, this flag should be 0 for older version of core firmware.
1341          */
1342         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED \
1343                 UINT32_C(0x100)
1344         /*
1345          * If set to 1, firmware is capable to support flow aging.
1346          * If set to 0, firmware is not capable to support flow aging.
1347          * By default, this flag should be 0 for older version of core firmware.
1348          */
1349         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_AGING_SUPPORTED \
1350                 UINT32_C(0x200)
1351         /*
1352          * If set to 1, firmware is capable to support advanced flow counters like,
1353          * Meter drop counters and EEM counters.
1354          * If set to 0, firmware is not capable to support advanced flow counters.
1355          * By default, this flag should be 0 for older version of core firmware.
1356          */
1357         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_ADV_FLOW_COUNTERS_SUPPORTED \
1358                 UINT32_C(0x400)
1359         /*
1360          * If set to 1, the firmware is able to support the use of the CFA
1361          * Extended Exact Match(EEM) feature.
1362          * If set to 0, firmware is not capable to support the use of the
1363          * CFA EEM feature.
1364          * By default, this flag should be 0 for older version of core firmware.
1365          */
1366         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_EEM_SUPPORTED \
1367                 UINT32_C(0x800)
1368         /*
1369          * If set to 1, the firmware is able to support advance CFA flow management
1370          * features reported in the HWRM_CFA_FLOW_MGNT_QCAPS.
1371          * If set to 0, then the firmware doesn’t support the advance CFA flow management
1372          * features.
1373          * By default, this flag should be 0 for older version of core firmware.
1374          */
1375         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_ADV_FLOW_MGNT_SUPPORTED \
1376                 UINT32_C(0x1000)
1377         /*
1378          * Deprecated and replaced with cfa_truflow_supported.
1379          * If set to 1, the firmware is able to support TFLIB features.
1380          * If set to 0, then the firmware doesn’t support TFLIB features.
1381          * By default, this flag should be 0 for older version of core firmware.
1382          */
1383         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TFLIB_SUPPORTED \
1384                 UINT32_C(0x2000)
1385         /*
1386          * If set to 1, the firmware is able to support TruFlow features.
1387          * If set to 0, then the firmware doesn’t support TruFlow features.
1388          * By default, this flag should be 0 for older version of
1389          * core firmware.
1390          */
1391         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TRUFLOW_SUPPORTED \
1392                 UINT32_C(0x4000)
1393         /*
1394          * If set to 1, then firmware supports secure boot.
1395          * If set to 0, then firmware doesn't support secure boot.
1396          */
1397         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_BOOT_CAPABLE \
1398                 UINT32_C(0x8000)
1399         /*
1400          * This field represents the major version of RoCE firmware.
1401          * A change in major version represents a major release.
1402          */
1403         uint8_t roce_fw_maj_8b;
1404         /*
1405          * This field represents the minor version of RoCE firmware.
1406          * A change in minor version represents significant
1407          * functionality changes.
1408          */
1409         uint8_t roce_fw_min_8b;
1410         /*
1411          * This field represents the build version of RoCE firmware.
1412          * A change in update version represents bug fixes.
1413          */
1414         uint8_t roce_fw_bld_8b;
1415         /*
1416          * This field is a reserved field. This field can be used to
1417          * represent firmware branches or customer specific releases
1418          * tied to a specific (major,minor,update) version
1419          */
1420         uint8_t roce_fw_rsvd_8b;
1421         /*
1422          * This field represents the name of HWRM FW (ASCII chars
1423          * with NULL at the end).
1424          */
1425         char    hwrm_fw_name[16];
1426         /*
1427          * This field represents the name of mgmt FW (ASCII chars
1428          * with NULL at the end).
1429          */
1430         char    mgmt_fw_name[16];
1431         /*
1432          * This field represents the name of network control
1433          * firmware (ASCII chars with NULL at the end).
1434          */
1435         char    netctrl_fw_name[16];
1436         /* This field represents the active board package name. */
1437         char    active_pkg_name[16];
1438         /*
1439          * This field represents the name of RoCE FW (ASCII chars
1440          * with NULL at the end).
1441          */
1442         char    roce_fw_name[16];
1443         /* This field returns the chip number. */
1444         uint16_t        chip_num;
1445         /* This field returns the revision of chip. */
1446         uint8_t chip_rev;
1447         /* This field returns the chip metal number. */
1448         uint8_t chip_metal;
1449         /* This field returns the bond id of the chip. */
1450         uint8_t chip_bond_id;
1451         /* This value indicates the type of platform used for chip implementation. */
1452         uint8_t chip_platform_type;
1453         /* ASIC */
1454         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC      UINT32_C(0x0)
1455         /* FPGA platform of the chip. */
1456         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA      UINT32_C(0x1)
1457         /* Palladium platform of the chip. */
1458         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
1459         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_LAST \
1460                 HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM
1461         /*
1462          * This field returns the maximum value of request window that
1463          * is supported by the HWRM. The request window is mapped
1464          * into device address space using MMIO.
1465          */
1466         uint16_t        max_req_win_len;
1467         /*
1468          * This field returns the maximum value of response buffer in
1469          * bytes.
1470          */
1471         uint16_t        max_resp_len;
1472         /*
1473          * This field returns the default request timeout value in
1474          * milliseconds.
1475          */
1476         uint16_t        def_req_timeout;
1477         /*
1478          * This field will indicate if any subsystems is not fully
1479          * initialized.
1480          */
1481         uint8_t flags;
1482         /*
1483          * If set to 1, it will indicate to host drivers that firmware is
1484          * not ready to start full blown HWRM commands. Host drivers should
1485          * re-try HWRM_VER_GET with some timeout period. The timeout period
1486          * can be selected up to 5 seconds. Host drivers should also check
1487          * for dev_not_rdy_backing_store to identify if flag is set due to
1488          * backing store not been available.
1489          * For Example, PCIe hot-plug:
1490          *     Hot plug timing is system dependent. It generally takes up to
1491          *     600 milliseconds for firmware to clear DEV_NOT_RDY flag.
1492          * If set to 0, device is ready to accept all HWRM commands.
1493          */
1494         #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY \
1495                 UINT32_C(0x1)
1496         /*
1497          * If set to 1, external version present.
1498          * If set to 0, external version not present.
1499          */
1500         #define HWRM_VER_GET_OUTPUT_FLAGS_EXT_VER_AVAIL \
1501                 UINT32_C(0x2)
1502         /*
1503          * Firmware sets this flag along with dev_not_rdy flag to indicate
1504          * host drivers that it has not completed resource initialization
1505          * required for data path operations. Host drivers should not send
1506          * any HWRM command that requires data path resources. Firmware will
1507          * fail those commands with HWRM_ERR_CODE_BUSY. Host drivers can retry
1508          * those commands once both the flags are cleared.
1509          * If this flag and dev_not_rdy flag are set to 0, device is ready
1510          * to accept all HWRM commands.
1511          */
1512         #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY_BACKING_STORE \
1513                 UINT32_C(0x4)
1514         uint8_t unused_0[2];
1515         /*
1516          * For backward compatibility this field must be set to 1.
1517          * Older drivers might look for this field to be 1 before
1518          * processing the message.
1519          */
1520         uint8_t always_1;
1521         /*
1522          * This field represents the major version of HWRM interface
1523          * specification supported by the HWRM implementation.
1524          * The interface major version is intended to change only when
1525          * non backward compatible changes are made to the HWRM
1526          * interface specification. A HWRM implementation that is
1527          * compliant with this specification shall provide value of 1
1528          * in this field.
1529          */
1530         uint16_t        hwrm_intf_major;
1531         /*
1532          * This field represents the minor version of HWRM interface
1533          * specification supported by the HWRM implementation.
1534          * A change in interface minor version is used to reflect
1535          * significant backward compatible modification to HWRM
1536          * interface specification. This can be due to addition or
1537          * removal of functionality. HWRM interface specifications
1538          * with the same major version but different minor versions are
1539          * compatible. A HWRM implementation that is compliant with
1540          * this specification shall provide value of 2 in this field.
1541          */
1542         uint16_t        hwrm_intf_minor;
1543         /*
1544          * This field represents the update version of HWRM interface
1545          * specification supported by the HWRM implementation. The
1546          * interface update version is used to reflect minor changes or
1547          * bug fixes to a released HWRM interface specification.
1548          * A HWRM implementation that is compliant with this
1549          * specification shall provide value of 2 in this field.
1550          */
1551         uint16_t        hwrm_intf_build;
1552         /*
1553          * This field represents the patch version of HWRM interface
1554          * specification supported by the HWRM implementation.
1555          */
1556         uint16_t        hwrm_intf_patch;
1557         /*
1558          * This field represents the major version of HWRM firmware.
1559          * A change in firmware major version represents a major
1560          * firmware release.
1561          */
1562         uint16_t        hwrm_fw_major;
1563         /*
1564          * This field represents the minor version of HWRM firmware.
1565          * A change in firmware minor version represents significant
1566          * firmware functionality changes.
1567          */
1568         uint16_t        hwrm_fw_minor;
1569         /*
1570          * This field represents the build version of HWRM firmware.
1571          * A change in firmware build version represents bug fixes to
1572          * a released firmware.
1573          */
1574         uint16_t        hwrm_fw_build;
1575         /*
1576          * This field is a reserved field.
1577          * This field can be used to represent firmware branches or customer
1578          * specific releases tied to a specific (major,minor,update) version
1579          * of the HWRM firmware.
1580          */
1581         uint16_t        hwrm_fw_patch;
1582         /*
1583          * This field represents the major version of mgmt firmware.
1584          * A change in major version represents a major release.
1585          */
1586         uint16_t        mgmt_fw_major;
1587         /*
1588          * This field represents the minor version of HWRM firmware.
1589          * A change in firmware minor version represents significant
1590          * firmware functionality changes.
1591          */
1592         uint16_t        mgmt_fw_minor;
1593         /*
1594          * This field represents the build version of mgmt firmware.
1595          * A change in update version represents bug fixes.
1596          */
1597         uint16_t        mgmt_fw_build;
1598         /*
1599          * This field is a reserved field. This field can be used to
1600          * represent firmware branches or customer specific releases
1601          * tied to a specific (major,minor,update) version.
1602          */
1603         uint16_t        mgmt_fw_patch;
1604         /*
1605          * This field represents the major version of network control
1606          * firmware. A change in major version represents
1607          * a major release.
1608          */
1609         uint16_t        netctrl_fw_major;
1610         /*
1611          * This field represents the minor version of network control
1612          * firmware. A change in minor version represents significant
1613          * functionality changes.
1614          */
1615         uint16_t        netctrl_fw_minor;
1616         /*
1617          * This field represents the build version of network control
1618          * firmware. A change in update version represents bug fixes.
1619          */
1620         uint16_t        netctrl_fw_build;
1621         /*
1622          * This field is a reserved field. This field can be used to
1623          * represent firmware branches or customer specific releases
1624          * tied to a specific (major,minor,update) version
1625          */
1626         uint16_t        netctrl_fw_patch;
1627         /*
1628          * This field represents the major version of RoCE firmware.
1629          * A change in major version represents a major release.
1630          */
1631         uint16_t        roce_fw_major;
1632         /*
1633          * This field represents the minor version of RoCE firmware.
1634          * A change in minor version represents significant
1635          * functionality changes.
1636          */
1637         uint16_t        roce_fw_minor;
1638         /*
1639          * This field represents the build version of RoCE firmware.
1640          * A change in update version represents bug fixes.
1641          */
1642         uint16_t        roce_fw_build;
1643         /*
1644          * This field is a reserved field. This field can be used to
1645          * represent firmware branches or customer specific releases
1646          * tied to a specific (major,minor,update) version
1647          */
1648         uint16_t        roce_fw_patch;
1649         /*
1650          * This field returns the maximum extended request length acceptable
1651          * by the device which allows requests greater than mailbox size when
1652          * used with the short cmd request format.
1653          */
1654         uint16_t        max_ext_req_len;
1655         /*
1656          * This field returns the maximum request timeout value in seconds.
1657          * For backward compatibility, a value of zero should be interpreted
1658          * as the default value of 40 seconds. Drivers should always honor the
1659          * maximum timeout, but are permitted to warn if a longer duration than
1660          * this default is advertised. Values larger than 40 seconds should
1661          * only be used as a stopgap measure to address a device limitation or
1662          * for the purposes of test and debugging. The long term goal is for
1663          * firmware to significantly reduce this value in the passage of time.
1664          */
1665         uint16_t        max_req_timeout;
1666         uint8_t unused_1[3];
1667         /*
1668          * This field is used in Output records to indicate that the output
1669          * is completely written to RAM.  This field should be read as '1'
1670          * to indicate that the output has been completely written.
1671          * When writing a command completion or response to an internal processor,
1672          * the order of writes has to be such that this field is written last.
1673          */
1674         uint8_t valid;
1675 } __rte_packed;
1676
1677 /* cfa_bds_read_cmd_data_msg (size:128b/16B) */
1678 struct cfa_bds_read_cmd_data_msg {
1679         /* This value selects the format for the mid-path command for the CFA. */
1680         uint8_t opcode;
1681         /*
1682          * This is read command. From 32 to 128B can be read from a table
1683          * using this command.
1684          */
1685         #define CFA_BDS_READ_CMD_DATA_MSG_OPCODE_READ UINT32_C(0x0)
1686         #define CFA_BDS_READ_CMD_DATA_MSG_OPCODE_LAST \
1687                 CFA_BDS_READ_CMD_DATA_MSG_OPCODE_READ
1688         /* This value selects the table type to be acted upon. */
1689         uint8_t table_type;
1690         /* This value selects the table type to be acted upon. */
1691         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
1692         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_SFT   0
1693         /* This command acts on the action table of the specified scope. */
1694         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
1695         /* This command acts on the exact match table of the specified scope. */
1696         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_EM      UINT32_C(0x1)
1697         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_LAST \
1698                 CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_EM
1699         /* This value selects which table scope will be accessed. */
1700         uint8_t table_scope;
1701         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1702         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1703         /*
1704          * This value identifies the number of 32B units will be accessed. A
1705          * value of zero is invalid. Maximum value is 4.
1706          */
1707         uint8_t data_size;
1708         #define CFA_BDS_READ_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1709         #define CFA_BDS_READ_CMD_DATA_MSG_DATA_SIZE_SFT 0
1710         /* This is the 32B index into the selected table to access. */
1711         uint32_t        table_index;
1712         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
1713         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_INDEX_SFT 0
1714         /*
1715          * This is the 64b host address where you want the data returned to. The
1716          * data will be written to the same function as the one that owns the SQ
1717          * this command is read from. The bottom two bits of this value must be
1718          * zero. The size of the write is controlled by the data_size field.
1719          */
1720         uint64_t        host_address;
1721 } __rte_packed;
1722
1723 /* cfa_bds_write_cmd_data_msg (size:1152b/144B) */
1724 struct cfa_bds_write_cmd_data_msg {
1725         /* This value selects the format for the mid-path command for the CFA. */
1726         uint8_t opcode;
1727         /*
1728          * This is write command. From 32 to 128B can be written to a table
1729          * using this command.
1730          */
1731         #define CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_WRITE UINT32_C(0x1)
1732         #define CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_LAST \
1733                 CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_WRITE
1734         /* This value selects the table type to be acted upon. */
1735         uint8_t write_thru_table_type;
1736         /* This value selects the table type to be acted upon. */
1737         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
1738         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_SFT   0
1739         /* This command acts on the action table of the specified scope. */
1740         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
1741         /* This command acts on the exact match table of the specified scope. */
1742         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_EM      UINT32_C(0x1)
1743         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_LAST \
1744                 CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_EM
1745         /*
1746          * Indicates write-through control. Indicates write-through when set,
1747          * or write back when cleared.
1748          */
1749         #define CFA_BDS_WRITE_CMD_DATA_MSG_WRITE_THRU       UINT32_C(0x10)
1750         /* This value selects which table scope will be accessed. */
1751         uint8_t table_scope;
1752         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1753         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1754         /*
1755          * This value identifies the number of 32B units will be accessed. A
1756          * value of zero is invalid. Maximum value is 4.
1757          */
1758         uint8_t data_size;
1759         #define CFA_BDS_WRITE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1760         #define CFA_BDS_WRITE_CMD_DATA_MSG_DATA_SIZE_SFT 0
1761         /* This is the 32B index into the selected table to access. */
1762         uint32_t        table_index;
1763         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
1764         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_INDEX_SFT 0
1765         uint32_t        unused0;
1766         uint32_t        unused1;
1767         /*
1768          * This is the data to be written. Data length is determined by the
1769          * data_size field. The bd_cnt in the encapsulating BD must also be set
1770          * correctly to ensure that the BD is processed correctly and the full
1771          * WRITE_CMD message is extracted from the BD.
1772          */
1773         uint32_t        dta[32];
1774 } __rte_packed;
1775
1776 /* cfa_bds_read_clr_cmd_data_msg (size:256b/32B) */
1777 struct cfa_bds_read_clr_cmd_data_msg {
1778         /* This value selects the format for the mid-path command for the CFA. */
1779         uint8_t opcode;
1780         /*
1781          * This is read-clear command. 32B can be read from a table and
1782          * a 16b mask can be used to clear specific 16b units after the
1783          * read as an atomic operation.
1784          */
1785         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_READ_CLR UINT32_C(0x2)
1786         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_LAST \
1787                 CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_READ_CLR
1788         /* This value selects the table type to be acted upon. */
1789         uint8_t table_type;
1790         /* This value selects the table type to be acted upon. */
1791         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
1792         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_SFT   0
1793         /* This command acts on the action table of the specified scope. */
1794         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
1795         /* This command acts on the exact match table of the specified scope. */
1796         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_EM      UINT32_C(0x1)
1797         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_LAST \
1798                 CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_EM
1799         /* This value selects which table scope will be accessed. */
1800         uint8_t table_scope;
1801         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1802         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1803         /*
1804          * This value identifies the number of 32B units will be accessed.
1805          * Always set the value to 1.
1806          */
1807         uint8_t data_size;
1808         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1809         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_DATA_SIZE_SFT 0
1810         /* This is the 32B index into the selected table to access. */
1811         uint32_t        table_index;
1812         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_INDEX_MASK \
1813                 UINT32_C(0x3ffffff)
1814         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_INDEX_SFT 0
1815         /*
1816          * This is the 64b host address where you want the data returned to. The
1817          * data will be written to the same function as the one that owns the SQ
1818          * this command is read from. The bottom two bits of this value must be
1819          * zero. The size of the write is controlled by the data_size field.
1820          */
1821         uint64_t        host_address;
1822         /*
1823          * This is active high clear mask for the 32B of data that this command
1824          * can read. Bit 0 of the field will clear bits 15:0 of the first word
1825          * of data read when set to '1'.
1826          */
1827         uint16_t        clear_mask;
1828         uint16_t        unused0[3];
1829         uint16_t        unused1[4];
1830 } __rte_packed;
1831
1832 /* cfa_bds_em_insert_cmd_data_msg (size:1152b/144B) */
1833 struct cfa_bds_em_insert_cmd_data_msg {
1834         /* This value selects the format for the mid-path command for the CFA. */
1835         uint8_t opcode;
1836         /*
1837          * An exact match table insert will be attempted into the table.
1838          * If there is a free location in the bucket, the payload will
1839          * be written to the bucket.
1840          */
1841         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_EM_INSERT UINT32_C(0x3)
1842         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_LAST \
1843                 CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_EM_INSERT
1844         /*
1845          * Indicates write-through control. Indicates write-through when set,
1846          * or write back when cleared.
1847          */
1848         uint8_t write_thru;
1849         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_UNUSED_MASK    UINT32_C(0xf)
1850         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_UNUSED_SFT     0
1851         /*
1852          * Indicates write-through control. Indicates write-through when set,
1853          * or write back when cleared.
1854          */
1855         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_WRITE_THRU     UINT32_C(0x10)
1856         /* This value selects which table scope will be accessed. */
1857         uint8_t table_scope;
1858         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1859         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1860         /*
1861          * This value identifies the number of 32B units will be accessed. A
1862          * value of zero is invalid. Maximum value is 4.
1863          */
1864         uint8_t data_size;
1865         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1866         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_DATA_SIZE_SFT 0
1867         /* This is the 32B index into the selected table to access. */
1868         uint32_t        table_index;
1869         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_INDEX_MASK \
1870                 UINT32_C(0x3ffffff)
1871         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_INDEX_SFT 0
1872         /*
1873          * This is the 64b host address where you want the data returned to. The
1874          * data will be written to the same function as the one that owns the SQ
1875          */
1876         uint64_t        host_address;
1877         /*
1878          * This is the Exact Match Lookup Record. Data length is determined by
1879          * the data_size field. The bd_cnt in the encapsulating BD must also be
1880          */
1881         uint32_t        dta[32];
1882 } __rte_packed;
1883
1884 /* cfa_bds_em_delete_cmd_data_msg (size:256b/32B) */
1885 struct cfa_bds_em_delete_cmd_data_msg {
1886         /* This value selects the format for the mid-path command for the CFA. */
1887         uint8_t opcode;
1888         /* An exact match table delete will be attempted. */
1889         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_EM_DELETE UINT32_C(0x4)
1890         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_LAST \
1891                 CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_EM_DELETE
1892         /*
1893          * Indicates write-through control. Indicates write-through when set,
1894          * or write back when cleared.
1895          */
1896         uint8_t write_thru;
1897         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_UNUSED_MASK    UINT32_C(0xf)
1898         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_UNUSED_SFT     0
1899         /*
1900          * Indicates write-through control. Indicates write-through when set,
1901          * or write back when cleared.
1902          */
1903         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_WRITE_THRU     UINT32_C(0x10)
1904         /* This value selects which table scope will be accessed. */
1905         uint8_t table_scope;
1906         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1907         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1908         /*
1909          * This value identifies the number of 32B units will be accessed. A
1910          * value of zero is invalid. Maximum value is 4.
1911          */
1912         uint8_t data_size;
1913         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1914         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_DATA_SIZE_SFT 0
1915         uint32_t        unused0;
1916         /*
1917          * This is the 64b host address where you want the data returned to. The
1918          * data will be written to the same function as the one that owns the SQ
1919          */
1920         uint64_t        host_address;
1921         /*
1922          * This is the Exact Match Lookup Record. Data length is determined by
1923          * the data_size field. The bd_cnt in the encapsulating BD must also be
1924          */
1925         uint64_t        dta;
1926         uint32_t        unused1[2];
1927 } __rte_packed;
1928
1929 /* cfa_bds_invalidate_cmd_data_msg (size:128b/16B) */
1930 struct cfa_bds_invalidate_cmd_data_msg {
1931         /* This value selects the format for the mid-path command for the CFA. */
1932         uint8_t opcode;
1933         /*
1934          * The specified table area will be invalidated. If it is needed.
1935          * again, it will be read from the backing store.
1936          */
1937         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_INVALIDATE UINT32_C(0x5)
1938         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_LAST \
1939                 CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_INVALIDATE
1940         /* This value selects the table type to be acted upon. */
1941         uint8_t table_type;
1942         /* This value selects the table type to be acted upon. */
1943         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
1944         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_SFT   0
1945         /* This command acts on the action table of the specified scope. */
1946         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_ACTION \
1947                 UINT32_C(0x0)
1948         /* This command acts on the exact match table of the specified scope. */
1949         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_EM \
1950                 UINT32_C(0x1)
1951         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_LAST \
1952                 CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_EM
1953         /* This value selects which table scope will be accessed. */
1954         uint8_t table_scope;
1955         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1956         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1957         /* This value specifies the number of cache lines to invalidate. */
1958         uint8_t data_size;
1959         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1960         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_DATA_SIZE_SFT 0
1961         /* This is the 32B index into the selected table to access. */
1962         uint32_t        table_index;
1963         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_INDEX_MASK \
1964                 UINT32_C(0x3ffffff)
1965         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_INDEX_SFT 0
1966         uint32_t        unused[2];
1967 } __rte_packed;
1968
1969 /* cfa_bds_event_collect_cmd_data_msg (size:128b/16B) */
1970 struct cfa_bds_event_collect_cmd_data_msg {
1971         /* This value selects the format for the mid-path command for the CFA. */
1972         uint8_t opcode;
1973         /* Reads notification messages from the Host Notification Queue. */
1974         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_EVENT_COLLECT \
1975                 UINT32_C(0x6)
1976         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_LAST \
1977                 CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_EVENT_COLLECT
1978         uint8_t unused0;
1979         /* This value selects which table scope will be accessed. */
1980         uint8_t table_scope;
1981         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_TABLE_SCOPE_MASK \
1982                 UINT32_C(0x1f)
1983         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1984         /*
1985          * This value identifies the number of 32B units will be accessed. A
1986          * value of zero is invalid. Maximum value is 4.
1987          */
1988         uint8_t data_size;
1989         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1990         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_DATA_SIZE_SFT 0
1991         uint32_t        unused1;
1992         /*
1993          * This is the 64b host address where you want the data returned to. The
1994          * data will be written to the same function as the one that owns the SQ
1995          */
1996         uint64_t        host_address;
1997 } __rte_packed;
1998
1999 /* ce_bds_add_data_msg (size:512b/64B) */
2000 struct ce_bds_add_data_msg {
2001         uint32_t        version_algorithm_kid_opcode;
2002         /*
2003          * This value selects the operation for the mid-path command for the
2004          * crypto blocks.
2005          */
2006         #define CE_BDS_ADD_DATA_MSG_OPCODE_MASK               UINT32_C(0xf)
2007         #define CE_BDS_ADD_DATA_MSG_OPCODE_SFT                0
2008         /*
2009          * This is the add command. Using this opcode, Host Driver can add
2010          * information required for kTLS processing. The information is
2011          * updated in the CFCK context.
2012          */
2013         #define CE_BDS_ADD_DATA_MSG_OPCODE_ADD                  UINT32_C(0x1)
2014         #define CE_BDS_ADD_DATA_MSG_OPCODE_LAST \
2015                 CE_BDS_ADD_DATA_MSG_OPCODE_ADD
2016         /*
2017          * This field is the Crypto Context ID. The KID is used to store
2018          * information used by the associated kTLS offloaded connection.
2019          */
2020         #define CE_BDS_ADD_DATA_MSG_KID_MASK \
2021                 UINT32_C(0xfffff0)
2022         #define CE_BDS_ADD_DATA_MSG_KID_SFT                   4
2023         /*
2024          * Currently only two algorithms are supported, AES_GCM_128 and
2025          * AES_GCM_256. Additional bits for future growth.
2026          */
2027         #define CE_BDS_ADD_DATA_MSG_ALGORITHM_MASK \
2028                 UINT32_C(0xf000000)
2029         #define CE_BDS_ADD_DATA_MSG_ALGORITHM_SFT             24
2030         /* AES_GCM_128 Algorithm */
2031         #define CE_BDS_ADD_DATA_MSG_ALGORITHM_AES_GCM_128 \
2032                 UINT32_C(0x1000000)
2033         /* AES_GCM_256 Algorithm */
2034         #define CE_BDS_ADD_DATA_MSG_ALGORITHM_AES_GCM_256 \
2035                 UINT32_C(0x2000000)
2036         /*
2037          * Version number of TLS connection. HW will provide registers that
2038          * converts the 4b encoded version number to 16b of actual version
2039          * number in the TLS Header. This field is initialized/updated by
2040          * this "KTLS crypto add" mid-path command.
2041          */
2042         #define CE_BDS_ADD_DATA_MSG_VERSION_MASK \
2043                 UINT32_C(0xf0000000)
2044         #define CE_BDS_ADD_DATA_MSG_VERSION_SFT               28
2045         /* TLS1.2 Version */
2046         #define CE_BDS_ADD_DATA_MSG__TLS1_2 \
2047                 (UINT32_C(0x0) << 28)
2048         /* TLS1.3 Version */
2049         #define CE_BDS_ADD_DATA_MSG__TLS1_3 \
2050                 (UINT32_C(0x1) << 28)
2051         #define CE_BDS_ADD_DATA_MSG__LAST \
2052                 CE_BDS_ADD_DATA_MSG__TLS1_3
2053         uint8_t cmd_type_ctx_kind;
2054         /*
2055          * Command Type in the TLS header. HW will provide registers that
2056          * converts the 3b encoded command type to 8b of actual command
2057          * type in the TLS Header. This field is initialized/updated by
2058          * this "KTLS crypto add" mid-path command.
2059          */
2060         #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_MASK UINT32_C(0x7)
2061         #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_SFT  0
2062         /* Application */
2063         #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_APP    UINT32_C(0x0)
2064         #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_LAST \
2065                 CE_BDS_ADD_DATA_MSG_CMD_TYPE_APP
2066         /* This field selects the context kind for the request. */
2067         #define CE_BDS_ADD_DATA_MSG_CTX_KIND_MASK UINT32_C(0xf8)
2068         #define CE_BDS_ADD_DATA_MSG_CTX_KIND_SFT  3
2069         /* Crypto key transmit context */
2070         #define CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_TX  (UINT32_C(0x11) << 3)
2071         /* Crypto key receive context */
2072         #define CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_RX  (UINT32_C(0x12) << 3)
2073         #define CE_BDS_ADD_DATA_MSG_CTX_KIND_LAST \
2074                 CE_BDS_ADD_DATA_MSG_CTX_KIND_CK_RX
2075         uint8_t unused0[3];
2076         /*
2077          * Salt is part of the nonce that is used as the Initial Vector (IV) in
2078          * AES-GCM cipher suites. These are exchanged as part of the handshake
2079          * process and is either the client_write_iv (when the client is
2080          * sending) or server_write_iv (when the server is sending). In
2081          * TLS1.2, 4B of Salt is concatenated with 8B of explicit_nonce to
2082          * generate the 12B of IV. In TLS1.3, 8B of TLS record sequence number
2083          * is zero padded to 12B and then xor'ed with the 4B of salt to generate
2084          * the 12B of IV. This value is initialized by this mid-path command.
2085          */
2086         uint32_t        salt;
2087         uint32_t        unused1;
2088         /*
2089          * This field keeps track of the TCP sequence number that is expected as
2090          * the first byte in the next TCP packet. This field is calculated by HW
2091          * using the output of the parser. The field is initialized as part of
2092          * the Mid-path BD download/update of a kTLS connection. For every TCP
2093          * packet processed, TCE HW will update the value to Current packet TCP
2094          * sequence number + Current packet TCP Payload Length.
2095          */
2096         uint32_t        pkt_tcp_seq_num;
2097         /*
2098          * This field maintains the TCP sequence number of the first byte in the
2099          * header of the active TLS record. This field is initialized as part of
2100          * the Mid-path BD download/update of a kTLS connection. For every
2101          * record that is processed, TCE HW copies the value from the
2102          * next_tls_header_tcp_seq_num field.
2103          */
2104         uint32_t        tls_header_tcp_seq_num;
2105         /*
2106          * This is sequence number for the TLS record in a particular session.
2107          * In TLS1.2, record sequence number is part of the Associated Data (AD)
2108          * in the AEAD algorithm. In TLS1.3, record sequence number is part of
2109          * the Initial Vector (IV). The field is initialized as part of the
2110          * mid-path BD download/update of a kTLS connection. TCE HW increments
2111          * the field after that for every record processed as it parses the TCP
2112          * packet.
2113          */
2114         uint32_t        record_seq_num[2];
2115         /*
2116          * Key used for encrypting or decrypting TLS records. The Key is
2117          * exchanged during the hand-shake protocol by the client-server and
2118          * provided to HW through this mid-path BD.
2119          */
2120         uint32_t        session_key[8];
2121 } __rte_packed;
2122
2123 /* ce_bds_delete_data_msg (size:64b/8B) */
2124 struct ce_bds_delete_data_msg {
2125         uint32_t        kid_opcode_ctx_kind;
2126         /*
2127          * This value selects the operation for the mid-path command for the
2128          * crypto blocks.
2129          */
2130         #define CE_BDS_DELETE_DATA_MSG_OPCODE_MASK     UINT32_C(0xf)
2131         #define CE_BDS_DELETE_DATA_MSG_OPCODE_SFT      0
2132         /*
2133          * This is the delete command. Using this opcode, the host Driver
2134          * can remove a key context from the CFCK. If context is deleted
2135          * and packets with the same KID come through the pipeline, the
2136          * following actions are taken. For transmit packets, no crypto
2137          * operation will be performed, payload will be zero'ed out. For
2138          * receive packets, no crypto operation will be performed,
2139          * payload will be unmodified.
2140          */
2141         #define CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE     UINT32_C(0x2)
2142         #define CE_BDS_DELETE_DATA_MSG_OPCODE_LAST \
2143                 CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE
2144         /*
2145          * This field is the Crypto Context ID. The KID is used to store
2146          * information used by the associated kTLS offloaded connection.
2147          */
2148         #define CE_BDS_DELETE_DATA_MSG_KID_MASK        UINT32_C(0xfffff0)
2149         #define CE_BDS_DELETE_DATA_MSG_KID_SFT         4
2150         /* This field selects the context kind for the request. */
2151         #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_MASK   UINT32_C(0x1f000000)
2152         #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_SFT    24
2153         /* Crypto Key Transmit Context. */
2154         #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_CK_TX    (UINT32_C(0x11) << 24)
2155         /* Crypto Key Receive Context. */
2156         #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_CK_RX    (UINT32_C(0x12) << 24)
2157         /* QUIC Key Transmit Context. */
2158         #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_TX  (UINT32_C(0x14) << 24)
2159         /* QUIC Key Receive Context. */
2160         #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_RX  (UINT32_C(0x15) << 24)
2161         #define CE_BDS_DELETE_DATA_MSG_CTX_KIND_LAST \
2162                 CE_BDS_DELETE_DATA_MSG_CTX_KIND_QUIC_RX
2163         uint32_t        unused0;
2164 } __rte_packed;
2165
2166 /* ce_bds_resync_resp_ack_msg (size:128b/16B) */
2167 struct ce_bds_resync_resp_ack_msg {
2168         uint32_t        resync_status_kid_opcode;
2169         /*
2170          * This value selects the operation for the mid-path command for the
2171          * crypto blocks.
2172          */
2173         #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_MASK       UINT32_C(0xf)
2174         #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_SFT        0
2175         /*
2176          * This command is used by the driver as a response to the resync
2177          * request sent by the crypto engine.
2178          */
2179         #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_RESYNC       UINT32_C(0x3)
2180         #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_LAST \
2181                 CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_RESYNC
2182         /*
2183          * This field is the Crypto Context ID. The KID is used to store
2184          * information used by the associated kTLS offloaded connection.
2185          */
2186         #define CE_BDS_RESYNC_RESP_ACK_MSG_KID_MASK          UINT32_C(0xfffff0)
2187         #define CE_BDS_RESYNC_RESP_ACK_MSG_KID_SFT           4
2188         /*
2189          * This field indicates if the resync request resulted in a success or
2190          * a failure.
2191          */
2192         #define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS \
2193                 UINT32_C(0x1000000)
2194         /*
2195          * An ACK indicates that the driver was able to find the TLS record
2196          * associated with TCP sequence number provided by the HW
2197          */
2198         #define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_ACK \
2199                 (UINT32_C(0x0) << 24)
2200         #define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_LAST \
2201                 CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_ACK
2202         /*
2203          * This field is the echo of the TCP sequence number provided in the
2204          * resync request by the HW. If HW sent multiple resync requests, it
2205          * only tracks the latest TCP sequence number. When the response from
2206          * the Driver doesn't match the latest request, HW will drop the resync
2207          * response.
2208          */
2209         uint32_t        resync_record_tcp_seq_num;
2210         /*
2211          * This field indicates the TLS record sequence number associated with
2212          * the resync request. HW will take this number and add the delta records
2213          * it has found since sending the resync request, update the context and
2214          * resume decrypting records.
2215          */
2216         uint32_t        resync_record_seq_num[2];
2217 } __rte_packed;
2218
2219 /* ce_bds_resync_resp_nack_msg (size:64b/8B) */
2220 struct ce_bds_resync_resp_nack_msg {
2221         uint32_t        resync_status_kid_opcode;
2222         /*
2223          * This value selects the operation for the mid-path command for the
2224          * crypto blocks.
2225          */
2226         #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_MASK       UINT32_C(0xf)
2227         #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_SFT        0
2228         /*
2229          * This command is used by the driver as a response to the resync
2230          * request sent by the crypto engine.
2231          */
2232         #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_RESYNC       UINT32_C(0x3)
2233         #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_LAST \
2234                 CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_RESYNC
2235         /*
2236          * This field is the Crypto Context ID. The KID is used to store
2237          * information used by the associated kTLS offloaded connection.
2238          */
2239         #define CE_BDS_RESYNC_RESP_NACK_MSG_KID_MASK \
2240                 UINT32_C(0xfffff0)
2241         #define CE_BDS_RESYNC_RESP_NACK_MSG_KID_SFT           4
2242         /*
2243          * This field indicates if the resync request resulted in a success or
2244          * a failure.
2245          */
2246         #define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS \
2247                 UINT32_C(0x1000000)
2248         /*
2249          * An NAK indicates that the driver wasn't able to find the TLS
2250          * record associated with TCP sequence number provided by the HW
2251          */
2252         #define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_NACK \
2253                 (UINT32_C(0x1) << 24)
2254         #define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_LAST \
2255                 CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_NACK
2256         /*
2257          * This field is the echo of the TCP sequence number provided in the
2258          * resync request by the HW. If HW sent multiple resync requests, it
2259          * only tracks the latest TCP sequence number. When the response from
2260          * the Driver doesn't match the latest request, HW will drop the resync
2261          * response.
2262          */
2263         uint32_t        resync_record_tcp_seq_num;
2264 } __rte_packed;
2265
2266 /* crypto_presync_bd_cmd (size:256b/32B) */
2267 struct crypto_presync_bd_cmd {
2268         uint8_t flags;
2269         /*
2270          * Typically, presync BDs are used for packet retransmissions. Source
2271          * port sends all the packets in order over the network to destination
2272          * port and packets get dropped in the network. The destination port
2273          * will request retranmission of dropped packets and source port driver
2274          * will send presync BD to setup the transmitter appropriately. It will
2275          * provide the start and end TCP sequence number of the data to be
2276          * transmitted. HW keeps two sets of context variable, one for in order
2277          * traffic and one for retransmission traffic. HW is designed to
2278          * transmit everything posted in the presync BD and return to in order
2279          * mode after that. No inorder context variables are updated in the
2280          * process. There is a special case where packets can be dropped
2281          * between the TCP stack and Device Driver (Berkeley Packet Filter for
2282          * ex) and HW still needs to transmit rest of the traffic. In this
2283          * mode, driver will send a presync BD as if it is a retransmission but
2284          * at the end of the transmission, the in order variables need to be
2285          * updated. This flag is used by driver to indicate that in order
2286          * variables needs to be updated at the end of completing the task
2287          * associated with the presync BD.
2288          */
2289         #define CRYPTO_PRESYNC_BD_CMD_FLAGS_UPDATE_IN_ORDER_VAR \
2290                 UINT32_C(0x1)
2291         uint8_t unused0;
2292         uint16_t        unused1;
2293         /*
2294          * This field maintains the TCP sequence number of the first byte in the
2295          * Header of the active TLS record. This field is set to 0 during
2296          * mid-path BD updates, but is set to correct value when a presync BD is
2297          * detected. For every record that is processed, the value from the
2298          * next_tls_header_tcp_seq_num field is copied.
2299          */
2300         uint32_t        header_tcp_seq_num;
2301         /*
2302          * When a retransmitted packet has a TLS authentication TAG present and
2303          * the data spans multiple TCP Packets, HW is required to read the entire
2304          * record to recalculate the TAG but only transmit what is required. This
2305          * field is the start TCP sequence number of the packet(s) that need to
2306          * be re-transmitted. This field is initialized to 0 during Mid-path BD
2307          * add command and initialized to value provided by the driver when
2308          * Pre-sync BD is detected. This field is never updated unless another
2309          * Pre-sync BD signaling a new retransmission is scheduled.
2310          */
2311         uint32_t        start_tcp_seq_num;
2312         /*
2313          * When a retransmitted packet has a TLS authentication TAG present and
2314          * the data spans multiple TCP Packets, HW is required to read the
2315          * entire record to recalculate the TAG but only transmit what is
2316          * required. This field is the end TCP sequence number of the packet(s)
2317          * that need to be re-transmitted. This field is initialized to 0 during
2318          * Mid-path BD add command and initialized to value provided by the
2319          * driver when Pre-sync BD is detected. This field is never updated
2320          * unless another Pre-sync BD signaling a new retransmission is
2321          * scheduled.
2322          */
2323         uint32_t        end_tcp_seq_num;
2324         /*
2325          * For TLS1.2, an explicit nonce is used as part of the IV (concatenated
2326          * with the SALT). For retrans packets, this field is extracted from the
2327          * TLS record, field right after the TLS Header and stored in the
2328          * context. This field needs to be stored in context as TCP segmentation
2329          * could have split the field into multiple TCP packets. This value is
2330          * initialized to 0 when presync BD is detected by taking the value from
2331          * the first TLS header. When subsequent TLS Headers are detected, the
2332          * value is extracted from packet.
2333          */
2334         uint32_t        explicit_nonce[2];
2335         /*
2336          * This is sequence number for the TLS record in a particular session. In
2337          * TLS1.2, record sequence number is part of the Associated Data (AD) in
2338          * the AEAD algorithm. In TLS1.3, record sequence number is part of the
2339          * Initial Vector (IV). The field is initialized to 0 during Mid-path BD
2340          * download. Is initialized to correct value when a pre-sync BD is
2341          * detected. TCE HW increments the field after that for every record
2342          * processed as it parses the TCP packet. Subsequent pre-sync BDs
2343          * delivering more retransmission instruction will also update this
2344          * field.
2345          */
2346         uint32_t        record_seq_num[2];
2347 } __rte_packed;
2348
2349 /* bd_base (size:64b/8B) */
2350 struct bd_base {
2351         uint8_t type;
2352         /* This value identifies the type of buffer descriptor. */
2353         #define BD_BASE_TYPE_MASK             UINT32_C(0x3f)
2354         #define BD_BASE_TYPE_SFT              0
2355         /*
2356          * Indicates that this BD is 16B long and is used for
2357          * normal L2 packet transmission.
2358          */
2359         #define BD_BASE_TYPE_TX_BD_SHORT        UINT32_C(0x0)
2360         /*
2361          * Indicates that this BD is 1BB long and is an empty
2362          * TX BD. Not valid for use by the driver.
2363          */
2364         #define BD_BASE_TYPE_TX_BD_EMPTY        UINT32_C(0x1)
2365         /*
2366          * Indicates that this BD is 16B long and is an RX Producer
2367          * (i.e. empty) buffer descriptor.
2368          */
2369         #define BD_BASE_TYPE_RX_PROD_PKT        UINT32_C(0x4)
2370         /*
2371          * Indicates that this BD is 16B long and is an RX
2372          * Producer Buffer BD.
2373          */
2374         #define BD_BASE_TYPE_RX_PROD_BFR        UINT32_C(0x5)
2375         /*
2376          * Indicates that this BD is 16B long and is an
2377          * RX Producer Assembly Buffer Descriptor.
2378          */
2379         #define BD_BASE_TYPE_RX_PROD_AGG        UINT32_C(0x6)
2380         /*
2381          * Indicates that this BD is used to issue a command to one of
2382          * the mid-path destinations.
2383          */
2384         #define BD_BASE_TYPE_TX_BD_MP_CMD       UINT32_C(0x8)
2385         /*
2386          * Indicates that this BD is used to issue a cryptographic pre-
2387          * sync command through the fast path and destined for TCE.
2388          */
2389         #define BD_BASE_TYPE_TX_BD_PRESYNC_CMD  UINT32_C(0x9)
2390         /*
2391          * Indicates a timed transmit BD. This is a 16b BD that is inserted
2392          * into a packet BD chain immediately after the first BD. It is used
2393          * to control the flow in a timed transmit operation.
2394          */
2395         #define BD_BASE_TYPE_TX_BD_TIMEDTX      UINT32_C(0xa)
2396         /*
2397          * Indicates that this BD is 32B long and is used for
2398          * normal L2 packet transmission.
2399          */
2400         #define BD_BASE_TYPE_TX_BD_LONG         UINT32_C(0x10)
2401         /*
2402          * Indicates that this BD is 32B long and is used for
2403          * L2 packet transmission for small packets that require
2404          * low latency.
2405          */
2406         #define BD_BASE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
2407         #define BD_BASE_TYPE_LAST              BD_BASE_TYPE_TX_BD_LONG_INLINE
2408         uint8_t unused_1[7];
2409 } __rte_packed;
2410
2411 /* tx_bd_short (size:128b/16B) */
2412 struct tx_bd_short {
2413         /*
2414          * All bits in this field must be valid on the first BD of a packet.
2415          * Only the packet_end bit must be valid for the remaining BDs
2416          * of a packet.
2417          */
2418         uint16_t        flags_type;
2419         /* This value identifies the type of buffer descriptor. */
2420         #define TX_BD_SHORT_TYPE_MASK            UINT32_C(0x3f)
2421         #define TX_BD_SHORT_TYPE_SFT             0
2422         /*
2423          * Indicates that this BD is 16B long and is used for
2424          * normal L2 packet transmission.
2425          */
2426         #define TX_BD_SHORT_TYPE_TX_BD_SHORT       UINT32_C(0x0)
2427         #define TX_BD_SHORT_TYPE_LAST             TX_BD_SHORT_TYPE_TX_BD_SHORT
2428         /*
2429          * All bits in this field must be valid on the first BD of a packet.
2430          * Only the packet_end bit must be valid for the remaining BDs
2431          * of a packet.
2432          */
2433         #define TX_BD_SHORT_FLAGS_MASK           UINT32_C(0xffc0)
2434         #define TX_BD_SHORT_FLAGS_SFT            6
2435         /*
2436          * If set to 1, the packet ends with the data in the buffer
2437          * pointed to by this descriptor. This flag must be
2438          * valid on every BD.
2439          */
2440         #define TX_BD_SHORT_FLAGS_PACKET_END      UINT32_C(0x40)
2441         /*
2442          * If set to 1, the device will not generate a completion for
2443          * this transmit packet unless there is an error in it's
2444          * processing.
2445          * If this bit
2446          * is set to 0, then the packet will be completed normally.
2447          *
2448          * This bit must be valid only on the first BD of a packet.
2449          */
2450         #define TX_BD_SHORT_FLAGS_NO_CMPL         UINT32_C(0x80)
2451         /*
2452          * This value indicates how many 16B BD locations are consumed
2453          * in the ring by this packet.
2454          * A value of 1 indicates that this BD is the only BD (and that
2455          * it is a short BD). A value
2456          * of 3 indicates either 3 short BDs or 1 long BD and one short
2457          * BD in the packet. A value of 0 indicates
2458          * that there are 32 BD locations in the packet (the maximum).
2459          *
2460          * This field is valid only on the first BD of a packet.
2461          */
2462         #define TX_BD_SHORT_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
2463         #define TX_BD_SHORT_FLAGS_BD_CNT_SFT      8
2464         /*
2465          * This value is a hint for the length of the entire packet.
2466          * It is used by the chip to optimize internal processing.
2467          *
2468          * The packet will be dropped if the hint is too short.
2469          *
2470          * This field is valid only on the first BD of a packet.
2471          */
2472         #define TX_BD_SHORT_FLAGS_LHINT_MASK      UINT32_C(0x6000)
2473         #define TX_BD_SHORT_FLAGS_LHINT_SFT       13
2474         /* indicates packet length < 512B */
2475         #define TX_BD_SHORT_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
2476         /* indicates 512 <= packet length < 1KB */
2477         #define TX_BD_SHORT_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
2478         /* indicates 1KB <= packet length < 2KB */
2479         #define TX_BD_SHORT_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
2480         /* indicates packet length >= 2KB */
2481         #define TX_BD_SHORT_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
2482         #define TX_BD_SHORT_FLAGS_LHINT_LAST \
2483                 TX_BD_SHORT_FLAGS_LHINT_GTE2K
2484         /*
2485          * If set to 1, the device immediately updates the Send Consumer
2486          * Index after the buffer associated with this descriptor has
2487          * been transferred via DMA to NIC memory from host memory. An
2488          * interrupt may or may not be generated according to the state
2489          * of the interrupt avoidance mechanisms. If this bit
2490          * is set to 0, then the Consumer Index is only updated as soon
2491          * as one of the host interrupt coalescing conditions has been met.
2492          *
2493          * This bit must be valid on the first BD of a packet.
2494          */
2495         #define TX_BD_SHORT_FLAGS_COAL_NOW        UINT32_C(0x8000)
2496         /*
2497          * This is the length of the host physical buffer this BD describes
2498          * in bytes.
2499          *
2500          * This field must be valid on all BDs of a packet.
2501          */
2502         uint16_t        len;
2503         /*
2504          * The opaque data field is pass through to the completion and can be
2505          * used for any data that the driver wants to associate with the
2506          * transmit BD.
2507          *
2508          * This field must be valid on the first BD of a packet. If completion
2509          * coalescing is enabled on the TX ring, it is suggested that the driver
2510          * populate the opaque field to indicate the specific TX ring with which
2511          * the completion is associated, then utilize the opaque and sq_cons_idx
2512          * fields in the coalesced completion record to determine the specific
2513          * packets that are to be completed on that ring.
2514          */
2515         uint32_t        opaque;
2516         /*
2517          * This is the host physical address for the portion of the packet
2518          * described by this TX BD.
2519          *
2520          * This value must be valid on all BDs of a packet.
2521          */
2522         uint64_t        address;
2523 } __rte_packed;
2524
2525 /* tx_bd_long (size:128b/16B) */
2526 struct tx_bd_long {
2527         /* This value identifies the type of buffer descriptor. */
2528         uint16_t        flags_type;
2529         /*
2530          * This value indicates the type of buffer descriptor.
2531          * packet.
2532          */
2533         #define TX_BD_LONG_TYPE_MASK            UINT32_C(0x3f)
2534         #define TX_BD_LONG_TYPE_SFT             0
2535         /*
2536          * Indicates that this BD is 32B long and is used for
2537          * normal L2 packet transmission.
2538          */
2539         #define TX_BD_LONG_TYPE_TX_BD_LONG        UINT32_C(0x10)
2540         #define TX_BD_LONG_TYPE_LAST             TX_BD_LONG_TYPE_TX_BD_LONG
2541         /*
2542          * All bits in this field must be valid on the first BD of a packet.
2543          * Only the packet_end bit must be valid for the remaining BDs
2544          * of a packet.
2545          */
2546         #define TX_BD_LONG_FLAGS_MASK           UINT32_C(0xffc0)
2547         #define TX_BD_LONG_FLAGS_SFT            6
2548         /*
2549          * If set to 1, the packet ends with the data in the buffer
2550          * pointed to by this descriptor. This flag must be
2551          * valid on every BD.
2552          */
2553         #define TX_BD_LONG_FLAGS_PACKET_END      UINT32_C(0x40)
2554         /*
2555          * If set to 1, the device will not generate a completion for
2556          * this transmit packet unless there is an error in it's
2557          * processing.
2558          * If this bit
2559          * is set to 0, then the packet will be completed normally.
2560          *
2561          * This bit must be valid only on the first BD of a packet.
2562          */
2563         #define TX_BD_LONG_FLAGS_NO_CMPL         UINT32_C(0x80)
2564         /*
2565          * This value indicates how many 16B BD locations are consumed
2566          * in the ring by this packet.
2567          * A value of 1 indicates that this BD is the only BD (and that
2568          * it is a short BD). A value
2569          * of 3 indicates either 3 short BDs or 1 long BD and one short
2570          * BD in the packet. A value of 0 indicates
2571          * that there are 32 BD locations in the packet (the maximum).
2572          *
2573          * This field is valid only on the first BD of a packet.
2574          */
2575         #define TX_BD_LONG_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
2576         #define TX_BD_LONG_FLAGS_BD_CNT_SFT      8
2577         /*
2578          * This value is a hint for the length of the entire packet.
2579          * It is used by the chip to optimize internal processing.
2580          *
2581          * The packet will be dropped if the hint is too short.
2582          *
2583          * This field is valid only on the first BD of a packet.
2584          */
2585         #define TX_BD_LONG_FLAGS_LHINT_MASK      UINT32_C(0x6000)
2586         #define TX_BD_LONG_FLAGS_LHINT_SFT       13
2587         /* indicates packet length < 512B */
2588         #define TX_BD_LONG_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
2589         /* indicates 512 <= packet length < 1KB */
2590         #define TX_BD_LONG_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
2591         /* indicates 1KB <= packet length < 2KB */
2592         #define TX_BD_LONG_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
2593         /* indicates packet length >= 2KB */
2594         #define TX_BD_LONG_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
2595         #define TX_BD_LONG_FLAGS_LHINT_LAST       TX_BD_LONG_FLAGS_LHINT_GTE2K
2596         /*
2597          * If set to 1, the device immediately updates the Send Consumer
2598          * Index after the buffer associated with this descriptor has
2599          * been transferred via DMA to NIC memory from host memory. An
2600          * interrupt may or may not be generated according to the state
2601          * of the interrupt avoidance mechanisms. If this bit
2602          * is set to 0, then the Consumer Index is only updated as soon
2603          * as one of the host interrupt coalescing conditions has been met.
2604          *
2605          * This bit must be valid on the first BD of a packet.
2606          */
2607         #define TX_BD_LONG_FLAGS_COAL_NOW        UINT32_C(0x8000)
2608         /*
2609          * This is the length of the host physical buffer this BD describes
2610          * in bytes.
2611          *
2612          * This field must be valid on all BDs of a packet.
2613          */
2614         uint16_t        len;
2615         /*
2616          * The opaque data field is passed through to the completion and can be
2617          * used for any data that the driver wants to associate with the
2618          * transmit BD.
2619          *
2620          * This field must be valid on the first BD of a packet. If completion
2621          * coalescing is enabled on the TX ring, it is suggested that the driver
2622          * populate the opaque field to indicate the specific TX ring with which
2623          * the completion is associated, then utilize the opaque and sq_cons_idx
2624          * fields in the coalesced completion record to determine the specific
2625          * packets that are to be completed on that ring.
2626          */
2627         uint32_t        opaque;
2628         /*
2629          * This is the host physical address for the portion of the packet
2630          * described by this TX BD.
2631          *
2632          * This value must be valid on all BDs of a packet.
2633          */
2634         uint64_t        address;
2635 } __rte_packed;
2636
2637 /* Last 16 bytes of tx_bd_long. */
2638 /* tx_bd_long_hi (size:128b/16B) */
2639 struct tx_bd_long_hi {
2640         /*
2641          * All bits in this field must be valid on the first BD of a packet.
2642          * Their value on other BDs of the packet will be ignored.
2643          */
2644         uint16_t        lflags;
2645         /*
2646          * If set to 1, the controller replaces the TCP/UPD checksum
2647          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
2648          * checksum field of the encapsulated TCP/UDP packets with the
2649          * hardware calculated TCP/UDP checksum for the packet associated
2650          * with this descriptor. The flag is ignored if the LSO flag is set.
2651          *
2652          * This bit must be valid on the first BD of a packet.
2653          */
2654         #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
2655         /*
2656          * If set to 1, the controller replaces the IP checksum of the
2657          * normal packets, or the inner IP checksum of the encapsulated
2658          * packets with the hardware calculated IP checksum for the
2659          * packet associated with this descriptor.
2660          *
2661          * This bit must be valid on the first BD of a packet.
2662          */
2663         #define TX_BD_LONG_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
2664         /*
2665          * If set to 1, the controller will not append an Ethernet CRC
2666          * to the end of the frame.
2667          *
2668          * This bit must be valid on the first BD of a packet.
2669          *
2670          * Packet must be 64B or longer when this flag is set. It is not
2671          * useful to use this bit with any form of TX offload such as
2672          * CSO or LSO. The intent is that the packet from the host already
2673          * has a valid Ethernet CRC on the packet.
2674          */
2675         #define TX_BD_LONG_LFLAGS_NOCRC              UINT32_C(0x4)
2676         /*
2677          * This bit, in conjunction with the stamp_1step bit, controls whether
2678          * a TX packet timestamp is collected and the type of timestamp that
2679          * is collected.
2680          *
2681          * This bit must be valid on the first BD of a packet.
2682          *
2683          * Enumerations of the concatenation { stamp, stamp_1step } are
2684          * as follows:
2685          *
2686          * - 2'b00: ts_none - no timestamp
2687          * - 2'b01: ts_ptp_1step - 1-step PTP
2688          * - 2'b10: ts_2cmpl - 2-step PTP timestamp or PA timestamp
2689          * - 2'b11: ts_rsvd - reserved, same behavior as ts_none
2690          * For the ts_2cmpl enumeration, an additional completion is returned.
2691          * This additional completion may carry a 2-step PTP timestamp or a PA
2692          * timestamp, depending on parsing of the transmitted packet.
2693          */
2694         #define TX_BD_LONG_LFLAGS_STAMP              UINT32_C(0x8)
2695         /*
2696          * If set to 1, The controller replaces the tunnel IP checksum
2697          * field with hardware calculated IP checksum for the IP header
2698          * of the packet associated with this descriptor.
2699          *
2700          * For outer UDP checksum, global outer UDP checksum TE_NIC register
2701          * needs to be enabled. If the global outer UDP checksum TE_NIC
2702          * register bit is set, outer UDP checksum will be calculated for
2703          * the following cases:
2704          * 1. Packets with tcp_udp_chksum flag set to offload checksum for
2705          * inner packet AND the inner packet is TCP/UDP. If the inner packet
2706          * is ICMP for example (non-TCP/UDP), even if the tcp_udp_chksum is
2707          * set, the outer UDP checksum will not be calculated.
2708          * 2. Packets with lso flag set which implies inner TCP checksum
2709          * calculation as part of LSO operation.
2710          */
2711         #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
2712         /*
2713          * If set to 1, the device will treat this packet with LSO(Large
2714          * Send Offload) processing for both normal or encapsulated
2715          * packets, which is a form of TCP segmentation. When this bit
2716          * is 1, the hdr_size and mss fields must be valid. The driver
2717          * doesn't need to set ot_ip_chksum, t_ip_chksum, ip_chksum, and
2718          * tcp_udp_chksum flags since the controller will replace the
2719          * appropriate checksum fields for segmented packets.
2720          *
2721          * When this bit is 1, the hdr_size and mss fields must be valid.
2722          */
2723         #define TX_BD_LONG_LFLAGS_LSO                UINT32_C(0x20)
2724         /*
2725          * If set to zero when LSO is '1', then the IPID will be treated
2726          * as a 16b number and will be wrapped if it exceeds a value of
2727          * 0xffff.
2728          *
2729          * If set to one when LSO is '1', then the IPID will be treated
2730          * as a 15b number and will be wrapped if it exceeds a value 0f
2731          * 0x7fff.
2732          */
2733         #define TX_BD_LONG_LFLAGS_IPID_FMT           UINT32_C(0x40)
2734         /*
2735          * If set to zero when LSO is '1', then the IPID of the tunnel
2736          * IP header will not be modified during LSO operations.
2737          *
2738          * If set to one when LSO is '1', then the IPID of the tunnel
2739          * IP header will be incremented for each subsequent segment of an
2740          * LSO operation.
2741          *
2742          * The flag is ignored if the LSO packet is a normal (non-tunneled)
2743          * TCP packet.
2744          */
2745         #define TX_BD_LONG_LFLAGS_T_IPID             UINT32_C(0x80)
2746         /*
2747          * If set to '1', then the RoCE ICRC will be appended to the
2748          * packet. Packet must be a valid RoCE format packet.
2749          */
2750         #define TX_BD_LONG_LFLAGS_ROCE_CRC           UINT32_C(0x100)
2751         /*
2752          * If set to '1', then the FCoE CRC will be appended to the
2753          * packet. Packet must be a valid FCoE format packet.
2754          */
2755         #define TX_BD_LONG_LFLAGS_FCOE_CRC           UINT32_C(0x200)
2756         /*
2757          * If set to '1', then the timestamp from the BD is used. If cleared
2758          * to 0, then TWE provides the timestamp.
2759          */
2760         #define TX_BD_LONG_LFLAGS_BD_TS_EN           UINT32_C(0x400)
2761         /*
2762          * If set to '1', this operation will cause a trace capture in each
2763          * block it passes through.
2764          */
2765         #define TX_BD_LONG_LFLAGS_DEBUG_TRACE        UINT32_C(0x800)
2766         /*
2767          * This bit, in conjunction with the stamp bit, controls whether a
2768          * TX packet timestamp is collected and the type of timestamp that
2769          * is collected.
2770          *
2771          * See the stamp field for a description of the valid combinations of
2772          * stamp and stamp_1step.
2773          *
2774          * This bit must be valid on the first BD of a packet.
2775          */
2776         #define TX_BD_LONG_LFLAGS_STAMP_1STEP        UINT32_C(0x1000)
2777         /*
2778          * If set to '1', the controller replaces the Outer-tunnel IP checksum
2779          * field with hardware calculated IP checksum for the IP header of the
2780          * packet associated with this descriptor. For outer UDP checksum, it
2781          * will be the following behavior for all cases independent of
2782          * settings of inner LSO and checksum offload BD flags.
2783          * If outer UDP checksum is 0, then do not update it.
2784          * If outer UDP checksum is non zero, then  the hardware should
2785          * compute and update it.
2786          */
2787         #define TX_BD_LONG_LFLAGS_OT_IP_CHKSUM       UINT32_C(0x2000)
2788         /*
2789          * If set to zero when LSO is '1', then the IPID of the Outer-tunnel
2790          * IP header will not be modified during LSO operations. If set to one
2791          * when LSO is '1', then the IPID of the Outer-tunnel IP header will
2792          * be incremented for each subsequent segment of an LSO operation. The
2793          * flag is ignored if the LSO packet is a normal (non-tunneled) TCP
2794          * packet.
2795          */
2796         #define TX_BD_LONG_LFLAGS_OT_IPID            UINT32_C(0x4000)
2797         /*
2798          * If set to '1', When set to 1, KTLS encryption will be enabled for
2799          * the packet.
2800          */
2801         #define TX_BD_LONG_LFLAGS_CRYPTO_EN          UINT32_C(0x8000)
2802         uint16_t        kid_or_ts_low_hdr_size;
2803         /*
2804          * When LSO is '1', this field must contain the offset of the
2805          * TCP payload from the beginning of the packet in as
2806          * 16b words. In case of encapsulated/tunneling packet, this field
2807          * contains the offset of the inner TCP payload from beginning of the
2808          * packet as 16-bit words.
2809          *
2810          * This value must be valid on the first BD of a packet.
2811          */
2812         #define TX_BD_LONG_HDR_SIZE_MASK     UINT32_C(0x1ff)
2813         #define TX_BD_LONG_HDR_SIZE_SFT      0
2814         /*
2815          * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit
2816          * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of
2817          * the 20-bit KID.
2818          */
2819         #define TX_BD_LONG_KID_OR_TS_LOW_MASK UINT32_C(0xfe00)
2820         #define TX_BD_LONG_KID_OR_TS_LOW_SFT 9
2821         uint32_t        kid_or_ts_high_mss;
2822         /*
2823          * This is the MSS value that will be used to do the LSO processing.
2824          * The value is the length in bytes of the TCP payload for each
2825          * segment generated by the LSO operation.
2826          *
2827          * This value must be valid on the first BD of a packet.
2828          */
2829         #define TX_BD_LONG_MSS_MASK           UINT32_C(0x7fff)
2830         #define TX_BD_LONG_MSS_SFT            0
2831         /*
2832          * If lflags.bd_ts_en is 1, this is the upper 17 bits of the 24-bit
2833          * timestamp. If lflags.crypto_en is 1, the least significant 13 bits
2834          * of this field contain the upper 13 bits of the 20-bit KID.
2835          */
2836         #define TX_BD_LONG_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000)
2837         #define TX_BD_LONG_KID_OR_TS_HIGH_SFT 15
2838         /*
2839          * This value selects bits 25:16 of the CFA action to perform on the
2840          * packet. See the cfa_action field for more information.
2841          */
2842         uint16_t        cfa_action_high;
2843         #define TX_BD_LONG_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
2844         #define TX_BD_LONG_CFA_ACTION_HIGH_SFT 0
2845         /*
2846          * This value selects a CFA action to perform on the packet.
2847          * Set this value to zero if no CFA action is desired.
2848          *
2849          * This value must be valid on the first BD of a packet.
2850          */
2851         uint16_t        cfa_action;
2852         /*
2853          * This value is action meta-data that defines CFA edit operations
2854          * that are done in addition to any action editing.
2855          */
2856         uint32_t        cfa_meta;
2857         /* When key=1, This is the VLAN tag VID value. */
2858         #define TX_BD_LONG_CFA_META_VLAN_VID_MASK        UINT32_C(0xfff)
2859         #define TX_BD_LONG_CFA_META_VLAN_VID_SFT         0
2860         /* When key=1, This is the VLAN tag DE value. */
2861         #define TX_BD_LONG_CFA_META_VLAN_DE              UINT32_C(0x1000)
2862         /* When key=1, This is the VLAN tag PRI value. */
2863         #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK        UINT32_C(0xe000)
2864         #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT         13
2865         /* When key=1, This is the VLAN tag TPID select value. */
2866         #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK       UINT32_C(0x70000)
2867         #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT        16
2868         /* 0x88a8 */
2869         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8 \
2870                 (UINT32_C(0x0) << 16)
2871         /* 0x8100 */
2872         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100 \
2873                 (UINT32_C(0x1) << 16)
2874         /* 0x9100 */
2875         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100 \
2876                 (UINT32_C(0x2) << 16)
2877         /* 0x9200 */
2878         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200 \
2879                 (UINT32_C(0x3) << 16)
2880         /* 0x9300 */
2881         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300 \
2882                 (UINT32_C(0x4) << 16)
2883         /* Value programmed in CFA VLANTPID register. */
2884         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG \
2885                 (UINT32_C(0x5) << 16)
2886         #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \
2887                 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
2888         /* When key=1, This is the VLAN tag TPID select value. */
2889         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK   UINT32_C(0xff80000)
2890         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT    19
2891         /*
2892          * This field identifies the type of edit to be performed
2893          * on the packet.
2894          *
2895          * This value must be valid on the first BD of a packet.
2896          */
2897         #define TX_BD_LONG_CFA_META_KEY_MASK             UINT32_C(0xf0000000)
2898         #define TX_BD_LONG_CFA_META_KEY_SFT              28
2899         /* No editing */
2900         #define TX_BD_LONG_CFA_META_KEY_NONE \
2901                 (UINT32_C(0x0) << 28)
2902         /*
2903          * - meta[17:16] - TPID select value (0 = 0x8100).
2904          * - meta[15:12] - PRI/DE value.
2905          * - meta[11:0] - VID value.
2906          */
2907         #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG \
2908                 (UINT32_C(0x1) << 28)
2909         /*
2910          * Provide metadata
2911          * - Wh+/SR - this option is not supported.
2912          * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta
2913          *   is set in the Lookup Table.
2914          * - SR2 - {4’d0, cfa_meta[27:0]} is used for metadata output if
2915          *   en_bd_meta is set in the Lookup Table.
2916          */
2917         #define TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER \
2918                 (UINT32_C(0x2) << 28)
2919         #define TX_BD_LONG_CFA_META_KEY_LAST \
2920                 TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER
2921 } __rte_packed;
2922
2923 /*
2924  * This structure is used to inform the NIC of packet data that needs to
2925  * be transmitted with additional processing that requires extra data
2926  * such as VLAN insertion plus attached inline data.
2927  * This BD type may be used to improve latency for small packets needing
2928  * the additional extended features supported by long BDs.
2929  */
2930 /* tx_bd_long_inline (size:256b/32B) */
2931 struct tx_bd_long_inline {
2932         uint16_t        flags_type;
2933         /* This value identifies the type of buffer descriptor. */
2934         #define TX_BD_LONG_INLINE_TYPE_MASK             UINT32_C(0x3f)
2935         #define TX_BD_LONG_INLINE_TYPE_SFT              0
2936         /*
2937          * This type of BD is 32B long and is used for inline L2 packet
2938          * transmission.
2939          */
2940         #define TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
2941         #define TX_BD_LONG_INLINE_TYPE_LAST \
2942                 TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE
2943         /*
2944          * All bits in this field may be set on the first BD of a packet.
2945          * Only the packet_end bit may be set in non-first BDs.
2946          */
2947         #define TX_BD_LONG_INLINE_FLAGS_MASK            UINT32_C(0xffc0)
2948         #define TX_BD_LONG_INLINE_FLAGS_SFT             6
2949         /*
2950          * If set to 1, the packet ends with the data in the buffer
2951          * pointed to by this descriptor. This flag must be
2952          * valid on every BD.
2953          */
2954         #define TX_BD_LONG_INLINE_FLAGS_PACKET_END       UINT32_C(0x40)
2955         /*
2956          * If set to 1, the device will not generate a completion for
2957          * this transmit packet unless there is an error in its processing.
2958          * If this bit is set to 0, then the packet will be completed
2959          * normally.
2960          *
2961          * This bit may be set only on the first BD of a packet.
2962          */
2963         #define TX_BD_LONG_INLINE_FLAGS_NO_CMPL          UINT32_C(0x80)
2964         /*
2965          * This value indicates how many 16B BD locations are consumed
2966          * in the ring by this packet, including the BD and inline
2967          * data.
2968          */
2969         #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_MASK      UINT32_C(0x1f00)
2970         #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_SFT       8
2971         /* This field is deprecated. */
2972         #define TX_BD_LONG_INLINE_FLAGS_LHINT_MASK       UINT32_C(0x6000)
2973         #define TX_BD_LONG_INLINE_FLAGS_LHINT_SFT        13
2974         /*
2975          * If set to 1, the device immediately updates the Send Consumer
2976          * Index after the buffer associated with this descriptor has
2977          * been transferred via DMA to NIC memory from host memory. An
2978          * interrupt may or may not be generated according to the state
2979          * of the interrupt avoidance mechanisms. If this bit
2980          * is set to 0, then the Consumer Index is only updated as soon
2981          * as one of the host interrupt coalescing conditions has been met.
2982          *
2983          * This bit must be valid on the first BD of a packet.
2984          */
2985         #define TX_BD_LONG_INLINE_FLAGS_COAL_NOW         UINT32_C(0x8000)
2986         /*
2987          * This is the length of the inline data, not including BD length, in
2988          * bytes.
2989          * The maximum value is 480.
2990          *
2991          * This field must be valid on all BDs of a packet.
2992          */
2993         uint16_t        len;
2994         /*
2995          * The opaque data field is passed through to the completion and can be
2996          * used for any data that the driver wants to associate with the
2997          * transmit BD. This field must be valid on the first BD of a packet.
2998          * If completion coalescing is enabled on the TX ring, it is suggested
2999          * that the driver populate the opaque field to indicate the specific
3000          * TX ring with which the completion is associated, then utilize the
3001          * opaque and sq_cons_idx fields in the coalesced completion record to
3002          * determine the specific packets that are to be completed on that ring.
3003          *
3004          * This field must be valid on the first BD of a packet.
3005          */
3006         uint32_t        opaque;
3007         uint64_t        unused1;
3008         /*
3009          * All bits in this field must be valid on the first BD of a packet.
3010          * Their value on other BDs of the packet is ignored.
3011          */
3012         uint16_t        lflags;
3013         /*
3014          * If set to 1, the controller replaces the TCP/UPD checksum
3015          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
3016          * checksum field of the encapsulated TCP/UDP packets with the
3017          * hardware calculated TCP/UDP checksum for the packet associated
3018          * with this descriptor. The flag is ignored if the LSO flag is set.
3019          */
3020         #define TX_BD_LONG_INLINE_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
3021         /*
3022          * If set to 1, the controller replaces the IP checksum of the
3023          * normal packets, or the inner IP checksum of the encapsulated
3024          * packets with the hardware calculated IP checksum for the
3025          * packet associated with this descriptor.
3026          */
3027         #define TX_BD_LONG_INLINE_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
3028         /*
3029          * If set to 1, the controller will not append an Ethernet CRC
3030          * to the end of the frame.
3031          *
3032          * Packet must be 64B or longer when this flag is set. It is not
3033          * useful to use this bit with any form of TX offload such as
3034          * CSO or LSO. The intent is that the packet from the host already
3035          * has a valid Ethernet CRC on the packet.
3036          */
3037         #define TX_BD_LONG_INLINE_LFLAGS_NOCRC              UINT32_C(0x4)
3038         /*
3039          * If set to 1, the device will record the time at which the packet
3040          * was actually transmitted at the TX MAC for 2-step time sync. This
3041          * bit must be valid on the first BD of a packet.
3042          */
3043         #define TX_BD_LONG_INLINE_LFLAGS_STAMP              UINT32_C(0x8)
3044         /*
3045          * If set to 1, the controller replaces the tunnel IP checksum
3046          * field with hardware calculated IP checksum for the IP header
3047          * of the packet associated with this descriptor. The hardware
3048          * updates an outer UDP checksum if it is non-zero.
3049          */
3050         #define TX_BD_LONG_INLINE_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
3051         /*
3052          * This bit must be 0 for BDs of this type. LSO is not supported with
3053          * inline BDs.
3054          */
3055         #define TX_BD_LONG_INLINE_LFLAGS_LSO                UINT32_C(0x20)
3056         /* Since LSO is not supported with inline BDs, this bit is not used. */
3057         #define TX_BD_LONG_INLINE_LFLAGS_IPID_FMT           UINT32_C(0x40)
3058         /* Since LSO is not supported with inline BDs, this bit is not used. */
3059         #define TX_BD_LONG_INLINE_LFLAGS_T_IPID             UINT32_C(0x80)
3060         /*
3061          * If set to '1', then the RoCE ICRC will be appended to the
3062          * packet. Packet must be a valid RoCE format packet.
3063          */
3064         #define TX_BD_LONG_INLINE_LFLAGS_ROCE_CRC           UINT32_C(0x100)
3065         /*
3066          * If set to '1', then the FCoE CRC will be appended to the
3067          * packet. Packet must be a valid FCoE format packet.
3068          */
3069         #define TX_BD_LONG_INLINE_LFLAGS_FCOE_CRC           UINT32_C(0x200)
3070         /*
3071          * If set to '1', then the timestamp from the BD is used. If cleared
3072          * to 0, then TWE provides the timestamp.
3073          */
3074         #define TX_BD_LONG_INLINE_LFLAGS_BD_TS_EN           UINT32_C(0x400)
3075         /*
3076          * If set to '1', this operation will cause a trace capture in each
3077          * block it passes through.
3078          */
3079         #define TX_BD_LONG_INLINE_LFLAGS_DEBUG_TRACE        UINT32_C(0x800)
3080         /*
3081          * If set to '1', the device will record the time at which the packet
3082          * was actually transmitted at the TX MAC for 1-step time sync. This
3083          * bit must be valid on the first BD of a packet.
3084          */
3085         #define TX_BD_LONG_INLINE_LFLAGS_STAMP_1STEP        UINT32_C(0x1000)
3086         /*
3087          * If set to '1', the controller replaces the Outer-tunnel IP checksum
3088          * field with hardware calculated IP checksum for the IP header of the
3089          * packet associated with this descriptor. For outer UDP checksum, it
3090          * will be the following behavior for all cases independent of settings
3091          * of inner LSO and checksum offload BD flags. If outer UDP checksum
3092          * is 0, then do not update it. If outer UDP checksum is non zero, then
3093          * the hardware should compute and update it.
3094          */
3095         #define TX_BD_LONG_INLINE_LFLAGS_OT_IP_CHKSUM       UINT32_C(0x2000)
3096         /*
3097          * If set to zero when LSO is '1', then the IPID of the Outer-tunnel IP
3098          * header will not be modified during LSO operations. If set to one
3099          * when LSO is '1', then the IPID of the Outer-tunnel IP header will be
3100          * incremented for each subsequent segment of an LSO operation. The
3101          * flag is ignored if the LSO packet is a normal (non-tunneled) TCP
3102          * packet.
3103          */
3104         #define TX_BD_LONG_INLINE_LFLAGS_OT_IPID            UINT32_C(0x4000)
3105         /*
3106          * If set to '1', When set to 1, KTLS encryption will be enabled for
3107          * the packet.
3108          */
3109         #define TX_BD_LONG_INLINE_LFLAGS_CRYPTO_EN          UINT32_C(0x8000)
3110         uint8_t unused2;
3111         uint8_t kid_or_ts_low;
3112         #define TX_BD_LONG_INLINE_UNUSED            UINT32_C(0x1)
3113         /*
3114          * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit
3115          * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of
3116          * the 20-bit KID.
3117          */
3118         #define TX_BD_LONG_INLINE_KID_OR_TS_LOW_MASK UINT32_C(0xfe)
3119         #define TX_BD_LONG_INLINE_KID_OR_TS_LOW_SFT 1
3120         uint32_t        kid_or_ts_high;
3121         #define TX_BD_LONG_INLINE_UNUSED_MASK        UINT32_C(0x7fff)
3122         #define TX_BD_LONG_INLINE_UNUSED_SFT         0
3123         /*
3124          * If lflags.bd_ts_en is 1, this is the upper 17 bits of the 24-bit
3125          * timestamp. If lflags.crypto_en is 1, the least significant 13 bits
3126          * of this field contain the upper 13 bits of the 20-bit KID.
3127          */
3128         #define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000)
3129         #define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_SFT 15
3130         /*
3131          * This value selects bits 25:16 of the CFA action to perform on the
3132          * packet. See the cfa_action field for more information.
3133          */
3134         uint16_t        cfa_action_high;
3135         #define TX_BD_LONG_INLINE_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
3136         #define TX_BD_LONG_INLINE_CFA_ACTION_HIGH_SFT 0
3137         /*
3138          * This value selects a CFA action to perform on the packet.
3139          * Set this value to zero if no CFA action is desired.
3140          *
3141          * This value must be valid on the first BD of a packet.
3142          */
3143         uint16_t        cfa_action;
3144         /*
3145          * This value is action meta-data that defines CFA edit operations
3146          * that are done in addition to any action editing.
3147          */
3148         uint32_t        cfa_meta;
3149         /* When key = 1, this is the VLAN tag VID value. */
3150         #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_MASK        UINT32_C(0xfff)
3151         #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_SFT         0
3152         /* When key = 1, this is the VLAN tag DE value. */
3153         #define TX_BD_LONG_INLINE_CFA_META_VLAN_DE \
3154                 UINT32_C(0x1000)
3155         /* When key = 1, this is the VLAN tag PRI value. */
3156         #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_MASK \
3157                 UINT32_C(0xe000)
3158         #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_SFT         13
3159         /* When key = 1, this is the VLAN tag TPID select value. */
3160         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_MASK \
3161                 UINT32_C(0x70000)
3162         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_SFT        16
3163         /* 0x88a8 */
3164         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID88A8 \
3165                 (UINT32_C(0x0) << 16)
3166         /* 0x8100 */
3167         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID8100 \
3168                 (UINT32_C(0x1) << 16)
3169         /* 0x9100 */
3170         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9100 \
3171                 (UINT32_C(0x2) << 16)
3172         /* 0x9200 */
3173         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9200 \
3174                 (UINT32_C(0x3) << 16)
3175         /* 0x9300 */
3176         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9300 \
3177                 (UINT32_C(0x4) << 16)
3178         /* Value programmed in CFA VLANTPID register. */
3179         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG \
3180                 (UINT32_C(0x5) << 16)
3181         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_LAST \
3182                 TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG
3183         #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_MASK \
3184                 UINT32_C(0xff80000)
3185         #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_SFT    19
3186         /*
3187          * This field identifies the type of edit to be performed
3188          * on the packet.
3189          *
3190          * This value must be valid on the first BD of a packet.
3191          */
3192         #define TX_BD_LONG_INLINE_CFA_META_KEY_MASK \
3193                 UINT32_C(0xf0000000)
3194         #define TX_BD_LONG_INLINE_CFA_META_KEY_SFT              28
3195         /* No editing */
3196         #define TX_BD_LONG_INLINE_CFA_META_KEY_NONE \
3197                 (UINT32_C(0x0) << 28)
3198         /*
3199          * - meta[17:16] - TPID select value (0 = 0x8100).
3200          * - meta[15:12] - PRI/DE value.
3201          * - meta[11:0] - VID value.
3202          */
3203         #define TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG \
3204                 (UINT32_C(0x1) << 28)
3205         /*
3206          * Provide metadata
3207          * - Wh+/SR - this option is not supported.
3208          * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta
3209          *   is set in the Lookup Table.
3210          * - SR2 - {4’d0, cfa_meta[27:0]} is used for metadata output if
3211          *   en_bd_meta is set in the Lookup Table.
3212          */
3213         #define TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER \
3214                 (UINT32_C(0x2) << 28)
3215         #define TX_BD_LONG_INLINE_CFA_META_KEY_LAST \
3216                 TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER
3217 } __rte_packed;
3218
3219 /* tx_bd_empty (size:128b/16B) */
3220 struct tx_bd_empty {
3221         /* This value identifies the type of buffer descriptor. */
3222         uint8_t type;
3223         #define TX_BD_EMPTY_TYPE_MASK       UINT32_C(0x3f)
3224         #define TX_BD_EMPTY_TYPE_SFT        0
3225         /*
3226          * Indicates that this BD is 1BB long and is an empty
3227          * TX BD. Not valid for use by the driver.
3228          */
3229         #define TX_BD_EMPTY_TYPE_TX_BD_EMPTY  UINT32_C(0x1)
3230         #define TX_BD_EMPTY_TYPE_LAST        TX_BD_EMPTY_TYPE_TX_BD_EMPTY
3231         uint8_t unused_1[3];
3232         uint8_t unused_2;
3233         uint8_t unused_3[3];
3234         uint8_t unused_4[8];
3235 } __rte_packed;
3236
3237 /* tx_bd_mp_cmd (size:128b/16B) */
3238 struct tx_bd_mp_cmd {
3239         /* Unless otherwise stated, sub-fields of this field are always valid. */
3240         uint16_t        flags_type;
3241         /* This value identifies the type of buffer descriptor. */
3242         #define TX_BD_MP_CMD_TYPE_MASK        UINT32_C(0x3f)
3243         #define TX_BD_MP_CMD_TYPE_SFT         0
3244         /*
3245          * Indicates that this BD is used to issue a command to one of
3246          * the mid-path destinations.
3247          */
3248         #define TX_BD_MP_CMD_TYPE_TX_BD_MP_CMD  UINT32_C(0x8)
3249         #define TX_BD_MP_CMD_TYPE_LAST         TX_BD_MP_CMD_TYPE_TX_BD_MP_CMD
3250         #define TX_BD_MP_CMD_FLAGS_MASK       UINT32_C(0xffc0)
3251         #define TX_BD_MP_CMD_FLAGS_SFT        6
3252         /*  */
3253         #define TX_BD_MP_CMD_FLAGS_UNUSED_MASK UINT32_C(0xc0)
3254         #define TX_BD_MP_CMD_FLAGS_UNUSED_SFT  6
3255         /*
3256          * This value indicates the number of 16B BD locations (slots)
3257          * consumed in the ring by this mid-path command BD, including the
3258          * BD header and the command field.
3259          */
3260         #define TX_BD_MP_CMD_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
3261         #define TX_BD_MP_CMD_FLAGS_BD_CNT_SFT  8
3262         /*
3263          * This value defines the length of command field in bytes. The maximum
3264          * value shall be 496.
3265          */
3266         uint16_t        len;
3267         /*
3268          * The opaque data field is pass through to the completion and can be
3269          * used for any data that the driver wants to associate with this
3270          * Tx mid-path command.
3271          */
3272         uint32_t        opaque;
3273         uint64_t        unused1;
3274 } __rte_packed;
3275
3276 /* tx_bd_presync_cmd (size:128b/16B) */
3277 struct tx_bd_presync_cmd {
3278         /* Unless otherwise stated, sub-fields of this field are always valid. */
3279         uint16_t        flags_type;
3280         /* This value identifies the type of buffer descriptor. */
3281         #define TX_BD_PRESYNC_CMD_TYPE_MASK             UINT32_C(0x3f)
3282         #define TX_BD_PRESYNC_CMD_TYPE_SFT              0
3283         /*
3284          * Indicates that this BD is used to issue a cryptographic pre-
3285          * sync command through the fast path and destined for TCE.
3286          */
3287         #define TX_BD_PRESYNC_CMD_TYPE_TX_BD_PRESYNC_CMD  UINT32_C(0x9)
3288         #define TX_BD_PRESYNC_CMD_TYPE_LAST \
3289                 TX_BD_PRESYNC_CMD_TYPE_TX_BD_PRESYNC_CMD
3290         #define TX_BD_PRESYNC_CMD_FLAGS_MASK            UINT32_C(0xffc0)
3291         #define TX_BD_PRESYNC_CMD_FLAGS_SFT             6
3292         /*  */
3293         #define TX_BD_PRESYNC_CMD_FLAGS_UNUSED_MASK      UINT32_C(0xc0)
3294         #define TX_BD_PRESYNC_CMD_FLAGS_UNUSED_SFT       6
3295         /*
3296          * This value indicates the number of 16B BD locations (slots)
3297          * consumed in the ring by this pre-sync command BD, including the
3298          * BD header and the command field.
3299          */
3300         #define TX_BD_PRESYNC_CMD_FLAGS_BD_CNT_MASK      UINT32_C(0x1f00)
3301         #define TX_BD_PRESYNC_CMD_FLAGS_BD_CNT_SFT       8
3302         /*
3303          * This value defines the length of command field in bytes. The maximum
3304          * value shall be 496.
3305          */
3306         uint16_t        len;
3307         /*
3308          * The opaque data field is pass through to TCE and can be used for
3309          * debug.
3310          */
3311         uint32_t        opaque;
3312         /*
3313          * This field is the Crypto Context ID to which the retransmit packet is
3314          * applied. The KID references the context fields used by the
3315          * associated kTLS offloaded connection.
3316          */
3317         uint32_t        kid;
3318         /*
3319          * The KID value of all-ones is reserved for non-KTLS packets, which
3320          * only implies that this value must not be used when filling this
3321          * field for crypto packets.
3322          */
3323         #define TX_BD_PRESYNC_CMD_KID_VAL_MASK UINT32_C(0xfffff)
3324         #define TX_BD_PRESYNC_CMD_KID_VAL_SFT 0
3325         uint32_t        unused_1;
3326 } __rte_packed;
3327
3328 /* rx_prod_pkt_bd (size:128b/16B) */
3329 struct rx_prod_pkt_bd {
3330         /* This value identifies the type of buffer descriptor. */
3331         uint16_t        flags_type;
3332         /* This value identifies the type of buffer descriptor. */
3333         #define RX_PROD_PKT_BD_TYPE_MASK         UINT32_C(0x3f)
3334         #define RX_PROD_PKT_BD_TYPE_SFT          0
3335         /*
3336          * Indicates that this BD is 16B long and is an RX Producer
3337          * (i.e. empty) buffer descriptor.
3338          */
3339         #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT    UINT32_C(0x4)
3340         #define RX_PROD_PKT_BD_TYPE_LAST \
3341                 RX_PROD_PKT_BD_TYPE_RX_PROD_PKT
3342         #define RX_PROD_PKT_BD_FLAGS_MASK        UINT32_C(0xffc0)
3343         #define RX_PROD_PKT_BD_FLAGS_SFT         6
3344         /*
3345          * If set to 1, the packet will be placed at the address plus
3346          * 2B. The 2 Bytes of padding will be written as zero.
3347          */
3348         #define RX_PROD_PKT_BD_FLAGS_SOP_PAD      UINT32_C(0x40)
3349         /*
3350          * If set to 1, the packet write will be padded out to the
3351          * nearest cache-line with zero value padding.
3352          */
3353         #define RX_PROD_PKT_BD_FLAGS_EOP_PAD      UINT32_C(0x80)
3354         /*
3355          * This field has been deprecated. There can be no additional
3356          * BDs for this packet from this ring.
3357          *
3358          * Old definition:
3359          * This value is the number of additional buffers in the ring that
3360          * describe the buffer space to be consumed for this packet.
3361          * If the value is zero, then the packet must fit within the
3362          * space described by this BD. If this value is 1 or more, it
3363          * indicates how many additional "buffer" BDs are in the ring
3364          * immediately following this BD to be used for the same
3365          * network packet. Even if the packet to be placed does not need
3366          * all the additional buffers, they will be consumed anyway.
3367          */
3368         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
3369         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT  8
3370         /*
3371          * This is the length in Bytes of the host physical buffer where
3372          * data for the packet may be placed in host memory.
3373          */
3374         uint16_t        len;
3375         /*
3376          * The opaque data field is pass through to the completion and can be
3377          * used for any data that the driver wants to associate with this
3378          * receive buffer set.
3379          */
3380         uint32_t        opaque;
3381         /*
3382          * This is the host physical address where data for the packet may
3383          * be placed in host memory.
3384          */
3385         uint64_t        address;
3386 } __rte_packed;
3387
3388 /* rx_prod_bfr_bd (size:128b/16B) */
3389 struct rx_prod_bfr_bd {
3390         /* This value identifies the type of buffer descriptor. */
3391         uint16_t        flags_type;
3392         /* This value identifies the type of buffer descriptor. */
3393         #define RX_PROD_BFR_BD_TYPE_MASK       UINT32_C(0x3f)
3394         #define RX_PROD_BFR_BD_TYPE_SFT        0
3395         /*
3396          * Indicates that this BD is 16B long and is an RX
3397          * Producer Buffer BD.
3398          */
3399         #define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR  UINT32_C(0x5)
3400         #define RX_PROD_BFR_BD_TYPE_LAST        RX_PROD_BFR_BD_TYPE_RX_PROD_BFR
3401         #define RX_PROD_BFR_BD_FLAGS_MASK      UINT32_C(0xffc0)
3402         #define RX_PROD_BFR_BD_FLAGS_SFT       6
3403         /*
3404          * This is the length in Bytes of the host physical buffer where
3405          * data for the packet may be placed in host memory.
3406          */
3407         uint16_t        len;
3408         /* This field is not used. */
3409         uint32_t        opaque;
3410         /*
3411          * This is the host physical address where data for the packet may
3412          * be placed in host memory.
3413          */
3414         uint64_t        address;
3415 } __rte_packed;
3416
3417 /* rx_prod_agg_bd (size:128b/16B) */
3418 struct rx_prod_agg_bd {
3419         /* This value identifies the type of buffer descriptor. */
3420         uint16_t        flags_type;
3421         /* This value identifies the type of buffer descriptor. */
3422         #define RX_PROD_AGG_BD_TYPE_MASK         UINT32_C(0x3f)
3423         #define RX_PROD_AGG_BD_TYPE_SFT          0
3424         /*
3425          * Indicates that this BD is 16B long and is an
3426          * RX Producer Assembly Buffer Descriptor.
3427          */
3428         #define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG    UINT32_C(0x6)
3429         #define RX_PROD_AGG_BD_TYPE_LAST \
3430                 RX_PROD_AGG_BD_TYPE_RX_PROD_AGG
3431         #define RX_PROD_AGG_BD_FLAGS_MASK        UINT32_C(0xffc0)
3432         #define RX_PROD_AGG_BD_FLAGS_SFT         6
3433         /*
3434          * If set to 1, the packet write will be padded out to the
3435          * nearest cache-line with zero value padding.
3436          */
3437         #define RX_PROD_AGG_BD_FLAGS_EOP_PAD      UINT32_C(0x40)
3438         /*
3439          * This is the length in Bytes of the host physical buffer where
3440          * data for the packet may be placed in host memory.
3441          */
3442         uint16_t        len;
3443         /*
3444          * The opaque data field is pass through to the completion and can be
3445          * used for any data that the driver wants to associate with this
3446          * receive assembly buffer.
3447          */
3448         uint32_t        opaque;
3449         /*
3450          * This is the host physical address where data for the packet may
3451          * be placed in host memory.
3452          */
3453         uint64_t        address;
3454 } __rte_packed;
3455
3456 /* cfa_cmpls_cmp_data_msg (size:128b/16B) */
3457 struct cfa_cmpls_cmp_data_msg {
3458         uint32_t        mp_client_dma_length_opcode_status_type;
3459         /*
3460          * This field represents the Mid-Path client that generated the
3461          * completion.
3462          */
3463         #define CFA_CMPLS_CMP_DATA_MSG_TYPE_MASK                UINT32_C(0x3f)
3464         #define CFA_CMPLS_CMP_DATA_MSG_TYPE_SFT                 0
3465         /* Mid Path Short Completion with length = 16B. */
3466         #define CFA_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT \
3467                 UINT32_C(0x1e)
3468         #define CFA_CMPLS_CMP_DATA_MSG_TYPE_LAST \
3469                 CFA_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT
3470         /* This value indicates the status for the command. */
3471         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_MASK              UINT32_C(0x3c0)
3472         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_SFT               6
3473         /* Completed without error. */
3474         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_OK \
3475                 (UINT32_C(0x0) << 6)
3476         /* Indicates an unsupported CFA opcode in the command. */
3477         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_UNSPRT_ERR \
3478                 (UINT32_C(0x1) << 6)
3479         /*
3480          * Indicates a CFA command formatting error. This error can occur on
3481          * any of the supported CFA commands.
3482          */
3483         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_FMT_ERR \
3484                 (UINT32_C(0x2) << 6)
3485         /*
3486          * Indicates an SVIF-Table scope error. This error can occur on any
3487          * of the supported CFA commands.
3488          */
3489         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_SCOPE_ERR \
3490                 (UINT32_C(0x3) << 6)
3491         /*
3492          * Indicates that the table_index is either outside of the
3493          * table_scope range set by its EM_SIZE or, for EM Insert, it is in
3494          * the static bucket range. This error can occur on EM Insert
3495          * commands. It can also occur on Read, Read Clear, Write, and
3496          * Invalidate commands if the table_type is EM.
3497          */
3498         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_ADDR_ERR \
3499                 (UINT32_C(0x4) << 6)
3500         /*
3501          * Cache operation responded with an error. This error can occur on
3502          * Read, Read Clear, Write, EM Insert, and EM Delete commands.
3503          */
3504         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_CACHE_ERR \
3505                 (UINT32_C(0x5) << 6)
3506         /*
3507          * Indicates failure on EM Insert or EM Delete Command. Hash index
3508          * and hash msb are returned in table_index and hash_msb fields.
3509          * Dma_length is set to 1 if the bucket is also returned (as dma
3510          * data).
3511          */
3512         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_EM_FAIL \
3513                 (UINT32_C(0x6) << 6)
3514         /*
3515          * Indicates no notifications were available on an Event Collection
3516          * command.
3517          */
3518         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_EVENT_COLLECT_FAIL \
3519                 (UINT32_C(0x7) << 6)
3520         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_LAST \
3521                 CFA_CMPLS_CMP_DATA_MSG_STATUS_EVENT_COLLECT_FAIL
3522         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED0_MASK             UINT32_C(0xc00)
3523         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED0_SFT              10
3524         /* This is the opcode from the command. */
3525         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_MASK \
3526                 UINT32_C(0xff000)
3527         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_SFT               12
3528         /*
3529          * This is read command. From 32 to 128B can be read from a table
3530          * using this command.
3531          */
3532         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_READ \
3533                 (UINT32_C(0x0) << 12)
3534         /*
3535          * This is write command. From 32 to 128B can be written to a table
3536          * using this command.
3537          */
3538         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_WRITE \
3539                 (UINT32_C(0x1) << 12)
3540         /*
3541          * This is read-clear command. 32B can be read from a table and a 16b
3542          * mask can be used to clear specific 16b units after the read as an
3543          * atomic operation.
3544          */
3545         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_READ_CLR \
3546                 (UINT32_C(0x2) << 12)
3547         /*
3548          * An exact match table insert will be attempted into the table. If
3549          * there is a free location in the bucket, the payload will be
3550          * written to the bucket.
3551          */
3552         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EM_INSERT \
3553                 (UINT32_C(0x3) << 12)
3554         /* An exact match table delete will be attempted. */
3555         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EM_DELETE \
3556                 (UINT32_C(0x4) << 12)
3557         /*
3558          * The specified table area will be invalidated. If it is needed
3559          * again, it will be read from the backing store.
3560          */
3561         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_INVALIDATE \
3562                 (UINT32_C(0x5) << 12)
3563         /* Reads notification messages from the Host Notification Queue. */
3564         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EVENT_COLLECT \
3565                 (UINT32_C(0x6) << 12)
3566         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_LAST \
3567                 CFA_CMPLS_CMP_DATA_MSG_OPCODE_EVENT_COLLECT
3568         /*
3569          * This field indicates the length of the DMA that accompanies the
3570          * completion. Specified in units of DWords (32b). Valid values are
3571          * between 0 and 128. A value of zero indicates that there is no DMA
3572          * that accompanies the completion.
3573          */
3574         #define CFA_CMPLS_CMP_DATA_MSG_DMA_LENGTH_MASK \
3575                 UINT32_C(0xff00000)
3576         #define CFA_CMPLS_CMP_DATA_MSG_DMA_LENGTH_SFT           20
3577         /*
3578          * This field represents the Mid-Path client that generated the
3579          * completion.
3580          */
3581         #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_MASK \
3582                 UINT32_C(0xf0000000)
3583         #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_SFT            28
3584         /* TX configurable flow processing block. */
3585         #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_TE_CFA \
3586                 (UINT32_C(0x2) << 28)
3587         /* RX configurable flow processing block. */
3588         #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_RE_CFA \
3589                 (UINT32_C(0x3) << 28)
3590         #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_LAST \
3591                 CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_RE_CFA
3592         /*
3593          * This is a copy of the opaque field from the mid path BD of this
3594          * command.
3595          */
3596         uint32_t        opaque;
3597         uint16_t        hash_msb_v;
3598         /*
3599          * This value is written by the NIC such that it will be different for
3600          * each pass through the completion queue. The even passes will
3601          * write 1. The odd passes will write 0.
3602          */
3603         #define CFA_CMPLS_CMP_DATA_MSG_V            UINT32_C(0x1)
3604         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED1_MASK UINT32_C(0xe)
3605         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED1_SFT  1
3606         /*
3607          * This is the upper 12b of the hash, returned on Exact Match
3608          * Insertion/Deletion Commands.
3609          */
3610         #define CFA_CMPLS_CMP_DATA_MSG_HASH_MSB_MASK UINT32_C(0xfff0)
3611         #define CFA_CMPLS_CMP_DATA_MSG_HASH_MSB_SFT 4
3612         /* This is the table type from the command. */
3613         uint8_t table_type;
3614         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED2_MASK     UINT32_C(0xf)
3615         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED2_SFT      0
3616         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf0)
3617         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_SFT   4
3618         /* This command acts on the action table of the specified scope. */
3619         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_ACTION  (UINT32_C(0x0) << 4)
3620         /* This command acts on the exact match table of the specified scope. */
3621         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_EM      (UINT32_C(0x1) << 4)
3622         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_LAST \
3623                 CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_EM
3624         uint8_t table_scope;
3625         /* This is the table scope from the command. */
3626         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
3627         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_SCOPE_SFT 0
3628         uint32_t        table_index;
3629         /*
3630          * This is the table index from the command (if it exists). However, if
3631          * an Exact Match Insertion/Deletion command failed, then this is the
3632          * table index of the calculated static hash bucket.
3633          */
3634         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
3635         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_INDEX_SFT 0
3636 } __rte_packed;
3637
3638 /* CFA Mid-Path 32B DMA Message */
3639 /* cfa_dma32b_data_msg (size:256b/32B) */
3640 struct cfa_dma32b_data_msg {
3641         /* DMA data value. */
3642         uint32_t        dta[8];
3643 } __rte_packed;
3644
3645 /* CFA Mid-Path 64B DMA Message */
3646 /* cfa_dma64b_data_msg (size:512b/64B) */
3647 struct cfa_dma64b_data_msg {
3648         /* DMA data value. */
3649         uint32_t        dta[16];
3650 } __rte_packed;
3651
3652 /* CFA Mid-Path 96B DMA Message */
3653 /* cfa_dma96b_data_msg (size:768b/96B) */
3654 struct cfa_dma96b_data_msg {
3655         /* DMA data value. */
3656         uint32_t        dta[24];
3657 } __rte_packed;
3658
3659 /* CFA Mid-Path 128B DMA Message */
3660 /* cfa_dma128b_data_msg (size:1024b/128B) */
3661 struct cfa_dma128b_data_msg {
3662         /* DMA data value. */
3663         uint32_t        dta[32];
3664 } __rte_packed;
3665
3666 /* ce_cmpls_cmp_data_msg (size:128b/16B) */
3667 struct ce_cmpls_cmp_data_msg {
3668         uint16_t        status_subtype_type;
3669         /*
3670          * This field indicates the exact type of the completion. By
3671          * convention, the LSB identifies the length of the record in 16B
3672          * units. Even values indicate 16B records. Odd values indicate 32B
3673          * records.
3674          */
3675         #define CE_CMPLS_CMP_DATA_MSG_TYPE_MASK          UINT32_C(0x3f)
3676         #define CE_CMPLS_CMP_DATA_MSG_TYPE_SFT           0
3677         /* Completion of a Mid Path Command. Length = 16B */
3678         #define CE_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT  UINT32_C(0x1e)
3679         #define CE_CMPLS_CMP_DATA_MSG_TYPE_LAST \
3680                 CE_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT
3681         /*
3682          * This value indicates the CE sub-type operation that is being
3683          * completed.
3684          */
3685         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_MASK       UINT32_C(0x3c0)
3686         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_SFT        6
3687         /* Completion Response for a Solicited Command. */
3688         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_SOLICITED    (UINT32_C(0x0) << 6)
3689         /* Error Completion (Unsolicited). */
3690         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_ERR          (UINT32_C(0x1) << 6)
3691         /* Re-Sync Completion (Unsolicited) */
3692         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_RESYNC       (UINT32_C(0x2) << 6)
3693         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_LAST \
3694                 CE_CMPLS_CMP_DATA_MSG_SUBTYPE_RESYNC
3695         /* This value indicates the status for the command. */
3696         #define CE_CMPLS_CMP_DATA_MSG_STATUS_MASK        UINT32_C(0x3c00)
3697         #define CE_CMPLS_CMP_DATA_MSG_STATUS_SFT         10
3698         /* Completed without error. */
3699         #define CE_CMPLS_CMP_DATA_MSG_STATUS_OK \
3700                 (UINT32_C(0x0) << 10)
3701         /* CFCK load error. */
3702         #define CE_CMPLS_CMP_DATA_MSG_STATUS_CTX_LD_ERR \
3703                 (UINT32_C(0x1) << 10)
3704         /* FID check error. */
3705         #define CE_CMPLS_CMP_DATA_MSG_STATUS_FID_CHK_ERR \
3706                 (UINT32_C(0x2) << 10)
3707         /* Context kind / MP version mismatch error. */
3708         #define CE_CMPLS_CMP_DATA_MSG_STATUS_CTX_VER_ERR \
3709                 (UINT32_C(0x3) << 10)
3710         /* Unsupported Destination Connection ID Length. */
3711         #define CE_CMPLS_CMP_DATA_MSG_STATUS_DST_ID_ERR \
3712                 (UINT32_C(0x4) << 10)
3713         /*
3714          * Invalid MP Command [anything other than ADD or DELETE
3715          * triggers this for QUIC].
3716          */
3717         #define CE_CMPLS_CMP_DATA_MSG_STATUS_MP_CMD_ERR \
3718                 (UINT32_C(0x5) << 10)
3719         #define CE_CMPLS_CMP_DATA_MSG_STATUS_LAST \
3720                 CE_CMPLS_CMP_DATA_MSG_STATUS_MP_CMD_ERR
3721         uint8_t unused0;
3722         uint8_t mp_clients;
3723         #define CE_CMPLS_CMP_DATA_MSG_UNUSED1_MASK   UINT32_C(0xf)
3724         #define CE_CMPLS_CMP_DATA_MSG_UNUSED1_SFT    0
3725         /*
3726          * This field represents the Mid-Path client that generated the
3727          * completion.
3728          */
3729         #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_MASK UINT32_C(0xf0)
3730         #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_SFT 4
3731         /* TX crypto engine block. */
3732         #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_TCE   (UINT32_C(0x0) << 4)
3733         /* RX crypto engine block. */
3734         #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_RCE   (UINT32_C(0x1) << 4)
3735         #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_LAST \
3736                 CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_RCE
3737         /*
3738          * This is a copy of the opaque field from the mid path BD of this
3739          * command.
3740          */
3741         uint32_t        opaque;
3742         /*  */
3743         uint32_t        kid_v;
3744         /*
3745          * This value is written by the NIC such that it will be different
3746          * for each pass through the completion queue. The even passes will
3747          * write 1. The odd passes will write 0.
3748          */
3749         #define CE_CMPLS_CMP_DATA_MSG_V       UINT32_C(0x1)
3750         /*
3751          * This field is the Crypto Context ID. The KID is used to store
3752          * information used by the associated kTLS offloaded connection.
3753          */
3754         #define CE_CMPLS_CMP_DATA_MSG_KID_MASK UINT32_C(0x1ffffe)
3755         #define CE_CMPLS_CMP_DATA_MSG_KID_SFT 1
3756         uint32_t        unused2;
3757 } __rte_packed;
3758
3759 /* cmpl_base (size:128b/16B) */
3760 struct cmpl_base {
3761         uint16_t        type;
3762         /*
3763          * This field indicates the exact type of the completion.
3764          * By convention, the LSB identifies the length of the
3765          * record in 16B units. Even values indicate 16B
3766          * records. Odd values indicate 32B
3767          * records.
3768          */
3769         #define CMPL_BASE_TYPE_MASK            UINT32_C(0x3f)
3770         #define CMPL_BASE_TYPE_SFT             0
3771         /*
3772          * TX L2 completion:
3773          * Completion of TX packet. Length = 16B
3774          */
3775         #define CMPL_BASE_TYPE_TX_L2             UINT32_C(0x0)
3776         /*
3777          * NO-OP completion:
3778          * Completion of NO-OP. Length = 16B
3779          */
3780         #define CMPL_BASE_TYPE_NO_OP             UINT32_C(0x1)
3781         /*
3782          * TX L2 coalesced completion:
3783          * Completion of coalesced TX packet. Length = 16B
3784          */
3785         #define CMPL_BASE_TYPE_TX_L2_COAL        UINT32_C(0x2)
3786         /*
3787          * TX L2 PTP completion:
3788          * Completion of PTP TX packet. Length = 32B
3789          */
3790         #define CMPL_BASE_TYPE_TX_L2_PTP         UINT32_C(0x3)
3791         /*
3792          * TX L2 Packet Timestamp completion:
3793          * Completion of an L2 Packet Timestamp Packet. Length = 16B
3794          */
3795         #define CMPL_BASE_TYPE_TX_L2_PTP_TS      UINT32_C(0x4)
3796         /*
3797          * RX L2 TPA Start V2 Completion:
3798          * Completion of and L2 RX packet. Length = 32B
3799          * This is the new version of the RX_TPA_START completion used
3800          * in SR2 and later chips.
3801          */
3802         #define CMPL_BASE_TYPE_RX_TPA_START_V2   UINT32_C(0xd)
3803         /*
3804          * RX L2 V2 completion:
3805          * Completion of and L2 RX packet. Length = 32B
3806          * This is the new version of the RX_L2 completion used in SR2
3807          * and later chips.
3808          */
3809         #define CMPL_BASE_TYPE_RX_L2_V2          UINT32_C(0xf)
3810         /*
3811          * RX L2 completion:
3812          * This is the compressed version of Rx Completion for performance
3813          * applications. Length = 16B
3814          */
3815         #define CMPL_BASE_TYPE_RX_L2_COMPRESS    UINT32_C(0x10)
3816         /*
3817          * RX L2 completion:
3818          * Completion of and L2 RX packet. Length = 32B
3819          */
3820         #define CMPL_BASE_TYPE_RX_L2             UINT32_C(0x11)
3821         /*
3822          * RX Aggregation Buffer completion:
3823          * Completion of an L2 aggregation buffer in support of
3824          * TPA, HDS, or Jumbo packet completion. Length = 16B
3825          */
3826         #define CMPL_BASE_TYPE_RX_AGG            UINT32_C(0x12)
3827         /*
3828          * RX L2 TPA Start Completion:
3829          * Completion at the beginning of a TPA operation.
3830          * Length = 32B
3831          */
3832         #define CMPL_BASE_TYPE_RX_TPA_START      UINT32_C(0x13)
3833         /*
3834          * RX L2 TPA End Completion:
3835          * Completion at the end of a TPA operation.
3836          * Length = 32B
3837          */
3838         #define CMPL_BASE_TYPE_RX_TPA_END        UINT32_C(0x15)
3839         /*
3840          * RX TPA Aggregation Buffer Completion:
3841          * Completion of an L2 aggregation buffer in support of TPA packet
3842          * completion.
3843          * Length = 16B
3844          */
3845         #define CMPL_BASE_TYPE_RX_TPA_AGG        UINT32_C(0x16)
3846         /*
3847          * RX L2 completion: Completion of and L2 RX packet.
3848          * Length = 32B
3849          */
3850         #define CMPL_BASE_TYPE_RX_L2_V3          UINT32_C(0x17)
3851         /*
3852          * RX L2 TPA Start completion: Completion at the beginning of a TPA
3853          * operation.
3854          * Length = 32B
3855          */
3856         #define CMPL_BASE_TYPE_RX_TPA_START_V3   UINT32_C(0x19)
3857         /*
3858          * Statistics Ejection Completion:
3859          * Completion of statistics data ejection buffer.
3860          * Length = 16B
3861          */
3862         #define CMPL_BASE_TYPE_STAT_EJECT        UINT32_C(0x1a)
3863         /*
3864          * VEE Flush Completion:
3865          * This completion is inserted manually by
3866          * the Primate and processed by the VEE hardware to ensure that
3867          * all completions on a VEE function have been processed by the
3868          * VEE hardware before FLR process is completed.
3869          */
3870         #define CMPL_BASE_TYPE_VEE_FLUSH         UINT32_C(0x1c)
3871         /*
3872          * Mid Path Short Completion :
3873          * Completion of a Mid Path Command. Length = 16B
3874          */
3875         #define CMPL_BASE_TYPE_MID_PATH_SHORT    UINT32_C(0x1e)
3876         /*
3877          * Mid Path Long Completion :
3878          * Completion of a Mid Path Command. Length = 32B
3879          */
3880         #define CMPL_BASE_TYPE_MID_PATH_LONG     UINT32_C(0x1f)
3881         /*
3882          * HWRM Command Completion:
3883          * Completion of an HWRM command.
3884          */
3885         #define CMPL_BASE_TYPE_HWRM_DONE         UINT32_C(0x20)
3886         /* Forwarded HWRM Request */
3887         #define CMPL_BASE_TYPE_HWRM_FWD_REQ      UINT32_C(0x22)
3888         /* Forwarded HWRM Response */
3889         #define CMPL_BASE_TYPE_HWRM_FWD_RESP     UINT32_C(0x24)
3890         /* HWRM Asynchronous Event Information */
3891         #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
3892         /* CQ Notification */
3893         #define CMPL_BASE_TYPE_CQ_NOTIFICATION   UINT32_C(0x30)
3894         /* SRQ Threshold Event */
3895         #define CMPL_BASE_TYPE_SRQ_EVENT         UINT32_C(0x32)
3896         /* DBQ Threshold Event */
3897         #define CMPL_BASE_TYPE_DBQ_EVENT         UINT32_C(0x34)
3898         /* QP Async Notification */
3899         #define CMPL_BASE_TYPE_QP_EVENT          UINT32_C(0x38)
3900         /* Function Async Notification */
3901         #define CMPL_BASE_TYPE_FUNC_EVENT        UINT32_C(0x3a)
3902         #define CMPL_BASE_TYPE_LAST             CMPL_BASE_TYPE_FUNC_EVENT
3903         /* info1 is 16 b */
3904         uint16_t        info1;
3905         /* info2 is 32 b */
3906         uint32_t        info2;
3907         /*
3908          * This value is written by the NIC such that it will be different
3909          * for each pass through the completion queue. The even passes
3910          * will write 1. The odd passes will write 0.
3911          */
3912         uint32_t        info3_v;
3913         #define CMPL_BASE_V         UINT32_C(0x1)
3914         #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
3915         #define CMPL_BASE_INFO3_SFT 1
3916         /* info4 is 32 b */
3917         uint32_t        info4;
3918 } __rte_packed;
3919
3920 /* tx_cmpl (size:128b/16B) */
3921 struct tx_cmpl {
3922         uint16_t        flags_type;
3923         /*
3924          * This field indicates the exact type of the completion.
3925          * By convention, the LSB identifies the length of the
3926          * record in 16B units. Even values indicate 16B
3927          * records. Odd values indicate 32B
3928          * records.
3929          */
3930         #define TX_CMPL_TYPE_MASK       UINT32_C(0x3f)
3931         #define TX_CMPL_TYPE_SFT        0
3932         /*
3933          * TX L2 completion:
3934          * Completion of TX packet. Length = 16B
3935          */
3936         #define TX_CMPL_TYPE_TX_L2        UINT32_C(0x0)
3937         #define TX_CMPL_TYPE_LAST        TX_CMPL_TYPE_TX_L2
3938         #define TX_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
3939         #define TX_CMPL_FLAGS_SFT       6
3940         /*
3941          * When this bit is '1', it indicates a packet that has an
3942          * error of some type. Type of error is indicated in
3943          * error_flags.
3944          */
3945         #define TX_CMPL_FLAGS_ERROR      UINT32_C(0x40)
3946         /*
3947          * When this bit is '1', it indicates that the packet completed
3948          * was transmitted using the push acceleration data provided
3949          * by the driver. When this bit is '0', it indicates that the
3950          * packet had not push acceleration data written or was executed
3951          * as a normal packet even though push data was provided.
3952          */
3953         #define TX_CMPL_FLAGS_PUSH       UINT32_C(0x80)
3954         /* unused1 is 16 b */
3955         uint16_t        unused_0;
3956         /*
3957          * This is a copy of the opaque field from the first TX BD of this
3958          * transmitted packet. Note that, if the packet was described by a short
3959          * CSO or short CSO inline BD, then the 16-bit opaque field from the
3960          * short CSO BD will appear in the bottom 16 bits of this field.
3961          */
3962         uint32_t        opaque;
3963         uint16_t        errors_v;
3964         /*
3965          * This value is written by the NIC such that it will be different
3966          * for each pass through the completion queue. The even passes
3967          * will write 1. The odd passes will write 0.
3968          */
3969         #define TX_CMPL_V                                  UINT32_C(0x1)
3970         #define TX_CMPL_ERRORS_MASK                        UINT32_C(0xfffe)
3971         #define TX_CMPL_ERRORS_SFT                         1
3972         /*
3973          * This error indicates that there was some sort of problem
3974          * with the BDs for the packet.
3975          */
3976         #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK            UINT32_C(0xe)
3977         #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT             1
3978         /* No error */
3979         #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR \
3980                 (UINT32_C(0x0) << 1)
3981         /*
3982          * Bad Format:
3983          * BDs were not formatted correctly.
3984          */
3985         #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT \
3986                 (UINT32_C(0x2) << 1)
3987         #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \
3988                 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
3989         /*
3990          * When this bit is '1', it indicates that the length of
3991          * the packet was zero. No packet was transmitted.
3992          */
3993         #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT              UINT32_C(0x10)
3994         /*
3995          * When this bit is '1', it indicates that the packet
3996          * was longer than the programmed limit in TDI. No
3997          * packet was transmitted.
3998          */
3999         #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH          UINT32_C(0x20)
4000         /*
4001          * When this bit is '1', it indicates that one or more of the
4002          * BDs associated with this packet generated a PCI error.
4003          * This probably means the address was not valid.
4004          */
4005         #define TX_CMPL_ERRORS_DMA_ERROR                    UINT32_C(0x40)
4006         /*
4007          * When this bit is '1', it indicates that the packet was longer
4008          * than indicated by the hint. No packet was transmitted.
4009          */
4010         #define TX_CMPL_ERRORS_HINT_TOO_SHORT               UINT32_C(0x80)
4011         /*
4012          * When this bit is '1', it indicates that the packet was
4013          * dropped due to Poison TLP error on one or more of the
4014          * TLPs in the PXP completion.
4015          */
4016         #define TX_CMPL_ERRORS_POISON_TLP_ERROR             UINT32_C(0x100)
4017         /*
4018          * When this bit is '1', it indicates that the packet was dropped
4019          * due to a transient internal error in TDC. The packet or LSO can
4020          * be retried and may transmit successfully on a subsequent attempt.
4021          */
4022         #define TX_CMPL_ERRORS_INTERNAL_ERROR               UINT32_C(0x200)
4023         /*
4024          * When this bit is '1', it was not possible to collect a timestamp
4025          * for a PTP completion, in which case the timestamp_hi and
4026          * timestamp_lo fields are invalid. When this bit is '0' for a PTP
4027          * completion, the timestamp_hi and timestamp_lo fields are valid.
4028          * RJRN will copy the value of this bit into the field of the same
4029          * name in all TX completions, regardless of whether such completions
4030          * are PTP completions or other TX completions.
4031          */
4032         #define TX_CMPL_ERRORS_TIMESTAMP_INVALID_ERROR      UINT32_C(0x400)
4033         /* unused2 is 16 b */
4034         uint16_t        unused_1;
4035         /* unused3 is 32 b */
4036         uint32_t        unused_2;
4037 } __rte_packed;
4038
4039 /* tx_cmpl_coal (size:128b/16B) */
4040 struct tx_cmpl_coal {
4041         uint16_t        flags_type;
4042         /*
4043          * This field indicates the exact type of the completion.
4044          * By convention, the LSB identifies the length of the
4045          * record in 16B units. Even values indicate 16B
4046          * records. Odd values indicate 32B
4047          * records.
4048          */
4049         #define TX_CMPL_COAL_TYPE_MASK       UINT32_C(0x3f)
4050         #define TX_CMPL_COAL_TYPE_SFT        0
4051         /*
4052          * TX L2 coalesced completion:
4053          * Completion of TX packet. Length = 16B
4054          */
4055         #define TX_CMPL_COAL_TYPE_TX_L2_COAL   UINT32_C(0x2)
4056         #define TX_CMPL_COAL_TYPE_LAST        TX_CMPL_COAL_TYPE_TX_L2_COAL
4057         #define TX_CMPL_COAL_FLAGS_MASK      UINT32_C(0xffc0)
4058         #define TX_CMPL_COAL_FLAGS_SFT       6
4059         /*
4060          * When this bit is '1', it indicates a packet that has an
4061          * error of some type. Type of error is indicated in
4062          * error_flags.
4063          */
4064         #define TX_CMPL_COAL_FLAGS_ERROR      UINT32_C(0x40)
4065         /*
4066          * When this bit is '1', it indicates that the packet completed
4067          * was transmitted using the push acceleration data provided
4068          * by the driver. When this bit is '0', it indicates that the
4069          * packet had not push acceleration data written or was executed
4070          * as a normal packet even though push data was provided.
4071          */
4072         #define TX_CMPL_COAL_FLAGS_PUSH       UINT32_C(0x80)
4073         /* unused1 is 16 b */
4074         uint16_t        unused_0;
4075         /*
4076          * This is a copy of the opaque field from the first TX BD of the packet
4077          * which corresponds with the reported sq_cons_idx. Note that, with
4078          * coalesced completions, completions are generated for only some of the
4079          * packets. The driver will see the opaque field for only those packets.
4080          * Note that, if the packet was described by a short CSO or short CSO
4081          * inline BD, then the 16-bit opaque field from the short CSO BD will
4082          * appear in the bottom 16 bits of this field. For TX rings with
4083          * completion coalescing enabled (which would use the coalesced
4084          * completion record), it is suggested that the driver populate the
4085          * opaque field to indicate the specific TX ring with which the
4086          * completion is associated, then utilize the opaque and sq_cons_idx
4087          * fields in the coalesced completion record to determine the specific
4088          * packets that are to be completed on that ring.
4089          */
4090         uint32_t        opaque;
4091         uint16_t        errors_v;
4092         /*
4093          * This value is written by the NIC such that it will be different
4094          * for each pass through the completion queue. The even passes
4095          * will write 1. The odd passes will write 0.
4096          */
4097         #define TX_CMPL_COAL_V                                  UINT32_C(0x1)
4098         #define TX_CMPL_COAL_ERRORS_MASK \
4099                 UINT32_C(0xfffe)
4100         #define TX_CMPL_COAL_ERRORS_SFT                         1
4101         /*
4102          * This error indicates that there was some sort of problem
4103          * with the BDs for the packet.
4104          */
4105         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_MASK            UINT32_C(0xe)
4106         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_SFT             1
4107         /* No error */
4108         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_NO_ERROR \
4109                 (UINT32_C(0x0) << 1)
4110         /*
4111          * Bad Format:
4112          * BDs were not formatted correctly.
4113          */
4114         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT \
4115                 (UINT32_C(0x2) << 1)
4116         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_LAST \
4117                 TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT
4118         /*
4119          * When this bit is '1', it indicates that the length of
4120          * the packet was zero. No packet was transmitted.
4121          */
4122         #define TX_CMPL_COAL_ERRORS_ZERO_LENGTH_PKT              UINT32_C(0x10)
4123         /*
4124          * When this bit is '1', it indicates that the packet
4125          * was longer than the programmed limit in TDI. No
4126          * packet was transmitted.
4127          */
4128         #define TX_CMPL_COAL_ERRORS_EXCESSIVE_BD_LENGTH          UINT32_C(0x20)
4129         /*
4130          * When this bit is '1', it indicates that one or more of the
4131          * BDs associated with this packet generated a PCI error.
4132          * This probably means the address was not valid.
4133          */
4134         #define TX_CMPL_COAL_ERRORS_DMA_ERROR                    UINT32_C(0x40)
4135         /*
4136          * When this bit is '1', it indicates that the packet was longer
4137          * than indicated by the hint. No packet was transmitted.
4138          */
4139         #define TX_CMPL_COAL_ERRORS_HINT_TOO_SHORT               UINT32_C(0x80)
4140         /*
4141          * When this bit is '1', it indicates that the packet was
4142          * dropped due to Poison TLP error on one or more of the
4143          * TLPs in the PXP completion.
4144          */
4145         #define TX_CMPL_COAL_ERRORS_POISON_TLP_ERROR \
4146                 UINT32_C(0x100)
4147         /*
4148          * When this bit is '1', it indicates that the packet was dropped
4149          * due to a transient internal error in TDC. The packet or LSO can
4150          * be retried and may transmit successfully on a subsequent attempt.
4151          */
4152         #define TX_CMPL_COAL_ERRORS_INTERNAL_ERROR \
4153                 UINT32_C(0x200)
4154         /*
4155          * When this bit is '1', it was not possible to collect a a timestamp
4156          * for a PTP completion, in which case the timestamp_hi and
4157          * timestamp_lo fields are invalid. When this bit is '0' for a PTP
4158          * completion, the timestamp_hi and timestamp_lo fields are valid.
4159          * RJRN will copy the value of this bit into the field of the same
4160          * name in all TX completions, regardless of whether such
4161          * completions are PTP completions or other TX completions.
4162          */
4163         #define TX_CMPL_COAL_ERRORS_TIMESTAMP_INVALID_ERROR \
4164                 UINT32_C(0x400)
4165         /* unused2 is 16 b */
4166         uint16_t        unused_1;
4167         uint32_t        sq_cons_idx;
4168         /*
4169          * This value is SQ index for the start of the packet following the
4170          * last completed packet.
4171          */
4172         #define TX_CMPL_COAL_SQ_CONS_IDX_MASK UINT32_C(0xffffff)
4173         #define TX_CMPL_COAL_SQ_CONS_IDX_SFT 0
4174 } __rte_packed;
4175
4176 /* tx_cmpl_ptp (size:128b/16B) */
4177 struct tx_cmpl_ptp {
4178         uint16_t        flags_type;
4179         /*
4180          * This field indicates the exact type of the completion.
4181          * By convention, the LSB identifies the length of the
4182          * record in 16B units. Even values indicate 16B
4183          * records. Odd values indicate 32B
4184          * records.
4185          */
4186         #define TX_CMPL_PTP_TYPE_MASK       UINT32_C(0x3f)
4187         #define TX_CMPL_PTP_TYPE_SFT        0
4188         /*
4189          * TX L2 PTP completion:
4190          * Completion of TX packet. Length = 32B
4191          */
4192         #define TX_CMPL_PTP_TYPE_TX_L2_PTP    UINT32_C(0x2)
4193         #define TX_CMPL_PTP_TYPE_LAST        TX_CMPL_PTP_TYPE_TX_L2_PTP
4194         #define TX_CMPL_PTP_FLAGS_MASK      UINT32_C(0xffc0)
4195         #define TX_CMPL_PTP_FLAGS_SFT       6
4196         /*
4197          * When this bit is '1', it indicates a packet that has an
4198          * error of some type. Type of error is indicated in
4199          * error_flags.
4200          */
4201         #define TX_CMPL_PTP_FLAGS_ERROR      UINT32_C(0x40)
4202         /*
4203          * When this bit is '1', it indicates that the packet completed
4204          * was transmitted using the push acceleration data provided
4205          * by the driver. When this bit is '0', it indicates that the
4206          * packet had not push acceleration data written or was executed
4207          * as a normal packet even though push data was provided.
4208          */
4209         #define TX_CMPL_PTP_FLAGS_PUSH       UINT32_C(0x80)
4210         /* unused1 is 16 b */
4211         uint16_t        unused_0;
4212         /*
4213          * This is a copy of the opaque field from the first TX BD of this
4214          * transmitted packet. Note that, if the packet was described by a short
4215          * CSO or short CSO inline BD, then the 16-bit opaque field from the
4216          * short CSO BD will appear in the bottom 16 bits of this field.
4217          */
4218         uint32_t        opaque;
4219         uint16_t        errors_v;
4220         /*
4221          * This value is written by the NIC such that it will be different
4222          * for each pass through the completion queue. The even passes
4223          * will write 1. The odd passes will write 0.
4224          */
4225         #define TX_CMPL_PTP_V                                  UINT32_C(0x1)
4226         #define TX_CMPL_PTP_ERRORS_MASK                        UINT32_C(0xfffe)
4227         #define TX_CMPL_PTP_ERRORS_SFT                         1
4228         /*
4229          * This error indicates that there was some sort of problem
4230          * with the BDs for the packet.
4231          */
4232         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_MASK            UINT32_C(0xe)
4233         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_SFT             1
4234         /* No error */
4235         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_NO_ERROR \
4236                 (UINT32_C(0x0) << 1)
4237         /*
4238          * Bad Format:
4239          * BDs were not formatted correctly.
4240          */
4241         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_BAD_FMT \
4242                 (UINT32_C(0x2) << 1)
4243         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_LAST \
4244                 TX_CMPL_PTP_ERRORS_BUFFER_ERROR_BAD_FMT
4245         /*
4246          * When this bit is '1', it indicates that the length of
4247          * the packet was zero. No packet was transmitted.
4248          */
4249         #define TX_CMPL_PTP_ERRORS_ZERO_LENGTH_PKT              UINT32_C(0x10)
4250         /*
4251          * When this bit is '1', it indicates that the packet
4252          * was longer than the programmed limit in TDI. No
4253          * packet was transmitted.
4254          */
4255         #define TX_CMPL_PTP_ERRORS_EXCESSIVE_BD_LENGTH          UINT32_C(0x20)
4256         /*
4257          * When this bit is '1', it indicates that one or more of the
4258          * BDs associated with this packet generated a PCI error.
4259          * This probably means the address was not valid.
4260          */
4261         #define TX_CMPL_PTP_ERRORS_DMA_ERROR                    UINT32_C(0x40)
4262         /*
4263          * When this bit is '1', it indicates that the packet was longer
4264          * than indicated by the hint. No packet was transmitted.
4265          */
4266         #define TX_CMPL_PTP_ERRORS_HINT_TOO_SHORT               UINT32_C(0x80)
4267         /*
4268          * When this bit is '1', it indicates that the packet was
4269          * dropped due to Poison TLP error on one or more of the
4270          * TLPs in the PXP completion.
4271          */
4272         #define TX_CMPL_PTP_ERRORS_POISON_TLP_ERROR             UINT32_C(0x100)
4273         /*
4274          * When this bit is '1', it indicates that the packet was dropped due
4275          * to a transient internal error in TDC. The packet or LSO can be
4276          * retried and may transmit successfully on a subsequent attempt.
4277          */
4278         #define TX_CMPL_PTP_ERRORS_INTERNAL_ERROR               UINT32_C(0x200)
4279         /*
4280          * When this bit is '1', it was not possible to collect a a timestamp
4281          * for a PTP completion, in which case the timestamp_hi and
4282          * timestamp_lo fields are invalid. When this bit is '0' for a PTP
4283          * completion, the timestamp_hi and timestamp_lo fields are valid.
4284          * RJRN will copy the value of this bit into the field of the same
4285          * name in all TX completions, regardless of whether such
4286          * completions are PTP completions or other TX completions.
4287          */
4288         #define TX_CMPL_PTP_ERRORS_TIMESTAMP_INVALID_ERROR      UINT32_C(0x400)
4289         /* unused2 is 16 b */
4290         uint16_t        unused_1;
4291         /*
4292          * This is timestamp value (lower 32bits) read from PM for the PTP
4293          * timestamp enabled packet.
4294          */
4295         uint32_t        timestamp_lo;
4296 } __rte_packed;
4297
4298 /* tx_cmpl_ptp_hi (size:128b/16B) */
4299 struct tx_cmpl_ptp_hi {
4300         /*
4301          * This is timestamp value (lower 32bits) read from PM for the PTP
4302          * timestamp enabled packet.
4303          */
4304         uint16_t        timestamp_hi[3];
4305         uint16_t        reserved16;
4306         uint64_t        v2;
4307         /*
4308          * This value is written by the NIC such that it will be different for
4309          * each pass through the completion queue.
4310          * The even passes will write 1.
4311          * The odd passes will write 0.
4312          */
4313         #define TX_CMPL_PTP_HI_V2     UINT32_C(0x1)
4314 } __rte_packed;
4315
4316 /* rx_pkt_cmpl (size:128b/16B) */
4317 struct rx_pkt_cmpl {
4318         uint16_t        flags_type;
4319         /*
4320          * This field indicates the exact type of the completion.
4321          * By convention, the LSB identifies the length of the
4322          * record in 16B units. Even values indicate 16B
4323          * records. Odd values indicate 32B
4324          * records.
4325          */
4326         #define RX_PKT_CMPL_TYPE_MASK                      UINT32_C(0x3f)
4327         #define RX_PKT_CMPL_TYPE_SFT                       0
4328         /*
4329          * RX L2 completion:
4330          * Completion of and L2 RX packet. Length = 32B
4331          */
4332         #define RX_PKT_CMPL_TYPE_RX_L2                       UINT32_C(0x11)
4333         #define RX_PKT_CMPL_TYPE_LAST \
4334                 RX_PKT_CMPL_TYPE_RX_L2
4335         #define RX_PKT_CMPL_FLAGS_MASK                     UINT32_C(0xffc0)
4336         #define RX_PKT_CMPL_FLAGS_SFT                      6
4337         /*
4338          * When this bit is '1', it indicates a packet that has an
4339          * error of some type. Type of error is indicated in
4340          * error_flags.
4341          */
4342         #define RX_PKT_CMPL_FLAGS_ERROR                     UINT32_C(0x40)
4343         /* This field indicates how the packet was placed in the buffer. */
4344         #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK            UINT32_C(0x380)
4345         #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT             7
4346         /*
4347          * Normal:
4348          * Packet was placed using normal algorithm.
4349          */
4350         #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL \
4351                 (UINT32_C(0x0) << 7)
4352         /*
4353          * Jumbo:
4354          * Packet was placed using jumbo algorithm.
4355          */
4356         #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO \
4357                 (UINT32_C(0x1) << 7)
4358         /*
4359          * Header/Data Separation:
4360          * Packet was placed using Header/Data separation algorithm.
4361          * The separation location is indicated by the itype field.
4362          */
4363         #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS \
4364                 (UINT32_C(0x2) << 7)
4365         #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \
4366                 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
4367         /* This bit is '1' if the RSS field in this completion is valid. */
4368         #define RX_PKT_CMPL_FLAGS_RSS_VALID                 UINT32_C(0x400)
4369         /*
4370          * This bit is '1' if metadata has been added to the end of the
4371          * packet in host memory.
4372          */
4373         #define RX_PKT_CMPL_FLAGS_PKT_METADATA_PRESENT      UINT32_C(0x800)
4374         /*
4375          * This value indicates what the inner packet determined for the
4376          * packet was.
4377          */
4378         #define RX_PKT_CMPL_FLAGS_ITYPE_MASK                UINT32_C(0xf000)
4379         #define RX_PKT_CMPL_FLAGS_ITYPE_SFT                 12
4380         /*
4381          * Not Known:
4382          * Indicates that the packet type was not known.
4383          */
4384         #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN \
4385                 (UINT32_C(0x0) << 12)
4386         /*
4387          * IP Packet:
4388          * Indicates that the packet was an IP packet, but further
4389          * classification was not possible.
4390          */
4391         #define RX_PKT_CMPL_FLAGS_ITYPE_IP \
4392                 (UINT32_C(0x1) << 12)
4393         /*
4394          * TCP Packet:
4395          * Indicates that the packet was IP and TCP.
4396          * This indicates that the payload_offset field is valid.
4397          */
4398         #define RX_PKT_CMPL_FLAGS_ITYPE_TCP \
4399                 (UINT32_C(0x2) << 12)
4400         /*
4401          * UDP Packet:
4402          * Indicates that the packet was IP and UDP.
4403          * This indicates that the payload_offset field is valid.
4404          */
4405         #define RX_PKT_CMPL_FLAGS_ITYPE_UDP \
4406                 (UINT32_C(0x3) << 12)
4407         /*
4408          * FCoE Packet:
4409          * Indicates that the packet was recognized as a FCoE.
4410          * This also indicates that the payload_offset field is valid.
4411          */
4412         #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE \
4413                 (UINT32_C(0x4) << 12)
4414         /*
4415          * RoCE Packet:
4416          * Indicates that the packet was recognized as a RoCE.
4417          * This also indicates that the payload_offset field is valid.
4418          */
4419         #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE \
4420                 (UINT32_C(0x5) << 12)
4421         /*
4422          * ICMP Packet:
4423          * Indicates that the packet was recognized as ICMP.
4424          * This indicates that the payload_offset field is valid.
4425          */
4426         #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP \
4427                 (UINT32_C(0x7) << 12)
4428         /*
4429          * PTP packet wo/timestamp:
4430          * Indicates that the packet was recognized as a PTP
4431          * packet.
4432          */
4433         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
4434                 (UINT32_C(0x8) << 12)
4435         /*
4436          * PTP packet w/timestamp:
4437          * Indicates that the packet was recognized as a PTP
4438          * packet and that a timestamp was taken for the packet.
4439          */
4440         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
4441                 (UINT32_C(0x9) << 12)
4442         #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \
4443                 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
4444         /*
4445          * This is the length of the data for the packet stored in the
4446          * buffer(s) identified by the opaque value. This includes
4447          * the packet BD and any associated buffer BDs. This does not include
4448          * the length of any data places in aggregation BDs.
4449          */
4450         uint16_t        len;
4451         /*
4452          * This is a copy of the opaque field from the RX BD this completion
4453          * corresponds to.
4454          */
4455         uint32_t        opaque;
4456         uint8_t agg_bufs_v1;
4457         /*
4458          * This value is written by the NIC such that it will be different
4459          * for each pass through the completion queue. The even passes
4460          * will write 1. The odd passes will write 0.
4461          */
4462         #define RX_PKT_CMPL_V1           UINT32_C(0x1)
4463         /*
4464          * This value is the number of aggregation buffers that follow this
4465          * entry in the completion ring that are a part of this packet.
4466          * If the value is zero, then the packet is completely contained
4467          * in the buffer space provided for the packet in the RX ring.
4468          */
4469         #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
4470         #define RX_PKT_CMPL_AGG_BUFS_SFT 1
4471         /* unused1 is 2 b */
4472         #define RX_PKT_CMPL_UNUSED1_MASK UINT32_C(0xc0)
4473         #define RX_PKT_CMPL_UNUSED1_SFT  6
4474         /*
4475          * This is the RSS hash type for the packet. The value is packed
4476          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
4477          * The value of tuple_extrac_op provides the information about
4478          * what fields the hash was computed on.
4479          * Note that 4-tuples values listed below are applicable
4480          * for layer 4 protocols supported and enabled for RSS in the hardware,
4481          * HWRM firmware, and drivers. For example, if RSS hash is supported and
4482          * enabled for TCP traffic only, then the values of tuple_extract_op
4483          * corresponding to 4-tuples are only valid for TCP traffic.
4484          */
4485         uint8_t rss_hash_type;
4486         /*
4487          * The RSS hash was computed over source IP address,
4488          * destination IP address, source port, and destination port of inner
4489          * IP and TCP or UDP headers. Note: For non-tunneled packets,
4490          * the packet headers are considered inner packet headers for the RSS
4491          * hash computation purpose.
4492          */
4493         #define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_0 UINT32_C(0x0)
4494         /*
4495          * The RSS hash was computed over source IP address and destination
4496          * IP address of inner IP header. Note: For non-tunneled packets,
4497          * the packet headers are considered inner packet headers for the RSS
4498          * hash computation purpose.
4499          */
4500         #define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_1 UINT32_C(0x1)
4501         /*
4502          * The RSS hash was computed over source IP address,
4503          * destination IP address, source port, and destination port of
4504          * IP and TCP or UDP headers of outer tunnel headers.
4505          * Note: For non-tunneled packets, this value is not applicable.
4506          */
4507         #define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_2 UINT32_C(0x2)
4508         /*
4509          * The RSS hash was computed over source IP address and
4510          * destination IP address of IP header of outer tunnel headers.
4511          * Note: For non-tunneled packets, this value is not applicable.
4512          */
4513         #define RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_3 UINT32_C(0x3)
4514         #define RX_PKT_CMPL_RSS_HASH_TYPE_LAST \
4515                 RX_PKT_CMPL_RSS_HASH_TYPE_ENUM_3
4516         /*
4517          * This value indicates the offset in bytes from the beginning of the
4518          * packet where the inner payload starts. This value is valid for TCP,
4519          * UDP, FCoE, and RoCE packets.
4520          *
4521          * A value of zero indicates that header is 256B into the packet.
4522          */
4523         uint8_t payload_offset;
4524         /* unused2 is 8 b */
4525         uint8_t unused1;
4526         /*
4527          * This value is the RSS hash value calculated for the packet
4528          * based on the mode bits and key value in the VNIC.
4529          */
4530         uint32_t        rss_hash;
4531 } __rte_packed;
4532
4533 /* Last 16 bytes of rx_pkt_cmpl. */
4534 /* rx_pkt_cmpl_hi (size:128b/16B) */
4535 struct rx_pkt_cmpl_hi {
4536         uint32_t        flags2;
4537         /*
4538          * This indicates that the ip checksum was calculated for the
4539          * inner packet and that the ip_cs_error field indicates if there
4540          * was an error.
4541          */
4542         #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC                 UINT32_C(0x1)
4543         /*
4544          * This indicates that the TCP, UDP or ICMP checksum was
4545          * calculated for the inner packet and that the l4_cs_error field
4546          * indicates if there was an error.
4547          */
4548         #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC                 UINT32_C(0x2)
4549         /*
4550          * This indicates that the ip checksum was calculated for the
4551          * tunnel header and that the t_ip_cs_error field indicates if there
4552          * was an error.
4553          */
4554         #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC               UINT32_C(0x4)
4555         /*
4556          * This indicates that the UDP checksum was
4557          * calculated for the tunnel packet and that the t_l4_cs_error field
4558          * indicates if there was an error.
4559          */
4560         #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC               UINT32_C(0x8)
4561         /* This value indicates what format the metadata field is. */
4562         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK           UINT32_C(0xf0)
4563         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT            4
4564         /* No metadata information. Value is zero. */
4565         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE \
4566                 (UINT32_C(0x0) << 4)
4567         /*
4568          * The metadata field contains the VLAN tag and TPID value.
4569          * - metadata[11:0] contains the vlan VID value.
4570          * - metadata[12] contains the vlan DE value.
4571          * - metadata[15:13] contains the vlan PRI value.
4572          * - metadata[31:16] contains the vlan TPID value.
4573          */
4574         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN \
4575                 (UINT32_C(0x1) << 4)
4576         /*
4577          * If ext_meta_format is equal to 1, the metadata field
4578          * contains the lower 16b of the tunnel ID value, justified
4579          * to LSB
4580          * - VXLAN = VNI[23:0] -> VXLAN Network ID
4581          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
4582          * - NVGRE = TNI[23:0] -> Tenant Network ID
4583          * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
4584          * - IPV4 = 0 (not populated)
4585          * - IPV6 = Flow Label[19:0]
4586          * - PPPoE = sessionID[15:0]
4587          * - MPLs = Outer label[19:0]
4588          * - UPAR = Selected[31:0] with bit mask
4589          */
4590         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
4591                 (UINT32_C(0x2) << 4)
4592         /*
4593          * if ext_meta_format is equal to 1, metadata field contains
4594          * 16b metadata from the prepended header (chdr_data).
4595          */
4596         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
4597                 (UINT32_C(0x3) << 4)
4598         /*
4599          * If ext_meta_format is equal to 1, the metadata field contains
4600          * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
4601          * inner_l4_size.
4602          * - metadata[8:0] contains the outer_l3_offset.
4603          * - metadata[17:9] contains the inner_l2_offset.
4604          * - metadata[26:18] contains the inner_l3_offset.
4605          * - metadata[31:27] contains the inner_l4_size.
4606          */
4607         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
4608                 (UINT32_C(0x4) << 4)
4609         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \
4610                 RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
4611         /*
4612          * This field indicates the IP type for the inner-most IP header.
4613          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
4614          * This value is only valid if itype indicates a packet
4615          * with an IP header.
4616          */
4617         #define RX_PKT_CMPL_FLAGS2_IP_TYPE                    UINT32_C(0x100)
4618         /*
4619          * This indicates that the complete 1's complement checksum was
4620          * calculated for the packet.
4621          */
4622         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC     UINT32_C(0x200)
4623         /*
4624          * The combination of this value and meta_format indicated what
4625          * format the metadata field is.
4626          */
4627         #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_MASK       UINT32_C(0xc00)
4628         #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_SFT        10
4629         /*
4630          * This value is the complete 1's complement checksum calculated from
4631          * the start of the outer L3 header to the end of the packet (not
4632          * including the ethernet crc). It is valid when the
4633          * 'complete_checksum_calc' flag is set.
4634          */
4635         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
4636                 UINT32_C(0xffff0000)
4637         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
4638         /*
4639          * This is data from the CFA block as indicated by the meta_format
4640          * field.
4641          */
4642         uint32_t        metadata;
4643         /* When meta_format=1, this value is the VLAN VID. */
4644         #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
4645         #define RX_PKT_CMPL_METADATA_VID_SFT  0
4646         /* When meta_format=1, this value is the VLAN DE. */
4647         #define RX_PKT_CMPL_METADATA_DE       UINT32_C(0x1000)
4648         /* When meta_format=1, this value is the VLAN PRI. */
4649         #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
4650         #define RX_PKT_CMPL_METADATA_PRI_SFT  13
4651         /* When meta_format=1, this value is the VLAN TPID. */
4652         #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
4653         #define RX_PKT_CMPL_METADATA_TPID_SFT 16
4654         uint16_t        errors_v2;
4655         /*
4656          * This value is written by the NIC such that it will be different
4657          * for each pass through the completion queue. The even passes
4658          * will write 1. The odd passes will write 0.
4659          */
4660         #define RX_PKT_CMPL_V2 \
4661                 UINT32_C(0x1)
4662         #define RX_PKT_CMPL_ERRORS_MASK \
4663                 UINT32_C(0xfffe)
4664         #define RX_PKT_CMPL_ERRORS_SFT                               1
4665         /*
4666          * This error indicates that there was some sort of problem with
4667          * the BDs for the packet that was found after part of the
4668          * packet was already placed. The packet should be treated as
4669          * invalid.
4670          */
4671         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK \
4672                 UINT32_C(0xe)
4673         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT                   1
4674         /* No buffer error */
4675         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
4676                 (UINT32_C(0x0) << 1)
4677         /*
4678          * Did Not Fit:
4679          * Packet did not fit into packet buffer provided.
4680          * For regular placement, this means the packet did not fit
4681          * in the buffer provided. For HDS and jumbo placement, this
4682          * means that the packet could not be placed into 7 physical
4683          * buffers or less.
4684          */
4685         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
4686                 (UINT32_C(0x1) << 1)
4687         /*
4688          * Not On Chip:
4689          * All BDs needed for the packet were not on-chip when
4690          * the packet arrived.
4691          */
4692         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
4693                 (UINT32_C(0x2) << 1)
4694         /*
4695          * Bad Format:
4696          * BDs were not formatted correctly.
4697          */
4698         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
4699                 (UINT32_C(0x3) << 1)
4700         /*
4701          * Flush:
4702          * There was a bad_format error on the previous operation
4703          */
4704         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
4705                 (UINT32_C(0x5) << 1)
4706         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \
4707                 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
4708         /*
4709          * This indicates that there was an error in the IP header
4710          * checksum.
4711          */
4712         #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR \
4713                 UINT32_C(0x10)
4714         /*
4715          * This indicates that there was an error in the TCP, UDP
4716          * or ICMP checksum.
4717          */
4718         #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR \
4719                 UINT32_C(0x20)
4720         /*
4721          * This indicates that there was an error in the tunnel
4722          * IP header checksum.
4723          */
4724         #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR \
4725                 UINT32_C(0x40)
4726         /*
4727          * This indicates that there was an error in the tunnel
4728          * UDP checksum.
4729          */
4730         #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR \
4731                 UINT32_C(0x80)
4732         /*
4733          * This indicates that there was a CRC error on either an FCoE
4734          * or RoCE packet. The itype indicates the packet type.
4735          */
4736         #define RX_PKT_CMPL_ERRORS_CRC_ERROR \
4737                 UINT32_C(0x100)
4738         /*
4739          * This indicates that there was an error in the tunnel
4740          * portion of the packet when this
4741          * field is non-zero.
4742          */
4743         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK \
4744                 UINT32_C(0xe00)
4745         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT                    9
4746         /*
4747          * No additional error occurred on the tunnel portion
4748          * or the packet of the packet does not have a tunnel.
4749          */
4750         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR \
4751                 (UINT32_C(0x0) << 9)
4752         /*
4753          * Indicates that IP header version does not match
4754          * expectation from L2 Ethertype for IPv4 and IPv6
4755          * in the tunnel header.
4756          */
4757         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
4758                 (UINT32_C(0x1) << 9)
4759         /*
4760          * Indicates that header length is out of range in the
4761          * tunnel header. Valid for
4762          * IPv4.
4763          */
4764         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
4765                 (UINT32_C(0x2) << 9)
4766         /*
4767          * Indicates that the physical packet is shorter than that
4768          * claimed by the PPPoE header length for a tunnel PPPoE
4769          * packet.
4770          */
4771         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
4772                 (UINT32_C(0x3) << 9)
4773         /*
4774          * Indicates that physical packet is shorter than that claimed
4775          * by the tunnel l3 header length. Valid for IPv4, or IPv6
4776          * tunnel packet packets.
4777          */
4778         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
4779                 (UINT32_C(0x4) << 9)
4780         /*
4781          * Indicates that the physical packet is shorter than that
4782          * claimed by the tunnel UDP header length for a tunnel
4783          * UDP packet that is not fragmented.
4784          */
4785         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
4786                 (UINT32_C(0x5) << 9)
4787         /*
4788          * indicates that the IPv4 TTL or IPv6 hop limit check
4789          * have failed (e.g. TTL = 0) in the tunnel header. Valid
4790          * for IPv4, and IPv6.
4791          */
4792         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
4793                 (UINT32_C(0x6) << 9)
4794         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \
4795                 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
4796         /*
4797          * This indicates that there was an error in the inner
4798          * portion of the packet when this
4799          * field is non-zero.
4800          */
4801         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK \
4802                 UINT32_C(0xf000)
4803         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT                      12
4804         /*
4805          * No additional error occurred on the tunnel portion
4806          * or the packet of the packet does not have a tunnel.
4807          */
4808         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR \
4809                 (UINT32_C(0x0) << 12)
4810         /*
4811          * Indicates that IP header version does not match
4812          * expectation from L2 Ethertype for IPv4 and IPv6 or that
4813          * option other than VFT was parsed on
4814          * FCoE packet.
4815          */
4816         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \
4817                 (UINT32_C(0x1) << 12)
4818         /*
4819          * indicates that header length is out of range. Valid for
4820          * IPv4 and RoCE
4821          */
4822         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
4823                 (UINT32_C(0x2) << 12)
4824         /*
4825          * indicates that the IPv4 TTL or IPv6 hop limit check
4826          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
4827          */
4828         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL \
4829                 (UINT32_C(0x3) << 12)
4830         /*
4831          * Indicates that physical packet is shorter than that
4832          * claimed by the l3 header length. Valid for IPv4,
4833          * IPv6 packet or RoCE packets.
4834          */
4835         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
4836                 (UINT32_C(0x4) << 12)
4837         /*
4838          * Indicates that the physical packet is shorter than that
4839          * claimed by the UDP header length for a UDP packet that is
4840          * not fragmented.
4841          */
4842         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
4843                 (UINT32_C(0x5) << 12)
4844         /*
4845          * Indicates that TCP header length > IP payload. Valid for
4846          * TCP packets only.
4847          */
4848         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
4849                 (UINT32_C(0x6) << 12)
4850         /* Indicates that TCP header length < 5. Valid for TCP. */
4851         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
4852                 (UINT32_C(0x7) << 12)
4853         /*
4854          * Indicates that TCP option headers result in a TCP header
4855          * size that does not match data offset in TCP header. Valid
4856          * for TCP.
4857          */
4858         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
4859                 (UINT32_C(0x8) << 12)
4860         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \
4861                 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
4862         /*
4863          * This field identifies the CFA action rule that was used for this
4864          * packet.
4865          */
4866         uint16_t        cfa_code;
4867         uint32_t        reorder;
4868         /*
4869          * This value holds the reordering sequence number for the packet.
4870          * If the reordering sequence is not valid, then this value is zero.
4871          * The reordering domain for the packet is in the bottom 8 to 10b of
4872          * the rss_hash value. The bottom 20b of this value contain the
4873          * ordering domain value for the packet.
4874          */
4875         #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
4876         #define RX_PKT_CMPL_REORDER_SFT 0
4877 } __rte_packed;
4878
4879 /* rx_pkt_v2_cmpl (size:128b/16B) */
4880 struct rx_pkt_v2_cmpl {
4881         uint16_t        flags_type;
4882         /*
4883          * This field indicates the exact type of the completion.
4884          * By convention, the LSB identifies the length of the
4885          * record in 16B units. Even values indicate 16B
4886          * records. Odd values indicate 32B
4887          * records.
4888          */
4889         #define RX_PKT_V2_CMPL_TYPE_MASK                      UINT32_C(0x3f)
4890         #define RX_PKT_V2_CMPL_TYPE_SFT                       0
4891         /*
4892          * RX L2 V2 completion:
4893          * Completion of and L2 RX packet. Length = 32B
4894          * This is the new version of the RX_L2 completion used in SR2
4895          * and later chips.
4896          */
4897         #define RX_PKT_V2_CMPL_TYPE_RX_L2_V2                    UINT32_C(0xf)
4898         #define RX_PKT_V2_CMPL_TYPE_LAST \
4899                 RX_PKT_V2_CMPL_TYPE_RX_L2_V2
4900         #define RX_PKT_V2_CMPL_FLAGS_MASK                     UINT32_C(0xffc0)
4901         #define RX_PKT_V2_CMPL_FLAGS_SFT                      6
4902         /*
4903          * When this bit is '1', it indicates a packet that has an
4904          * error of some type. Type of error is indicated in
4905          * error_flags.
4906          */
4907         #define RX_PKT_V2_CMPL_FLAGS_ERROR                     UINT32_C(0x40)
4908         /* This field indicates how the packet was placed in the buffer. */
4909         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_MASK            UINT32_C(0x380)
4910         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_SFT             7
4911         /*
4912          * Normal:
4913          * Packet was placed using normal algorithm.
4914          */
4915         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_NORMAL \
4916                 (UINT32_C(0x0) << 7)
4917         /*
4918          * Jumbo:
4919          * Packet was placed using jumbo algorithm.
4920          */
4921         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_JUMBO \
4922                 (UINT32_C(0x1) << 7)
4923         /*
4924          * Header/Data Separation:
4925          * Packet was placed using Header/Data separation algorithm.
4926          * The separation location is indicated by the itype field.
4927          */
4928         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_HDS \
4929                 (UINT32_C(0x2) << 7)
4930         /*
4931          * Truncation:
4932          * Packet was placed using truncation algorithm. The
4933          * placed (truncated) length is indicated in the payload_offset
4934          * field. The original length is indicated in the len field.
4935          */
4936         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION \
4937                 (UINT32_C(0x3) << 7)
4938         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_LAST \
4939                 RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION
4940         /* This bit is '1' if the RSS field in this completion is valid. */
4941         #define RX_PKT_V2_CMPL_FLAGS_RSS_VALID                 UINT32_C(0x400)
4942         /*
4943          * This bit is '1' if metadata has been added to the end of the
4944          * packet in host memory. Metadata starts at the first 32B boundary
4945          * after the end of the packet for regular and jumbo placement.
4946          * It starts at the first 32B boundary after the end of the header
4947          * for HDS placement. The length of the metadata is indicated in the
4948          * metadata itself.
4949          */
4950         #define RX_PKT_V2_CMPL_FLAGS_PKT_METADATA_PRESENT      UINT32_C(0x800)
4951         /*
4952          * This value indicates what the inner packet determined for the
4953          * packet was.
4954          */
4955         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_MASK                UINT32_C(0xf000)
4956         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_SFT                 12
4957         /*
4958          * Not Known:
4959          * Indicates that the packet type was not known.
4960          */
4961         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_NOT_KNOWN \
4962                 (UINT32_C(0x0) << 12)
4963         /*
4964          * IP Packet:
4965          * Indicates that the packet was an IP packet, but further
4966          * classification was not possible.
4967          */
4968         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_IP \
4969                 (UINT32_C(0x1) << 12)
4970         /*
4971          * TCP Packet:
4972          * Indicates that the packet was IP and TCP.
4973          * This indicates that the payload_offset field is valid.
4974          */
4975         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_TCP \
4976                 (UINT32_C(0x2) << 12)
4977         /*
4978          * UDP Packet:
4979          * Indicates that the packet was IP and UDP.
4980          * This indicates that the payload_offset field is valid.
4981          */
4982         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_UDP \
4983                 (UINT32_C(0x3) << 12)
4984         /*
4985          * FCoE Packet:
4986          * Indicates that the packet was recognized as a FCoE.
4987          * This also indicates that the payload_offset field is valid.
4988          */
4989         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_FCOE \
4990                 (UINT32_C(0x4) << 12)
4991         /*
4992          * RoCE Packet:
4993          * Indicates that the packet was recognized as a RoCE.
4994          * This also indicates that the payload_offset field is valid.
4995          */
4996         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_ROCE \
4997                 (UINT32_C(0x5) << 12)
4998         /*
4999          * ICMP Packet:
5000          * Indicates that the packet was recognized as ICMP.
5001          * This indicates that the payload_offset field is valid.
5002          */
5003         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_ICMP \
5004                 (UINT32_C(0x7) << 12)
5005         /*
5006          * PTP packet wo/timestamp:
5007          * Indicates that the packet was recognized as a PTP
5008          * packet.
5009          */
5010         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
5011                 (UINT32_C(0x8) << 12)
5012         /*
5013          * PTP packet w/timestamp:
5014          * Indicates that the packet was recognized as a PTP
5015          * packet and that a timestamp was taken for the packet.
5016          */
5017         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
5018                 (UINT32_C(0x9) << 12)
5019         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_LAST \
5020                 RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
5021         /*
5022          * This is the length of the data for the packet stored in the
5023          * buffer(s) identified by the opaque value. This includes
5024          * the packet BD and any associated buffer BDs. This does not include
5025          * the length of any data places in aggregation BDs.
5026          */
5027         uint16_t        len;
5028         /*
5029          * This is a copy of the opaque field from the RX BD this completion
5030          * corresponds to.
5031          */
5032         uint32_t        opaque;
5033         uint8_t agg_bufs_v1;
5034         /*
5035          * This value is written by the NIC such that it will be different
5036          * for each pass through the completion queue. The even passes
5037          * will write 1. The odd passes will write 0.
5038          */
5039         #define RX_PKT_V2_CMPL_V1           UINT32_C(0x1)
5040         /*
5041          * This value is the number of aggregation buffers that follow this
5042          * entry in the completion ring that are a part of this packet.
5043          * If the value is zero, then the packet is completely contained
5044          * in the buffer space provided for the packet in the RX ring.
5045          */
5046         #define RX_PKT_V2_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
5047         #define RX_PKT_V2_CMPL_AGG_BUFS_SFT 1
5048         /* unused1 is 2 b */
5049         #define RX_PKT_V2_CMPL_UNUSED1_MASK UINT32_C(0xc0)
5050         #define RX_PKT_V2_CMPL_UNUSED1_SFT  6
5051         /*
5052          * This is the RSS hash type for the packet. The value is packed
5053          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5054          * The value of tuple_extrac_op provides the information about
5055          * what fields the hash was computed on.
5056          * Note that 4-tuples values listed below are applicable
5057          * for layer 4 protocols supported and enabled for RSS in the hardware,
5058          * HWRM firmware, and drivers. For example, if RSS hash is supported and
5059          * enabled for TCP traffic only, then the values of tuple_extract_op
5060          * corresponding to 4-tuples are only valid for TCP traffic.
5061          */
5062         uint8_t rss_hash_type;
5063         /*
5064          * The RSS hash was computed over source IP address,
5065          * destination IP address, source port, and destination port of inner
5066          * IP and TCP or UDP headers. Note: For non-tunneled packets,
5067          * the packet headers are considered inner packet headers for the RSS
5068          * hash computation purpose.
5069          */
5070         #define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_0 UINT32_C(0x0)
5071         /*
5072          * The RSS hash was computed over source IP address and destination
5073          * IP address of inner IP header. Note: For non-tunneled packets,
5074          * the packet headers are considered inner packet headers for the RSS
5075          * hash computation purpose.
5076          */
5077         #define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_1 UINT32_C(0x1)
5078         /*
5079          * The RSS hash was computed over source IP address,
5080          * destination IP address, source port, and destination port of
5081          * IP and TCP or UDP headers of outer tunnel headers.
5082          * Note: For non-tunneled packets, this value is not applicable.
5083          */
5084         #define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_2 UINT32_C(0x2)
5085         /*
5086          * The RSS hash was computed over source IP address and
5087          * destination IP address of IP header of outer tunnel headers.
5088          * Note: For non-tunneled packets, this value is not applicable.
5089          */
5090         #define RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_3 UINT32_C(0x3)
5091         #define RX_PKT_V2_CMPL_RSS_HASH_TYPE_LAST \
5092                 RX_PKT_V2_CMPL_RSS_HASH_TYPE_ENUM_3
5093         uint16_t        metadata1_payload_offset;
5094         /*
5095          * This is data from the CFA as indicated by the meta_format field.
5096          * If truncation placement is not used, this value indicates the offset
5097          * in bytes from the beginning of the packet where the inner payload
5098          * starts. This value is valid for TCP, UDP, FCoE, and RoCE packets. If
5099          * truncation placement is used, this value represents the placed
5100          * (truncated) length of the packet.
5101          */
5102         #define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_MASK        UINT32_C(0x1ff)
5103         #define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_SFT         0
5104         /* This is data from the CFA as indicated by the meta_format field. */
5105         #define RX_PKT_V2_CMPL_METADATA1_MASK             UINT32_C(0xf000)
5106         #define RX_PKT_V2_CMPL_METADATA1_SFT              12
5107         /* When meta_format != 0, this value is the VLAN TPID_SEL. */
5108         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_MASK     UINT32_C(0x7000)
5109         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_SFT      12
5110         /* 0x88a8 */
5111         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID88A8 \
5112                 (UINT32_C(0x0) << 12)
5113         /* 0x8100 */
5114         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID8100 \
5115                 (UINT32_C(0x1) << 12)
5116         /* 0x9100 */
5117         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9100 \
5118                 (UINT32_C(0x2) << 12)
5119         /* 0x9200 */
5120         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9200 \
5121                 (UINT32_C(0x3) << 12)
5122         /* 0x9300 */
5123         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9300 \
5124                 (UINT32_C(0x4) << 12)
5125         /* Value programmed in CFA VLANTPID register. */
5126         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG \
5127                 (UINT32_C(0x5) << 12)
5128         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_LAST \
5129                 RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
5130         /* When meta_format != 0, this value is the VLAN valid. */
5131         #define RX_PKT_V2_CMPL_METADATA1_VALID             UINT32_C(0x8000)
5132         /*
5133          * This value is the RSS hash value calculated for the packet
5134          * based on the mode bits and key value in the VNIC. When vee_cmpl_mode
5135          * is set in VNIC context, this is the lower 32b of the host address
5136          * from the first BD used to place the packet.
5137          */
5138         uint32_t        rss_hash;
5139 } __rte_packed;
5140
5141 /* Last 16 bytes of RX Packet V2 Completion Record */
5142 /* rx_pkt_v2_cmpl_hi (size:128b/16B) */
5143 struct rx_pkt_v2_cmpl_hi {
5144         uint32_t        flags2;
5145         /*
5146          * When this bit is '0', the cs_ok field has the following definition:-
5147          * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
5148          * in the delivered packet, counted from the outer-most header group to
5149          * the inner-most header group, stopping at the first error. -
5150          * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
5151          * in the delivered packet, counted from the outer-most header group to
5152          * the inner-most header group, stopping at the first error. When this
5153          * bit is '1', the cs_ok field has the following definition: -
5154          * hdr_cnt[2:0] = The number of header groups that were parsed by the
5155          * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
5156          * will be '1' if all the parsed header groups with an IP checksum are
5157          * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
5158          * header groups with an L4 checksum are valid.
5159          */
5160         #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_ALL_OK_MODE \
5161                 UINT32_C(0x8)
5162         /* This value indicates what format the metadata field is. */
5163         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_MASK \
5164                 UINT32_C(0xf0)
5165         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_SFT            4
5166         /* There is no metadata information. Values are zero. */
5167         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_NONE \
5168                 (UINT32_C(0x0) << 4)
5169         /*
5170          * The {metadata1, metadata0} fields contain the vtag
5171          * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
5172          * de, vid[11:0]} The metadata2 field contains the table scope
5173          * and action record pointer. - metadata2[25:0] contains the
5174          * action record pointer. - metadata2[31:26] contains the table
5175          * scope.
5176          */
5177         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR \
5178                 (UINT32_C(0x1) << 4)
5179         /*
5180          * The {metadata1, metadata0} fields contain the vtag
5181          * information:
5182          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
5183          * The metadata2 field contains the Tunnel ID
5184          * value, justified to LSB.
5185          * - VXLAN = VNI[23:0] -> VXLAN Network ID
5186          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
5187          * - NVGRE = TNI[23:0] -> Tenant Network ID
5188          * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
5189          * - IPv4 = 0 (not populated)
5190          * - IPv6 = Flow Label[19:0]
5191          * - PPPoE = sessionID[15:0]
5192          * - MPLs = Outer label[19:0]
5193          * - UPAR = Selected[31:0] with bit mask
5194          */
5195         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_TUNNEL_ID \
5196                 (UINT32_C(0x2) << 4)
5197         /*
5198          * The {metadata1, metadata0} fields contain the vtag
5199          * information:
5200          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
5201          * The metadata2 field contains the 32b metadata from the prepended
5202          * header (chdr_data).
5203          */
5204         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_CHDR_DATA \
5205                 (UINT32_C(0x3) << 4)
5206         /*
5207          * The {metadata1, metadata0} fields contain the vtag
5208          * information:
5209          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
5210          * The metadata2 field contains the outer_l3_offset,
5211          * inner_l2_offset, inner_l3_offset, and inner_l4_size.
5212          * - metadata2[8:0] contains the outer_l3_offset.
5213          * - metadata2[17:9] contains the inner_l2_offset.
5214          * - metadata2[26:18] contains the inner_l3_offset.
5215          * - metadata2[31:27] contains the inner_l4_size.
5216          */
5217         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET \
5218                 (UINT32_C(0x4) << 4)
5219         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_LAST \
5220                 RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET
5221         /*
5222          * This field indicates the IP type for the inner-most IP header.
5223          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
5224          * This value is only valid if itype indicates a packet
5225          * with an IP header.
5226          */
5227         #define RX_PKT_V2_CMPL_HI_FLAGS2_IP_TYPE \
5228                 UINT32_C(0x100)
5229         /*
5230          * This indicates that the complete 1's complement checksum was
5231          * calculated for the packet.
5232          */
5233         #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_CALC \
5234                 UINT32_C(0x200)
5235         /*
5236          * This field indicates the status of IP and L4 CS calculations done
5237          * by the chip. The format of this field is indicated by the
5238          * cs_all_ok_mode bit.
5239          */
5240         #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_MASK \
5241                 UINT32_C(0xfc00)
5242         #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_SFT                  10
5243         /*
5244          * This value is the complete 1's complement checksum calculated from
5245          * the start of the outer L3 header to the end of the packet (not
5246          * including the ethernet crc). It is valid when the
5247          * 'complete_checksum_calc' flag is set.
5248          */
5249         #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_MASK \
5250                 UINT32_C(0xffff0000)
5251         #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_SFT      16
5252         /*
5253          * This is data from the CFA block as indicated by the meta_format
5254          * field.
5255          * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
5256          * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
5257          *   act_rec_ptr[25:0]}
5258          * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
5259          * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
5260          * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
5261          * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
5262          * of the host address from the first BD used to place the packet.
5263          */
5264         uint32_t        metadata2;
5265         uint16_t        errors_v2;
5266         /*
5267          * This value is written by the NIC such that it will be different
5268          * for each pass through the completion queue. The even passes
5269          * will write 1. The odd passes will write 0.
5270          */
5271         #define RX_PKT_V2_CMPL_HI_V2 \
5272                 UINT32_C(0x1)
5273         #define RX_PKT_V2_CMPL_HI_ERRORS_MASK \
5274                 UINT32_C(0xfffe)
5275         #define RX_PKT_V2_CMPL_HI_ERRORS_SFT                               1
5276         /*
5277          * This error indicates that there was some sort of problem with
5278          * the BDs for the packet that was found after part of the
5279          * packet was already placed. The packet should be treated as
5280          * invalid.
5281          */
5282         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_MASK \
5283                 UINT32_C(0xe)
5284         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_SFT                   1
5285         /* No buffer error */
5286         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NO_BUFFER \
5287                 (UINT32_C(0x0) << 1)
5288         /*
5289          * Did Not Fit: Packet did not fit into packet buffer provided.
5290          * For regular placement, this means the packet did not fit in
5291          * the buffer provided. For HDS and jumbo placement, this means
5292          * that the packet could not be placed into 8 physical buffers
5293          * (if fixed-size buffers are used), or that the packet could
5294          * not be placed in the number of physical buffers configured
5295          * for the VNIC (if variable-size buffers are used)
5296          */
5297         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
5298                 (UINT32_C(0x1) << 1)
5299         /*
5300          * Not On Chip: All BDs needed for the packet were not on-chip
5301          * when the packet arrived. For regular placement, this error is
5302          * not valid. For HDS and jumbo placement, this means that not
5303          * enough agg BDs were posted to place the packet.
5304          */
5305         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
5306                 (UINT32_C(0x2) << 1)
5307         /*
5308          * Bad Format:
5309          * BDs were not formatted correctly.
5310          */
5311         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_BAD_FORMAT \
5312                 (UINT32_C(0x3) << 1)
5313         /*
5314          * Flush:
5315          * There was a bad_format error on the previous operation
5316          */
5317         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH \
5318                 (UINT32_C(0x5) << 1)
5319         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_LAST \
5320                 RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH
5321         /*
5322          * This indicates that there was an error in the outer tunnel
5323          * portion of the packet when this field is non-zero.
5324          */
5325         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_MASK \
5326                 UINT32_C(0x70)
5327         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_SFT                   4
5328         /*
5329          * No additional error occurred on the outer tunnel portion
5330          * of the packet or the packet does not have a outer tunnel.
5331          */
5332         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_NO_ERROR \
5333                 (UINT32_C(0x0) << 4)
5334         /*
5335          * Indicates that IP header version does not match expectation
5336          * from L2 Ethertype for IPv4 and IPv6 in the outer tunnel header.
5337          */
5338         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_VERSION \
5339                 (UINT32_C(0x1) << 4)
5340         /*
5341          * Indicates that header length is out of range in the outer
5342          * tunnel header. Valid for IPv4.
5343          */
5344         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_HDR_LEN \
5345                 (UINT32_C(0x2) << 4)
5346         /*
5347          * Indicates that physical packet is shorter than that claimed
5348          * by the outer tunnel l3 header length. Valid for IPv4, or
5349          * IPv6 outer tunnel packets.
5350          */
5351         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_TOTAL_ERROR \
5352                 (UINT32_C(0x3) << 4)
5353         /*
5354          * Indicates that the physical packet is shorter than that
5355          * claimed by the outer tunnel UDP header length for a outer
5356          * tunnel UDP packet that is not fragmented.
5357          */
5358         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_UDP_TOTAL_ERROR \
5359                 (UINT32_C(0x4) << 4)
5360         /*
5361          * Indicates that the IPv4 TTL or IPv6 hop limit check have
5362          * failed (e.g. TTL = 0) in the outer tunnel header. Valid for
5363          * IPv4, and IPv6.
5364          */
5365         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_TTL \
5366                 (UINT32_C(0x5) << 4)
5367         /*
5368          * Indicates that the IP checksum failed its check in the outer
5369          * tunnel header.
5370          */
5371         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_CS_ERROR \
5372                 (UINT32_C(0x6) << 4)
5373         /*
5374          * Indicates that the L4 checksum failed its check in the outer
5375          * tunnel header.
5376          */
5377         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR \
5378                 (UINT32_C(0x7) << 4)
5379         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_LAST \
5380                 RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR
5381         /*
5382          * This indicates that there was a CRC error on either an FCoE
5383          * or RoCE packet. The itype indicates the packet type.
5384          */
5385         #define RX_PKT_V2_CMPL_HI_ERRORS_CRC_ERROR \
5386                 UINT32_C(0x100)
5387         /*
5388          * This indicates that there was an error in the tunnel portion
5389          * of the packet when this field is non-zero.
5390          */
5391         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_MASK \
5392                 UINT32_C(0xe00)
5393         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_SFT                    9
5394         /*
5395          * No additional error occurred on the tunnel portion
5396          * of the packet or the packet does not have a tunnel.
5397          */
5398         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_NO_ERROR \
5399                 (UINT32_C(0x0) << 9)
5400         /*
5401          * Indicates that IP header version does not match expectation
5402          * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
5403          */
5404         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
5405                 (UINT32_C(0x1) << 9)
5406         /*
5407          * Indicates that header length is out of range in the tunnel
5408          * header. Valid for IPv4.
5409          */
5410         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
5411                 (UINT32_C(0x2) << 9)
5412         /*
5413          * Indicates that physical packet is shorter than that claimed
5414          * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
5415          * packet packets.
5416          */
5417         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
5418                 (UINT32_C(0x3) << 9)
5419         /*
5420          * Indicates that the physical packet is shorter than that claimed
5421          * by the tunnel UDP header length for a tunnel UDP packet that is
5422          * not fragmented.
5423          */
5424         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
5425                 (UINT32_C(0x4) << 9)
5426         /*
5427          * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
5428          * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
5429          */
5430         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
5431                 (UINT32_C(0x5) << 9)
5432         /*
5433          * Indicates that the IP checksum failed its check in the tunnel
5434          * header.
5435          */
5436         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR \
5437                 (UINT32_C(0x6) << 9)
5438         /*
5439          * Indicates that the L4 checksum failed its check in the tunnel
5440          * header.
5441          */
5442         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR \
5443                 (UINT32_C(0x7) << 9)
5444         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_LAST \
5445                 RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR
5446         /*
5447          * This indicates that there was an error in the inner
5448          * portion of the packet when this
5449          * field is non-zero.
5450          */
5451         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_MASK \
5452                 UINT32_C(0xf000)
5453         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_SFT                      12
5454         /*
5455          * No additional error occurred on the tunnel portion
5456          * or the packet of the packet does not have a tunnel.
5457          */
5458         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_NO_ERROR \
5459                 (UINT32_C(0x0) << 12)
5460         /*
5461          * Indicates that IP header version does not match
5462          * expectation from L2 Ethertype for IPv4 and IPv6 or that
5463          * option other than VFT was parsed on
5464          * FCoE packet.
5465          */
5466         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_VERSION \
5467                 (UINT32_C(0x1) << 12)
5468         /*
5469          * indicates that header length is out of range. Valid for
5470          * IPv4 and RoCE
5471          */
5472         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
5473                 (UINT32_C(0x2) << 12)
5474         /*
5475          * indicates that the IPv4 TTL or IPv6 hop limit check
5476          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
5477          */
5478         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_TTL \
5479                 (UINT32_C(0x3) << 12)
5480         /*
5481          * Indicates that physical packet is shorter than that
5482          * claimed by the l3 header length. Valid for IPv4,
5483          * IPv6 packet or RoCE packets.
5484          */
5485         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
5486                 (UINT32_C(0x4) << 12)
5487         /*
5488          * Indicates that the physical packet is shorter than that
5489          * claimed by the UDP header length for a UDP packet that is
5490          * not fragmented.
5491          */
5492         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
5493                 (UINT32_C(0x5) << 12)
5494         /*
5495          * Indicates that TCP header length > IP payload. Valid for
5496          * TCP packets only.
5497          */
5498         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
5499                 (UINT32_C(0x6) << 12)
5500         /* Indicates that TCP header length < 5. Valid for TCP. */
5501         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
5502                 (UINT32_C(0x7) << 12)
5503         /*
5504          * Indicates that TCP option headers result in a TCP header
5505          * size that does not match data offset in TCP header. Valid
5506          * for TCP.
5507          */
5508         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
5509                 (UINT32_C(0x8) << 12)
5510         /*
5511          * Indicates that the IP checksum failed its check in the
5512          * inner header.
5513          */
5514         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_CS_ERROR \
5515                 (UINT32_C(0x9) << 12)
5516         /*
5517          * Indicates that the L4 checksum failed its check in the
5518          * inner header.
5519          */
5520         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR \
5521                 (UINT32_C(0xa) << 12)
5522         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_LAST \
5523                 RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR
5524         /*
5525          * This is data from the CFA block as indicated by the meta_format
5526          * field.
5527          */
5528         uint16_t        metadata0;
5529         /* When meta_format=1, this value is the VLAN VID. */
5530         #define RX_PKT_V2_CMPL_HI_METADATA0_VID_MASK UINT32_C(0xfff)
5531         #define RX_PKT_V2_CMPL_HI_METADATA0_VID_SFT 0
5532         /* When meta_format=1, this value is the VLAN DE. */
5533         #define RX_PKT_V2_CMPL_HI_METADATA0_DE      UINT32_C(0x1000)
5534         /* When meta_format=1, this value is the VLAN PRI. */
5535         #define RX_PKT_V2_CMPL_HI_METADATA0_PRI_MASK UINT32_C(0xe000)
5536         #define RX_PKT_V2_CMPL_HI_METADATA0_PRI_SFT 13
5537         /*
5538          * The timestamp field contains the 32b timestamp for the packet from
5539          * the MAC.
5540          */
5541         uint32_t        timestamp;
5542 } __rte_packed;
5543
5544 /* rx_pkt_v3_cmpl (size:128b/16B) */
5545 struct rx_pkt_v3_cmpl {
5546         uint16_t        flags_type;
5547         /*
5548          * This field indicates the exact type of the completion.
5549          * By convention, the LSB identifies the length of the
5550          * record in 16B units. Even values indicate 16B
5551          * records. Odd values indicate 32B
5552          * records.
5553          */
5554         #define RX_PKT_V3_CMPL_TYPE_MASK                      UINT32_C(0x3f)
5555         #define RX_PKT_V3_CMPL_TYPE_SFT                       0
5556         /*
5557          * RX L2 V3 completion:
5558          * Completion of and L2 RX packet. Length = 32B
5559          * This is the new version of the RX_L2 completion used in Thor2
5560          * and later chips.
5561          */
5562         #define RX_PKT_V3_CMPL_TYPE_RX_L2_V3                    UINT32_C(0x17)
5563         #define RX_PKT_V3_CMPL_TYPE_LAST \
5564                 RX_PKT_V3_CMPL_TYPE_RX_L2_V3
5565         #define RX_PKT_V3_CMPL_FLAGS_MASK                     UINT32_C(0xffc0)
5566         #define RX_PKT_V3_CMPL_FLAGS_SFT                      6
5567         /*
5568          * When this bit is '1', it indicates a packet that has an
5569          * error of some type. Type of error is indicated in
5570          * error_flags.
5571          */
5572         #define RX_PKT_V3_CMPL_FLAGS_ERROR                     UINT32_C(0x40)
5573         /* This field indicates how the packet was placed in the buffer. */
5574         #define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_MASK            UINT32_C(0x380)
5575         #define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_SFT             7
5576         /*
5577          * Normal:
5578          * Packet was placed using normal algorithm.
5579          */
5580         #define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_NORMAL \
5581                 (UINT32_C(0x0) << 7)
5582         /*
5583          * Jumbo:
5584          * Packet was placed using jumbo algorithm.
5585          */
5586         #define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_JUMBO \
5587                 (UINT32_C(0x1) << 7)
5588         /*
5589          * Header/Data Separation:
5590          * Packet was placed using Header/Data separation algorithm.
5591          * The separation location is indicated by the itype field.
5592          */
5593         #define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_HDS \
5594                 (UINT32_C(0x2) << 7)
5595         /*
5596          * Truncation:
5597          * Packet was placed using truncation algorithm. The
5598          * placed (truncated) length is indicated in the payload_offset
5599          * field. The original length is indicated in the len field.
5600          */
5601         #define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_TRUNCATION \
5602                 (UINT32_C(0x3) << 7)
5603         #define RX_PKT_V3_CMPL_FLAGS_PLACEMENT_LAST \
5604                 RX_PKT_V3_CMPL_FLAGS_PLACEMENT_TRUNCATION
5605         /* This bit is '1' if the RSS field in this completion is valid. */
5606         #define RX_PKT_V3_CMPL_FLAGS_RSS_VALID                 UINT32_C(0x400)
5607         /*
5608          * This bit is '1' if metadata has been added to the end of the
5609          * packet in host memory. Metadata starts at the first 32B boundary
5610          * after the end of the packet for regular and jumbo placement.
5611          * It starts at the first 32B boundary after the end of the header
5612          * for HDS placement. The length of the metadata is indicated in the
5613          * metadata itself.
5614          */
5615         #define RX_PKT_V3_CMPL_FLAGS_PKT_METADATA_PRESENT      UINT32_C(0x800)
5616         /*
5617          * This value indicates what the inner packet determined for the
5618          * packet was.
5619          */
5620         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_MASK                UINT32_C(0xf000)
5621         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_SFT                 12
5622         /*
5623          * Not Known:
5624          * Indicates that the packet type was not known.
5625          */
5626         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_NOT_KNOWN \
5627                 (UINT32_C(0x0) << 12)
5628         /*
5629          * IP Packet:
5630          * Indicates that the packet was an IP packet, but further
5631          * classification was not possible.
5632          */
5633         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_IP \
5634                 (UINT32_C(0x1) << 12)
5635         /*
5636          * TCP Packet:
5637          * Indicates that the packet was IP and TCP.
5638          * This indicates that the payload_offset field is valid.
5639          */
5640         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_TCP \
5641                 (UINT32_C(0x2) << 12)
5642         /*
5643          * UDP Packet:
5644          * Indicates that the packet was IP and UDP.
5645          * This indicates that the payload_offset field is valid.
5646          */
5647         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_UDP \
5648                 (UINT32_C(0x3) << 12)
5649         /*
5650          * FCoE Packet:
5651          * Indicates that the packet was recognized as a FCoE.
5652          * This also indicates that the payload_offset field is valid.
5653          */
5654         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_FCOE \
5655                 (UINT32_C(0x4) << 12)
5656         /*
5657          * RoCE Packet:
5658          * Indicates that the packet was recognized as a RoCE.
5659          * This also indicates that the payload_offset field is valid.
5660          */
5661         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_ROCE \
5662                 (UINT32_C(0x5) << 12)
5663         /*
5664          * ICMP Packet:
5665          * Indicates that the packet was recognized as ICMP.
5666          * This indicates that the payload_offset field is valid.
5667          */
5668         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_ICMP \
5669                 (UINT32_C(0x7) << 12)
5670         /*
5671          * PTP packet wo/timestamp:
5672          * Indicates that the packet was recognized as a PTP
5673          * packet.
5674          */
5675         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
5676                 (UINT32_C(0x8) << 12)
5677         /*
5678          * PTP packet w/timestamp:
5679          * Indicates that the packet was recognized as a PTP
5680          * packet and that a timestamp was taken for the packet.
5681          * The 4b sub-nanosecond portion of the timestamp is in
5682          * the payload_offset field.
5683          */
5684         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
5685                 (UINT32_C(0x9) << 12)
5686         #define RX_PKT_V3_CMPL_FLAGS_ITYPE_LAST \
5687                 RX_PKT_V3_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
5688         /*
5689          * This is the length of the data for the packet stored in the
5690          * buffer(s) identified by the opaque value. This includes
5691          * the packet BD and any associated buffer BDs. This does not include
5692          * the length of any data places in aggregation BDs.
5693          */
5694         uint16_t        len;
5695         /*
5696          * This is a copy of the opaque field from the RX BD this completion
5697          * corresponds to.
5698          */
5699         uint32_t        opaque;
5700         uint16_t        rss_hash_type_agg_bufs_v1;
5701         /*
5702          * This value is written by the NIC such that it will be different
5703          * for each pass through the completion queue. The even passes
5704          * will write 1. The odd passes will write 0.
5705          */
5706         #define RX_PKT_V3_CMPL_V1                   UINT32_C(0x1)
5707         /*
5708          * This value is the number of aggregation buffers that follow this
5709          * entry in the completion ring that are a part of this packet.
5710          * If the value is zero, then the packet is completely contained
5711          * in the buffer space provided for the packet in the RX ring.
5712          */
5713         #define RX_PKT_V3_CMPL_AGG_BUFS_MASK        UINT32_C(0x3e)
5714         #define RX_PKT_V3_CMPL_AGG_BUFS_SFT         1
5715         /* unused1 is 1 b */
5716         #define RX_PKT_V3_CMPL_UNUSED1              UINT32_C(0x40)
5717         /*
5718          * This is the RSS hash type for the packet. The value is packed
5719          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5720          * The value of tuple_extrac_op provides the information about
5721          * what fields the hash was computed on.
5722          * Note that 4-tuples values listed below are applicable
5723          * for layer 4 protocols supported and enabled for RSS in the
5724          * hardware, HWRM firmware, and drivers. For example, if RSS hash
5725          * is supported and enabled for TCP traffic only, then the values of
5726          * tuple_extract_op corresponding to 4-tuples are only valid for
5727          * TCP traffic.
5728          */
5729         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_MASK   UINT32_C(0xff80)
5730         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_SFT    7
5731         /*
5732          * The RSS hash was computed over source IP address,
5733          * destination IP address, source port, and destination port of
5734          * inner IP and TCP or UDP headers.
5735          */
5736         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_0   (UINT32_C(0x0) << 7)
5737         /*
5738          * The RSS hash was computed over source IP address and
5739          * destination IP address of inner IP header.
5740          */
5741         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_1   (UINT32_C(0x1) << 7)
5742         /*
5743          * The RSS hash was computed over source IP address,
5744          * destination IP address, source port, and destination port of
5745          * IP and TCP or UDP headers of outer tunnel headers.
5746          * Note: For non-tunneled packets, this value is not applicable.
5747          */
5748         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_2   (UINT32_C(0x2) << 7)
5749         /*
5750          * The RSS hash was computed over source IP address and
5751          * destination IP address of IP header of outer tunnel headers.
5752          * Note: For non-tunneled packets, this value is not applicable.
5753          */
5754         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_3   (UINT32_C(0x3) << 7)
5755         /*
5756          * The RSS hash was computed over source IP address of the inner
5757          * IP header.
5758          */
5759         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_4   (UINT32_C(0x4) << 7)
5760         /*
5761          * The RSS hash was computed over destination IP address of the
5762          * inner IP header.
5763          */
5764         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_5   (UINT32_C(0x5) << 7)
5765         /*
5766          * The RSS hash was computed over source IP address of the outer
5767          * IP header.
5768          * Note: For non-tunneled packets, this value is not applicable.
5769          */
5770         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_6   (UINT32_C(0x6) << 7)
5771         /*
5772          * The RSS hash was computed over destination IP address of the
5773          * outer IP header.
5774          * Note: For non-tunneled packets, this value is not applicable.
5775          */
5776         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_7   (UINT32_C(0x7) << 7)
5777         /*
5778          * The RSS hash was computed over source IP address, destination
5779          * IP address, and flow label of the inner IP header.
5780          * Note: For packets without an inner IPv6 header, this value is not
5781          * this value is not applicable.
5782          */
5783         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_8   (UINT32_C(0x8) << 7)
5784         /*
5785          * The RSS hash was computed over the flow label of the inner
5786          * IP header.
5787          * Note: For packets without an inner IPv6 header, this value
5788          * is not applicable.
5789          */
5790         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_9   (UINT32_C(0x9) << 7)
5791         /*
5792          * The RSS hash was computed over source IP address, destination
5793          * IP address, and flow label of the outer IP header.
5794          * Note: For packets without an outer IPv6 header, this value is not
5795          * applicable.
5796          */
5797         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_10  (UINT32_C(0xa) << 7)
5798         /*
5799          * The RSS hash was computed over the flow label of the outer
5800          * IP header.
5801          * Note: For packets without an outer IPv6 header, this value
5802          * is not applicable.
5803          */
5804         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_11  (UINT32_C(0xb) << 7)
5805         #define RX_PKT_V3_CMPL_RSS_HASH_TYPE_LAST \
5806                 RX_PKT_V3_CMPL_RSS_HASH_TYPE_ENUM_11
5807         uint16_t        metadata1_payload_offset;
5808         /*
5809          * If truncation placement is not used, this value indicates the offset
5810          * in bytes from the beginning of the packet where the inner payload
5811          * starts. This value is valid for TCP, UDP, FCoE, and RoCE packets.
5812          * For PTP packets with timestamp (as indicated by the flags_itype
5813          * field), this field contains the 4b sub-nanosecond portion of the
5814          * timestamp.
5815          *
5816          * If truncation placement is used, this value represents the placed
5817          * (truncated) length of the packet.
5818          */
5819         #define RX_PKT_V3_CMPL_PAYLOAD_OFFSET_MASK        UINT32_C(0x1ff)
5820         #define RX_PKT_V3_CMPL_PAYLOAD_OFFSET_SFT         0
5821         /* This is data from the CFA as indicated by the meta_format field. */
5822         #define RX_PKT_V3_CMPL_METADATA1_MASK             UINT32_C(0xf000)
5823         #define RX_PKT_V3_CMPL_METADATA1_SFT              12
5824         /* When meta_format != 0, this value is the VLAN TPID_SEL. */
5825         #define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_MASK     UINT32_C(0x7000)
5826         #define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_SFT      12
5827         /* 0x88a8 */
5828         #define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID88A8 \
5829                 (UINT32_C(0x0) << 12)
5830         /* 0x8100 */
5831         #define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID8100 \
5832                 (UINT32_C(0x1) << 12)
5833         /* 0x9100 */
5834         #define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID9100 \
5835                 (UINT32_C(0x2) << 12)
5836         /* 0x9200 */
5837         #define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID9200 \
5838                 (UINT32_C(0x3) << 12)
5839         /* 0x9300 */
5840         #define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPID9300 \
5841                 (UINT32_C(0x4) << 12)
5842         /* Value programmed in CFA VLANTPID register. */
5843         #define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG \
5844                 (UINT32_C(0x5) << 12)
5845         #define RX_PKT_V3_CMPL_METADATA1_TPID_SEL_LAST \
5846                 RX_PKT_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG
5847         /* When meta_format != 0, this value is the VLAN valid. */
5848         #define RX_PKT_V3_CMPL_METADATA1_VALID             UINT32_C(0x8000)
5849         /*
5850          * This value is the RSS hash value calculated for the packet
5851          * based on the mode bits and key value in the VNIC. When hairpin_en
5852          * is set in VNIC context, this is the lower 32b of the host address
5853          * from the first BD used to place the packet.
5854          */
5855         uint32_t        rss_hash;
5856 } __rte_packed;
5857
5858 /* Last 16 bytes of RX Packet V3 Completion Record */
5859 /* rx_pkt_v3_cmpl_hi (size:128b/16B) */
5860 struct rx_pkt_v3_cmpl_hi {
5861         uint32_t        flags2;
5862         /*
5863          * This indicates that the ip checksum was calculated for the inner
5864          * packet and that the ip_cs_error field indicates if there was an
5865          * error.
5866          */
5867         #define RX_PKT_V3_CMPL_HI_FLAGS2_IP_CS_CALC \
5868                 UINT32_C(0x1)
5869         /*
5870          * This indicates that the TCP, UDP or ICMP checksum was calculated
5871          * for the inner packet and that the l4_cs_error field indicates if
5872          * there was an error.
5873          */
5874         #define RX_PKT_V3_CMPL_HI_FLAGS2_L4_CS_CALC \
5875                 UINT32_C(0x2)
5876         /*
5877          * This indicates that the ip checksum was calculated for the tunnel
5878          * header and that the t_ip_cs_error field indicates if there was an
5879          * error.
5880          */
5881         #define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_CS_CALC \
5882                 UINT32_C(0x4)
5883         /*
5884          * This indicates that the UDP checksum was calculated for the tunnel
5885          * packet and that the t_l4_cs_error field indicates if there was an
5886          * error.
5887          */
5888         #define RX_PKT_V3_CMPL_HI_FLAGS2_T_L4_CS_CALC \
5889                 UINT32_C(0x8)
5890         /* This value indicates what format the metadata field is. */
5891         #define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_MASK \
5892                 UINT32_C(0xf0)
5893         #define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_SFT            4
5894         /* There is no metadata information. Values are zero. */
5895         #define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_NONE \
5896                 (UINT32_C(0x0) << 4)
5897         /*
5898          * The {metadata1, metadata0} fields contain the vtag
5899          * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
5900          * de, vid[11:0]} The metadata2 field contains the table scope
5901          * and action record pointer. - metadata2[25:0] contains the
5902          * action record pointer. - metadata2[31:26] contains the table
5903          * scope.
5904          */
5905         #define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR \
5906                 (UINT32_C(0x1) << 4)
5907         /*
5908          * The {metadata1, metadata0} fields contain the vtag
5909          * information:
5910          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
5911          * The metadata2 field contains the Tunnel ID
5912          * value, justified to LSB.
5913          * - VXLAN = VNI[23:0] -> VXLAN Network ID
5914          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
5915          * - NVGRE = TNI[23:0] -> Tenant Network ID
5916          * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
5917          * - IPv4 = 0 (not populated)
5918          * - IPv6 = Flow Label[19:0]
5919          * - PPPoE = sessionID[15:0]
5920          * - MPLs = Outer label[19:0]
5921          * - UPAR = Selected[31:0] with bit mask
5922          */
5923         #define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_TUNNEL_ID \
5924                 (UINT32_C(0x2) << 4)
5925         /*
5926          * The {metadata1, metadata0} fields contain the vtag
5927          * information:
5928          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
5929          * The metadata2 field contains the 32b metadata from the prepended
5930          * header (chdr_data).
5931          */
5932         #define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_CHDR_DATA \
5933                 (UINT32_C(0x3) << 4)
5934         /*
5935          * The {metadata1, metadata0} fields contain the vtag
5936          * information:
5937          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
5938          * The metadata2 field contains the outer_l3_offset,
5939          * inner_l2_offset, inner_l3_offset, and inner_l4_size.
5940          * - metadata2[8:0] contains the outer_l3_offset.
5941          * - metadata2[17:9] contains the inner_l2_offset.
5942          * - metadata2[26:18] contains the inner_l3_offset.
5943          * - metadata2[31:27] contains the inner_l4_size.
5944          */
5945         #define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET \
5946                 (UINT32_C(0x4) << 4)
5947         #define RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_LAST \
5948                 RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET
5949         /*
5950          * This field indicates the IP type for the inner-most IP header.
5951          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
5952          * This value is only valid if itype indicates a packet
5953          * with an IP header.
5954          */
5955         #define RX_PKT_V3_CMPL_HI_FLAGS2_IP_TYPE \
5956                 UINT32_C(0x100)
5957         /*
5958          * This indicates that the complete 1's complement checksum was
5959          * calculated for the packet.
5960          */
5961         #define RX_PKT_V3_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_CALC \
5962                 UINT32_C(0x200)
5963         /*
5964          * This field indicates the status of IP and L4 CS calculations done
5965          * by the chip. The format of this field is indicated by the
5966          * cs_all_ok_mode bit.
5967          */
5968         #define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE \
5969                 UINT32_C(0x400)
5970         /* Indicates that the Tunnel IP type was IPv4 */
5971         #define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_IPV4 \
5972                 (UINT32_C(0x0) << 10)
5973         /* Indicates that the Tunnel IP type was IPv6 */
5974         #define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_IPV6 \
5975                 (UINT32_C(0x1) << 10)
5976         #define RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_LAST \
5977                 RX_PKT_V3_CMPL_HI_FLAGS2_T_IP_TYPE_IPV6
5978         /*
5979          * This value is the complete 1's complement checksum calculated from
5980          * the start of the outer L3 header to the end of the packet (not
5981          * including the ethernet crc). It is valid when the
5982          * 'complete_checksum_calc' flag is set.
5983          */
5984         #define RX_PKT_V3_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_MASK \
5985                 UINT32_C(0xffff0000)
5986         #define RX_PKT_V3_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_SFT      16
5987         /*
5988          * This is data from the CFA block as indicated by the meta_format
5989          * field.
5990          * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
5991          * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
5992          *   act_rec_ptr[25:0]}
5993          * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
5994          * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
5995          * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
5996          */
5997         uint32_t        metadata2;
5998         uint16_t        errors_v2;
5999         /*
6000          * This value is written by the NIC such that it will be different
6001          * for each pass through the completion queue. The even passes
6002          * will write 1. The odd passes will write 0.
6003          */
6004         #define RX_PKT_V3_CMPL_HI_V2 \
6005                 UINT32_C(0x1)
6006         #define RX_PKT_V3_CMPL_HI_ERRORS_MASK \
6007                 UINT32_C(0xfffe)
6008         #define RX_PKT_V3_CMPL_HI_ERRORS_SFT                               1
6009         /*
6010          * This error indicates that there was some sort of problem with
6011          * the BDs for the packet that was found after part of the
6012          * packet was already placed. The packet should be treated as
6013          * invalid.
6014          */
6015         #define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_MASK \
6016                 UINT32_C(0xe)
6017         #define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_SFT                   1
6018         /* No buffer error */
6019         #define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_NO_BUFFER \
6020                 (UINT32_C(0x0) << 1)
6021         /*
6022          * Did Not Fit: Packet did not fit into packet buffer provided.
6023          * For regular placement, this means the packet did not fit in
6024          * the buffer provided. For HDS and jumbo placement, this means
6025          * that the packet could not be placed into 8 physical buffers.
6026          */
6027         #define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
6028                 (UINT32_C(0x1) << 1)
6029         /*
6030          * Not On Chip: All BDs needed for the packet were not on-chip
6031          * when the packet arrived. For regular placement, this error is
6032          * not valid. For HDS and jumbo placement, this means that not
6033          * enough agg BDs were posted to place the packet.
6034          */
6035         #define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
6036                 (UINT32_C(0x2) << 1)
6037         /*
6038          * Bad Format:
6039          * BDs were not formatted correctly.
6040          */
6041         #define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_BAD_FORMAT \
6042                 (UINT32_C(0x3) << 1)
6043         /*
6044          * Flush:
6045          * There was a bad_format error on the previous operation
6046          */
6047         #define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH \
6048                 (UINT32_C(0x5) << 1)
6049         #define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_LAST \
6050                 RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH
6051         /* This indicates that there was an error in the IP header checksum. */
6052         #define RX_PKT_V3_CMPL_HI_ERRORS_IP_CS_ERROR \
6053                 UINT32_C(0x10)
6054         /*
6055          * This indicates that there was an error in the TCP, UDP or ICMP
6056          * checksum.
6057          */
6058         #define RX_PKT_V3_CMPL_HI_ERRORS_L4_CS_ERROR \
6059                 UINT32_C(0x20)
6060         /*
6061          * This indicates that there was an error in the tunnel IP header
6062          * checksum.
6063          */
6064         #define RX_PKT_V3_CMPL_HI_ERRORS_T_IP_CS_ERROR \
6065                 UINT32_C(0x40)
6066         /* This indicates that there was an error in the tunnel UDP checksum. */
6067         #define RX_PKT_V3_CMPL_HI_ERRORS_T_L4_CS_ERROR \
6068                 UINT32_C(0x80)
6069         /*
6070          * This indicates that there was a CRC error on either an FCoE
6071          * or RoCE packet. The itype indicates the packet type.
6072          */
6073         #define RX_PKT_V3_CMPL_HI_ERRORS_CRC_ERROR \
6074                 UINT32_C(0x100)
6075         /*
6076          * This indicates that there was an error in the tunnel portion
6077          * of the packet when this field is non-zero.
6078          */
6079         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_MASK \
6080                 UINT32_C(0xe00)
6081         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_SFT                    9
6082         /*
6083          * No additional error occurred on the tunnel portion
6084          * of the packet or the packet does not have a tunnel.
6085          */
6086         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_NO_ERROR \
6087                 (UINT32_C(0x0) << 9)
6088         /*
6089          * Indicates that IP header version does not match expectation
6090          * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
6091          */
6092         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
6093                 (UINT32_C(0x1) << 9)
6094         /*
6095          * Indicates that header length is out of range in the tunnel
6096          * header. Valid for IPv4.
6097          */
6098         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
6099                 (UINT32_C(0x2) << 9)
6100         /*
6101          * Indicates that physical packet is shorter than that claimed
6102          * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
6103          * packet packets.
6104          */
6105         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
6106                 (UINT32_C(0x3) << 9)
6107         /*
6108          * Indicates that the physical packet is shorter than that claimed
6109          * by the tunnel UDP header length for a tunnel UDP packet that is
6110          * not fragmented.
6111          */
6112         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
6113                 (UINT32_C(0x4) << 9)
6114         /*
6115          * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
6116          * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
6117          */
6118         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
6119                 (UINT32_C(0x5) << 9)
6120         /*
6121          * Indicates that the IP checksum failed its check in the tunnel
6122          * header.
6123          */
6124         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR \
6125                 (UINT32_C(0x6) << 9)
6126         /*
6127          * Indicates that the L4 checksum failed its check in the tunnel
6128          * header.
6129          */
6130         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR \
6131                 (UINT32_C(0x7) << 9)
6132         #define RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_LAST \
6133                 RX_PKT_V3_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR
6134         /*
6135          * This indicates that there was an error in the inner
6136          * portion of the packet when this
6137          * field is non-zero.
6138          */
6139         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_MASK \
6140                 UINT32_C(0xf000)
6141         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_SFT                      12
6142         /*
6143          * No additional error occurred on the tunnel portion
6144          * or the packet of the packet does not have a tunnel.
6145          */
6146         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_NO_ERROR \
6147                 (UINT32_C(0x0) << 12)
6148         /*
6149          * Indicates that IP header version does not match
6150          * expectation from L2 Ethertype for IPv4 and IPv6 or that
6151          * option other than VFT was parsed on
6152          * FCoE packet.
6153          */
6154         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_VERSION \
6155                 (UINT32_C(0x1) << 12)
6156         /*
6157          * indicates that header length is out of range. Valid for
6158          * IPv4 and RoCE
6159          */
6160         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
6161                 (UINT32_C(0x2) << 12)
6162         /*
6163          * indicates that the IPv4 TTL or IPv6 hop limit check
6164          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
6165          */
6166         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_TTL \
6167                 (UINT32_C(0x3) << 12)
6168         /*
6169          * Indicates that physical packet is shorter than that
6170          * claimed by the l3 header length. Valid for IPv4,
6171          * IPv6 packet or RoCE packets.
6172          */
6173         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
6174                 (UINT32_C(0x4) << 12)
6175         /*
6176          * Indicates that the physical packet is shorter than that
6177          * claimed by the UDP header length for a UDP packet that is
6178          * not fragmented.
6179          */
6180         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
6181                 (UINT32_C(0x5) << 12)
6182         /*
6183          * Indicates that TCP header length > IP payload. Valid for
6184          * TCP packets only.
6185          */
6186         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
6187                 (UINT32_C(0x6) << 12)
6188         /* Indicates that TCP header length < 5. Valid for TCP. */
6189         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
6190                 (UINT32_C(0x7) << 12)
6191         /*
6192          * Indicates that TCP option headers result in a TCP header
6193          * size that does not match data offset in TCP header. Valid
6194          * for TCP.
6195          */
6196         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
6197                 (UINT32_C(0x8) << 12)
6198         /*
6199          * Indicates that the IP checksum failed its check in the
6200          * inner header.
6201          */
6202         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_IP_CS_ERROR \
6203                 (UINT32_C(0x9) << 12)
6204         /*
6205          * Indicates that the L4 checksum failed its check in the
6206          * inner header.
6207          */
6208         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR \
6209                 (UINT32_C(0xa) << 12)
6210         #define RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_LAST \
6211                 RX_PKT_V3_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR
6212         /*
6213          * This is data from the CFA block as indicated by the meta_format
6214          * field.
6215          */
6216         uint16_t        metadata0;
6217         /* When meta_format=1, this value is the VLAN VID. */
6218         #define RX_PKT_V3_CMPL_HI_METADATA0_VID_MASK UINT32_C(0xfff)
6219         #define RX_PKT_V3_CMPL_HI_METADATA0_VID_SFT 0
6220         /* When meta_format=1, this value is the VLAN DE. */
6221         #define RX_PKT_V3_CMPL_HI_METADATA0_DE      UINT32_C(0x1000)
6222         /* When meta_format=1, this value is the VLAN PRI. */
6223         #define RX_PKT_V3_CMPL_HI_METADATA0_PRI_MASK UINT32_C(0xe000)
6224         #define RX_PKT_V3_CMPL_HI_METADATA0_PRI_SFT 13
6225         /*
6226          * The timestamp field contains the 32b timestamp for the packet from
6227          * the MAC.
6228          *
6229          * When hairpin_en is set in VNIC context, this is the upper 32b of the
6230          * host address from the first BD used to place the packet.
6231          */
6232         uint32_t        timestamp;
6233 } __rte_packed;
6234
6235 /* rx_pkt_compress_cmpl (size:128b/16B) */
6236 struct rx_pkt_compress_cmpl {
6237         uint16_t        flags_type;
6238         /*
6239          * This field indicates the exact type of the completion.
6240          * By convention, the LSB identifies the length of the
6241          * record in 16B units. Even values indicate 16B
6242          * records. Odd values indicate 32B
6243          * records.
6244          */
6245         #define RX_PKT_COMPRESS_CMPL_TYPE_MASK                   UINT32_C(0x3f)
6246         #define RX_PKT_COMPRESS_CMPL_TYPE_SFT                    0
6247         /*
6248          * RX L2 completion:
6249          * This is the compressed version of Rx Completion for performance
6250          * applications. Length = 16B
6251          * This version of the completion record is used in Thor2 and later
6252          * chips.
6253          */
6254         #define RX_PKT_COMPRESS_CMPL_TYPE_RX_L2_COMPRESS \
6255                 UINT32_C(0x10)
6256         #define RX_PKT_COMPRESS_CMPL_TYPE_LAST \
6257                 RX_PKT_COMPRESS_CMPL_TYPE_RX_L2_COMPRESS
6258         #define RX_PKT_COMPRESS_CMPL_FLAGS_MASK \
6259                 UINT32_C(0xffc0)
6260         #define RX_PKT_COMPRESS_CMPL_FLAGS_SFT                   6
6261         /*
6262          * When this bit is '1', it indicates a packet that has an
6263          * error of some type. Type of error is indicated in
6264          * error_flags.
6265          */
6266         #define RX_PKT_COMPRESS_CMPL_FLAGS_ERROR \
6267                 UINT32_C(0x40)
6268         /*
6269          * This field indicates the status of IP and L4 CS calculations done
6270          * by the chip. The format of this field is indicated by the
6271          * cs_all_ok_mode bit.
6272          */
6273         #define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE \
6274                 UINT32_C(0x100)
6275         /* Indicates that the Tunnel IP type was IPv4 */
6276         #define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_IPV4 \
6277                 (UINT32_C(0x0) << 8)
6278         /* Indicates that the Tunnel IP type was IPv6 */
6279         #define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_IPV6 \
6280                 (UINT32_C(0x1) << 8)
6281         #define RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_LAST \
6282                 RX_PKT_COMPRESS_CMPL_FLAGS_T_IP_TYPE_IPV6
6283         /*
6284          * This field indicates the IP type for the inner-most IP header.
6285          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
6286          * This value is only valid if itype indicates a packet
6287          * with an IP header.
6288          */
6289         #define RX_PKT_COMPRESS_CMPL_FLAGS_IP_TYPE \
6290                 UINT32_C(0x200)
6291         /* This bit is '1' if the RSS field in this completion is valid. */
6292         #define RX_PKT_COMPRESS_CMPL_FLAGS_RSS_VALID \
6293                 UINT32_C(0x400)
6294         /*
6295          * This value indicates what the inner packet determined for the
6296          * packet was.
6297          */
6298         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_MASK \
6299                 UINT32_C(0xf000)
6300         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_SFT              12
6301         /*
6302          * Not Known:
6303          * Indicates that the packet type was not known.
6304          */
6305         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_NOT_KNOWN \
6306                 (UINT32_C(0x0) << 12)
6307         /*
6308          * IP Packet:
6309          * Indicates that the packet was an IP packet, but further
6310          * classification was not possible.
6311          */
6312         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_IP \
6313                 (UINT32_C(0x1) << 12)
6314         /*
6315          * TCP Packet:
6316          * Indicates that the packet was IP and TCP.
6317          * This indicates that the payload_offset field is valid.
6318          */
6319         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_TCP \
6320                 (UINT32_C(0x2) << 12)
6321         /*
6322          * UDP Packet:
6323          * Indicates that the packet was IP and UDP.
6324          * This indicates that the payload_offset field is valid.
6325          */
6326         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_UDP \
6327                 (UINT32_C(0x3) << 12)
6328         /*
6329          * FCoE Packet:
6330          * Indicates that the packet was recognized as a FCoE.
6331          * This also indicates that the payload_offset field is valid.
6332          */
6333         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_FCOE \
6334                 (UINT32_C(0x4) << 12)
6335         /*
6336          * RoCE Packet:
6337          * Indicates that the packet was recognized as a RoCE.
6338          * This also indicates that the payload_offset field is valid.
6339          */
6340         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_ROCE \
6341                 (UINT32_C(0x5) << 12)
6342         /*
6343          * ICMP Packet:
6344          * Indicates that the packet was recognized as ICMP.
6345          * This indicates that the payload_offset field is valid.
6346          */
6347         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_ICMP \
6348                 (UINT32_C(0x7) << 12)
6349         /*
6350          * PTP packet wo/timestamp:
6351          * Indicates that the packet was recognized as a PTP
6352          * packet.
6353          */
6354         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
6355                 (UINT32_C(0x8) << 12)
6356         /*
6357          * PTP packet w/timestamp:
6358          * Indicates that the packet was recognized as a PTP
6359          * packet and that a timestamp was taken for the packet.
6360          * The 4b sub-nanosecond portion of the timestamp is in
6361          * the payload_offset field.
6362          */
6363         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
6364                 (UINT32_C(0x9) << 12)
6365         #define RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_LAST \
6366                 RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
6367         /*
6368          * This is the length of the data for the packet stored in the
6369          * buffer(s) identified by the opaque value. This includes
6370          * the packet BD and any associated buffer BDs. This does not include
6371          * the length of any data places in aggregation BDs.
6372          */
6373         uint16_t        len;
6374         /*
6375          * This value is the RSS hash value calculated for the packet
6376          * based on the mode bits and key value in the VNIC. When hairpin_en
6377          * is set in VNIC context, this is the lower 32b of the host address
6378          * from the first BD used to place the packet.
6379          */
6380         uint32_t        rss_hash;
6381         uint16_t        metadata1_cs_error_calc_v1;
6382         /*
6383          * This value is written by the NIC such that it will be different
6384          * for each pass through the completion queue. The even passes
6385          * will write 1. The odd passes will write 0.
6386          */
6387         #define RX_PKT_COMPRESS_CMPL_V1 \
6388                 UINT32_C(0x1)
6389         /* unused is 3 b */
6390         #define RX_PKT_COMPRESS_CMPL_UNUSED_MASK \
6391                 UINT32_C(0xe)
6392         #define RX_PKT_COMPRESS_CMPL_UNUSED_SFT                      1
6393         #define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_MASK \
6394                 UINT32_C(0xff0)
6395         #define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_SFT               4
6396         /* This indicates that there was an error in the IP header checksum. */
6397         #define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_IP_CS_ERROR \
6398                 UINT32_C(0x10)
6399         /*
6400          * This indicates that there was an error in the TCP, UDP or ICMP
6401          * checksum.
6402          */
6403         #define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_L4_CS_ERROR \
6404                 UINT32_C(0x20)
6405         /*
6406          * This indicates that there was an error in the tunnel IP header
6407          * checksum.
6408          */
6409         #define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_IP_CS_ERROR \
6410                 UINT32_C(0x40)
6411         /* This indicates that there was an error in the tunnel UDP checksum. */
6412         #define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_L4_CS_ERROR \
6413                 UINT32_C(0x80)
6414         /*
6415          * This indicates that the ip checksum was calculated for the inner
6416          * packet and that the ip_cs_error field indicates if there was an
6417          * error.
6418          */
6419         #define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_IP_CS_CALC \
6420                 UINT32_C(0x100)
6421         /*
6422          * This indicates that the TCP, UDP or ICMP checksum was calculated
6423          * for the inner packet and that the l4_cs_error field indicates if
6424          * there was an error.
6425          */
6426         #define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_L4_CS_CALC \
6427                 UINT32_C(0x200)
6428         /*
6429          * This indicates that the ip checksum was calculated for the tunnel
6430          * header and that the t_ip_cs_error field indicates if there was an
6431          * error.
6432          */
6433         #define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_IP_CS_CALC \
6434                 UINT32_C(0x400)
6435         /*
6436          * This indicates that the UDP checksum was calculated for the tunnel
6437          * packet and that the t_l4_cs_error field indicates if there was an
6438          * error.
6439          */
6440         #define RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_T_L4_CS_CALC \
6441                 UINT32_C(0x800)
6442         /* This is data from the CFA as indicated by the meta_format field. */
6443         #define RX_PKT_COMPRESS_CMPL_METADATA1_MASK \
6444                 UINT32_C(0xf000)
6445         #define RX_PKT_COMPRESS_CMPL_METADATA1_SFT                   12
6446         /* When meta_format != 0, this value is the VLAN TPID_SEL. */
6447         #define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_MASK \
6448                 UINT32_C(0x7000)
6449         #define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_SFT           12
6450         /* 0x88a8 */
6451         #define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID88A8 \
6452                 (UINT32_C(0x0) << 12)
6453         /* 0x8100 */
6454         #define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID8100 \
6455                 (UINT32_C(0x1) << 12)
6456         /* 0x9100 */
6457         #define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID9100 \
6458                 (UINT32_C(0x2) << 12)
6459         /* 0x9200 */
6460         #define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID9200 \
6461                 (UINT32_C(0x3) << 12)
6462         /* 0x9300 */
6463         #define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPID9300 \
6464                 (UINT32_C(0x4) << 12)
6465         /* Value programmed in CFA VLANTPID register. */
6466         #define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPIDCFG \
6467                 (UINT32_C(0x5) << 12)
6468         #define RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_LAST \
6469                 RX_PKT_COMPRESS_CMPL_METADATA1_TPID_SEL_TPIDCFG
6470         /* When meta_format != 0, this value is the VLAN valid. */
6471         #define RX_PKT_COMPRESS_CMPL_METADATA1_VALID \
6472                 UINT32_C(0x8000)
6473         /* This is data from the CFA as indicated by the meta_format field. */
6474         uint16_t        vlanc_tcid;
6475         /* When meta_format!=0, this value is the VLAN VID. */
6476         #define RX_PKT_COMPRESS_CMPL_VLANC_TCID_VID_MASK UINT32_C(0xfff)
6477         #define RX_PKT_COMPRESS_CMPL_VLANC_TCID_VID_SFT 0
6478         /* When meta_format!=0, this value is the VLAN DE. */
6479         #define RX_PKT_COMPRESS_CMPL_VLANC_TCID_DE      UINT32_C(0x1000)
6480         /* When meta_format!=0, this value is the VLAN PRI. */
6481         #define RX_PKT_COMPRESS_CMPL_VLANC_TCID_PRI_MASK UINT32_C(0xe000)
6482         #define RX_PKT_COMPRESS_CMPL_VLANC_TCID_PRI_SFT 13
6483         uint32_t        errors_agg_bufs_opaque;
6484         /* Lower 16bits of the Opaque field provided in the Rx BD. */
6485         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_OPAQUE_MASK \
6486                 UINT32_C(0xffff)
6487         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_OPAQUE_SFT \
6488                 0
6489         /*
6490          * This value is the number of aggregation buffers that follow this
6491          * entry in the completion ring that are a part of this packet.
6492          * If the value is zero, then the packet is completely contained
6493          * in the buffer space provided for the packet in the RX ring.
6494          */
6495         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_AGG_BUFS_MASK \
6496                 UINT32_C(0x1f0000)
6497         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_AGG_BUFS_SFT \
6498                 16
6499         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_MASK \
6500                 UINT32_C(0x1fe00000)
6501         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_SFT \
6502                 21
6503         /*
6504          * This indicates that there was an error in the inner
6505          * portion of the packet when this
6506          * field is non-zero.
6507          */
6508         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_MASK \
6509                 UINT32_C(0x1e00000)
6510         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_SFT \
6511                 21
6512         /*
6513          * No additional error occurred on the tunnel portion
6514          * or the packet of the packet does not have a tunnel.
6515          */
6516         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_NO_ERROR \
6517                 (UINT32_C(0x0) << 21)
6518         /*
6519          * Indicates that IP header version does not match
6520          * expectation from L2 Ethertype for IPv4 and IPv6 or that
6521          * option other than VFT was parsed on
6522          * FCoE packet.
6523          */
6524         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L3_BAD_VERSION \
6525                 (UINT32_C(0x1) << 21)
6526         /*
6527          * indicates that header length is out of range. Valid for
6528          * IPv4 and RoCE
6529          */
6530         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
6531                 (UINT32_C(0x2) << 21)
6532         /*
6533          * indicates that the IPv4 TTL or IPv6 hop limit check
6534          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
6535          */
6536         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L3_BAD_TTL \
6537                 (UINT32_C(0x3) << 21)
6538         /*
6539          * Indicates that physical packet is shorter than that
6540          * claimed by the l3 header length. Valid for IPv4,
6541          * IPv6 packet or RoCE packets.
6542          */
6543         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
6544                 (UINT32_C(0x4) << 21)
6545         /*
6546          * Indicates that the physical packet is shorter than that
6547          * claimed by the UDP header length for a UDP packet that is
6548          * not fragmented.
6549          */
6550         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
6551                 (UINT32_C(0x5) << 21)
6552         /*
6553          * Indicates that TCP header length > IP payload. Valid for
6554          * TCP packets only.
6555          */
6556         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
6557                 (UINT32_C(0x6) << 21)
6558         /* Indicates that TCP header length < 5. Valid for TCP. */
6559         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
6560                 (UINT32_C(0x7) << 21)
6561         /*
6562          * Indicates that TCP option headers result in a TCP header
6563          * size that does not match data offset in TCP header. Valid
6564          * for TCP.
6565          */
6566         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
6567                 (UINT32_C(0x8) << 21)
6568         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_LAST \
6569                 RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
6570         /*
6571          * This indicates that there was an error in the tunnel portion
6572          * of the packet when this field is non-zero.
6573          */
6574         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_MASK \
6575                 UINT32_C(0xe000000)
6576         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_SFT \
6577                 25
6578         /*
6579          * No additional error occurred on the tunnel portion
6580          * of the packet or the packet does not have a tunnel.
6581          */
6582         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_NO_ERROR \
6583                 (UINT32_C(0x0) << 25)
6584         /*
6585          * Indicates that IP header version does not match expectation
6586          * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
6587          */
6588         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
6589                 (UINT32_C(0x1) << 25)
6590         /*
6591          * Indicates that header length is out of range in the tunnel
6592          * header. Valid for IPv4.
6593          */
6594         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
6595                 (UINT32_C(0x2) << 25)
6596         /*
6597          * Indicates that physical packet is shorter than that claimed
6598          * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
6599          * packet packets.
6600          */
6601         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
6602                 (UINT32_C(0x3) << 25)
6603         /*
6604          * Indicates that the physical packet is shorter than that claimed
6605          * by the tunnel UDP header length for a tunnel UDP packet that is
6606          * not fragmented.
6607          */
6608         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
6609                 (UINT32_C(0x4) << 25)
6610         /*
6611          * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
6612          * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
6613          */
6614         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
6615                 (UINT32_C(0x5) << 25)
6616         /*
6617          * Indicates that the IP checksum failed its check in the tunnel
6618          * header.
6619          */
6620         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR \
6621                 (UINT32_C(0x6) << 25)
6622         /*
6623          * Indicates that the L4 checksum failed its check in the tunnel
6624          * header.
6625          */
6626         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR \
6627                 (UINT32_C(0x7) << 25)
6628         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_LAST \
6629                 RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR
6630         /*
6631          * This indicates that there was a CRC error on either an FCoE
6632          * or RoCE packet. The itype indicates the packet type.
6633          */
6634         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_ERRORS_CRC_ERROR \
6635                 UINT32_C(0x10000000)
6636         /* unused1 is 3 b */
6637         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_UNUSED1_MASK \
6638                 UINT32_C(0xe0000000)
6639         #define RX_PKT_COMPRESS_CMPL_ERRORS_AGG_BUFS_OPAQUE_UNUSED1_SFT \
6640                 29
6641 } __rte_packed;
6642
6643 /*
6644  * This TPA completion structure is used on devices where the
6645  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
6646  */
6647 /* rx_tpa_start_cmpl (size:128b/16B) */
6648 struct rx_tpa_start_cmpl {
6649         uint16_t        flags_type;
6650         /*
6651          * This field indicates the exact type of the completion.
6652          * By convention, the LSB identifies the length of the
6653          * record in 16B units. Even values indicate 16B
6654          * records. Odd values indicate 32B
6655          * records.
6656          */
6657         #define RX_TPA_START_CMPL_TYPE_MASK                UINT32_C(0x3f)
6658         #define RX_TPA_START_CMPL_TYPE_SFT                 0
6659         /*
6660          * RX L2 TPA Start Completion:
6661          * Completion at the beginning of a TPA operation.
6662          * Length = 32B
6663          */
6664         #define RX_TPA_START_CMPL_TYPE_RX_TPA_START          UINT32_C(0x13)
6665         #define RX_TPA_START_CMPL_TYPE_LAST \
6666                 RX_TPA_START_CMPL_TYPE_RX_TPA_START
6667         #define RX_TPA_START_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
6668         #define RX_TPA_START_CMPL_FLAGS_SFT                6
6669         /* This bit will always be '0' for TPA start completions. */
6670         #define RX_TPA_START_CMPL_FLAGS_ERROR               UINT32_C(0x40)
6671         /* This field indicates how the packet was placed in the buffer. */
6672         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
6673         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT       7
6674         /*
6675          * Jumbo:
6676          * TPA Packet was placed using jumbo algorithm. This means
6677          * that the first buffer will be filled with data before
6678          * moving to aggregation buffers. Each aggregation buffer
6679          * will be filled before moving to the next aggregation
6680          * buffer.
6681          */
6682         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO \
6683                 (UINT32_C(0x1) << 7)
6684         /*
6685          * Header/Data Separation:
6686          * Packet was placed using Header/Data separation algorithm.
6687          * The separation location is indicated by the itype field.
6688          */
6689         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS \
6690                 (UINT32_C(0x2) << 7)
6691         /*
6692          * GRO/Jumbo:
6693          * Packet will be placed using GRO/Jumbo where the first
6694          * packet is filled with data. Subsequent packets will be
6695          * placed such that any one packet does not span two
6696          * aggregation buffers unless it starts at the beginning of
6697          * an aggregation buffer.
6698          */
6699         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
6700                 (UINT32_C(0x5) << 7)
6701         /*
6702          * GRO/Header-Data Separation:
6703          * Packet will be placed using GRO/HDS where the header
6704          * is in the first packet.
6705          * Payload of each packet will be
6706          * placed such that any one packet does not span two
6707          * aggregation buffers unless it starts at the beginning of
6708          * an aggregation buffer.
6709          */
6710         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \
6711                 (UINT32_C(0x6) << 7)
6712         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \
6713                 RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
6714         /* This bit is '1' if the RSS field in this completion is valid. */
6715         #define RX_TPA_START_CMPL_FLAGS_RSS_VALID           UINT32_C(0x400)
6716         /* unused is 1 b */
6717         #define RX_TPA_START_CMPL_FLAGS_UNUSED              UINT32_C(0x800)
6718         /*
6719          * This value indicates what the inner packet determined for the
6720          * packet was.
6721          */
6722         #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
6723         #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT           12
6724         /*
6725          * TCP Packet:
6726          * Indicates that the packet was IP and TCP.
6727          */
6728         #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP \
6729                 (UINT32_C(0x2) << 12)
6730         #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \
6731                 RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
6732         /*
6733          * This value indicates the amount of packet data written to the
6734          * buffer the opaque field in this completion corresponds to.
6735          */
6736         uint16_t        len;
6737         /*
6738          * This is a copy of the opaque field from the RX BD this completion
6739          * corresponds to.
6740          */
6741         uint32_t        opaque;
6742         /*
6743          * This value is written by the NIC such that it will be different
6744          * for each pass through the completion queue. The even passes
6745          * will write 1. The odd passes will write 0.
6746          */
6747         uint8_t v1;
6748         /*
6749          * This value is written by the NIC such that it will be different
6750          * for each pass through the completion queue. The even passes
6751          * will write 1. The odd passes will write 0.
6752          */
6753         #define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
6754         #define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1
6755         /*
6756          * This is the RSS hash type for the packet. The value is packed
6757          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
6758          *
6759          * The value of tuple_extrac_op provides the information about
6760          * what fields the hash was computed on.
6761          * * 0: The RSS hash was computed over source IP address,
6762          * destination IP address, source port, and destination port of inner
6763          * IP and TCP or UDP headers. Note: For non-tunneled packets,
6764          * the packet headers are considered inner packet headers for the RSS
6765          * hash computation purpose.
6766          * * 1: The RSS hash was computed over source IP address and destination
6767          * IP address of inner IP header. Note: For non-tunneled packets,
6768          * the packet headers are considered inner packet headers for the RSS
6769          * hash computation purpose.
6770          * * 2: The RSS hash was computed over source IP address,
6771          * destination IP address, source port, and destination port of
6772          * IP and TCP or UDP headers of outer tunnel headers.
6773          * Note: For non-tunneled packets, this value is not applicable.
6774          * * 3: The RSS hash was computed over source IP address and
6775          * destination IP address of IP header of outer tunnel headers.
6776          * Note: For non-tunneled packets, this value is not applicable.
6777          *
6778          * Note that 4-tuples values listed above are applicable
6779          * for layer 4 protocols supported and enabled for RSS in the hardware,
6780          * HWRM firmware, and drivers. For example, if RSS hash is supported and
6781          * enabled for TCP traffic only, then the values of tuple_extract_op
6782          * corresponding to 4-tuples are only valid for TCP traffic.
6783          */
6784         uint8_t rss_hash_type;
6785         /*
6786          * This is the aggregation ID that the completion is associated
6787          * with. Use this number to correlate the TPA start completion
6788          * with the TPA end completion.
6789          */
6790         uint16_t        agg_id;
6791         /* unused2 is 9 b */
6792         #define RX_TPA_START_CMPL_UNUSED2_MASK UINT32_C(0x1ff)
6793         #define RX_TPA_START_CMPL_UNUSED2_SFT 0
6794         /*
6795          * This is the aggregation ID that the completion is associated
6796          * with. Use this number to correlate the TPA start completion
6797          * with the TPA end completion.
6798          */
6799         #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
6800         #define RX_TPA_START_CMPL_AGG_ID_SFT  9
6801         /*
6802          * This value is the RSS hash value calculated for the packet
6803          * based on the mode bits and key value in the VNIC.
6804          */
6805         uint32_t        rss_hash;
6806 } __rte_packed;
6807
6808 /*
6809  * Last 16 bytes of rx_tpa_start_cmpl.
6810  *
6811  * This TPA completion structure is used on devices where the
6812  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
6813  */
6814 /* rx_tpa_start_cmpl_hi (size:128b/16B) */
6815 struct rx_tpa_start_cmpl_hi {
6816         uint32_t        flags2;
6817         /*
6818          * This indicates that the ip checksum was calculated for the
6819          * inner packet and that the sum passed for all segments
6820          * included in the aggregation.
6821          */
6822         #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC       UINT32_C(0x1)
6823         /*
6824          * This indicates that the TCP, UDP or ICMP checksum was
6825          * calculated for the inner packet and that the sum passed
6826          * for all segments included in the aggregation.
6827          */
6828         #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC       UINT32_C(0x2)
6829         /*
6830          * This indicates that the ip checksum was calculated for the
6831          * tunnel header and that the sum passed for all segments
6832          * included in the aggregation.
6833          */
6834         #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC     UINT32_C(0x4)
6835         /*
6836          * This indicates that the UDP checksum was
6837          * calculated for the tunnel packet and that the sum passed for
6838          * all segments included in the aggregation.
6839          */
6840         #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC     UINT32_C(0x8)
6841         /* This value indicates what format the metadata field is. */
6842         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
6843         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT  4
6844         /* No metadata information. Value is zero. */
6845         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE \
6846                 (UINT32_C(0x0) << 4)
6847         /*
6848          * The metadata field contains the VLAN tag and TPID value.
6849          * - metadata[11:0] contains the vlan VID value.
6850          * - metadata[12] contains the vlan DE value.
6851          * - metadata[15:13] contains the vlan PRI value.
6852          * - metadata[31:16] contains the vlan TPID value.
6853          */
6854         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN \
6855                 (UINT32_C(0x1) << 4)
6856         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST \
6857                 RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
6858         /*
6859          * This field indicates the IP type for the inner-most IP header.
6860          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
6861          */
6862         #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE          UINT32_C(0x100)
6863         /*
6864          * This is data from the CFA block as indicated by the meta_format
6865          * field.
6866          */
6867         uint32_t        metadata;
6868         /* When meta_format=1, this value is the VLAN VID. */
6869         #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
6870         #define RX_TPA_START_CMPL_METADATA_VID_SFT  0
6871         /* When meta_format=1, this value is the VLAN DE. */
6872         #define RX_TPA_START_CMPL_METADATA_DE       UINT32_C(0x1000)
6873         /* When meta_format=1, this value is the VLAN PRI. */
6874         #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
6875         #define RX_TPA_START_CMPL_METADATA_PRI_SFT  13
6876         /* When meta_format=1, this value is the VLAN TPID. */
6877         #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
6878         #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
6879         uint16_t        v2;
6880         /*
6881          * This value is written by the NIC such that it will be different
6882          * for each pass through the completion queue. The even passes
6883          * will write 1. The odd passes will write 0.
6884          */
6885         #define RX_TPA_START_CMPL_V2     UINT32_C(0x1)
6886         /*
6887          * This field identifies the CFA action rule that was used for this
6888          * packet.
6889          */
6890         uint16_t        cfa_code;
6891         /*
6892          * This is the size in bytes of the inner most L4 header.
6893          * This can be subtracted from the payload_offset to determine
6894          * the start of the inner most L4 header.
6895          */
6896         uint32_t        inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
6897         /*
6898          * This is the offset from the beginning of the packet in bytes for
6899          * the outer L3 header. If there is no outer L3 header, then this
6900          * value is zero.
6901          */
6902         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
6903         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
6904         /*
6905          * This is the offset from the beginning of the packet in bytes for
6906          * the inner most L2 header.
6907          */
6908         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
6909         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
6910         /*
6911          * This is the offset from the beginning of the packet in bytes for
6912          * the inner most L3 header.
6913          */
6914         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
6915         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
6916         /*
6917          * This is the size in bytes of the inner most L4 header.
6918          * This can be subtracted from the payload_offset to determine
6919          * the start of the inner most L4 header.
6920          */
6921         #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
6922         #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT   27
6923 } __rte_packed;
6924
6925 /*
6926  * This TPA completion structure is used on devices where the
6927  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
6928  * RX L2 TPA Start V2 Completion Record (32 bytes split to 2 16-byte
6929  * struct)
6930  */
6931 /* rx_tpa_start_v2_cmpl (size:128b/16B) */
6932 struct rx_tpa_start_v2_cmpl {
6933         uint16_t        flags_type;
6934         /*
6935          * This field indicates the exact type of the completion.
6936          * By convention, the LSB identifies the length of the
6937          * record in 16B units. Even values indicate 16B
6938          * records. Odd values indicate 32B
6939          * records.
6940          */
6941         #define RX_TPA_START_V2_CMPL_TYPE_MASK \
6942                 UINT32_C(0x3f)
6943         #define RX_TPA_START_V2_CMPL_TYPE_SFT                       0
6944         /*
6945          * RX L2 TPA Start V2 Completion:
6946          * Completion at the beginning of a TPA operation.
6947          * Length = 32B
6948          * This is the new version of the RX_TPA_START completion used
6949          * in SR2 and later chips.
6950          */
6951         #define RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2 \
6952                 UINT32_C(0xd)
6953         #define RX_TPA_START_V2_CMPL_TYPE_LAST \
6954                 RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2
6955         #define RX_TPA_START_V2_CMPL_FLAGS_MASK \
6956                 UINT32_C(0xffc0)
6957         #define RX_TPA_START_V2_CMPL_FLAGS_SFT                      6
6958         /*
6959          * When this bit is '1', it indicates a packet that has an error
6960          * of some type. Type of error is indicated in error_flags.
6961          */
6962         #define RX_TPA_START_V2_CMPL_FLAGS_ERROR \
6963                 UINT32_C(0x40)
6964         /* This field indicates how the packet was placed in the buffer. */
6965         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_MASK \
6966                 UINT32_C(0x380)
6967         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_SFT             7
6968         /*
6969          * Jumbo:
6970          * TPA Packet was placed using jumbo algorithm. This means
6971          * that the first buffer will be filled with data before
6972          * moving to aggregation buffers. Each aggregation buffer
6973          * will be filled before moving to the next aggregation
6974          * buffer.
6975          */
6976         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_JUMBO \
6977                 (UINT32_C(0x1) << 7)
6978         /*
6979          * Header/Data Separation:
6980          * Packet was placed using Header/Data separation algorithm.
6981          * The separation location is indicated by the itype field.
6982          */
6983         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_HDS \
6984                 (UINT32_C(0x2) << 7)
6985         /*
6986          * IOC/Jumbo:
6987          * Packet will be placed using In-Order Completion/Jumbo where
6988          * the first packet of the aggregation is placed using Jumbo
6989          * Placement. Subsequent packets will be placed such that each
6990          * packet starts at the beginning of an aggregation buffer.
6991          */
6992         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_JUMBO \
6993                 (UINT32_C(0x4) << 7)
6994         /*
6995          * GRO/Jumbo:
6996          * Packet will be placed using GRO/Jumbo where the first
6997          * packet is filled with data. Subsequent packets will be
6998          * placed such that any one packet does not span two
6999          * aggregation buffers unless it starts at the beginning of
7000          * an aggregation buffer.
7001          */
7002         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
7003                 (UINT32_C(0x5) << 7)
7004         /*
7005          * GRO/Header-Data Separation:
7006          * Packet will be placed using GRO/HDS where the header
7007          * is in the first packet.
7008          * Payload of each packet will be
7009          * placed such that any one packet does not span two
7010          * aggregation buffers unless it starts at the beginning of
7011          * an aggregation buffer.
7012          */
7013         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_HDS \
7014                 (UINT32_C(0x6) << 7)
7015         /*
7016          * IOC/Header-Data Separation:
7017          * Packet will be placed using In-Order Completion/HDS where
7018          * the header is in the first packet buffer. Payload of each
7019          * packet will be placed such that each packet starts at the
7020          * beginning of an aggregation buffer.
7021          */
7022         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS \
7023                 (UINT32_C(0x7) << 7)
7024         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_LAST \
7025                 RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS
7026         /* This bit is '1' if the RSS field in this completion is valid. */
7027         #define RX_TPA_START_V2_CMPL_FLAGS_RSS_VALID \
7028                 UINT32_C(0x400)
7029         /*
7030          * This bit is '1' if metadata has been added to the end of the
7031          * packet in host memory. Metadata starts at the first 32B boundary
7032          * after the end of the packet for regular and jumbo placement. It
7033          * starts at the first 32B boundary after the end of the header for
7034          * HDS placement. The length of the metadata is indicated in the
7035          * metadata itself.
7036          */
7037         #define RX_TPA_START_V2_CMPL_FLAGS_PKT_METADATA_PRESENT \
7038                 UINT32_C(0x800)
7039         /*
7040          * This value indicates what the inner packet determined for the
7041          * packet was.
7042          */
7043         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_MASK \
7044                 UINT32_C(0xf000)
7045         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_SFT                 12
7046         /*
7047          * TCP Packet:
7048          * Indicates that the packet was IP and TCP.
7049          */
7050         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP \
7051                 (UINT32_C(0x2) << 12)
7052         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_LAST \
7053                 RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP
7054         /*
7055          * This value indicates the amount of packet data written to the
7056          * buffer the opaque field in this completion corresponds to.
7057          */
7058         uint16_t        len;
7059         /*
7060          * This is a copy of the opaque field from the RX BD this completion
7061          * corresponds to. If the VNIC is configured to not use an Rx BD for
7062          * the TPA Start completion, then this is a copy of the opaque field
7063          * from the first BD used to place the TPA Start packet.
7064          */
7065         uint32_t        opaque;
7066         /*
7067          * This value is written by the NIC such that it will be different
7068          * for each pass through the completion queue. The even passes
7069          * will write 1. The odd passes will write 0.
7070          */
7071         uint8_t v1;
7072         /*
7073          * This value is written by the NIC such that it will be different
7074          * for each pass through the completion queue. The even passes
7075          * will write 1. The odd passes will write 0.
7076          */
7077         #define RX_TPA_START_V2_CMPL_V1 UINT32_C(0x1)
7078         #define RX_TPA_START_V2_CMPL_LAST RX_TPA_START_V2_CMPL_V1
7079         /*
7080          * This is the RSS hash type for the packet. The value is packed
7081          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
7082          *
7083          * The value of tuple_extrac_op provides the information about
7084          * what fields the hash was computed on.
7085          * * 0: The RSS hash was computed over source IP address,
7086          * destination IP address, source port, and destination port of inner
7087          * IP and TCP or UDP headers. Note: For non-tunneled packets,
7088          * the packet headers are considered inner packet headers for the RSS
7089          * hash computation purpose.
7090          * * 1: The RSS hash was computed over source IP address and destination
7091          * IP address of inner IP header. Note: For non-tunneled packets,
7092          * the packet headers are considered inner packet headers for the RSS
7093          * hash computation purpose.
7094          * * 2: The RSS hash was computed over source IP address,
7095          * destination IP address, source port, and destination port of
7096          * IP and TCP or UDP headers of outer tunnel headers.
7097          * Note: For non-tunneled packets, this value is not applicable.
7098          * * 3: The RSS hash was computed over source IP address and
7099          * destination IP address of IP header of outer tunnel headers.
7100          * Note: For non-tunneled packets, this value is not applicable.
7101          *
7102          * Note that 4-tuples values listed above are applicable
7103          * for layer 4 protocols supported and enabled for RSS in the hardware,
7104          * HWRM firmware, and drivers. For example, if RSS hash is supported and
7105          * enabled for TCP traffic only, then the values of tuple_extract_op
7106          * corresponding to 4-tuples are only valid for TCP traffic.
7107          */
7108         uint8_t rss_hash_type;
7109         /*
7110          * This is the aggregation ID that the completion is associated
7111          * with. Use this number to correlate the TPA start completion
7112          * with the TPA end completion.
7113          */
7114         uint16_t        agg_id;
7115         /*
7116          * This is the aggregation ID that the completion is associated
7117          * with. Use this number to correlate the TPA start completion
7118          * with the TPA end completion.
7119          */
7120         #define RX_TPA_START_V2_CMPL_AGG_ID_MASK                UINT32_C(0xfff)
7121         #define RX_TPA_START_V2_CMPL_AGG_ID_SFT                 0
7122         #define RX_TPA_START_V2_CMPL_METADATA1_MASK \
7123                 UINT32_C(0xf000)
7124         #define RX_TPA_START_V2_CMPL_METADATA1_SFT              12
7125         /* When meta_format != 0, this value is the VLAN TPID_SEL. */
7126         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_MASK \
7127                 UINT32_C(0x7000)
7128         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_SFT      12
7129         /* 0x88a8 */
7130         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID88A8 \
7131                 (UINT32_C(0x0) << 12)
7132         /* 0x8100 */
7133         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID8100 \
7134                 (UINT32_C(0x1) << 12)
7135         /* 0x9100 */
7136         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9100 \
7137                 (UINT32_C(0x2) << 12)
7138         /* 0x9200 */
7139         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9200 \
7140                 (UINT32_C(0x3) << 12)
7141         /* 0x9300 */
7142         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9300 \
7143                 (UINT32_C(0x4) << 12)
7144         /* Value programmed in CFA VLANTPID register. */
7145         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG \
7146                 (UINT32_C(0x5) << 12)
7147         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_LAST \
7148                 RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
7149         /* When meta_format != 0, this value is the VLAN valid. */
7150         #define RX_TPA_START_V2_CMPL_METADATA1_VALID \
7151                 UINT32_C(0x8000)
7152         /*
7153          * This value is the RSS hash value calculated for the packet
7154          * based on the mode bits and key value in the VNIC.
7155          * When vee_cmpl_mode is set in VNIC context, this is the lower
7156          * 32b of the host address from the first BD used to place the packet.
7157          */
7158         uint32_t        rss_hash;
7159 } __rte_packed;
7160
7161 /*
7162  * Last 16 bytes of RX L2 TPA Start V2 Completion Record
7163  *
7164  * This TPA completion structure is used on devices where the
7165  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7166  */
7167 /* rx_tpa_start_v2_cmpl_hi (size:128b/16B) */
7168 struct rx_tpa_start_v2_cmpl_hi {
7169         uint32_t        flags2;
7170         /* This indicates that the aggregation was done using GRO rules. */
7171         #define RX_TPA_START_V2_CMPL_FLAGS2_AGG_GRO \
7172                 UINT32_C(0x4)
7173         /*
7174          * When this bit is '0', the cs_ok field has the following definition:-
7175          * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
7176          * in the delivered packet, counted from the outer-most header group to
7177          * the inner-most header group, stopping at the first error. -
7178          * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
7179          * in the delivered packet, counted from the outer-most header group to
7180          * the inner-most header group, stopping at the first error. When this
7181          * bit is '1', the cs_ok field has the following definition: -
7182          * hdr_cnt[2:0] = The number of header groups that were parsed by the
7183          * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
7184          * will be '1' if all the parsed header groups with an IP checksum are
7185          * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
7186          * header groups with an L4 checksum are valid.
7187          */
7188         #define RX_TPA_START_V2_CMPL_FLAGS2_CS_ALL_OK_MODE \
7189                 UINT32_C(0x8)
7190         /* This value indicates what format the metadata field is. */
7191         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_MASK \
7192                 UINT32_C(0xf0)
7193         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_SFT            4
7194         /* There is no metadata information. Values are zero. */
7195         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_NONE \
7196                 (UINT32_C(0x0) << 4)
7197         /*
7198          * The {metadata1, metadata0} fields contain the vtag
7199          * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
7200          * de, vid[11:0]} The metadata2 field contains the table scope
7201          * and action record pointer. - metadata2[25:0] contains the
7202          * action record pointer. - metadata2[31:26] contains the table
7203          * scope.
7204          */
7205         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_ACT_REC_PTR \
7206                 (UINT32_C(0x1) << 4)
7207         /*
7208          * The {metadata1, metadata0} fields contain the vtag
7209          * information:
7210          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
7211          * The metadata2 field contains the Tunnel ID
7212          * value, justified to LSB.
7213          * - VXLAN = VNI[23:0] -> VXLAN Network ID
7214          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
7215          * - NVGRE = TNI[23:0] -> Tenant Network ID
7216          * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
7217          * - IPv4 = 0 (not populated)
7218          * - IPv6 = Flow Label[19:0]
7219          * - PPPoE = sessionID[15:0]
7220          * - MPLs = Outer label[19:0]
7221          * - UPAR = Selected[31:0] with bit mask
7222          */
7223         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
7224                 (UINT32_C(0x2) << 4)
7225         /*
7226          * The {metadata1, metadata0} fields contain the vtag
7227          * information:
7228          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
7229          * The metadata2 field contains the 32b metadata from the prepended
7230          * header (chdr_data).
7231          */
7232         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
7233                 (UINT32_C(0x3) << 4)
7234         /*
7235          * The {metadata1, metadata0} fields contain the vtag
7236          * information:
7237          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
7238          * The metadata2 field contains the outer_l3_offset,
7239          * inner_l2_offset, inner_l3_offset, and inner_l4_size.
7240          * - metadata2[8:0] contains the outer_l3_offset.
7241          * - metadata2[17:9] contains the inner_l2_offset.
7242          * - metadata2[26:18] contains the inner_l3_offset.
7243          * - metadata2[31:27] contains the inner_l4_size.
7244          */
7245         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
7246                 (UINT32_C(0x4) << 4)
7247         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_LAST \
7248                 RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
7249         /*
7250          * This field indicates the IP type for the inner-most IP header.
7251          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
7252          * This value is only valid if itype indicates a packet
7253          * with an IP header.
7254          */
7255         #define RX_TPA_START_V2_CMPL_FLAGS2_IP_TYPE \
7256                 UINT32_C(0x100)
7257         /*
7258          * This indicates that the complete 1's complement checksum was
7259          * calculated for the packet in the affregation.
7260          */
7261         #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC \
7262                 UINT32_C(0x200)
7263         /*
7264          * This field indicates the status of IP and L4 CS calculations done
7265          * by the chip. The format of this field is indicated by the
7266          * cs_all_ok_mode bit.
7267          * CS status for TPA packets is always valid. This means that "all_ok"
7268          * status will always be set. The ok count status will be set
7269          * appropriately for the packet header, such that all existing CS
7270          * values are ok.
7271          */
7272         #define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_MASK \
7273                 UINT32_C(0xfc00)
7274         #define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_SFT                  10
7275         /*
7276          * This value is the complete 1's complement checksum calculated from
7277          * the start of the outer L3 header to the end of the packet (not
7278          * including the ethernet crc). It is valid when the
7279          * 'complete_checksum_calc' flag is set. For TPA Start completions,
7280          * the complete checksum is calculated for the first packet in the
7281          * aggregation only.
7282          */
7283         #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
7284                 UINT32_C(0xffff0000)
7285         #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
7286         /*
7287          * This is data from the CFA block as indicated by the meta_format
7288          * field.
7289          * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
7290          * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
7291          *   act_rec_ptr[25:0]}
7292          * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
7293          * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
7294          * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
7295          * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
7296          * of the host address from the first BD used to place the packet.
7297          */
7298         uint32_t        metadata2;
7299         uint16_t        errors_v2;
7300         /*
7301          * This value is written by the NIC such that it will be different
7302          * for each pass through the completion queue. The even passes
7303          * will write 1. The odd passes will write 0.
7304          */
7305         #define RX_TPA_START_V2_CMPL_V2 \
7306                 UINT32_C(0x1)
7307         #define RX_TPA_START_V2_CMPL_ERRORS_MASK \
7308                 UINT32_C(0xfffe)
7309         #define RX_TPA_START_V2_CMPL_ERRORS_SFT                     1
7310         /*
7311          * This error indicates that there was some sort of problem with
7312          * the BDs for the packetThe packet should be treated as
7313          * invalid.
7314          */
7315         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_MASK \
7316                 UINT32_C(0xe)
7317         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_SFT         1
7318         /* No buffer error */
7319         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
7320                 (UINT32_C(0x0) << 1)
7321         /*
7322          * Did Not Fit:
7323          * Packet did not fit into packet buffer provided. This means
7324          * that the TPA Start packet was too big to be placed into the
7325          * per-packet maximum number of physical buffers configured for
7326          * the VNIC, or that it was too big to be placed into the
7327          * per-aggregation maximum number of physical buffers configured
7328          * for the VNIC. This error only occurs when the VNIC is
7329          * configured for variable size receive buffers.
7330          */
7331         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
7332                 (UINT32_C(0x1) << 1)
7333         /*
7334          * Bad Format:
7335          * BDs were not formatted correctly.
7336          */
7337         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
7338                 (UINT32_C(0x3) << 1)
7339         /*
7340          * Flush:
7341          * There was a bad_format error on the previous operation
7342          */
7343         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
7344                 (UINT32_C(0x5) << 1)
7345         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_LAST \
7346                 RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH
7347         /*
7348          * This is data from the CFA block as indicated by the meta_format
7349          * field.
7350          */
7351         uint16_t        metadata0;
7352         /* When meta_format != 0, this value is the VLAN VID. */
7353         #define RX_TPA_START_V2_CMPL_METADATA0_VID_MASK UINT32_C(0xfff)
7354         #define RX_TPA_START_V2_CMPL_METADATA0_VID_SFT 0
7355         /* When meta_format != 0, this value is the VLAN DE. */
7356         #define RX_TPA_START_V2_CMPL_METADATA0_DE      UINT32_C(0x1000)
7357         /* When meta_format != 0, this value is the VLAN PRI. */
7358         #define RX_TPA_START_V2_CMPL_METADATA0_PRI_MASK UINT32_C(0xe000)
7359         #define RX_TPA_START_V2_CMPL_METADATA0_PRI_SFT 13
7360         /*
7361          * This field contains the outer_l3_offset, inner_l2_offset,
7362          * inner_l3_offset, and inner_l4_size.
7363          *
7364          * hdr_offsets[8:0] contains the outer_l3_offset.
7365          * hdr_offsets[17:9] contains the inner_l2_offset.
7366          * hdr_offsets[26:18] contains the inner_l3_offset.
7367          * hdr_offsets[31:27] contains the inner_l4_size.
7368          */
7369         uint32_t        hdr_offsets;
7370 } __rte_packed;
7371
7372 /*
7373  * This TPA completion structure is used on devices where the
7374  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7375  * RX L2 TPA Start V3 Completion Record (32 bytes split to 2 16-byte
7376  * struct)
7377  */
7378 /* rx_tpa_start_v3_cmpl (size:128b/16B) */
7379 struct rx_tpa_start_v3_cmpl {
7380         uint16_t        flags_type;
7381         /*
7382          * This field indicates the exact type of the completion.
7383          * By convention, the LSB identifies the length of the
7384          * record in 16B units. Even values indicate 16B
7385          * records. Odd values indicate 32B
7386          * records.
7387          */
7388         #define RX_TPA_START_V3_CMPL_TYPE_MASK \
7389                 UINT32_C(0x3f)
7390         #define RX_TPA_START_V3_CMPL_TYPE_SFT                       0
7391         /*
7392          * RX L2 TPA Start V3 completion:
7393          * Completion at the beginning of a TPA operation.
7394          * Length = 32B
7395          * This is the new version of the RX_TPA_START completion used
7396          * in Thor2 and later chips.
7397          */
7398         #define RX_TPA_START_V3_CMPL_TYPE_RX_TPA_START_V3 \
7399                 UINT32_C(0x19)
7400         #define RX_TPA_START_V3_CMPL_TYPE_LAST \
7401                 RX_TPA_START_V3_CMPL_TYPE_RX_TPA_START_V3
7402         #define RX_TPA_START_V3_CMPL_FLAGS_MASK \
7403                 UINT32_C(0xffc0)
7404         #define RX_TPA_START_V3_CMPL_FLAGS_SFT                      6
7405         /*
7406          * When this bit is '1', it indicates a packet that has an error
7407          * of some type. Type of error is indicated in error_flags.
7408          */
7409         #define RX_TPA_START_V3_CMPL_FLAGS_ERROR \
7410                 UINT32_C(0x40)
7411         /* This field indicates how the packet was placed in the buffer. */
7412         #define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_MASK \
7413                 UINT32_C(0x380)
7414         #define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_SFT             7
7415         /*
7416          * Jumbo:
7417          * TPA Packet was placed using jumbo algorithm. This means
7418          * that the first buffer will be filled with data before
7419          * moving to aggregation buffers. Each aggregation buffer
7420          * will be filled before moving to the next aggregation
7421          * buffer.
7422          */
7423         #define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_JUMBO \
7424                 (UINT32_C(0x1) << 7)
7425         /*
7426          * Header/Data Separation:
7427          * Packet was placed using Header/Data separation algorithm.
7428          * The separation location is indicated by the itype field.
7429          */
7430         #define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_HDS \
7431                 (UINT32_C(0x2) << 7)
7432         /*
7433          * IOC/Jumbo:
7434          * Packet will be placed using In-Order Completion/Jumbo where
7435          * the first packet of the aggregation is placed using Jumbo
7436          * Placement. Subsequent packets will be placed such that each
7437          * packet starts at the beginning of an aggregation buffer.
7438          */
7439         #define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_IOC_JUMBO \
7440                 (UINT32_C(0x4) << 7)
7441         /*
7442          * GRO/Jumbo:
7443          * Packet will be placed using GRO/Jumbo where the first
7444          * packet is filled with data. Subsequent packets will be
7445          * placed such that any one packet does not span two
7446          * aggregation buffers unless it starts at the beginning of
7447          * an aggregation buffer.
7448          */
7449         #define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
7450                 (UINT32_C(0x5) << 7)
7451         /*
7452          * GRO/Header-Data Separation:
7453          * Packet will be placed using GRO/HDS where the header
7454          * is in the first packet.
7455          * Payload of each packet will be
7456          * placed such that any one packet does not span two
7457          * aggregation buffers unless it starts at the beginning of
7458          * an aggregation buffer.
7459          */
7460         #define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_GRO_HDS \
7461                 (UINT32_C(0x6) << 7)
7462         /*
7463          * IOC/Header-Data Separation:
7464          * Packet will be placed using In-Order Completion/HDS where
7465          * the header is in the first packet buffer. Payload of each
7466          * packet will be placed such that each packet starts at the
7467          * beginning of an aggregation buffer.
7468          */
7469         #define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_IOC_HDS \
7470                 (UINT32_C(0x7) << 7)
7471         #define RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_LAST \
7472                 RX_TPA_START_V3_CMPL_FLAGS_PLACEMENT_IOC_HDS
7473         /* This bit is '1' if the RSS field in this completion is valid. */
7474         #define RX_TPA_START_V3_CMPL_FLAGS_RSS_VALID \
7475                 UINT32_C(0x400)
7476         /*
7477          * This bit is '1' if metadata has been added to the end of the
7478          * packet in host memory. Metadata starts at the first 32B boundary
7479          * after the end of the packet for regular and jumbo placement. It
7480          * starts at the first 32B boundary after the end of the header for
7481          * HDS placement. The length of the metadata is indicated in the
7482          * metadata itself.
7483          */
7484         #define RX_TPA_START_V3_CMPL_FLAGS_PKT_METADATA_PRESENT \
7485                 UINT32_C(0x800)
7486         /*
7487          * This value indicates what the inner packet determined for the
7488          * packet was.
7489          */
7490         #define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_MASK \
7491                 UINT32_C(0xf000)
7492         #define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_SFT                 12
7493         /*
7494          * TCP Packet:
7495          * Indicates that the packet was IP and TCP.
7496          */
7497         #define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_TCP \
7498                 (UINT32_C(0x2) << 12)
7499         #define RX_TPA_START_V3_CMPL_FLAGS_ITYPE_LAST \
7500                 RX_TPA_START_V3_CMPL_FLAGS_ITYPE_TCP
7501         /*
7502          * This value indicates the amount of packet data written to the
7503          * buffer the opaque field in this completion corresponds to.
7504          */
7505         uint16_t        len;
7506         /*
7507          * This is a copy of the opaque field from the RX BD this completion
7508          * corresponds to. If the VNIC is configured to not use an Rx BD for
7509          * the TPA Start completion, then this is a copy of the opaque field
7510          * from the first BD used to place the TPA Start packet.
7511          */
7512         uint32_t        opaque;
7513         uint16_t        rss_hash_type_v1;
7514         /*
7515          * This value is written by the NIC such that it will be different
7516          * for each pass through the completion queue. The even passes
7517          * will write 1. The odd passes will write 0.
7518          */
7519         #define RX_TPA_START_V3_CMPL_V1                UINT32_C(0x1)
7520         /* unused1 is 6 b. */
7521         #define RX_TPA_START_V3_CMPL_UNUSED1_MASK      UINT32_C(0x7e)
7522         #define RX_TPA_START_V3_CMPL_UNUSED1_SFT       1
7523         /*
7524          * This is the RSS hash type for the packet. The value is packed
7525          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
7526          *
7527          * The value of tuple_extrac_op provides the information about
7528          * what fields the hash was computed on.
7529          * * 0: The RSS hash was computed over source IP address,
7530          * destination IP address, source port, and destination port of inner
7531          * IP and TCP or UDP headers.
7532          * * 1: The RSS hash was computed over source IP address and
7533          * destination IP address of inner IP header.
7534          * * 2: The RSS hash was computed over source IP address,
7535          * destination IP address, source port, and destination port of
7536          * IP and TCP or UDP headers of outer tunnel headers.
7537          * Note: For non-tunneled packets, this value is not applicable.
7538          * * 3: The RSS hash was computed over source IP address and
7539          * destination IP address of IP header of outer tunnel headers.
7540          * Note: For non-tunneled packets, this value is not applicable.
7541          * * 4: The RSS hash was computed over source IP address of the inner
7542          * IP header.
7543          * * 5: The RSS hash was computed over destination IP address of the
7544          * inner IP header.
7545          * * 6: The RSS hash was computed over source IP address of the outer
7546          * IP header. Note: For non-tunneled packets, this value is not
7547          * applicable
7548          * * 7: The RSS hash was computed over destination IP address of the
7549          * outer IP header.
7550          * Note: For non-tunneled packets, this value is not applicable.
7551          * * 8: The RSS hash was computed over source IP address, destination
7552          * IP address, and flow label of the inner IP header.
7553          * Note: For packets without an inner IPv6 header, this value is not
7554          * applicable.
7555          * * 9: The RSS hash was computed over the flow label of the inner
7556          * IP header.
7557          * Note: For packets without an inner IPv6 header, this value
7558          * is not applicable.
7559          * * 10: The RSS hash was computed over source IP address, destination
7560          * IP address, and flow label of the outer IP header.
7561          * Note: For packets without an outer IPv6 header, this value is not
7562          * applicable.
7563          * * 11: The RSS hash was computed over the flow label of the outer
7564          * IP header. Note: For packets without an outer IPv6 header, this
7565          * value is not applicable.
7566          *
7567          * Note that 4-tuples values listed above are applicable
7568          * for layer 4 protocols supported and enabled for RSS in the hardware,
7569          * HWRM firmware, and drivers. For example, if RSS hash is supported
7570          * and enabled for TCP traffic only, then the values of
7571          * tuple_extract_op corresponding to 4-tuples are only valid for TCP
7572          * traffic
7573          */
7574         #define RX_TPA_START_V3_CMPL_RSS_HASH_TYPE_MASK UINT32_C(0xff80)
7575         #define RX_TPA_START_V3_CMPL_RSS_HASH_TYPE_SFT 7
7576         /*
7577          * This is the aggregation ID that the completion is associated
7578          * with. Use this number to correlate the TPA start completion
7579          * with the TPA end completion.
7580          */
7581         uint16_t        agg_id;
7582         /*
7583          * This is the aggregation ID that the completion is associated
7584          * with. Use this number to correlate the TPA start completion
7585          * with the TPA end completion.
7586          */
7587         #define RX_TPA_START_V3_CMPL_AGG_ID_MASK                UINT32_C(0xfff)
7588         #define RX_TPA_START_V3_CMPL_AGG_ID_SFT                 0
7589         #define RX_TPA_START_V3_CMPL_METADATA1_MASK \
7590                 UINT32_C(0xf000)
7591         #define RX_TPA_START_V3_CMPL_METADATA1_SFT              12
7592         /* When meta_format != 0, this value is the VLAN TPID_SEL. */
7593         #define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_MASK \
7594                 UINT32_C(0x7000)
7595         #define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_SFT      12
7596         /* 0x88a8 */
7597         #define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID88A8 \
7598                 (UINT32_C(0x0) << 12)
7599         /* 0x8100 */
7600         #define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID8100 \
7601                 (UINT32_C(0x1) << 12)
7602         /* 0x9100 */
7603         #define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID9100 \
7604                 (UINT32_C(0x2) << 12)
7605         /* 0x9200 */
7606         #define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID9200 \
7607                 (UINT32_C(0x3) << 12)
7608         /* 0x9300 */
7609         #define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPID9300 \
7610                 (UINT32_C(0x4) << 12)
7611         /* Value programmed in CFA VLANTPID register. */
7612         #define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG \
7613                 (UINT32_C(0x5) << 12)
7614         #define RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_LAST \
7615                 RX_TPA_START_V3_CMPL_METADATA1_TPID_SEL_TPIDCFG
7616         /* When meta_format != 0, this value is the VLAN valid. */
7617         #define RX_TPA_START_V3_CMPL_METADATA1_VALID \
7618                 UINT32_C(0x8000)
7619         /*
7620          * This value is the RSS hash value calculated for the packet
7621          * based on the mode bits and key value in the VNIC.
7622          * When vee_cmpl_mode is set in VNIC context, this is the lower
7623          * 32b of the host address from the first BD used to place the packet.
7624          */
7625         uint32_t        rss_hash;
7626 } __rte_packed;
7627
7628 /*
7629  * Last 16 bytes of RX L2 TPA Start V3 Completion Record
7630  *
7631  * This TPA completion structure is used on devices where the
7632  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7633  */
7634 /* rx_tpa_start_v3_cmpl_hi (size:128b/16B) */
7635 struct rx_tpa_start_v3_cmpl_hi {
7636         uint32_t        flags2;
7637         /*
7638          * This indicates that the ip checksum was calculated for the inner
7639          * packet and that the ip_cs_error field indicates if there was an
7640          * error.
7641          */
7642         #define RX_TPA_START_V3_CMPL_FLAGS2_IP_CS_CALC \
7643                 UINT32_C(0x1)
7644         /*
7645          * This indicates that the TCP, UDP or ICMP checksum was calculated
7646          * for the inner packet and that the l4_cs_error field indicates if
7647          * there was an error.
7648          */
7649         #define RX_TPA_START_V3_CMPL_FLAGS2_L4_CS_CALC \
7650                 UINT32_C(0x2)
7651         /*
7652          * This indicates that the ip checksum was calculated for the tunnel
7653          * header and that the t_ip_cs_error field indicates if there was an
7654          * error.
7655          */
7656         #define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_CS_CALC \
7657                 UINT32_C(0x4)
7658         /*
7659          * This indicates that the UDP checksum was calculated for the tunnel
7660          * packet and that the t_l4_cs_error field indicates if there was an
7661          * error.
7662          */
7663         #define RX_TPA_START_V3_CMPL_FLAGS2_T_L4_CS_CALC \
7664                 UINT32_C(0x8)
7665         /* This value indicates what format the metadata field is. */
7666         #define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_MASK \
7667                 UINT32_C(0xf0)
7668         #define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_SFT            4
7669         /* There is no metadata information. Values are zero. */
7670         #define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_NONE \
7671                 (UINT32_C(0x0) << 4)
7672         /*
7673          * The {metadata1, metadata0} fields contain the vtag
7674          * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
7675          * de, vid[11:0]} The metadata2 field contains the table scope
7676          * and action record pointer. - metadata2[25:0] contains the
7677          * action record pointer. - metadata2[31:26] contains the table
7678          * scope.
7679          */
7680         #define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_ACT_REC_PTR \
7681                 (UINT32_C(0x1) << 4)
7682         /*
7683          * The {metadata1, metadata0} fields contain the vtag
7684          * information:
7685          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
7686          * The metadata2 field contains the Tunnel ID
7687          * value, justified to LSB.
7688          * - VXLAN = VNI[23:0] -> VXLAN Network ID
7689          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
7690          * - NVGRE = TNI[23:0] -> Tenant Network ID
7691          * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
7692          * - IPv4 = 0 (not populated)
7693          * - IPv6 = Flow Label[19:0]
7694          * - PPPoE = sessionID[15:0]
7695          * - MPLs = Outer label[19:0]
7696          * - UPAR = Selected[31:0] with bit mask
7697          */
7698         #define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
7699                 (UINT32_C(0x2) << 4)
7700         /*
7701          * The {metadata1, metadata0} fields contain the vtag
7702          * information:
7703          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
7704          * The metadata2 field contains the 32b metadata from the prepended
7705          * header (chdr_data).
7706          */
7707         #define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
7708                 (UINT32_C(0x3) << 4)
7709         /*
7710          * The {metadata1, metadata0} fields contain the vtag
7711          * information:
7712          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
7713          * The metadata2 field contains the outer_l3_offset,
7714          * inner_l2_offset, inner_l3_offset, and inner_l4_size.
7715          * - metadata2[8:0] contains the outer_l3_offset.
7716          * - metadata2[17:9] contains the inner_l2_offset.
7717          * - metadata2[26:18] contains the inner_l3_offset.
7718          * - metadata2[31:27] contains the inner_l4_size.
7719          */
7720         #define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
7721                 (UINT32_C(0x4) << 4)
7722         #define RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_LAST \
7723                 RX_TPA_START_V3_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
7724         /*
7725          * This field indicates the IP type for the inner-most IP header.
7726          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
7727          * This value is only valid if itype indicates a packet
7728          * with an IP header.
7729          */
7730         #define RX_TPA_START_V3_CMPL_FLAGS2_IP_TYPE \
7731                 UINT32_C(0x100)
7732         /*
7733          * This indicates that the complete 1's complement checksum was
7734          * calculated for the packet.
7735          */
7736         #define RX_TPA_START_V3_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC \
7737                 UINT32_C(0x200)
7738         /*
7739          * This field indicates the status of IP and L4 CS calculations done
7740          * by the chip. The format of this field is indicated by the
7741          * cs_all_ok_mode bit.
7742          */
7743         #define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE \
7744                 UINT32_C(0x400)
7745         /* Indicates that the Tunnel IP type was IPv4 */
7746         #define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_IPV4 \
7747                 (UINT32_C(0x0) << 10)
7748         /* Indicates that the Tunnel IP type was IPv6 */
7749         #define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_IPV6 \
7750                 (UINT32_C(0x1) << 10)
7751         #define RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_LAST \
7752                 RX_TPA_START_V3_CMPL_FLAGS2_T_IP_TYPE_IPV6
7753         /* This indicates that the aggregation was done using GRO rules. */
7754         #define RX_TPA_START_V3_CMPL_FLAGS2_AGG_GRO \
7755                 UINT32_C(0x800)
7756         /*
7757          * This value is the complete 1's complement checksum calculated from
7758          * the start of the outer L3 header to the end of the packet (not
7759          * including the ethernet crc). It is valid when the
7760          * 'complete_checksum_calc' flag is set. For TPA Start completions,
7761          * the complete checksum is calculated for the first packet in the
7762          * aggregation only.
7763          */
7764         #define RX_TPA_START_V3_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
7765                 UINT32_C(0xffff0000)
7766         #define RX_TPA_START_V3_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
7767         /*
7768          * This is data from the CFA block as indicated by the meta_format
7769          * field.
7770          * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
7771          * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
7772          *   act_rec_ptr[25:0]}
7773          * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
7774          * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
7775          * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
7776          * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
7777          * of the host address from the first BD used to place the packet.
7778          */
7779         uint32_t        metadata2;
7780         uint16_t        errors_v2;
7781         /*
7782          * This value is written by the NIC such that it will be different
7783          * for each pass through the completion queue. The even passes
7784          * will write 1. The odd passes will write 0.
7785          */
7786         #define RX_TPA_START_V3_CMPL_V2 \
7787                 UINT32_C(0x1)
7788         #define RX_TPA_START_V3_CMPL_ERRORS_MASK \
7789                 UINT32_C(0xfffe)
7790         #define RX_TPA_START_V3_CMPL_ERRORS_SFT                     1
7791         /*
7792          * This error indicates that there was some sort of problem with
7793          * the BDs for the packetThe packet should be treated as
7794          * invalid.
7795          */
7796         #define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_MASK \
7797                 UINT32_C(0xe)
7798         #define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_SFT         1
7799         /* No buffer error */
7800         #define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
7801                 (UINT32_C(0x0) << 1)
7802         /*
7803          * Did Not Fit:
7804          * Packet did not fit into packet buffer provided. This means
7805          * that the TPA Start packet was too big to be placed into the
7806          * per-packet maximum number of physical buffers configured for
7807          * the VNIC, or that it was too big to be placed into the
7808          * per-aggregation maximum number of physical buffers configured
7809          * for the VNIC. This error only occurs when the VNIC is
7810          * configured for variable size receive buffers.
7811          */
7812         #define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
7813                 (UINT32_C(0x1) << 1)
7814         /*
7815          * Bad Format:
7816          * BDs were not formatted correctly.
7817          */
7818         #define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
7819                 (UINT32_C(0x3) << 1)
7820         /*
7821          * Flush:
7822          * There was a bad_format error on the previous operation
7823          */
7824         #define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
7825                 (UINT32_C(0x5) << 1)
7826         #define RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_LAST \
7827                 RX_TPA_START_V3_CMPL_ERRORS_BUFFER_ERROR_FLUSH
7828         /*
7829          * This is data from the CFA block as indicated by the meta_format
7830          * field.
7831          */
7832         uint16_t        metadata0;
7833         /* When meta_format != 0, this value is the VLAN VID. */
7834         #define RX_TPA_START_V3_CMPL_METADATA0_VID_MASK UINT32_C(0xfff)
7835         #define RX_TPA_START_V3_CMPL_METADATA0_VID_SFT 0
7836         /* When meta_format != 0, this value is the VLAN DE. */
7837         #define RX_TPA_START_V3_CMPL_METADATA0_DE      UINT32_C(0x1000)
7838         /* When meta_format != 0, this value is the VLAN PRI. */
7839         #define RX_TPA_START_V3_CMPL_METADATA0_PRI_MASK UINT32_C(0xe000)
7840         #define RX_TPA_START_V3_CMPL_METADATA0_PRI_SFT 13
7841         /*
7842          * This field contains the outer_l3_offset, inner_l2_offset,
7843          * inner_l3_offset, and inner_l4_size.
7844          *
7845          * hdr_offsets[8:0] contains the outer_l3_offset.
7846          * hdr_offsets[17:9] contains the inner_l2_offset.
7847          * hdr_offsets[26:18] contains the inner_l3_offset.
7848          * hdr_offsets[31:27] contains the inner_l4_size.
7849          */
7850         uint32_t        hdr_offsets;
7851 } __rte_packed;
7852
7853 /*
7854  * This TPA completion structure is used on devices where the
7855  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
7856  */
7857 /* rx_tpa_end_cmpl (size:128b/16B) */
7858 struct rx_tpa_end_cmpl {
7859         uint16_t        flags_type;
7860         /*
7861          * This field indicates the exact type of the completion.
7862          * By convention, the LSB identifies the length of the
7863          * record in 16B units. Even values indicate 16B
7864          * records. Odd values indicate 32B
7865          * records.
7866          */
7867         #define RX_TPA_END_CMPL_TYPE_MASK                      UINT32_C(0x3f)
7868         #define RX_TPA_END_CMPL_TYPE_SFT                       0
7869         /*
7870          * RX L2 TPA End Completion:
7871          * Completion at the end of a TPA operation.
7872          * Length = 32B
7873          */
7874         #define RX_TPA_END_CMPL_TYPE_RX_TPA_END                  UINT32_C(0x15)
7875         #define RX_TPA_END_CMPL_TYPE_LAST \
7876                 RX_TPA_END_CMPL_TYPE_RX_TPA_END
7877         #define RX_TPA_END_CMPL_FLAGS_MASK                     UINT32_C(0xffc0)
7878         #define RX_TPA_END_CMPL_FLAGS_SFT                      6
7879         /*
7880          * When this bit is '1', it indicates a packet that has an
7881          * error of some type. Type of error is indicated in
7882          * error_flags.
7883          */
7884         #define RX_TPA_END_CMPL_FLAGS_ERROR                     UINT32_C(0x40)
7885         /* This field indicates how the packet was placed in the buffer. */
7886         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK            UINT32_C(0x380)
7887         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT             7
7888         /*
7889          * Jumbo:
7890          * TPA Packet was placed using jumbo algorithm. This means
7891          * that the first buffer will be filled with data before
7892          * moving to aggregation buffers. Each aggregation buffer
7893          * will be filled before moving to the next aggregation
7894          * buffer.
7895          */
7896         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO \
7897                 (UINT32_C(0x1) << 7)
7898         /*
7899          * Header/Data Separation:
7900          * Packet was placed using Header/Data separation algorithm.
7901          * The separation location is indicated by the itype field.
7902          */
7903         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS \
7904                 (UINT32_C(0x2) << 7)
7905         /*
7906          * IOC/Jumbo:
7907          * Packet will be placed using In-Order Completion/Jumbo where
7908          * the first packet of the aggregation is placed using Jumbo
7909          * Placement. Subsequent packets will be placed such that each
7910          * packet starts at the beginning of an aggregation buffer.
7911          */
7912         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_JUMBO \
7913                 (UINT32_C(0x4) << 7)
7914         /*
7915          * GRO/Jumbo:
7916          * Packet will be placed using GRO/Jumbo where the first
7917          * packet is filled with data. Subsequent packets will be
7918          * placed such that any one packet does not span two
7919          * aggregation buffers unless it starts at the beginning of
7920          * an aggregation buffer.
7921          */
7922         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
7923                 (UINT32_C(0x5) << 7)
7924         /*
7925          * GRO/Header-Data Separation:
7926          * Packet will be placed using GRO/HDS where the header
7927          * is in the first packet.
7928          * Payload of each packet will be
7929          * placed such that any one packet does not span two
7930          * aggregation buffers unless it starts at the beginning of
7931          * an aggregation buffer.
7932          */
7933         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \
7934                 (UINT32_C(0x6) << 7)
7935         /*
7936          * IOC/Header-Data Separation:
7937          * Packet will be placed using In-Order Completion/HDS where
7938          * the header is in the first packet buffer. Payload of each
7939          * packet will be placed such that each packet starts at the
7940          * beginning of an aggregation buffer.
7941          */
7942         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS \
7943                 (UINT32_C(0x7) << 7)
7944         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \
7945                 RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
7946         /* When set, this bit indicates that the timestamp field is valid. */
7947         #define RX_TPA_END_CMPL_FLAGS_TIMESTAMP_VALID           UINT32_C(0x400)
7948         /*
7949          * This bit is '1' if metadata has been added to the end of the
7950          * packet in host memory. Metadata starts at the first 32B boundary
7951          * after the end of the packet for regular and jumbo placement.
7952          * It starts at the first 32B boundary after the end of the header
7953          * for HDS placement. The length of the metadata is indicated in the
7954          * metadata itself.
7955          */
7956         #define RX_TPA_END_CMPL_FLAGS_PKT_METADATA_PRESENT      UINT32_C(0x800)
7957         /*
7958          * This value indicates what the inner packet determined for the
7959          * packet was.
7960          * - 2 TCP Packet
7961          *     Indicates that the packet was IP and TCP. This indicates
7962          *     that the ip_cs field is valid and that the tcp_udp_cs
7963          *     field is valid and contains the TCP checksum.
7964          *     This also indicates that the payload_offset field is valid.
7965          */
7966         #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK \
7967                 UINT32_C(0xf000)
7968         #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT                 12
7969         /*
7970          * This value is zero for TPA End completions.
7971          * There is no data in the buffer that corresponds to the opaque
7972          * value in this completion.
7973          */
7974         uint16_t        len;
7975         /*
7976          * This is a copy of the opaque field from the RX BD this completion
7977          * corresponds to.
7978          */
7979         uint32_t        opaque;
7980         /*
7981          * This value is written by the NIC such that it will be different
7982          * for each pass through the completion queue. The even passes
7983          * will write 1. The odd passes will write 0.
7984          */
7985         uint8_t agg_bufs_v1;
7986         /*
7987          * This value is written by the NIC such that it will be different
7988          * for each pass through the completion queue. The even passes
7989          * will write 1. The odd passes will write 0.
7990          */
7991         #define RX_TPA_END_CMPL_V1           UINT32_C(0x1)
7992         /*
7993          * This value is the number of aggregation buffers that follow this
7994          * entry in the completion ring that are a part of this aggregation
7995          * packet.
7996          * If the value is zero, then the packet is completely contained
7997          * in the buffer space provided in the aggregation start completion.
7998          */
7999         #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
8000         #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
8001         /* This value is the number of segments in the TPA operation. */
8002         uint8_t tpa_segs;
8003         /*
8004          * This value indicates the offset in bytes from the beginning of the
8005          * packet where the inner payload starts. This value is valid for TCP,
8006          * UDP, FCoE, and RoCE packets.
8007          *
8008          * A value of zero indicates an offset of 256 bytes.
8009          */
8010         uint8_t payload_offset;
8011         uint8_t agg_id;
8012         /* unused2 is 1 b */
8013         #define RX_TPA_END_CMPL_UNUSED2     UINT32_C(0x1)
8014         /*
8015          * This is the aggregation ID that the completion is associated
8016          * with. Use this number to correlate the TPA start completion
8017          * with the TPA end completion.
8018          */
8019         #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
8020         #define RX_TPA_END_CMPL_AGG_ID_SFT  1
8021         /*
8022          * For non-GRO packets, this value is the
8023          * timestamp delta between earliest and latest timestamp values for
8024          * TPA packet. If packets were not time stamped, then delta will be
8025          * zero.
8026          *
8027          * For GRO packets, this field is zero except for the following
8028          * sub-fields.
8029          * - tsdelta[31]
8030          *     Timestamp present indication. When '0', no Timestamp
8031          *     option is in the packet. When '1', then a Timestamp
8032          *     option is present in the packet.
8033          */
8034         uint32_t        tsdelta;
8035 } __rte_packed;
8036
8037 /*
8038  * Last 16 bytes of rx_tpa_end_cmpl.
8039  *
8040  * This TPA completion structure is used on devices where the
8041  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
8042  */
8043 /* rx_tpa_end_cmpl_hi (size:128b/16B) */
8044 struct rx_tpa_end_cmpl_hi {
8045         uint32_t        tpa_dup_acks;
8046         /*
8047          * This value is the number of duplicate ACKs that have been
8048          * received as part of the TPA operation.
8049          */
8050         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
8051         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
8052         /*
8053          * This value is the valid when TPA completion is active. It
8054          * indicates the length of the longest segment of the TPA operation
8055          * for LRO mode and the length of the first segment in GRO mode.
8056          *
8057          * This value may be used by GRO software to re-construct the original
8058          * packet stream from the TPA packet. This is the length of all
8059          * but the last segment for GRO. In LRO mode this value may be used
8060          * to indicate MSS size to the stack.
8061          */
8062         uint16_t        tpa_seg_len;
8063         /*
8064          * The lower 16b of the timestamp of the last packet added to the
8065          * aggregation. Only valid when flags.timestamp_valid is set.
8066          */
8067         uint16_t        timestamp_lower;
8068         uint16_t        errors_v2;
8069         /*
8070          * This value is written by the NIC such that it will be different
8071          * for each pass through the completion queue. The even passes
8072          * will write 1. The odd passes will write 0.
8073          */
8074         #define RX_TPA_END_CMPL_V2                             UINT32_C(0x1)
8075         #define RX_TPA_END_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
8076         #define RX_TPA_END_CMPL_ERRORS_SFT                     1
8077         /*
8078          * This error indicates that there was some sort of problem with
8079          * the BDs for the packet that was found after part of the
8080          * packet was already placed. The packet should be treated as
8081          * invalid.
8082          */
8083         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
8084         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT         1
8085         /*
8086          * This error occurs when there is a fatal HW problem in
8087          * the chip only. It indicates that there were not
8088          * BDs on chip but that there was adequate reservation.
8089          * provided by the TPA block.
8090          */
8091         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
8092                 (UINT32_C(0x2) << 1)
8093         /*
8094          * This error occurs when TPA block was not configured to
8095          * reserve adequate BDs for TPA operations on this RX
8096          * ring. All data for the TPA operation was not placed.
8097          *
8098          * This error can also be generated when the number of
8099          * segments is not programmed correctly in TPA and the
8100          * 33 total aggregation buffers allowed for the TPA
8101          * operation has been exceeded.
8102          */
8103         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
8104                 (UINT32_C(0x4) << 1)
8105         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
8106                 RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
8107         /*
8108          * The upper 16b of the timestamp of the last packet added to the
8109          * aggregation. Only valid when flags.timestamp_valid is set.
8110          */
8111         uint16_t        timestamp_upper;
8112         /*
8113          * This is the opaque value that was completed for the TPA start
8114          * completion that corresponds to this TPA end completion.
8115          */
8116         uint32_t        start_opaque;
8117 } __rte_packed;
8118
8119 /*
8120  * This TPA completion structure is used on devices where the
8121  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8122  */
8123 /* rx_tpa_v2_start_cmpl (size:128b/16B) */
8124 struct rx_tpa_v2_start_cmpl {
8125         uint16_t        flags_type;
8126         /*
8127          * This field indicates the exact type of the completion.
8128          * By convention, the LSB identifies the length of the
8129          * record in 16B units. Even values indicate 16B
8130          * records. Odd values indicate 32B
8131          * records.
8132          */
8133         #define RX_TPA_V2_START_CMPL_TYPE_MASK \
8134                 UINT32_C(0x3f)
8135         #define RX_TPA_V2_START_CMPL_TYPE_SFT                       0
8136         /*
8137          * RX L2 TPA Start Completion:
8138          * Completion at the beginning of a TPA operation.
8139          * Length = 32B
8140          */
8141         #define RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START \
8142                 UINT32_C(0x13)
8143         #define RX_TPA_V2_START_CMPL_TYPE_LAST \
8144                 RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START
8145         #define RX_TPA_V2_START_CMPL_FLAGS_MASK \
8146                 UINT32_C(0xffc0)
8147         #define RX_TPA_V2_START_CMPL_FLAGS_SFT                      6
8148         /* This bit will always be '0' for TPA start completions. */
8149         #define RX_TPA_V2_START_CMPL_FLAGS_ERROR \
8150                 UINT32_C(0x40)
8151         /* This field indicates how the packet was placed in the buffer. */
8152         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_MASK \
8153                 UINT32_C(0x380)
8154         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_SFT             7
8155         /*
8156          * Jumbo:
8157          * TPA Packet was placed using jumbo algorithm. This means
8158          * that the first buffer will be filled with data before
8159          * moving to aggregation buffers. Each aggregation buffer
8160          * will be filled before moving to the next aggregation
8161          * buffer.
8162          */
8163         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_JUMBO \
8164                 (UINT32_C(0x1) << 7)
8165         /*
8166          * Header/Data Separation:
8167          * Packet was placed using Header/Data separation algorithm.
8168          * The separation location is indicated by the itype field.
8169          */
8170         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_HDS \
8171                 (UINT32_C(0x2) << 7)
8172         /*
8173          * GRO/Jumbo:
8174          * Packet will be placed using GRO/Jumbo where the first
8175          * packet is filled with data. Subsequent packets will be
8176          * placed such that any one packet does not span two
8177          * aggregation buffers unless it starts at the beginning of
8178          * an aggregation buffer.
8179          */
8180         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
8181                 (UINT32_C(0x5) << 7)
8182         /*
8183          * GRO/Header-Data Separation:
8184          * Packet will be placed using GRO/HDS where the header
8185          * is in the first packet.
8186          * Payload of each packet will be
8187          * placed such that any one packet does not span two
8188          * aggregation buffers unless it starts at the beginning of
8189          * an aggregation buffer.
8190          */
8191         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \
8192                 (UINT32_C(0x6) << 7)
8193         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_LAST \
8194                 RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
8195         /* This bit is '1' if the RSS field in this completion is valid. */
8196         #define RX_TPA_V2_START_CMPL_FLAGS_RSS_VALID \
8197                 UINT32_C(0x400)
8198         /*
8199          * For devices that support timestamps, when this bit is cleared the
8200          * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
8201          * field contains the 32b timestamp for
8202          * the packet from the MAC. When this bit is set, the
8203          * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
8204          * field contains the outer_l3_offset, inner_l2_offset,
8205          * inner_l3_offset, and inner_l4_size.
8206          */
8207         #define RX_TPA_V2_START_CMPL_FLAGS_TIMESTAMP_FLD_FORMAT \
8208                 UINT32_C(0x800)
8209         /*
8210          * This value indicates what the inner packet determined for the
8211          * packet was.
8212          */
8213         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_MASK \
8214                 UINT32_C(0xf000)
8215         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_SFT                 12
8216         /*
8217          * TCP Packet:
8218          * Indicates that the packet was IP and TCP.
8219          */
8220         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP \
8221                 (UINT32_C(0x2) << 12)
8222         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_LAST \
8223                 RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP
8224         /*
8225          * This value indicates the amount of packet data written to the
8226          * buffer the opaque field in this completion corresponds to.
8227          */
8228         uint16_t        len;
8229         /*
8230          * This is a copy of the opaque field from the RX BD this completion
8231          * corresponds to.
8232          */
8233         uint32_t        opaque;
8234         /*
8235          * This value is written by the NIC such that it will be different
8236          * for each pass through the completion queue. The even passes
8237          * will write 1. The odd passes will write 0.
8238          */
8239         uint8_t v1;
8240         /*
8241          * This value is written by the NIC such that it will be different
8242          * for each pass through the completion queue. The even passes
8243          * will write 1. The odd passes will write 0.
8244          */
8245         #define RX_TPA_V2_START_CMPL_V1 UINT32_C(0x1)
8246         #define RX_TPA_V2_START_CMPL_LAST RX_TPA_V2_START_CMPL_V1
8247         /*
8248          * This is the RSS hash type for the packet. The value is packed
8249          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
8250          *
8251          * The value of tuple_extrac_op provides the information about
8252          * what fields the hash was computed on.
8253          * * 0: The RSS hash was computed over source IP address,
8254          * destination IP address, source port, and destination port of inner
8255          * IP and TCP or UDP headers. Note: For non-tunneled packets,
8256          * the packet headers are considered inner packet headers for the RSS
8257          * hash computation purpose.
8258          * * 1: The RSS hash was computed over source IP address and destination
8259          * IP address of inner IP header. Note: For non-tunneled packets,
8260          * the packet headers are considered inner packet headers for the RSS
8261          * hash computation purpose.
8262          * * 2: The RSS hash was computed over source IP address,
8263          * destination IP address, source port, and destination port of
8264          * IP and TCP or UDP headers of outer tunnel headers.
8265          * Note: For non-tunneled packets, this value is not applicable.
8266          * * 3: The RSS hash was computed over source IP address and
8267          * destination IP address of IP header of outer tunnel headers.
8268          * Note: For non-tunneled packets, this value is not applicable.
8269          *
8270          * Note that 4-tuples values listed above are applicable
8271          * for layer 4 protocols supported and enabled for RSS in the hardware,
8272          * HWRM firmware, and drivers. For example, if RSS hash is supported and
8273          * enabled for TCP traffic only, then the values of tuple_extract_op
8274          * corresponding to 4-tuples are only valid for TCP traffic.
8275          */
8276         uint8_t rss_hash_type;
8277         /*
8278          * This is the aggregation ID that the completion is associated
8279          * with. Use this number to correlate the TPA start completion
8280          * with the TPA end completion.
8281          */
8282         uint16_t        agg_id;
8283         /*
8284          * This value is the RSS hash value calculated for the packet
8285          * based on the mode bits and key value in the VNIC.
8286          */
8287         uint32_t        rss_hash;
8288 } __rte_packed;
8289
8290 /*
8291  * Last 16 bytes of rx_tpa_v2_start_cmpl.
8292  *
8293  * This TPA completion structure is used on devices where the
8294  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8295  */
8296 /* rx_tpa_v2_start_cmpl_hi (size:128b/16B) */
8297 struct rx_tpa_v2_start_cmpl_hi {
8298         uint32_t        flags2;
8299         /*
8300          * This indicates that the ip checksum was calculated for the
8301          * inner packet and that the sum passed for all segments
8302          * included in the aggregation.
8303          */
8304         #define RX_TPA_V2_START_CMPL_FLAGS2_IP_CS_CALC \
8305                 UINT32_C(0x1)
8306         /*
8307          * This indicates that the TCP, UDP or ICMP checksum was
8308          * calculated for the inner packet and that the sum passed
8309          * for all segments included in the aggregation.
8310          */
8311         #define RX_TPA_V2_START_CMPL_FLAGS2_L4_CS_CALC \
8312                 UINT32_C(0x2)
8313         /*
8314          * This indicates that the ip checksum was calculated for the
8315          * tunnel header and that the sum passed for all segments
8316          * included in the aggregation.
8317          */
8318         #define RX_TPA_V2_START_CMPL_FLAGS2_T_IP_CS_CALC \
8319                 UINT32_C(0x4)
8320         /*
8321          * This indicates that the UDP checksum was
8322          * calculated for the tunnel packet and that the sum passed for
8323          * all segments included in the aggregation.
8324          */
8325         #define RX_TPA_V2_START_CMPL_FLAGS2_T_L4_CS_CALC \
8326                 UINT32_C(0x8)
8327         /* This value indicates what format the metadata field is. */
8328         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_MASK \
8329                 UINT32_C(0xf0)
8330         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_SFT            4
8331         /* No metadata informtaion. Value is zero. */
8332         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_NONE \
8333                 (UINT32_C(0x0) << 4)
8334         /*
8335          * The metadata field contains the VLAN tag and TPID value.
8336          * - metadata[11:0] contains the vlan VID value.
8337          * - metadata[12] contains the vlan DE value.
8338          * - metadata[15:13] contains the vlan PRI value.
8339          * - metadata[31:16] contains the vlan TPID value.
8340          */
8341         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_VLAN \
8342                 (UINT32_C(0x1) << 4)
8343         /*
8344          * If ext_meta_format is equal to 1, the metadata field
8345          * contains the lower 16b of the tunnel ID value, justified
8346          * to LSB
8347          * - VXLAN = VNI[23:0] -> VXLAN Network ID
8348          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
8349          * - NVGRE = TNI[23:0] -> Tenant Network ID
8350          * - GRE = KEY[31:0 -> key fieled with bit mask. zero if K = 0
8351          * - IPV4 = 0 (not populated)
8352          * - IPV6 = Flow Label[19:0]
8353          * - PPPoE = sessionID[15:0]
8354          * - MPLs = Outer label[19:0]
8355          * - UPAR = Selected[31:0] with bit mask
8356          */
8357         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
8358                 (UINT32_C(0x2) << 4)
8359         /*
8360          * if ext_meta_format is equal to 1, metadata field contains
8361          * 16b metadata from the prepended header (chdr_data).
8362          */
8363         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
8364                 (UINT32_C(0x3) << 4)
8365         /*
8366          * If ext_meta_format is equal to 1, the metadata field contains
8367          * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
8368          * inner_l4_size.
8369          * - metadata[8:0] contains the outer_l3_offset.
8370          * - metadata[17:9] contains the inner_l2_offset.
8371          * - metadata[26:18] contains the inner_l3_offset.
8372          * - metadata[31:27] contains the inner_l4_size.
8373          */
8374         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
8375                 (UINT32_C(0x4) << 4)
8376         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_LAST \
8377                 RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
8378         /*
8379          * This field indicates the IP type for the inner-most IP header.
8380          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
8381          */
8382         #define RX_TPA_V2_START_CMPL_FLAGS2_IP_TYPE \
8383                 UINT32_C(0x100)
8384         /*
8385          * This indicates that the complete 1's complement checksum was
8386          * calculated for the packet.
8387          */
8388         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC \
8389                 UINT32_C(0x200)
8390         /*
8391          * The combination of this value and meta_format indicated what
8392          * format the metadata field is.
8393          */
8394         #define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_MASK \
8395                 UINT32_C(0xc00)
8396         #define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_SFT        10
8397         /*
8398          * This value is the complete 1's complement checksum calculated from
8399          * the start of the outer L3 header to the end of the packet (not
8400          * including the ethernet crc). It is valid when the
8401          * 'complete_checksum_calc' flag is set. For TPA Start completions,
8402          * the complete checksum is calculated for the first packet in the
8403          * aggregation only.
8404          */
8405         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
8406                 UINT32_C(0xffff0000)
8407         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
8408         /*
8409          * This is data from the CFA block as indicated by the meta_format
8410          * field.
8411          */
8412         uint32_t        metadata;
8413         /* When {ext_meta_format,meta_format}=1, this value is the VLAN VID. */
8414         #define RX_TPA_V2_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
8415         #define RX_TPA_V2_START_CMPL_METADATA_VID_SFT  0
8416         /* When {ext_meta_format,meta_format}=1, this value is the VLAN DE. */
8417         #define RX_TPA_V2_START_CMPL_METADATA_DE       UINT32_C(0x1000)
8418         /* When {ext_meta_format,meta_format}=1, this value is the VLAN PRI. */
8419         #define RX_TPA_V2_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
8420         #define RX_TPA_V2_START_CMPL_METADATA_PRI_SFT  13
8421         /* When {ext_meta_format,meta_format}=1, this value is the VLAN TPID. */
8422         #define RX_TPA_V2_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
8423         #define RX_TPA_V2_START_CMPL_METADATA_TPID_SFT 16
8424         uint16_t        errors_v2;
8425         /*
8426          * This value is written by the NIC such that it will be different
8427          * for each pass through the completion queue. The even passes
8428          * will write 1. The odd passes will write 0.
8429          */
8430         #define RX_TPA_V2_START_CMPL_V2 \
8431                 UINT32_C(0x1)
8432         #define RX_TPA_V2_START_CMPL_ERRORS_MASK \
8433                 UINT32_C(0xfffe)
8434         #define RX_TPA_V2_START_CMPL_ERRORS_SFT                    1
8435         /*
8436          * This error indicates that there was some sort of problem with
8437          * the BDs for the packet that was found after part of the
8438          * packet was already placed. The packet should be treated as
8439          * invalid.
8440          */
8441         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_MASK \
8442                 UINT32_C(0xe)
8443         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_SFT        1
8444         /* No buffer error */
8445         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
8446                 (UINT32_C(0x0) << 1)
8447         /*
8448          * Bad Format:
8449          * BDs were not formatted correctly.
8450          */
8451         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
8452                 (UINT32_C(0x3) << 1)
8453         /*
8454          * Flush:
8455          * There was a bad_format error on the previous operation
8456          */
8457         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
8458                 (UINT32_C(0x5) << 1)
8459         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_LAST \
8460                 RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH
8461         /*
8462          * This field identifies the CFA action rule that was used for this
8463          * packet.
8464          */
8465         uint16_t        cfa_code;
8466         /*
8467          * For devices that support timestamps this field is overridden
8468          * with the timestamp value. When `flags.timestamp_fld_format` is
8469          * cleared, this field contains the 32b timestamp for the packet from the
8470          * MAC.
8471          *
8472          * When `flags.timestamp_fld_format` is set, this field contains the
8473          * outer_l3_offset, inner_l2_offset, inner_l3_offset, and inner_l4_size
8474          * as defined below.
8475          */
8476         uint32_t        inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
8477         /*
8478          * This is the offset from the beginning of the packet in bytes for
8479          * the outer L3 header. If there is no outer L3 header, then this
8480          * value is zero.
8481          */
8482         #define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
8483         #define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_SFT 0
8484         /*
8485          * This is the offset from the beginning of the packet in bytes for
8486          * the inner most L2 header.
8487          */
8488         #define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
8489         #define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_SFT 9
8490         /*
8491          * This is the offset from the beginning of the packet in bytes for
8492          * the inner most L3 header.
8493          */
8494         #define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
8495         #define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_SFT 18
8496         /*
8497          * This is the size in bytes of the inner most L4 header.
8498          * This can be subtracted from the payload_offset to determine
8499          * the start of the inner most L4 header.
8500          */
8501         #define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
8502         #define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_SFT   27
8503 } __rte_packed;
8504
8505 /*
8506  * This TPA completion structure is used on devices where the
8507  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8508  */
8509 /* rx_tpa_v2_end_cmpl (size:128b/16B) */
8510 struct rx_tpa_v2_end_cmpl {
8511         uint16_t        flags_type;
8512         /*
8513          * This field indicates the exact type of the completion.
8514          * By convention, the LSB identifies the length of the
8515          * record in 16B units. Even values indicate 16B
8516          * records. Odd values indicate 32B
8517          * records.
8518          */
8519         #define RX_TPA_V2_END_CMPL_TYPE_MASK \
8520                 UINT32_C(0x3f)
8521         #define RX_TPA_V2_END_CMPL_TYPE_SFT                       0
8522         /*
8523          * RX L2 TPA End Completion:
8524          * Completion at the end of a TPA operation.
8525          * Length = 32B
8526          */
8527         #define RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END \
8528                 UINT32_C(0x15)
8529         #define RX_TPA_V2_END_CMPL_TYPE_LAST \
8530                 RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END
8531         #define RX_TPA_V2_END_CMPL_FLAGS_MASK \
8532                 UINT32_C(0xffc0)
8533         #define RX_TPA_V2_END_CMPL_FLAGS_SFT                      6
8534         /*
8535          * When this bit is '1', it indicates a packet that has an
8536          * error of some type. Type of error is indicated in
8537          * error_flags.
8538          */
8539         #define RX_TPA_V2_END_CMPL_FLAGS_ERROR \
8540                 UINT32_C(0x40)
8541         /* This field indicates how the packet was placed in the buffer. */
8542         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_MASK \
8543                 UINT32_C(0x380)
8544         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_SFT             7
8545         /*
8546          * Jumbo:
8547          * TPA Packet was placed using jumbo algorithm. This means
8548          * that the first buffer will be filled with data before
8549          * moving to aggregation buffers. Each aggregation buffer
8550          * will be filled before moving to the next aggregation
8551          * buffer.
8552          */
8553         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_JUMBO \
8554                 (UINT32_C(0x1) << 7)
8555         /*
8556          * Header/Data Separation:
8557          * Packet was placed using Header/Data separation algorithm.
8558          * The separation location is indicated by the itype field.
8559          */
8560         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_HDS \
8561                 (UINT32_C(0x2) << 7)
8562         /*
8563          * GRO/Jumbo:
8564          * Packet will be placed using GRO/Jumbo where the first
8565          * packet is filled with data. Subsequent packets will be
8566          * placed such that any one packet does not span two
8567          * aggregation buffers unless it starts at the beginning of
8568          * an aggregation buffer.
8569          */
8570         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
8571                 (UINT32_C(0x5) << 7)
8572         /*
8573          * GRO/Header-Data Separation:
8574          * Packet will be placed using GRO/HDS where the header
8575          * is in the first packet.
8576          * Payload of each packet will be
8577          * placed such that any one packet does not span two
8578          * aggregation buffers unless it starts at the beginning of
8579          * an aggregation buffer.
8580          */
8581         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \
8582                 (UINT32_C(0x6) << 7)
8583         /*
8584          * IOC/Header-Data Separation:
8585          * Packet will be placed using In-Order Completion/HDS where
8586          * the header is in the first packet buffer. Payload of each
8587          * packet will be placed such that each packet starts at the
8588          * beginning of an aggregation buffer.
8589          */
8590         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_IOC_HDS \
8591                 (UINT32_C(0x7) << 7)
8592         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_LAST \
8593                 RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
8594         /* unused is 1 b */
8595         #define RX_TPA_V2_END_CMPL_FLAGS_UNUSED \
8596                 UINT32_C(0x400)
8597         /*
8598          * This bit is '1' if metadata has been added to the end of the
8599          * packet in host memory. Metadata starts at the first 32B boundary
8600          * after the end of the packet for regular and jumbo placement.
8601          * It starts at the first 32B boundary after the end of the header
8602          * for HDS placement. The length of the metadata is indicated in the
8603          * metadata itself.
8604          */
8605         #define RX_TPA_V2_END_CMPL_FLAGS_PKT_METADATA_PRESENT \
8606                 UINT32_C(0x800)
8607         /*
8608          * This value indicates what the inner packet determined for the
8609          * packet was.
8610          * - 2 TCP Packet
8611          *     Indicates that the packet was IP and TCP. This indicates
8612          *     that the ip_cs field is valid and that the tcp_udp_cs
8613          *     field is valid and contains the TCP checksum.
8614          *     This also indicates that the payload_offset field is valid.
8615          */
8616         #define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_MASK \
8617                 UINT32_C(0xf000)
8618         #define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_SFT                 12
8619         /*
8620          * This value is zero for TPA End completions.
8621          * There is no data in the buffer that corresponds to the opaque
8622          * value in this completion.
8623          */
8624         uint16_t        len;
8625         /*
8626          * This is a copy of the opaque field from the RX BD this completion
8627          * corresponds to.
8628          */
8629         uint32_t        opaque;
8630         uint8_t v1;
8631         /*
8632          * This value is written by the NIC such that it will be different
8633          * for each pass through the completion queue. The even passes
8634          * will write 1. The odd passes will write 0.
8635          */
8636         #define RX_TPA_V2_END_CMPL_V1     UINT32_C(0x1)
8637         /* This value is the number of segments in the TPA operation. */
8638         uint8_t tpa_segs;
8639         /*
8640          * This is the aggregation ID that the completion is associated
8641          * with. Use this number to correlate the TPA start completion
8642          * with the TPA end completion.
8643          */
8644         uint16_t        agg_id;
8645         /*
8646          * For non-GRO packets, this value is the
8647          * timestamp delta between earliest and latest timestamp values for
8648          * TPA packet. If packets were not time stamped, then delta will be
8649          * zero.
8650          *
8651          * For GRO packets, this field is zero except for the following
8652          * sub-fields.
8653          * - tsdelta[31]
8654          *     Timestamp present indication. When '0', no Timestamp
8655          *     option is in the packet. When '1', then a Timestamp
8656          *     option is present in the packet.
8657          */
8658         uint32_t        tsdelta;
8659 } __rte_packed;
8660
8661 /*
8662  * Last 16 bytes of rx_tpa_v2_end_cmpl.
8663  *
8664  * This TPA completion structure is used on devices where the
8665  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8666  */
8667 /* rx_tpa_v2_end_cmpl_hi (size:128b/16B) */
8668 struct rx_tpa_v2_end_cmpl_hi {
8669         /*
8670          * This value is the number of duplicate ACKs that have been
8671          * received as part of the TPA operation.
8672          */
8673         uint16_t        tpa_dup_acks;
8674         /*
8675          * This value is the number of duplicate ACKs that have been
8676          * received as part of the TPA operation.
8677          */
8678         #define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
8679         #define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_SFT 0
8680         /*
8681          * This value indicated the offset in bytes from the beginning of
8682          * the packet where the inner payload starts. This value is valid
8683          * for TCP, UDP, FCoE and RoCE packets
8684          */
8685         uint8_t payload_offset;
8686         /*
8687          * The value is the total number of aggregation buffers that were
8688          * used in the TPA operation. All TPA aggregation buffer completions
8689          * precede the TPA End completion. If the value is zero, then the
8690          * aggregation is completely contained in the buffer space provided
8691          * in the aggregation start completion.
8692          * Note that the field is simply provided as a cross check.
8693          */
8694         uint8_t tpa_agg_bufs;
8695         /*
8696          * This value is the valid when TPA completion is active. It
8697          * indicates the length of the longest segment of the TPA operation
8698          * for LRO mode and the length of the first segment in GRO mode.
8699          *
8700          * This value may be used by GRO software to re-construct the original
8701          * packet stream from the TPA packet. This is the length of all
8702          * but the last segment for GRO. In LRO mode this value may be used
8703          * to indicate MSS size to the stack.
8704          */
8705         uint16_t        tpa_seg_len;
8706         uint16_t        unused_1;
8707         uint16_t        errors_v2;
8708         /*
8709          * This value is written by the NIC such that it will be different
8710          * for each pass through the completion queue. The even passes
8711          * will write 1. The odd passes will write 0.
8712          */
8713         #define RX_TPA_V2_END_CMPL_V2                             UINT32_C(0x1)
8714         #define RX_TPA_V2_END_CMPL_ERRORS_MASK \
8715                 UINT32_C(0xfffe)
8716         #define RX_TPA_V2_END_CMPL_ERRORS_SFT                     1
8717         /*
8718          * This error indicates that there was some sort of problem with
8719          * the BDs for the packet that was found after part of the
8720          * packet was already placed. The packet should be treated as
8721          * invalid.
8722          */
8723         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_MASK \
8724                 UINT32_C(0xe)
8725         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_SFT         1
8726         /* No buffer error */
8727         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
8728                 (UINT32_C(0x0) << 1)
8729         /*
8730          * This error occurs when there is a fatal HW problem in
8731          * the chip only. It indicates that there were not
8732          * BDs on chip but that there was adequate reservation.
8733          * provided by the TPA block.
8734          */
8735         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
8736                 (UINT32_C(0x2) << 1)
8737         /*
8738          * Bad Format:
8739          * BDs were not formatted correctly.
8740          */
8741         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
8742                 (UINT32_C(0x3) << 1)
8743         /*
8744          * This error occurs when TPA block was not configured to
8745          * reserve adequate BDs for TPA operations on this RX
8746          * ring. All data for the TPA operation was not placed.
8747          *
8748          * This error can also be generated when the number of
8749          * segments is not programmed correctly in TPA and the
8750          * 33 total aggregation buffers allowed for the TPA
8751          * operation has been exceeded.
8752          */
8753         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
8754                 (UINT32_C(0x4) << 1)
8755         /*
8756          * Flush:
8757          * There was a bad_format error on the previous operation
8758          */
8759         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
8760                 (UINT32_C(0x5) << 1)
8761         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
8762                 RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH
8763         uint16_t        unused_2;
8764         /*
8765          * This is the opaque value that was completed for the TPA start
8766          * completion that corresponds to this TPA end completion.
8767          */
8768         uint32_t        start_opaque;
8769 } __rte_packed;
8770
8771 /*
8772  * This TPA completion structure is used on devices where the
8773  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
8774  */
8775 /* rx_tpa_v2_abuf_cmpl (size:128b/16B) */
8776 struct rx_tpa_v2_abuf_cmpl {
8777         uint16_t        type;
8778         /*
8779          * This field indicates the exact type of the completion.
8780          * By convention, the LSB identifies the length of the
8781          * record in 16B units. Even values indicate 16B
8782          * records. Odd values indicate 32B
8783          * records.
8784          */
8785         #define RX_TPA_V2_ABUF_CMPL_TYPE_MASK      UINT32_C(0x3f)
8786         #define RX_TPA_V2_ABUF_CMPL_TYPE_SFT       0
8787         /*
8788          * RX TPA Aggregation Buffer completion:
8789          * Completion of an L2 aggregation buffer in support of
8790          * TPA packet completion. Length = 16B
8791          */
8792         #define RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG  UINT32_C(0x16)
8793         #define RX_TPA_V2_ABUF_CMPL_TYPE_LAST \
8794                 RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG
8795         /*
8796          * This is the length of the data for the packet stored in this
8797          * aggregation buffer identified by the opaque value. This does not
8798          * include the length of any
8799          * data placed in other aggregation BDs or in the packet or buffer
8800          * BDs. This length does not include any space added due to
8801          * hdr_offset register during HDS placement mode.
8802          */
8803         uint16_t        len;
8804         /*
8805          * This is a copy of the opaque field from the RX BD this aggregation
8806          * buffer corresponds to.
8807          */
8808         uint32_t        opaque;
8809         uint16_t        v;
8810         /*
8811          * This value is written by the NIC such that it will be different
8812          * for each pass through the completion queue. The even passes
8813          * will write 1. The odd passes will write 0.
8814          */
8815         #define RX_TPA_V2_ABUF_CMPL_V     UINT32_C(0x1)
8816         /*
8817          * This is the aggregation ID that the completion is associated with. Use
8818          * this number to correlate the TPA agg completion with the TPA start
8819          * completion and the TPA end completion.
8820          */
8821         uint16_t        agg_id;
8822         uint32_t        unused_1;
8823 } __rte_packed;
8824
8825 /* rx_abuf_cmpl (size:128b/16B) */
8826 struct rx_abuf_cmpl {
8827         uint16_t        type;
8828         /*
8829          * This field indicates the exact type of the completion.
8830          * By convention, the LSB identifies the length of the
8831          * record in 16B units. Even values indicate 16B
8832          * records. Odd values indicate 32B
8833          * records.
8834          */
8835         #define RX_ABUF_CMPL_TYPE_MASK  UINT32_C(0x3f)
8836         #define RX_ABUF_CMPL_TYPE_SFT   0
8837         /*
8838          * RX Aggregation Buffer completion:
8839          * Completion of an L2 aggregation buffer in support of
8840          * TPA, HDS, or Jumbo packet completion. Length = 16B
8841          */
8842         #define RX_ABUF_CMPL_TYPE_RX_AGG  UINT32_C(0x12)
8843         #define RX_ABUF_CMPL_TYPE_LAST   RX_ABUF_CMPL_TYPE_RX_AGG
8844         /*
8845          * This is the length of the data for the packet stored in this
8846          * aggregation buffer identified by the opaque value. This does not
8847          * include the length of any
8848          * data placed in other aggregation BDs or in the packet or buffer
8849          * BDs. This length does not include any space added due to
8850          * hdr_offset register during HDS placement mode.
8851          */
8852         uint16_t        len;
8853         /*
8854          * This is a copy of the opaque field from the RX BD this aggregation
8855          * buffer corresponds to.
8856          */
8857         uint32_t        opaque;
8858         uint32_t        v;
8859         /*
8860          * This value is written by the NIC such that it will be different
8861          * for each pass through the completion queue. The even passes
8862          * will write 1. The odd passes will write 0.
8863          */
8864         #define RX_ABUF_CMPL_V     UINT32_C(0x1)
8865         /* unused3 is 32 b */
8866         uint32_t        unused_2;
8867 } __rte_packed;
8868
8869 /* VEE FLUSH Completion Record (16 bytes) */
8870 /* vee_flush (size:128b/16B) */
8871 struct vee_flush {
8872         uint32_t        downstream_path_type;
8873         /*
8874          * This field indicates the exact type of the completion.
8875          * By convention, the LSB identifies the length of the
8876          * record in 16B units. Even values indicate 16B
8877          * records. Odd values indicate 32B
8878          * records.
8879          */
8880         #define VEE_FLUSH_TYPE_MASK           UINT32_C(0x3f)
8881         #define VEE_FLUSH_TYPE_SFT            0
8882         /*
8883          * VEE Flush Completion:
8884          * This completion is inserted manually by the Primate and processed
8885          * by the VEE hardware to ensure that all completions on a VEE
8886          * function have been processed by the VEE hardware before FLR
8887          * process is completed.
8888          */
8889         #define VEE_FLUSH_TYPE_VEE_FLUSH        UINT32_C(0x1c)
8890         #define VEE_FLUSH_TYPE_LAST            VEE_FLUSH_TYPE_VEE_FLUSH
8891         /* downstream_path is 1 b */
8892         #define VEE_FLUSH_DOWNSTREAM_PATH     UINT32_C(0x40)
8893         /* This completion is associated with VEE Transmit */
8894         #define VEE_FLUSH_DOWNSTREAM_PATH_TX    (UINT32_C(0x0) << 6)
8895         /* This completion is associated with VEE Receive */
8896         #define VEE_FLUSH_DOWNSTREAM_PATH_RX    (UINT32_C(0x1) << 6)
8897         #define VEE_FLUSH_DOWNSTREAM_PATH_LAST VEE_FLUSH_DOWNSTREAM_PATH_RX
8898         /*
8899          * This is an opaque value that is passed through the completion
8900          * to the VEE handler SW and is used to indicate what VEE VQ or
8901          * function has completed FLR processing.
8902          */
8903         uint32_t        opaque;
8904         uint32_t        v;
8905         /*
8906          * This value is written by the NIC such that it will be different
8907          * for each pass through the completion queue. The even passes will
8908          * write 1. The odd passes will write 0.
8909          */
8910         #define VEE_FLUSH_V     UINT32_C(0x1)
8911         /* unused3 is 32 b */
8912         uint32_t        unused_3;
8913 } __rte_packed;
8914
8915 /* eject_cmpl (size:128b/16B) */
8916 struct eject_cmpl {
8917         uint16_t        type;
8918         /*
8919          * This field indicates the exact type of the completion.
8920          * By convention, the LSB identifies the length of the
8921          * record in 16B units. Even values indicate 16B
8922          * records. Odd values indicate 32B
8923          * records.
8924          */
8925         #define EJECT_CMPL_TYPE_MASK       UINT32_C(0x3f)
8926         #define EJECT_CMPL_TYPE_SFT        0
8927         /*
8928          * Statistics Ejection Completion:
8929          * Completion of statistics data ejection buffer.
8930          * Length = 16B
8931          */
8932         #define EJECT_CMPL_TYPE_STAT_EJECT   UINT32_C(0x1a)
8933         #define EJECT_CMPL_TYPE_LAST        EJECT_CMPL_TYPE_STAT_EJECT
8934         #define EJECT_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
8935         #define EJECT_CMPL_FLAGS_SFT       6
8936         /*
8937          * When this bit is '1', it indicates a packet that has an
8938          * error of some type. Type of error is indicated in
8939          * error_flags.
8940          */
8941         #define EJECT_CMPL_FLAGS_ERROR      UINT32_C(0x40)
8942         /*
8943          * This is the length of the statistics data stored in this
8944          * buffer.
8945          */
8946         uint16_t        len;
8947         /*
8948          * This is a copy of the opaque field from the RX BD this ejection
8949          * buffer corresponds to.
8950          */
8951         uint32_t        opaque;
8952         uint16_t        v;
8953         /*
8954          * This value is written by the NIC such that it will be different
8955          * for each pass through the completion queue. The even passes
8956          * will write 1. The odd passes will write 0.
8957          */
8958         #define EJECT_CMPL_V                              UINT32_C(0x1)
8959         #define EJECT_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
8960         #define EJECT_CMPL_ERRORS_SFT                     1
8961         /*
8962          * This error indicates that there was some sort of problem with
8963          * the BDs for statistics ejection. The statistics ejection should
8964          * be treated as invalid
8965          */
8966         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
8967         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_SFT         1
8968         /* No buffer error */
8969         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
8970                 (UINT32_C(0x0) << 1)
8971         /*
8972          * Did Not Fit:
8973          * Statistics did not fit into aggregation buffer provided.
8974          */
8975         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
8976                 (UINT32_C(0x1) << 1)
8977         /*
8978          * Bad Format:
8979          * BDs were not formatted correctly.
8980          */
8981         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
8982                 (UINT32_C(0x3) << 1)
8983         /*
8984          * Flush:
8985          * There was a bad_format error on the previous operation
8986          */
8987         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
8988                 (UINT32_C(0x5) << 1)
8989         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_LAST \
8990                 EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
8991         /* reserved16 is 16 b */
8992         uint16_t        reserved16;
8993         /* unused3 is 32 b */
8994         uint32_t        unused_2;
8995 } __rte_packed;
8996
8997 /* hwrm_cmpl (size:128b/16B) */
8998 struct hwrm_cmpl {
8999         uint16_t        type;
9000         /*
9001          * This field indicates the exact type of the completion.
9002          * By convention, the LSB identifies the length of the
9003          * record in 16B units. Even values indicate 16B
9004          * records. Odd values indicate 32B
9005          * records.
9006          */
9007         #define HWRM_CMPL_TYPE_MASK     UINT32_C(0x3f)
9008         #define HWRM_CMPL_TYPE_SFT      0
9009         /*
9010          * HWRM Command Completion:
9011          * Completion of an HWRM command.
9012          */
9013         #define HWRM_CMPL_TYPE_HWRM_DONE  UINT32_C(0x20)
9014         #define HWRM_CMPL_TYPE_LAST      HWRM_CMPL_TYPE_HWRM_DONE
9015         /* This is the sequence_id of the HWRM command that has completed. */
9016         uint16_t        sequence_id;
9017         /* unused2 is 32 b */
9018         uint32_t        unused_1;
9019         uint32_t        v;
9020         /*
9021          * This value is written by the NIC such that it will be different
9022          * for each pass through the completion queue. The even passes
9023          * will write 1. The odd passes will write 0.
9024          */
9025         #define HWRM_CMPL_V     UINT32_C(0x1)
9026         /* unused4 is 32 b */
9027         uint32_t        unused_3;
9028 } __rte_packed;
9029
9030 /* hwrm_fwd_req_cmpl (size:128b/16B) */
9031 struct hwrm_fwd_req_cmpl {
9032         /*
9033          * This field indicates the exact type of the completion.
9034          * By convention, the LSB identifies the length of the
9035          * record in 16B units. Even values indicate 16B
9036          * records. Odd values indicate 32B
9037          * records.
9038          */
9039         uint16_t        req_len_type;
9040         /*
9041          * This field indicates the exact type of the completion.
9042          * By convention, the LSB identifies the length of the
9043          * record in 16B units. Even values indicate 16B
9044          * records. Odd values indicate 32B
9045          * records.
9046          */
9047         #define HWRM_FWD_REQ_CMPL_TYPE_MASK        UINT32_C(0x3f)
9048         #define HWRM_FWD_REQ_CMPL_TYPE_SFT         0
9049         /* Forwarded HWRM Request */
9050         #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ  UINT32_C(0x22)
9051         #define HWRM_FWD_REQ_CMPL_TYPE_LAST \
9052                 HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ
9053         /* Length of forwarded request in bytes. */
9054         #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK     UINT32_C(0xffc0)
9055         #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT      6
9056         /*
9057          * Source ID of this request.
9058          * Typically used in forwarding requests and responses.
9059          * 0x0 - 0xFFF8 - Used for function ids
9060          * 0xFFF8 - 0xFFFE - Reserved for internal processors
9061          * 0xFFFF - HWRM
9062          */
9063         uint16_t        source_id;
9064         /* unused1 is 32 b */
9065         uint32_t        unused0;
9066         /* Address of forwarded request. */
9067         uint32_t        req_buf_addr_v[2];
9068         /*
9069          * This value is written by the NIC such that it will be different
9070          * for each pass through the completion queue. The even passes
9071          * will write 1. The odd passes will write 0.
9072          */
9073         #define HWRM_FWD_REQ_CMPL_V                UINT32_C(0x1)
9074         /* Address of forwarded request. */
9075         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
9076         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
9077 } __rte_packed;
9078
9079 /* hwrm_fwd_resp_cmpl (size:128b/16B) */
9080 struct hwrm_fwd_resp_cmpl {
9081         uint16_t        type;
9082         /*
9083          * This field indicates the exact type of the completion.
9084          * By convention, the LSB identifies the length of the
9085          * record in 16B units. Even values indicate 16B
9086          * records. Odd values indicate 32B
9087          * records.
9088          */
9089         #define HWRM_FWD_RESP_CMPL_TYPE_MASK         UINT32_C(0x3f)
9090         #define HWRM_FWD_RESP_CMPL_TYPE_SFT          0
9091         /* Forwarded HWRM Response */
9092         #define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP  UINT32_C(0x24)
9093         #define HWRM_FWD_RESP_CMPL_TYPE_LAST \
9094                 HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP
9095         /*
9096          * Source ID of this response.
9097          * Typically used in forwarding requests and responses.
9098          * 0x0 - 0xFFF8 - Used for function ids
9099          * 0xFFF8 - 0xFFFE - Reserved for internal processors
9100          * 0xFFFF - HWRM
9101          */
9102         uint16_t        source_id;
9103         /* Length of forwarded response in bytes. */
9104         uint16_t        resp_len;
9105         /* unused2 is 16 b */
9106         uint16_t        unused_1;
9107         /* Address of forwarded request. */
9108         uint32_t        resp_buf_addr_v[2];
9109         /*
9110          * This value is written by the NIC such that it will be different
9111          * for each pass through the completion queue. The even passes
9112          * will write 1. The odd passes will write 0.
9113          */
9114         #define HWRM_FWD_RESP_CMPL_V                 UINT32_C(0x1)
9115         /* Address of forwarded request. */
9116         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe)
9117         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
9118 } __rte_packed;
9119
9120 /* hwrm_async_event_cmpl (size:128b/16B) */
9121 struct hwrm_async_event_cmpl {
9122         uint16_t        type;
9123         /*
9124          * This field indicates the exact type of the completion.
9125          * By convention, the LSB identifies the length of the
9126          * record in 16B units. Even values indicate 16B
9127          * records. Odd values indicate 32B
9128          * records.
9129          */
9130         #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK            UINT32_C(0x3f)
9131         #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT             0
9132         /* HWRM Asynchronous Event Information */
9133         #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
9134         #define HWRM_ASYNC_EVENT_CMPL_TYPE_LAST \
9135                 HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT
9136         /* Identifiers of events. */
9137         uint16_t        event_id;
9138         /* Link status changed */
9139         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \
9140                 UINT32_C(0x0)
9141         /* Link MTU changed */
9142         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \
9143                 UINT32_C(0x1)
9144         /* Link speed changed */
9145         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \
9146                 UINT32_C(0x2)
9147         /* DCB Configuration changed */
9148         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \
9149                 UINT32_C(0x3)
9150         /* Port connection not allowed */
9151         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \
9152                 UINT32_C(0x4)
9153         /* Link speed configuration was not allowed */
9154         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
9155                 UINT32_C(0x5)
9156         /* Link speed configuration change */
9157         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE \
9158                 UINT32_C(0x6)
9159         /* Port PHY configuration change */
9160         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE \
9161                 UINT32_C(0x7)
9162         /* Reset notification to clients */
9163         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY \
9164                 UINT32_C(0x8)
9165         /* Master function selection event */
9166         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY \
9167                 UINT32_C(0x9)
9168         /*
9169          * An event signifying that a ring has been disabled by
9170          * hw due to error.
9171          */
9172         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG \
9173                 UINT32_C(0xa)
9174         /* Function driver unloaded */
9175         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \
9176                 UINT32_C(0x10)
9177         /* Function driver loaded */
9178         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \
9179                 UINT32_C(0x11)
9180         /* Function FLR related processing has completed */
9181         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT \
9182                 UINT32_C(0x12)
9183         /* PF driver unloaded */
9184         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \
9185                 UINT32_C(0x20)
9186         /* PF driver loaded */
9187         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \
9188                 UINT32_C(0x21)
9189         /* VF Function Level Reset (FLR) */
9190         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR \
9191                 UINT32_C(0x30)
9192         /* VF MAC Address Change */
9193         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \
9194                 UINT32_C(0x31)
9195         /* PF-VF communication channel status change. */
9196         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
9197                 UINT32_C(0x32)
9198         /* VF Configuration Change */
9199         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE \
9200                 UINT32_C(0x33)
9201         /* LLFC/PFC Configuration Change */
9202         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE \
9203                 UINT32_C(0x34)
9204         /* Default VNIC Configuration Change */
9205         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE \
9206                 UINT32_C(0x35)
9207         /* HW flow aged */
9208         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HW_FLOW_AGED \
9209                 UINT32_C(0x36)
9210         /*
9211          * A debug notification being posted to the driver. These
9212          * notifications are purely for diagnostic purpose and should not be
9213          * used for functional purpose. The driver is not supposed to act
9214          * on these messages except to log/record it.
9215          */
9216         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION \
9217                 UINT32_C(0x37)
9218         /*
9219          * An EEM flow cached memory flush for all flows request event being
9220          * posted to the PF driver.
9221          */
9222         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_REQ \
9223                 UINT32_C(0x38)
9224         /*
9225          * An EEM flow cache memory flush completion event being posted to the
9226          * firmware by the PF driver. This is indication that host EEM flush
9227          * has completed by the PF.
9228          */
9229         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_DONE \
9230                 UINT32_C(0x39)
9231         /*
9232          * A tcp flag action change event being posted to the PF or trusted VF
9233          * driver by the firmware. The PF or trusted VF driver should query
9234          * the firmware for the new TCP flag action update after receiving
9235          * this async event.
9236          */
9237         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TCP_FLAG_ACTION_CHANGE \
9238                 UINT32_C(0x3a)
9239         /*
9240          * An EEM flow active event being posted to the PF or trusted VF driver
9241          * by the firmware. The PF or trusted VF driver should update the
9242          * flow's aging timer after receiving this async event.
9243          */
9244         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_FLOW_ACTIVE \
9245                 UINT32_C(0x3b)
9246         /*
9247          * A eem cfg change event being posted to the trusted VF driver by the
9248          * firmware if the parent PF EEM configuration changed.
9249          */
9250         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CFG_CHANGE \
9251                 UINT32_C(0x3c)
9252         /*
9253          * Deprecated.
9254          * TFLIB unique default VNIC Configuration Change
9255          */
9256         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_DEFAULT_VNIC_CHANGE \
9257                 UINT32_C(0x3d)
9258         /*
9259          * Deprecated.
9260          * TFLIB unique link status changed
9261          */
9262         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_LINK_STATUS_CHANGE \
9263                 UINT32_C(0x3e)
9264         /*
9265          * An event signifying completion for HWRM_FW_STATE_QUIESCE
9266          * (completion, timeout, or error)
9267          */
9268         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_QUIESCE_DONE \
9269                 UINT32_C(0x3f)
9270         /*
9271          * An event signifying a HWRM command is in progress and its
9272          * response will be deferred. This event is used on crypto controllers
9273          * only.
9274          */
9275         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFERRED_RESPONSE \
9276                 UINT32_C(0x40)
9277         /*
9278          * An event signifying that a PFC WatchDog configuration
9279          * has changed on any port / cos.
9280          */
9281         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE \
9282                 UINT32_C(0x41)
9283         /*
9284          * An echo request from the firmware. An echo response is expected by
9285          * the firmware.
9286          */
9287         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST \
9288                 UINT32_C(0x42)
9289         /*
9290          * An event from firmware indicating who has been selected as the
9291          * PHC Master or secondary. Also indicates the last time a failover
9292          * happens. Event will also be sent when PHC rolls over.
9293          */
9294         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PHC_UPDATE \
9295                 UINT32_C(0x43)
9296         /*
9297          * An event from firmware showing the last PPS timestamp that has been
9298          * latched.
9299          */
9300         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PPS_TIMESTAMP \
9301                 UINT32_C(0x44)
9302         /*
9303          * An event from firmware indicating that an error has occurred.
9304          * The driver should log the event so that an administrator can be
9305          * aware that a problem has occurred that may need attention.
9306          */
9307         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT \
9308                 UINT32_C(0x45)
9309         /*
9310          * An event from firmware indicating that the programmed pacing
9311          * threshold for the doorbell global FIFO has been crossed. The driver
9312          * needs to take appropriate action to pace the doorbells when this
9313          * event is received from the firmware.
9314          */
9315         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DOORBELL_PACING_THRESHOLD \
9316                 UINT32_C(0x46)
9317         /* Maximum Registrable event id. */
9318         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID \
9319                 UINT32_C(0x47)
9320         /*
9321          * A trace log message. This contains firmware trace logs string
9322          * embedded in the asynchronous message. This is an experimental
9323          * event, not meant for production use at this time.
9324          */
9325         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG \
9326                 UINT32_C(0xfe)
9327         /* HWRM Error */
9328         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \
9329                 UINT32_C(0xff)
9330         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LAST \
9331                 HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR
9332         /* Event specific data */
9333         uint32_t        event_data2;
9334         uint8_t opaque_v;
9335         /*
9336          * This value is written by the NIC such that it will be different
9337          * for each pass through the completion queue. The even passes
9338          * will write 1. The odd passes will write 0.
9339          */
9340         #define HWRM_ASYNC_EVENT_CMPL_V          UINT32_C(0x1)
9341         /* opaque is 7 b */
9342         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
9343         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
9344         /* 8-lsb timestamp from POR (100-msec resolution) */
9345         uint8_t timestamp_lo;
9346         /* 16-lsb timestamp from POR (100-msec resolution) */
9347         uint16_t        timestamp_hi;
9348         /* Event specific data */
9349         uint32_t        event_data1;
9350 } __rte_packed;
9351
9352 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */
9353 struct hwrm_async_event_cmpl_link_status_change {
9354         uint16_t        type;
9355         /*
9356          * This field indicates the exact type of the completion.
9357          * By convention, the LSB identifies the length of the
9358          * record in 16B units. Even values indicate 16B
9359          * records. Odd values indicate 32B
9360          * records.
9361          */
9362         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK \
9363                 UINT32_C(0x3f)
9364         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT             0
9365         /* HWRM Asynchronous Event Information */
9366         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
9367                 UINT32_C(0x2e)
9368         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_LAST \
9369                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
9370         /* Identifiers of events. */
9371         uint16_t        event_id;
9372         /* Link status changed */
9373         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE \
9374                 UINT32_C(0x0)
9375         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LAST \
9376                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE
9377         /* Event specific data */
9378         uint32_t        event_data2;
9379         uint8_t opaque_v;
9380         /*
9381          * This value is written by the NIC such that it will be different
9382          * for each pass through the completion queue. The even passes
9383          * will write 1. The odd passes will write 0.
9384          */
9385         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V \
9386                 UINT32_C(0x1)
9387         /* opaque is 7 b */
9388         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK \
9389                 UINT32_C(0xfe)
9390         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
9391         /* 8-lsb timestamp from POR (100-msec resolution) */
9392         uint8_t timestamp_lo;
9393         /* 16-lsb timestamp from POR (100-msec resolution) */
9394         uint16_t        timestamp_hi;
9395         /* Event specific data */
9396         uint32_t        event_data1;
9397         /* Indicates link status change */
9398         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE \
9399                 UINT32_C(0x1)
9400         /*
9401          * If this bit set to 0, then it indicates that the link
9402          * was up and it went down.
9403          */
9404         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN \
9405                 UINT32_C(0x0)
9406         /*
9407          * If this bit is set to 1, then it indicates that the link
9408          * was down and it went up.
9409          */
9410         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP \
9411                 UINT32_C(0x1)
9412         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_LAST \
9413                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP
9414         /* Indicates the physical port this link status change occur */
9415         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK \
9416                 UINT32_C(0xe)
9417         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT \
9418                 1
9419         /* PORT ID */
9420         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK \
9421                 UINT32_C(0xffff0)
9422         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT \
9423                 4
9424         /* Indicates the physical function this event occurred on. */
9425         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_MASK \
9426                 UINT32_C(0xff00000)
9427         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_SFT \
9428                 20
9429 } __rte_packed;
9430
9431 /* hwrm_async_event_cmpl_link_mtu_change (size:128b/16B) */
9432 struct hwrm_async_event_cmpl_link_mtu_change {
9433         uint16_t        type;
9434         /*
9435          * This field indicates the exact type of the completion.
9436          * By convention, the LSB identifies the length of the
9437          * record in 16B units. Even values indicate 16B
9438          * records. Odd values indicate 32B
9439          * records.
9440          */
9441         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK \
9442                 UINT32_C(0x3f)
9443         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT             0
9444         /* HWRM Asynchronous Event Information */
9445         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT \
9446                 UINT32_C(0x2e)
9447         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_LAST \
9448                 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT
9449         /* Identifiers of events. */
9450         uint16_t        event_id;
9451         /* Link MTU changed */
9452         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE \
9453                 UINT32_C(0x1)
9454         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LAST \
9455                 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE
9456         /* Event specific data */
9457         uint32_t        event_data2;
9458         uint8_t opaque_v;
9459         /*
9460          * This value is written by the NIC such that it will be different
9461          * for each pass through the completion queue. The even passes
9462          * will write 1. The odd passes will write 0.
9463          */
9464         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V          UINT32_C(0x1)
9465         /* opaque is 7 b */
9466         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK \
9467                 UINT32_C(0xfe)
9468         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT 1
9469         /* 8-lsb timestamp from POR (100-msec resolution) */
9470         uint8_t timestamp_lo;
9471         /* 16-lsb timestamp from POR (100-msec resolution) */
9472         uint16_t        timestamp_hi;
9473         /* Event specific data */
9474         uint32_t        event_data1;
9475         /* The new MTU of the link in bytes. */
9476         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK \
9477                 UINT32_C(0xffff)
9478         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
9479 } __rte_packed;
9480
9481 /* hwrm_async_event_cmpl_link_speed_change (size:128b/16B) */
9482 struct hwrm_async_event_cmpl_link_speed_change {
9483         uint16_t        type;
9484         /*
9485          * This field indicates the exact type of the completion.
9486          * By convention, the LSB identifies the length of the
9487          * record in 16B units. Even values indicate 16B
9488          * records. Odd values indicate 32B
9489          * records.
9490          */
9491         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK \
9492                 UINT32_C(0x3f)
9493         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT             0
9494         /* HWRM Asynchronous Event Information */
9495         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT \
9496                 UINT32_C(0x2e)
9497         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_LAST \
9498                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT
9499         /* Identifiers of events. */
9500         uint16_t        event_id;
9501         /* Link speed changed */
9502         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE \
9503                 UINT32_C(0x2)
9504         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LAST \
9505                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE
9506         /* Event specific data */
9507         uint32_t        event_data2;
9508         uint8_t opaque_v;
9509         /*
9510          * This value is written by the NIC such that it will be different
9511          * for each pass through the completion queue. The even passes
9512          * will write 1. The odd passes will write 0.
9513          */
9514         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V \
9515                 UINT32_C(0x1)
9516         /* opaque is 7 b */
9517         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK \
9518                 UINT32_C(0xfe)
9519         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
9520         /* 8-lsb timestamp from POR (100-msec resolution) */
9521         uint8_t timestamp_lo;
9522         /* 16-lsb timestamp from POR (100-msec resolution) */
9523         uint16_t        timestamp_hi;
9524         /* Event specific data */
9525         uint32_t        event_data1;
9526         /*
9527          * When this bit is '1', the link was forced to the
9528          * force_link_speed value.
9529          */
9530         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE \
9531                 UINT32_C(0x1)
9532         /* The new link speed in 100 Mbps units. */
9533         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK \
9534                 UINT32_C(0xfffe)
9535         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT \
9536                 1
9537         /* 100Mb link speed */
9538         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB \
9539                 (UINT32_C(0x1) << 1)
9540         /* 1Gb link speed */
9541         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB \
9542                 (UINT32_C(0xa) << 1)
9543         /* 2Gb link speed */
9544         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB \
9545                 (UINT32_C(0x14) << 1)
9546         /* 25Gb link speed */
9547         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB \
9548                 (UINT32_C(0x19) << 1)
9549         /* 10Gb link speed */
9550         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB \
9551                 (UINT32_C(0x64) << 1)
9552         /* 20Mb link speed */
9553         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB \
9554                 (UINT32_C(0xc8) << 1)
9555         /* 25Gb link speed */
9556         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB \
9557                 (UINT32_C(0xfa) << 1)
9558         /* 40Gb link speed */
9559         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB \
9560                 (UINT32_C(0x190) << 1)
9561         /* 50Gb link speed */
9562         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB \
9563                 (UINT32_C(0x1f4) << 1)
9564         /* 100Gb link speed */
9565         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB \
9566                 (UINT32_C(0x3e8) << 1)
9567         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_LAST \
9568                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB
9569         /* PORT ID */
9570         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK \
9571                 UINT32_C(0xffff0000)
9572         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT \
9573                 16
9574 } __rte_packed;
9575
9576 /* hwrm_async_event_cmpl_dcb_config_change (size:128b/16B) */
9577 struct hwrm_async_event_cmpl_dcb_config_change {
9578         uint16_t        type;
9579         /*
9580          * This field indicates the exact type of the completion.
9581          * By convention, the LSB identifies the length of the
9582          * record in 16B units. Even values indicate 16B
9583          * records. Odd values indicate 32B
9584          * records.
9585          */
9586         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK \
9587                 UINT32_C(0x3f)
9588         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT             0
9589         /* HWRM Asynchronous Event Information */
9590         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
9591                 UINT32_C(0x2e)
9592         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_LAST \
9593                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT
9594         /* Identifiers of events. */
9595         uint16_t        event_id;
9596         /* DCB Configuration changed */
9597         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE \
9598                 UINT32_C(0x3)
9599         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_LAST \
9600                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE
9601         /* Event specific data */
9602         uint32_t        event_data2;
9603         /* ETS configuration change */
9604         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS \
9605                 UINT32_C(0x1)
9606         /* PFC configuration change */
9607         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC \
9608                 UINT32_C(0x2)
9609         /* APP configuration change */
9610         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP \
9611                 UINT32_C(0x4)
9612         /* DSCP configuration change */
9613         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_DSCP \
9614                 UINT32_C(0x8)
9615         uint8_t opaque_v;
9616         /*
9617          * This value is written by the NIC such that it will be different
9618          * for each pass through the completion queue. The even passes
9619          * will write 1. The odd passes will write 0.
9620          */
9621         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V \
9622                 UINT32_C(0x1)
9623         /* opaque is 7 b */
9624         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK \
9625                 UINT32_C(0xfe)
9626         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
9627         /* 8-lsb timestamp from POR (100-msec resolution) */
9628         uint8_t timestamp_lo;
9629         /* 16-lsb timestamp from POR (100-msec resolution) */
9630         uint16_t        timestamp_hi;
9631         /* Event specific data */
9632         uint32_t        event_data1;
9633         /* PORT ID */
9634         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
9635                 UINT32_C(0xffff)
9636         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
9637                 0
9638         /* Priority recommended for RoCE traffic */
9639         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK \
9640                 UINT32_C(0xff0000)
9641         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT \
9642                 16
9643         /* none is 255 */
9644         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE \
9645                 (UINT32_C(0xff) << 16)
9646         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_LAST \
9647                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE
9648         /* Priority recommended for L2 traffic */
9649         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK \
9650                 UINT32_C(0xff000000)
9651         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT \
9652                 24
9653         /* none is 255 */
9654         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE \
9655                 (UINT32_C(0xff) << 24)
9656         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_LAST \
9657                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE
9658 } __rte_packed;
9659
9660 /* hwrm_async_event_cmpl_port_conn_not_allowed (size:128b/16B) */
9661 struct hwrm_async_event_cmpl_port_conn_not_allowed {
9662         uint16_t        type;
9663         /*
9664          * This field indicates the exact type of the completion.
9665          * By convention, the LSB identifies the length of the
9666          * record in 16B units. Even values indicate 16B
9667          * records. Odd values indicate 32B
9668          * records.
9669          */
9670         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK \
9671                 UINT32_C(0x3f)
9672         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT \
9673                 0
9674         /* HWRM Asynchronous Event Information */
9675         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \
9676                 UINT32_C(0x2e)
9677         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_LAST \
9678                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
9679         /* Identifiers of events. */
9680         uint16_t        event_id;
9681         /* Port connection not allowed */
9682         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED \
9683                 UINT32_C(0x4)
9684         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_LAST \
9685                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED
9686         /* Event specific data */
9687         uint32_t        event_data2;
9688         uint8_t opaque_v;
9689         /*
9690          * This value is written by the NIC such that it will be different
9691          * for each pass through the completion queue. The even passes
9692          * will write 1. The odd passes will write 0.
9693          */
9694         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V \
9695                 UINT32_C(0x1)
9696         /* opaque is 7 b */
9697         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK \
9698                 UINT32_C(0xfe)
9699         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
9700         /* 8-lsb timestamp from POR (100-msec resolution) */
9701         uint8_t timestamp_lo;
9702         /* 16-lsb timestamp from POR (100-msec resolution) */
9703         uint16_t        timestamp_hi;
9704         /* Event specific data */
9705         uint32_t        event_data1;
9706         /* PORT ID */
9707         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \
9708                 UINT32_C(0xffff)
9709         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
9710                 0
9711         /*
9712          * This value indicates the current port level enforcement policy
9713          * for the optics module when there is an optical module mismatch
9714          * and port is not connected.
9715          */
9716         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK \
9717                 UINT32_C(0xff0000)
9718         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT \
9719                 16
9720         /* No enforcement */
9721         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE \
9722                 (UINT32_C(0x0) << 16)
9723         /* Disable Transmit side Laser. */
9724         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX \
9725                 (UINT32_C(0x1) << 16)
9726         /* Raise a warning message. */
9727         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG \
9728                 (UINT32_C(0x2) << 16)
9729         /* Power down the module. */
9730         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN \
9731                 (UINT32_C(0x3) << 16)
9732         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_LAST \
9733                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN
9734 } __rte_packed;
9735
9736 /* hwrm_async_event_cmpl_link_speed_cfg_not_allowed (size:128b/16B) */
9737 struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
9738         uint16_t        type;
9739         /*
9740          * This field indicates the exact type of the completion.
9741          * By convention, the LSB identifies the length of the
9742          * record in 16B units. Even values indicate 16B
9743          * records. Odd values indicate 32B
9744          * records.
9745          */
9746         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK \
9747                 UINT32_C(0x3f)
9748         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT \
9749                 0
9750         /* HWRM Asynchronous Event Information */
9751         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \
9752                 UINT32_C(0x2e)
9753         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_LAST \
9754                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
9755         /* Identifiers of events. */
9756         uint16_t        event_id;
9757         /* Link speed configuration was not allowed */
9758         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
9759                 UINT32_C(0x5)
9760         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LAST \
9761                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED
9762         /* Event specific data */
9763         uint32_t        event_data2;
9764         uint8_t opaque_v;
9765         /*
9766          * This value is written by the NIC such that it will be different
9767          * for each pass through the completion queue. The even passes
9768          * will write 1. The odd passes will write 0.
9769          */
9770         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V \
9771                 UINT32_C(0x1)
9772         /* opaque is 7 b */
9773         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK \
9774                 UINT32_C(0xfe)
9775         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1
9776         /* 8-lsb timestamp from POR (100-msec resolution) */
9777         uint8_t timestamp_lo;
9778         /* 16-lsb timestamp from POR (100-msec resolution) */
9779         uint16_t        timestamp_hi;
9780         /* Event specific data */
9781         uint32_t        event_data1;
9782         /* PORT ID */
9783         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \
9784                 UINT32_C(0xffff)
9785         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
9786                 0
9787 } __rte_packed;
9788
9789 /* hwrm_async_event_cmpl_link_speed_cfg_change (size:128b/16B) */
9790 struct hwrm_async_event_cmpl_link_speed_cfg_change {
9791         uint16_t        type;
9792         /*
9793          * This field indicates the exact type of the completion.
9794          * By convention, the LSB identifies the length of the
9795          * record in 16B units. Even values indicate 16B
9796          * records. Odd values indicate 32B
9797          * records.
9798          */
9799         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK \
9800                 UINT32_C(0x3f)
9801         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT \
9802                 0
9803         /* HWRM Asynchronous Event Information */
9804         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
9805                 UINT32_C(0x2e)
9806         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_LAST \
9807                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
9808         /* Identifiers of events. */
9809         uint16_t        event_id;
9810         /* Link speed configuration change */
9811         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE \
9812                 UINT32_C(0x6)
9813         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LAST \
9814                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE
9815         /* Event specific data */
9816         uint32_t        event_data2;
9817         uint8_t opaque_v;
9818         /*
9819          * This value is written by the NIC such that it will be different
9820          * for each pass through the completion queue. The even passes
9821          * will write 1. The odd passes will write 0.
9822          */
9823         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V \
9824                 UINT32_C(0x1)
9825         /* opaque is 7 b */
9826         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK \
9827                 UINT32_C(0xfe)
9828         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1
9829         /* 8-lsb timestamp from POR (100-msec resolution) */
9830         uint8_t timestamp_lo;
9831         /* 16-lsb timestamp from POR (100-msec resolution) */
9832         uint16_t        timestamp_hi;
9833         /* Event specific data */
9834         uint32_t        event_data1;
9835         /* PORT ID */
9836         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
9837                 UINT32_C(0xffff)
9838         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
9839                 0
9840         /*
9841          * If set to 1, it indicates that the supported link speeds
9842          * configuration on the port has changed.
9843          * If set to 0, then there is no change in supported link speeds
9844          * configuration.
9845          */
9846         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE \
9847                 UINT32_C(0x10000)
9848         /*
9849          * If set to 1, it indicates that the link speed configuration
9850          * on the port has become illegal or invalid.
9851          * If set to 0, then the link speed configuration on the port is
9852          * legal or valid.
9853          */
9854         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG \
9855                 UINT32_C(0x20000)
9856 } __rte_packed;
9857
9858 /* hwrm_async_event_cmpl_port_phy_cfg_change (size:128b/16B) */
9859 struct hwrm_async_event_cmpl_port_phy_cfg_change {
9860         uint16_t        type;
9861         /*
9862          * This field indicates the exact type of the completion.
9863          * By convention, the LSB identifies the length of the
9864          * record in 16B units. Even values indicate 16B
9865          * records. Odd values indicate 32B
9866          * records.
9867          */
9868         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_MASK \
9869                 UINT32_C(0x3f)
9870         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_SFT \
9871                 0
9872         /* HWRM Asynchronous Event Information */
9873         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
9874                 UINT32_C(0x2e)
9875         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_LAST \
9876                 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
9877         /* Identifiers of events. */
9878         uint16_t        event_id;
9879         /* Port PHY configuration change */
9880         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE \
9881                 UINT32_C(0x7)
9882         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_LAST \
9883                 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE
9884         /* Event specific data */
9885         uint32_t        event_data2;
9886         uint8_t opaque_v;
9887         /*
9888          * This value is written by the NIC such that it will be different
9889          * for each pass through the completion queue. The even passes
9890          * will write 1. The odd passes will write 0.
9891          */
9892         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_V \
9893                 UINT32_C(0x1)
9894         /* opaque is 7 b */
9895         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_MASK \
9896                 UINT32_C(0xfe)
9897         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_SFT 1
9898         /* 8-lsb timestamp from POR (100-msec resolution) */
9899         uint8_t timestamp_lo;
9900         /* 16-lsb timestamp from POR (100-msec resolution) */
9901         uint16_t        timestamp_hi;
9902         /* Event specific data */
9903         uint32_t        event_data1;
9904         /* PORT ID */
9905         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
9906                 UINT32_C(0xffff)
9907         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
9908                 0
9909         /*
9910          * If set to 1, it indicates that the FEC
9911          * configuration on the port has changed.
9912          * If set to 0, then there is no change in FEC configuration.
9913          */
9914         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_FEC_CFG_CHANGE \
9915                 UINT32_C(0x10000)
9916         /*
9917          * If set to 1, it indicates that the EEE configuration
9918          * on the port has changed.
9919          * If set to 0, then there is no change in EEE configuration
9920          * on the port.
9921          */
9922         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_EEE_CFG_CHANGE \
9923                 UINT32_C(0x20000)
9924         /*
9925          * If set to 1, it indicates that the pause configuration
9926          * on the PHY has changed.
9927          * If set to 0, then there is no change in the pause
9928          * configuration on the PHY.
9929          */
9930         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE \
9931                 UINT32_C(0x40000)
9932 } __rte_packed;
9933
9934 /* hwrm_async_event_cmpl_reset_notify (size:128b/16B) */
9935 struct hwrm_async_event_cmpl_reset_notify {
9936         uint16_t        type;
9937         /*
9938          * This field indicates the exact type of the completion.
9939          * By convention, the LSB identifies the length of the
9940          * record in 16B units. Even values indicate 16B
9941          * records. Odd values indicate 32B
9942          * records.
9943          */
9944         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_MASK \
9945                 UINT32_C(0x3f)
9946         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_SFT             0
9947         /* HWRM Asynchronous Event Information */
9948         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT \
9949                 UINT32_C(0x2e)
9950         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_LAST \
9951                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT
9952         /* Identifiers of events. */
9953         uint16_t        event_id;
9954         /* Notify clients of imminent reset. */
9955         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY \
9956                 UINT32_C(0x8)
9957         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_LAST \
9958                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY
9959         /* Event specific data. The data is for internal debug use only. */
9960         uint32_t        event_data2;
9961         /*
9962          * These bits indicate the status as being reported by the firmware.
9963          * This value is exactly the same as status code in fw_status register.
9964          * If the status code is equal to 0x8000, then the reset is initiated
9965          * by the Host using the FW_RESET command when the FW is in a healthy
9966          * state. If the status code is not equal to 0x8000, then the reset is
9967          * initiated by the FW to recover from the error or FATAL state.
9968          */
9969         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_MASK \
9970                 UINT32_C(0xffff)
9971         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_SFT \
9972                 0
9973         uint8_t opaque_v;
9974         /*
9975          * This value is written by the NIC such that it will be different
9976          * for each pass through the completion queue. The even passes
9977          * will write 1. The odd passes will write 0.
9978          */
9979         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_V          UINT32_C(0x1)
9980         /* opaque is 7 b */
9981         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_MASK UINT32_C(0xfe)
9982         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_SFT 1
9983         /*
9984          * 8-lsb timestamp (100-msec resolution)
9985          * The Minimum time required for the Firmware readiness after sending
9986          * this notification to the driver instances.
9987          */
9988         uint8_t timestamp_lo;
9989         /*
9990          * 16-lsb timestamp (100-msec resolution)
9991          * The Maximum Firmware Reset bail out value in the order of 100
9992          * milliseconds. The driver instances will use this value to reinitiate
9993          * the registration process again if the core firmware didn’t set the
9994          * state bit.
9995          */
9996         uint16_t        timestamp_hi;
9997         /* Event specific data */
9998         uint32_t        event_data1;
9999         /* Indicates driver action requested */
10000         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_MASK \
10001                 UINT32_C(0xff)
10002         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_SFT \
10003                 0
10004         /*
10005          * If set to 1, it indicates that the l2 client should
10006          * stop sending in band traffic to Nitro.
10007          * if set to 0, there is no change in L2 client behavior.
10008          */
10009         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_STOP_TX_QUEUE \
10010                 UINT32_C(0x1)
10011         /*
10012          * If set to 1, it indicates that the L2 client should
10013          * bring down the interface.
10014          * If set to 0, then there is no change in L2 client behavior.
10015          */
10016         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN \
10017                 UINT32_C(0x2)
10018         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_LAST \
10019                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN
10020         /* Indicates reason for reset. */
10021         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK \
10022                 UINT32_C(0xff00)
10023         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_SFT \
10024                 8
10025         /* A management client has requested reset. */
10026         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MANAGEMENT_RESET_REQUEST \
10027                 (UINT32_C(0x1) << 8)
10028         /* A fatal firmware exception has occurred. */
10029         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL \
10030                 (UINT32_C(0x2) << 8)
10031         /* A non-fatal firmware exception has occurred. */
10032         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL \
10033                 (UINT32_C(0x3) << 8)
10034         /* Fast reset */
10035         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FAST_RESET \
10036                 (UINT32_C(0x4) << 8)
10037         /*
10038          * Reset was a result of a firmware activation. That is, the
10039          * fw_activation flag was set in a FW_RESET operation.
10040          */
10041         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_ACTIVATION \
10042                 (UINT32_C(0x5) << 8)
10043         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_LAST \
10044                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_ACTIVATION
10045         /*
10046          * Minimum time before driver should attempt access - units 100ms
10047          * ticks.
10048          * Range 0-65535
10049          */
10050         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_MASK \
10051                 UINT32_C(0xffff0000)
10052         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_SFT \
10053                 16
10054 } __rte_packed;
10055
10056 /* hwrm_async_event_cmpl_error_recovery (size:128b/16B) */
10057 struct hwrm_async_event_cmpl_error_recovery {
10058         uint16_t        type;
10059         /*
10060          * This field indicates the exact type of the completion.
10061          * By convention, the LSB identifies the length of the
10062          * record in 16B units. Even values indicate 16B
10063          * records. Odd values indicate 32B
10064          * records.
10065          */
10066         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_MASK \
10067                 UINT32_C(0x3f)
10068         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_SFT             0
10069         /* HWRM Asynchronous Event Information */
10070         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT \
10071                 UINT32_C(0x2e)
10072         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_LAST \
10073                 HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT
10074         /* Identifiers of events. */
10075         uint16_t        event_id;
10076         /*
10077          * This async notification message can be used for selecting or
10078          * deselecting master function for error recovery,
10079          * and to communicate to all the functions whether error recovery
10080          * was enabled/disabled.
10081          */
10082         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY \
10083                 UINT32_C(0x9)
10084         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_LAST \
10085                 HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY
10086         /* Event specific data */
10087         uint32_t        event_data2;
10088         uint8_t opaque_v;
10089         /*
10090          * This value is written by the NIC such that it will be different
10091          * for each pass through the completion queue. The even passes
10092          * will write 1. The odd passes will write 0.
10093          */
10094         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_V          UINT32_C(0x1)
10095         /* opaque is 7 b */
10096         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_MASK UINT32_C(0xfe)
10097         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_SFT 1
10098         /* 8-lsb timestamp (100-msec resolution) */
10099         uint8_t timestamp_lo;
10100         /* 16-lsb timestamp (100-msec resolution) */
10101         uint16_t        timestamp_hi;
10102         /* Event specific data */
10103         uint32_t        event_data1;
10104         /* Indicates driver action requested */
10105         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASK \
10106                 UINT32_C(0xff)
10107         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_SFT \
10108                 0
10109         /*
10110          * If set to 1, this function is selected as Master function.
10111          * This function has responsibility to do 'chip reset' when it
10112          * detects a fatal error. If set to 0, master function functionality
10113          * is disabled on this function.
10114          */
10115         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASTER_FUNC \
10116                 UINT32_C(0x1)
10117         /*
10118          * If set to 1, error recovery is enabled.
10119          * If set to 0, error recovery is disabled.
10120          */
10121         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED \
10122                 UINT32_C(0x2)
10123 } __rte_packed;
10124
10125 /* hwrm_async_event_cmpl_ring_monitor_msg (size:128b/16B) */
10126 struct hwrm_async_event_cmpl_ring_monitor_msg {
10127         uint16_t        type;
10128         /*
10129          * This field indicates the exact type of the completion.
10130          * By convention, the LSB identifies the length of the
10131          * record in 16B units. Even values indicate 16B
10132          * records. Odd values indicate 32B
10133          * records.
10134          */
10135         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_MASK \
10136                 UINT32_C(0x3f)
10137         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_SFT             0
10138         /* HWRM Asynchronous Event Information */
10139         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_HWRM_ASYNC_EVENT \
10140                 UINT32_C(0x2e)
10141         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_LAST \
10142                 HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_HWRM_ASYNC_EVENT
10143         /* Identifiers of events. */
10144         uint16_t        event_id;
10145         /* Ring Monitor Message. */
10146         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_RING_MONITOR_MSG \
10147                 UINT32_C(0xa)
10148         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_LAST \
10149                 HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_RING_MONITOR_MSG
10150         /* Event specific data */
10151         uint32_t        event_data2;
10152         /* Type of Ring disabled. */
10153         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_MASK \
10154                 UINT32_C(0xff)
10155         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_SFT \
10156                 0
10157         /* tx ring disabled. */
10158         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_TX \
10159                 UINT32_C(0x0)
10160         /* rx ring disabled. */
10161         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_RX \
10162                 UINT32_C(0x1)
10163         /* cmpl ring disabled. */
10164         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_CMPL \
10165                 UINT32_C(0x2)
10166         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_LAST \
10167                 HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_CMPL
10168         uint8_t opaque_v;
10169         /*
10170          * This value is written by the NIC such that it will be different
10171          * for each pass through the completion queue. The even passes
10172          * will write 1. The odd passes will write 0.
10173          */
10174         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_V          UINT32_C(0x1)
10175         /* opaque is 7 b */
10176         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_OPAQUE_MASK \
10177                 UINT32_C(0xfe)
10178         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_OPAQUE_SFT 1
10179         /* 8-lsb timestamp from POR (100-msec resolution) */
10180         uint8_t timestamp_lo;
10181         /* 16-lsb timestamp from POR (100-msec resolution) */
10182         uint16_t        timestamp_hi;
10183         /*
10184          * Event specific data. If ring_type_disabled indicates a tx, rx or cmpl
10185          * then this field will indicate the ring id.
10186          */
10187         uint32_t        event_data1;
10188 } __rte_packed;
10189
10190 /* hwrm_async_event_cmpl_func_drvr_unload (size:128b/16B) */
10191 struct hwrm_async_event_cmpl_func_drvr_unload {
10192         uint16_t        type;
10193         /*
10194          * This field indicates the exact type of the completion.
10195          * By convention, the LSB identifies the length of the
10196          * record in 16B units. Even values indicate 16B
10197          * records. Odd values indicate 32B
10198          * records.
10199          */
10200         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK \
10201                 UINT32_C(0x3f)
10202         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT             0
10203         /* HWRM Asynchronous Event Information */
10204         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \
10205                 UINT32_C(0x2e)
10206         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_LAST \
10207                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
10208         /* Identifiers of events. */
10209         uint16_t        event_id;
10210         /* Function driver unloaded */
10211         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD \
10212                 UINT32_C(0x10)
10213         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_LAST \
10214                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD
10215         /* Event specific data */
10216         uint32_t        event_data2;
10217         uint8_t opaque_v;
10218         /*
10219          * This value is written by the NIC such that it will be different
10220          * for each pass through the completion queue. The even passes
10221          * will write 1. The odd passes will write 0.
10222          */
10223         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V          UINT32_C(0x1)
10224         /* opaque is 7 b */
10225         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK \
10226                 UINT32_C(0xfe)
10227         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT 1
10228         /* 8-lsb timestamp from POR (100-msec resolution) */
10229         uint8_t timestamp_lo;
10230         /* 16-lsb timestamp from POR (100-msec resolution) */
10231         uint16_t        timestamp_hi;
10232         /* Event specific data */
10233         uint32_t        event_data1;
10234         /* Function ID */
10235         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \
10236                 UINT32_C(0xffff)
10237         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT \
10238                 0
10239 } __rte_packed;
10240
10241 /* hwrm_async_event_cmpl_func_drvr_load (size:128b/16B) */
10242 struct hwrm_async_event_cmpl_func_drvr_load {
10243         uint16_t        type;
10244         /*
10245          * This field indicates the exact type of the completion.
10246          * By convention, the LSB identifies the length of the
10247          * record in 16B units. Even values indicate 16B
10248          * records. Odd values indicate 32B
10249          * records.
10250          */
10251         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK \
10252                 UINT32_C(0x3f)
10253         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT             0
10254         /* HWRM Asynchronous Event Information */
10255         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \
10256                 UINT32_C(0x2e)
10257         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_LAST \
10258                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
10259         /* Identifiers of events. */
10260         uint16_t        event_id;
10261         /* Function driver loaded */
10262         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD \
10263                 UINT32_C(0x11)
10264         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_LAST \
10265                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD
10266         /* Event specific data */
10267         uint32_t        event_data2;
10268         uint8_t opaque_v;
10269         /*
10270          * This value is written by the NIC such that it will be different
10271          * for each pass through the completion queue. The even passes
10272          * will write 1. The odd passes will write 0.
10273          */
10274         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V          UINT32_C(0x1)
10275         /* opaque is 7 b */
10276         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
10277         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT 1
10278         /* 8-lsb timestamp from POR (100-msec resolution) */
10279         uint8_t timestamp_lo;
10280         /* 16-lsb timestamp from POR (100-msec resolution) */
10281         uint16_t        timestamp_hi;
10282         /* Event specific data */
10283         uint32_t        event_data1;
10284         /* Function ID */
10285         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
10286                 UINT32_C(0xffff)
10287         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
10288 } __rte_packed;
10289
10290 /* hwrm_async_event_cmpl_func_flr_proc_cmplt (size:128b/16B) */
10291 struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
10292         uint16_t        type;
10293         /*
10294          * This field indicates the exact type of the completion.
10295          * By convention, the LSB identifies the length of the
10296          * record in 16B units. Even values indicate 16B
10297          * records. Odd values indicate 32B
10298          * records.
10299          */
10300         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_MASK \
10301                 UINT32_C(0x3f)
10302         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_SFT \
10303                 0
10304         /* HWRM Asynchronous Event Information */
10305         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT \
10306                 UINT32_C(0x2e)
10307         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_LAST \
10308                 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT
10309         /* Identifiers of events. */
10310         uint16_t        event_id;
10311         /* Function FLR related processing has completed */
10312         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT \
10313                 UINT32_C(0x12)
10314         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_LAST \
10315                 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT
10316         /* Event specific data */
10317         uint32_t        event_data2;
10318         uint8_t opaque_v;
10319         /*
10320          * This value is written by the NIC such that it will be different
10321          * for each pass through the completion queue. The even passes
10322          * will write 1. The odd passes will write 0.
10323          */
10324         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_V \
10325                 UINT32_C(0x1)
10326         /* opaque is 7 b */
10327         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_MASK \
10328                 UINT32_C(0xfe)
10329         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_SFT 1
10330         /* 8-lsb timestamp from POR (100-msec resolution) */
10331         uint8_t timestamp_lo;
10332         /* 16-lsb timestamp from POR (100-msec resolution) */
10333         uint16_t        timestamp_hi;
10334         /* Event specific data */
10335         uint32_t        event_data1;
10336         /* Function ID */
10337         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_MASK \
10338                 UINT32_C(0xffff)
10339         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT \
10340                 0
10341 } __rte_packed;
10342
10343 /* hwrm_async_event_cmpl_pf_drvr_unload (size:128b/16B) */
10344 struct hwrm_async_event_cmpl_pf_drvr_unload {
10345         uint16_t        type;
10346         /*
10347          * This field indicates the exact type of the completion.
10348          * By convention, the LSB identifies the length of the
10349          * record in 16B units. Even values indicate 16B
10350          * records. Odd values indicate 32B
10351          * records.
10352          */
10353         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK \
10354                 UINT32_C(0x3f)
10355         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT             0
10356         /* HWRM Asynchronous Event Information */
10357         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \
10358                 UINT32_C(0x2e)
10359         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_LAST \
10360                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
10361         /* Identifiers of events. */
10362         uint16_t        event_id;
10363         /* PF driver unloaded */
10364         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD \
10365                 UINT32_C(0x20)
10366         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_LAST \
10367                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD
10368         /* Event specific data */
10369         uint32_t        event_data2;
10370         uint8_t opaque_v;
10371         /*
10372          * This value is written by the NIC such that it will be different
10373          * for each pass through the completion queue. The even passes
10374          * will write 1. The odd passes will write 0.
10375          */
10376         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V          UINT32_C(0x1)
10377         /* opaque is 7 b */
10378         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
10379         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT 1
10380         /* 8-lsb timestamp from POR (100-msec resolution) */
10381         uint8_t timestamp_lo;
10382         /* 16-lsb timestamp from POR (100-msec resolution) */
10383         uint16_t        timestamp_hi;
10384         /* Event specific data */
10385         uint32_t        event_data1;
10386         /* PF ID */
10387         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \
10388                 UINT32_C(0xffff)
10389         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
10390         /* Indicates the physical port this pf belongs to */
10391         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK \
10392                 UINT32_C(0x70000)
10393         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT    16
10394 } __rte_packed;
10395
10396 /* hwrm_async_event_cmpl_pf_drvr_load (size:128b/16B) */
10397 struct hwrm_async_event_cmpl_pf_drvr_load {
10398         uint16_t        type;
10399         /*
10400          * This field indicates the exact type of the completion.
10401          * By convention, the LSB identifies the length of the
10402          * record in 16B units. Even values indicate 16B
10403          * records. Odd values indicate 32B
10404          * records.
10405          */
10406         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK \
10407                 UINT32_C(0x3f)
10408         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT             0
10409         /* HWRM Asynchronous Event Information */
10410         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \
10411                 UINT32_C(0x2e)
10412         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_LAST \
10413                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
10414         /* Identifiers of events. */
10415         uint16_t        event_id;
10416         /* PF driver loaded */
10417         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD \
10418                 UINT32_C(0x21)
10419         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_LAST \
10420                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD
10421         /* Event specific data */
10422         uint32_t        event_data2;
10423         uint8_t opaque_v;
10424         /*
10425          * This value is written by the NIC such that it will be different
10426          * for each pass through the completion queue. The even passes
10427          * will write 1. The odd passes will write 0.
10428          */
10429         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V          UINT32_C(0x1)
10430         /* opaque is 7 b */
10431         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
10432         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT 1
10433         /* 8-lsb timestamp from POR (100-msec resolution) */
10434         uint8_t timestamp_lo;
10435         /* 16-lsb timestamp from POR (100-msec resolution) */
10436         uint16_t        timestamp_hi;
10437         /* Event specific data */
10438         uint32_t        event_data1;
10439         /* PF ID */
10440         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
10441                 UINT32_C(0xffff)
10442         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
10443         /* Indicates the physical port this pf belongs to */
10444         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK \
10445                 UINT32_C(0x70000)
10446         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT    16
10447 } __rte_packed;
10448
10449 /* hwrm_async_event_cmpl_vf_flr (size:128b/16B) */
10450 struct hwrm_async_event_cmpl_vf_flr {
10451         uint16_t        type;
10452         /*
10453          * This field indicates the exact type of the completion.
10454          * By convention, the LSB identifies the length of the
10455          * record in 16B units. Even values indicate 16B
10456          * records. Odd values indicate 32B
10457          * records.
10458          */
10459         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK \
10460                 UINT32_C(0x3f)
10461         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT             0
10462         /* HWRM Asynchronous Event Information */
10463         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT \
10464                 UINT32_C(0x2e)
10465         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_LAST \
10466                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT
10467         /* Identifiers of events. */
10468         uint16_t        event_id;
10469         /* VF Function Level Reset (FLR) */
10470         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR UINT32_C(0x30)
10471         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_LAST \
10472                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR
10473         /* Event specific data */
10474         uint32_t        event_data2;
10475         uint8_t opaque_v;
10476         /*
10477          * This value is written by the NIC such that it will be different
10478          * for each pass through the completion queue. The even passes
10479          * will write 1. The odd passes will write 0.
10480          */
10481         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V          UINT32_C(0x1)
10482         /* opaque is 7 b */
10483         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK UINT32_C(0xfe)
10484         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT 1
10485         /* 8-lsb timestamp from POR (100-msec resolution) */
10486         uint8_t timestamp_lo;
10487         /* 16-lsb timestamp from POR (100-msec resolution) */
10488         uint16_t        timestamp_hi;
10489         /* Event specific data */
10490         uint32_t        event_data1;
10491         /* VF ID */
10492         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK \
10493                 UINT32_C(0xffff)
10494         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
10495         /* Indicates the physical function this event occurred on. */
10496         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK \
10497                 UINT32_C(0xff0000)
10498         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT 16
10499 } __rte_packed;
10500
10501 /* hwrm_async_event_cmpl_vf_mac_addr_change (size:128b/16B) */
10502 struct hwrm_async_event_cmpl_vf_mac_addr_change {
10503         uint16_t        type;
10504         /*
10505          * This field indicates the exact type of the completion.
10506          * By convention, the LSB identifies the length of the
10507          * record in 16B units. Even values indicate 16B
10508          * records. Odd values indicate 32B
10509          * records.
10510          */
10511         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK \
10512                 UINT32_C(0x3f)
10513         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT             0
10514         /* HWRM Asynchronous Event Information */
10515         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT \
10516                 UINT32_C(0x2e)
10517         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_LAST \
10518                 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT
10519         /* Identifiers of events. */
10520         uint16_t        event_id;
10521         /* VF MAC Address Change */
10522         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE \
10523                 UINT32_C(0x31)
10524         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_LAST \
10525                 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE
10526         /* Event specific data */
10527         uint32_t        event_data2;
10528         uint8_t opaque_v;
10529         /*
10530          * This value is written by the NIC such that it will be different
10531          * for each pass through the completion queue. The even passes
10532          * will write 1. The odd passes will write 0.
10533          */
10534         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V \
10535                 UINT32_C(0x1)
10536         /* opaque is 7 b */
10537         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK \
10538                 UINT32_C(0xfe)
10539         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
10540         /* 8-lsb timestamp from POR (100-msec resolution) */
10541         uint8_t timestamp_lo;
10542         /* 16-lsb timestamp from POR (100-msec resolution) */
10543         uint16_t        timestamp_hi;
10544         /* Event specific data */
10545         uint32_t        event_data1;
10546         /* VF ID */
10547         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK \
10548                 UINT32_C(0xffff)
10549         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT \
10550                 0
10551 } __rte_packed;
10552
10553 /* hwrm_async_event_cmpl_pf_vf_comm_status_change (size:128b/16B) */
10554 struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
10555         uint16_t        type;
10556         /*
10557          * This field indicates the exact type of the completion.
10558          * By convention, the LSB identifies the length of the
10559          * record in 16B units. Even values indicate 16B
10560          * records. Odd values indicate 32B
10561          * records.
10562          */
10563         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK \
10564                 UINT32_C(0x3f)
10565         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT \
10566                 0
10567         /* HWRM Asynchronous Event Information */
10568         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
10569                 UINT32_C(0x2e)
10570         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_LAST \
10571                 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
10572         /* Identifiers of events. */
10573         uint16_t        event_id;
10574         /* PF-VF communication channel status change. */
10575         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
10576                 UINT32_C(0x32)
10577         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_LAST \
10578                 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE
10579         /* Event specific data */
10580         uint32_t        event_data2;
10581         uint8_t opaque_v;
10582         /*
10583          * This value is written by the NIC such that it will be different
10584          * for each pass through the completion queue. The even passes
10585          * will write 1. The odd passes will write 0.
10586          */
10587         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V \
10588                 UINT32_C(0x1)
10589         /* opaque is 7 b */
10590         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK \
10591                 UINT32_C(0xfe)
10592         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1
10593         /* 8-lsb timestamp from POR (100-msec resolution) */
10594         uint8_t timestamp_lo;
10595         /* 16-lsb timestamp from POR (100-msec resolution) */
10596         uint16_t        timestamp_hi;
10597         /* Event specific data */
10598         uint32_t        event_data1;
10599         /*
10600          * If this bit is set to 1, then it indicates that the PF-VF
10601          * communication was lost and it is established.
10602          * If this bit set to 0, then it indicates that the PF-VF
10603          * communication was established and it is lost.
10604          */
10605         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED \
10606                 UINT32_C(0x1)
10607 } __rte_packed;
10608
10609 /* hwrm_async_event_cmpl_vf_cfg_change (size:128b/16B) */
10610 struct hwrm_async_event_cmpl_vf_cfg_change {
10611         uint16_t        type;
10612         /*
10613          * This field indicates the exact type of the completion.
10614          * By convention, the LSB identifies the length of the
10615          * record in 16B units. Even values indicate 16B
10616          * records. Odd values indicate 32B
10617          * records.
10618          */
10619         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK \
10620                 UINT32_C(0x3f)
10621         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT             0
10622         /* HWRM Asynchronous Event Information */
10623         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
10624                 UINT32_C(0x2e)
10625         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_LAST \
10626                 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
10627         /* Identifiers of events. */
10628         uint16_t        event_id;
10629         /* VF Configuration Change */
10630         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE \
10631                 UINT32_C(0x33)
10632         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_LAST \
10633                 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE
10634         /* Event specific data */
10635         uint32_t        event_data2;
10636         /*
10637          * This value indicates the VF ID of the VF whose configuration
10638          * is changing if this async. event is sent to the parent PF.
10639          * The firmware supports sending this to the parent PF if the
10640          * `hwrm_func_qcaps.vf_cfg_async_for_pf_supported` value is 1.
10641          * This value is undefined when the async. event is sent to the
10642          * VF.
10643          */
10644         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA2_VF_ID_MASK \
10645                 UINT32_C(0xffff)
10646         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA2_VF_ID_SFT 0
10647         uint8_t opaque_v;
10648         /*
10649          * This value is written by the NIC such that it will be different
10650          * for each pass through the completion queue. The even passes
10651          * will write 1. The odd passes will write 0.
10652          */
10653         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V          UINT32_C(0x1)
10654         /* opaque is 7 b */
10655         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
10656         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT 1
10657         /* 8-lsb timestamp from POR (100-msec resolution) */
10658         uint8_t timestamp_lo;
10659         /* 16-lsb timestamp from POR (100-msec resolution) */
10660         uint16_t        timestamp_hi;
10661         /*
10662          * Each flag provided in this field indicates a specific VF
10663          * configuration change. At least one of these flags shall be set to 1
10664          * when an asynchronous event completion of this type is provided
10665          * by the HWRM.
10666          */
10667         uint32_t        event_data1;
10668         /*
10669          * If this bit is set to 1, then the value of MTU
10670          * was changed on this VF.
10671          * If set to 0, then this bit should be ignored.
10672          */
10673         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE \
10674                 UINT32_C(0x1)
10675         /*
10676          * If this bit is set to 1, then the value of MRU
10677          * was changed on this VF.
10678          * If set to 0, then this bit should be ignored.
10679          */
10680         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE \
10681                 UINT32_C(0x2)
10682         /*
10683          * If this bit is set to 1, then the value of default MAC
10684          * address was changed on this VF.
10685          * If set to 0, then this bit should be ignored.
10686          */
10687         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE \
10688                 UINT32_C(0x4)
10689         /*
10690          * If this bit is set to 1, then the value of default VLAN
10691          * was changed on this VF.
10692          * If set to 0, then this bit should be ignored.
10693          */
10694         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE \
10695                 UINT32_C(0x8)
10696         /*
10697          * If this bit is set to 1, then the value of trusted VF enable
10698          * was changed on this VF.
10699          * If set to 0, then this bit should be ignored.
10700          */
10701         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE \
10702                 UINT32_C(0x10)
10703 } __rte_packed;
10704
10705 /* hwrm_async_event_cmpl_llfc_pfc_change (size:128b/16B) */
10706 struct hwrm_async_event_cmpl_llfc_pfc_change {
10707         uint16_t        type;
10708         /*
10709          * This field indicates the exact type of the completion.
10710          * By convention, the LSB identifies the length of the
10711          * record in 16B units. Even values indicate 16B
10712          * records. Odd values indicate 32B
10713          * records.
10714          */
10715         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK \
10716                 UINT32_C(0x3f)
10717         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT             0
10718         /* HWRM Asynchronous Event Information */
10719         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT \
10720                 UINT32_C(0x2e)
10721         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_LAST \
10722                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT
10723         /* unused1 is 10 b */
10724         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_MASK \
10725                 UINT32_C(0xffc0)
10726         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_SFT          6
10727         /* Identifiers of events. */
10728         uint16_t        event_id;
10729         /* LLFC/PFC Configuration Change */
10730         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE \
10731                 UINT32_C(0x34)
10732         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LAST \
10733                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE
10734         /* Event specific data */
10735         uint32_t        event_data2;
10736         uint8_t opaque_v;
10737         /*
10738          * This value is written by the NIC such that it will be different
10739          * for each pass through the completion queue. The even passes
10740          * will write 1. The odd passes will write 0.
10741          */
10742         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V          UINT32_C(0x1)
10743         /* opaque is 7 b */
10744         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK \
10745                 UINT32_C(0xfe)
10746         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT 1
10747         /* 8-lsb timestamp from POR (100-msec resolution) */
10748         uint8_t timestamp_lo;
10749         /* 16-lsb timestamp from POR (100-msec resolution) */
10750         uint16_t        timestamp_hi;
10751         /* Event specific data */
10752         uint32_t        event_data1;
10753         /* Indicates llfc pfc status change */
10754         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK \
10755                 UINT32_C(0x3)
10756         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT \
10757                 0
10758         /*
10759          * If this field set to 1, then it indicates that llfc is
10760          * enabled.
10761          */
10762         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC \
10763                 UINT32_C(0x1)
10764         /*
10765          * If this field is set to 2, then it indicates that pfc
10766          * is enabled.
10767          */
10768         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC \
10769                 UINT32_C(0x2)
10770         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LAST \
10771                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC
10772         /* Indicates the physical port this llfc pfc change occur */
10773         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK \
10774                 UINT32_C(0x1c)
10775         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT \
10776                 2
10777         /* PORT ID */
10778         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK \
10779                 UINT32_C(0x1fffe0)
10780         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT \
10781                 5
10782 } __rte_packed;
10783
10784 /* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */
10785 struct hwrm_async_event_cmpl_default_vnic_change {
10786         uint16_t        type;
10787         /*
10788          * This field indicates the exact type of the completion.
10789          * By convention, the LSB identifies the length of the
10790          * record in 16B units. Even values indicate 16B
10791          * records. Odd values indicate 32B
10792          * records.
10793          */
10794         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_MASK \
10795                 UINT32_C(0x3f)
10796         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_SFT \
10797                 0
10798         /* HWRM Asynchronous Event Information */
10799         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT \
10800                 UINT32_C(0x2e)
10801         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_LAST \
10802                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT
10803         /* unused1 is 10 b */
10804         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_MASK \
10805                 UINT32_C(0xffc0)
10806         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_SFT \
10807                 6
10808         /* Identifiers of events. */
10809         uint16_t        event_id;
10810         /* Notification of a default vnic allocation or free */
10811         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION \
10812                 UINT32_C(0x35)
10813         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_LAST \
10814                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION
10815         /* Event specific data */
10816         uint32_t        event_data2;
10817         uint8_t opaque_v;
10818         /*
10819          * This value is written by the NIC such that it will be different
10820          * for each pass through the completion queue. The even passes
10821          * will write 1. The odd passes will write 0.
10822          */
10823         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_V \
10824                 UINT32_C(0x1)
10825         /* opaque is 7 b */
10826         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_MASK \
10827                 UINT32_C(0xfe)
10828         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_SFT 1
10829         /* 8-lsb timestamp from POR (100-msec resolution) */
10830         uint8_t timestamp_lo;
10831         /* 16-lsb timestamp from POR (100-msec resolution) */
10832         uint16_t        timestamp_hi;
10833         /* Event specific data */
10834         uint32_t        event_data1;
10835         /* Indicates default vnic configuration change */
10836         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_MASK \
10837                 UINT32_C(0x3)
10838         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_SFT \
10839                 0
10840         /*
10841          * If this field is set to 1, then it indicates that
10842          * a default VNIC has been allocate.
10843          */
10844         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_ALLOC \
10845                 UINT32_C(0x1)
10846         /*
10847          * If this field is set to 2, then it indicates that
10848          * a default VNIC has been freed.
10849          */
10850         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE \
10851                 UINT32_C(0x2)
10852         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_LAST \
10853                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE
10854         /* Indicates the physical function this event occurred on. */
10855         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_MASK \
10856                 UINT32_C(0x3fc)
10857         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_SFT \
10858                 2
10859         /* Indicates the virtual function this event occurred on */
10860         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_MASK \
10861                 UINT32_C(0x3fffc00)
10862         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT \
10863                 10
10864 } __rte_packed;
10865
10866 /* hwrm_async_event_cmpl_hw_flow_aged (size:128b/16B) */
10867 struct hwrm_async_event_cmpl_hw_flow_aged {
10868         uint16_t        type;
10869         /*
10870          * This field indicates the exact type of the completion.
10871          * By convention, the LSB identifies the length of the
10872          * record in 16B units. Even values indicate 16B
10873          * records. Odd values indicate 32B
10874          * records.
10875          */
10876         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_MASK \
10877                 UINT32_C(0x3f)
10878         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_SFT             0
10879         /* HWRM Asynchronous Event Information */
10880         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT \
10881                 UINT32_C(0x2e)
10882         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_LAST \
10883                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT
10884         /* Identifiers of events. */
10885         uint16_t        event_id;
10886         /* Notification of a hw flow aged */
10887         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED \
10888                 UINT32_C(0x36)
10889         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_LAST \
10890                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED
10891         /* Event specific data */
10892         uint32_t        event_data2;
10893         uint8_t opaque_v;
10894         /*
10895          * This value is written by the NIC such that it will be different
10896          * for each pass through the completion queue. The even passes
10897          * will write 1. The odd passes will write 0.
10898          */
10899         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_V          UINT32_C(0x1)
10900         /* opaque is 7 b */
10901         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_MASK UINT32_C(0xfe)
10902         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_SFT 1
10903         /* 8-lsb timestamp from POR (100-msec resolution) */
10904         uint8_t timestamp_lo;
10905         /* 16-lsb timestamp from POR (100-msec resolution) */
10906         uint16_t        timestamp_hi;
10907         /* Event specific data */
10908         uint32_t        event_data1;
10909         /* Indicates flow ID this event occurred on. */
10910         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_MASK \
10911                 UINT32_C(0x7fffffff)
10912         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_SFT \
10913                 0
10914         /* Indicates flow direction this event occurred on. */
10915         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION \
10916                 UINT32_C(0x80000000)
10917         /*
10918          * If this bit set to 0, then it indicates that the aged
10919          * event was rx flow.
10920          */
10921         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_RX \
10922                 (UINT32_C(0x0) << 31)
10923         /*
10924          * If this bit is set to 1, then it indicates that the aged
10925          * event was tx flow.
10926          */
10927         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX \
10928                 (UINT32_C(0x1) << 31)
10929         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_LAST \
10930                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX
10931 } __rte_packed;
10932
10933 /* hwrm_async_event_cmpl_eem_cache_flush_req (size:128b/16B) */
10934 struct hwrm_async_event_cmpl_eem_cache_flush_req {
10935         uint16_t        type;
10936         /*
10937          * This field indicates the exact type of the completion.
10938          * By convention, the LSB identifies the length of the
10939          * record in 16B units. Even values indicate 16B
10940          * records. Odd values indicate 32B
10941          * records.
10942          */
10943         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_MASK \
10944                 UINT32_C(0x3f)
10945         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_SFT \
10946                 0
10947         /* HWRM Asynchronous Event Information */
10948         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT \
10949                 UINT32_C(0x2e)
10950         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_LAST \
10951                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT
10952         /* Identifiers of events. */
10953         uint16_t        event_id;
10954         /* Notification of a eem_cache_flush request */
10955         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ \
10956                 UINT32_C(0x38)
10957         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_LAST \
10958                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ
10959         /* Event specific data */
10960         uint32_t        event_data2;
10961         uint8_t opaque_v;
10962         /*
10963          * This value is written by the NIC such that it will be different
10964          * for each pass through the completion queue. The even passes
10965          * will write 1. The odd passes will write 0.
10966          */
10967         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_V \
10968                 UINT32_C(0x1)
10969         /* opaque is 7 b */
10970         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_MASK \
10971                 UINT32_C(0xfe)
10972         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_SFT 1
10973         /* 8-lsb timestamp from POR (100-msec resolution) */
10974         uint8_t timestamp_lo;
10975         /* 16-lsb timestamp from POR (100-msec resolution) */
10976         uint16_t        timestamp_hi;
10977         /* Event specific data */
10978         uint32_t        event_data1;
10979 } __rte_packed;
10980
10981 /* hwrm_async_event_cmpl_eem_cache_flush_done (size:128b/16B) */
10982 struct hwrm_async_event_cmpl_eem_cache_flush_done {
10983         uint16_t        type;
10984         /*
10985          * This field indicates the exact type of the completion.
10986          * By convention, the LSB identifies the length of the
10987          * record in 16B units. Even values indicate 16B
10988          * records. Odd values indicate 32B
10989          * records.
10990          */
10991         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_MASK \
10992                 UINT32_C(0x3f)
10993         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_SFT \
10994                 0
10995         /* HWRM Asynchronous Event Information */
10996         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT \
10997                 UINT32_C(0x2e)
10998         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_LAST \
10999                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT
11000         /* Identifiers of events. */
11001         uint16_t        event_id;
11002         /*
11003          * Notification of a host eem_cache_flush has completed. This event
11004          * is generated by the host driver.
11005          */
11006         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE \
11007                 UINT32_C(0x39)
11008         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_LAST \
11009                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE
11010         /* Event specific data */
11011         uint32_t        event_data2;
11012         uint8_t opaque_v;
11013         /*
11014          * This value is written by the NIC such that it will be different
11015          * for each pass through the completion queue. The even passes
11016          * will write 1. The odd passes will write 0.
11017          */
11018         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_V \
11019                 UINT32_C(0x1)
11020         /* opaque is 7 b */
11021         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_MASK \
11022                 UINT32_C(0xfe)
11023         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_SFT 1
11024         /* 8-lsb timestamp from POR (100-msec resolution) */
11025         uint8_t timestamp_lo;
11026         /* 16-lsb timestamp from POR (100-msec resolution) */
11027         uint16_t        timestamp_hi;
11028         /* Event specific data */
11029         uint32_t        event_data1;
11030         /* Indicates function ID that this event occurred on. */
11031         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_MASK \
11032                 UINT32_C(0xffff)
11033         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_SFT \
11034                 0
11035 } __rte_packed;
11036
11037 /* hwrm_async_event_cmpl_tcp_flag_action_change (size:128b/16B) */
11038 struct hwrm_async_event_cmpl_tcp_flag_action_change {
11039         uint16_t        type;
11040         /*
11041          * This field indicates the exact type of the completion.
11042          * By convention, the LSB identifies the length of the
11043          * record in 16B units. Even values indicate 16B
11044          * records. Odd values indicate 32B
11045          * records.
11046          */
11047         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_MASK \
11048                 UINT32_C(0x3f)
11049         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_SFT \
11050                 0
11051         /* HWRM Asynchronous Event Information */
11052         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT \
11053                 UINT32_C(0x2e)
11054         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_LAST \
11055                 HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT
11056         /* Identifiers of events. */
11057         uint16_t        event_id;
11058         /* Notification of tcp flag action change */
11059         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE \
11060                 UINT32_C(0x3a)
11061         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_LAST \
11062                 HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE
11063         /* Event specific data */
11064         uint32_t        event_data2;
11065         uint8_t opaque_v;
11066         /*
11067          * This value is written by the NIC such that it will be different
11068          * for each pass through the completion queue. The even passes
11069          * will write 1. The odd passes will write 0.
11070          */
11071         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_V \
11072                 UINT32_C(0x1)
11073         /* opaque is 7 b */
11074         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_MASK \
11075                 UINT32_C(0xfe)
11076         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_SFT 1
11077         /* 8-lsb timestamp from POR (100-msec resolution) */
11078         uint8_t timestamp_lo;
11079         /* 16-lsb timestamp from POR (100-msec resolution) */
11080         uint16_t        timestamp_hi;
11081         /* Event specific data */
11082         uint32_t        event_data1;
11083 } __rte_packed;
11084
11085 /* hwrm_async_event_cmpl_eem_flow_active (size:128b/16B) */
11086 struct hwrm_async_event_cmpl_eem_flow_active {
11087         uint16_t        type;
11088         /*
11089          * This field indicates the exact type of the completion.
11090          * By convention, the LSB identifies the length of the
11091          * record in 16B units. Even values indicate 16B
11092          * records. Odd values indicate 32B
11093          * records.
11094          */
11095         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_MASK \
11096                 UINT32_C(0x3f)
11097         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_SFT             0
11098         /* HWRM Asynchronous Event Information */
11099         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT \
11100                 UINT32_C(0x2e)
11101         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_LAST \
11102                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT
11103         /* Identifiers of events. */
11104         uint16_t        event_id;
11105         /* Notification of an active eem flow */
11106         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE \
11107                 UINT32_C(0x3b)
11108         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_LAST \
11109                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE
11110         /* Event specific data */
11111         uint32_t        event_data2;
11112         /* Indicates the 2nd global id this event occurred on. */
11113         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_MASK \
11114                 UINT32_C(0x3fffffff)
11115         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_SFT \
11116                 0
11117         /*
11118          * Indicates flow direction of the flow identified by
11119          * the global_id_2.
11120          */
11121         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION \
11122                 UINT32_C(0x40000000)
11123         /* If this bit is set to 0, then it indicates that this rx flow. */
11124         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_RX \
11125                 (UINT32_C(0x0) << 30)
11126         /* If this bit is set to 1, then it indicates that this tx flow. */
11127         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX \
11128                 (UINT32_C(0x1) << 30)
11129         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_LAST \
11130                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX
11131         uint8_t opaque_v;
11132         /*
11133          * This value is written by the NIC such that it will be different
11134          * for each pass through the completion queue. The even passes
11135          * will write 1. The odd passes will write 0.
11136          */
11137         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_V          UINT32_C(0x1)
11138         /* opaque is 7 b */
11139         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_MASK \
11140                 UINT32_C(0xfe)
11141         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_SFT 1
11142         /* 8-lsb timestamp from POR (100-msec resolution) */
11143         uint8_t timestamp_lo;
11144         /* 16-lsb timestamp from POR (100-msec resolution) */
11145         uint16_t        timestamp_hi;
11146         /* Event specific data */
11147         uint32_t        event_data1;
11148         /* Indicates the 1st global id this event occurred on. */
11149         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_MASK \
11150                 UINT32_C(0x3fffffff)
11151         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_SFT \
11152                 0
11153         /*
11154          * Indicates flow direction of the flow identified by the
11155          * global_id_1.
11156          */
11157         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION \
11158                 UINT32_C(0x40000000)
11159         /* If this bit is set to 0, then it indicates that this is rx flow. */
11160         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_RX \
11161                 (UINT32_C(0x0) << 30)
11162         /* If this bit is set to 1, then it indicates that this is tx flow. */
11163         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX \
11164                 (UINT32_C(0x1) << 30)
11165         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_LAST \
11166                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX
11167         /*
11168          * Indicates EEM flow aging mode this event occurred on. If
11169          * this bit is set to 0, the event_data1 is the EEM global
11170          * ID. If this bit is set to 1, the event_data1 is the number
11171          * of global ID in the context memory.
11172          */
11173         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE \
11174                 UINT32_C(0x80000000)
11175         /* EEM flow aging mode 0. */
11176         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_0 \
11177                 (UINT32_C(0x0) << 31)
11178         /* EEM flow aging mode 1. */
11179         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1 \
11180                 (UINT32_C(0x1) << 31)
11181         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_LAST \
11182                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1
11183 } __rte_packed;
11184
11185 /* hwrm_async_event_cmpl_eem_cfg_change (size:128b/16B) */
11186 struct hwrm_async_event_cmpl_eem_cfg_change {
11187         uint16_t        type;
11188         /*
11189          * This field indicates the exact type of the completion.
11190          * By convention, the LSB identifies the length of the
11191          * record in 16B units. Even values indicate 16B
11192          * records. Odd values indicate 32B
11193          * records.
11194          */
11195         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_MASK \
11196                 UINT32_C(0x3f)
11197         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_SFT             0
11198         /* HWRM Asynchronous Event Information */
11199         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
11200                 UINT32_C(0x2e)
11201         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_LAST \
11202                 HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
11203         /* Identifiers of events. */
11204         uint16_t        event_id;
11205         /* Notification of EEM configuration change */
11206         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE \
11207                 UINT32_C(0x3c)
11208         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_LAST \
11209                 HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE
11210         /* Event specific data */
11211         uint32_t        event_data2;
11212         uint8_t opaque_v;
11213         /*
11214          * This value is written by the NIC such that it will be different
11215          * for each pass through the completion queue. The even passes
11216          * will write 1. The odd passes will write 0.
11217          */
11218         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_V          UINT32_C(0x1)
11219         /* opaque is 7 b */
11220         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
11221         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_SFT 1
11222         /* 8-lsb timestamp from POR (100-msec resolution) */
11223         uint8_t timestamp_lo;
11224         /* 16-lsb timestamp from POR (100-msec resolution) */
11225         uint16_t        timestamp_hi;
11226         /* Event specific data */
11227         uint32_t        event_data1;
11228         /*
11229          * Value of 1 to indicate EEM TX configuration is enabled. Value of
11230          * 0 to indicate the EEM TX configuration is disabled.
11231          */
11232         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_TX_ENABLE \
11233                 UINT32_C(0x1)
11234         /*
11235          * Value of 1 to indicate EEM RX configuration is enabled. Value of 0
11236          * to indicate the EEM RX configuration is disabled.
11237          */
11238         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_RX_ENABLE \
11239                 UINT32_C(0x2)
11240 } __rte_packed;
11241
11242 /* hwrm_async_event_cmpl_quiesce_done (size:128b/16B) */
11243 struct hwrm_async_event_cmpl_quiesce_done {
11244         uint16_t        type;
11245         /*
11246          * This field indicates the exact type of the completion.
11247          * By convention, the LSB identifies the length of the
11248          * record in 16B units. Even values indicate 16B
11249          * records. Odd values indicate 32B
11250          * records.
11251          */
11252         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_MASK \
11253                 UINT32_C(0x3f)
11254         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_SFT             0
11255         /* HWRM Asynchronous Event Information */
11256         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT \
11257                 UINT32_C(0x2e)
11258         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_LAST \
11259                 HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT
11260         /* Identifiers of events. */
11261         uint16_t        event_id;
11262         /* An event signifying completion of HWRM_FW_STATE_QUIESCE */
11263         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE \
11264                 UINT32_C(0x3f)
11265         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_LAST \
11266                 HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE
11267         /* Event specific data */
11268         uint32_t        event_data2;
11269         /* Status of HWRM_FW_STATE_QUIESCE completion */
11270         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_MASK \
11271                 UINT32_C(0xff)
11272         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SFT \
11273                 0
11274         /*
11275          * The quiesce operation started by HWRM_FW_STATE_QUIESCE
11276          * completed successfully.
11277          */
11278         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SUCCESS \
11279                 UINT32_C(0x0)
11280         /*
11281          * The quiesce operation started by HWRM_FW_STATE_QUIESCE timed
11282          * out.
11283          */
11284         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_TIMEOUT \
11285                 UINT32_C(0x1)
11286         /*
11287          * The quiesce operation started by HWRM_FW_STATE_QUIESCE
11288          * encountered an error.
11289          */
11290         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR \
11291                 UINT32_C(0x2)
11292         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_LAST \
11293                 HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR
11294         /* opaque is 8 b */
11295         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_MASK \
11296                 UINT32_C(0xff00)
11297         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_SFT \
11298                 8
11299         /*
11300          * Additional information about internal hardware state related to
11301          * idle/quiesce state.  QUIESCE may succeed per quiesce_status
11302          * regardless of idle_state_flags.  If QUIESCE fails, the host may
11303          * inspect idle_state_flags to determine whether a retry is warranted.
11304          */
11305         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_MASK \
11306                 UINT32_C(0xff0000)
11307         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_SFT \
11308                 16
11309         /*
11310          * Failure to quiesce is caused by host not updating the NQ consumer
11311          * index.
11312          */
11313         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_INCOMPLETE_NQ \
11314                 UINT32_C(0x10000)
11315         /* Flag 1 indicating partial non-idle state. */
11316         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_1 \
11317                 UINT32_C(0x20000)
11318         /* Flag 2 indicating partial non-idle state. */
11319         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_2 \
11320                 UINT32_C(0x40000)
11321         /* Flag 3 indicating partial non-idle state. */
11322         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_3 \
11323                 UINT32_C(0x80000)
11324         uint8_t opaque_v;
11325         /*
11326          * This value is written by the NIC such that it will be different
11327          * for each pass through the completion queue. The even passes
11328          * will write 1. The odd passes will write 0.
11329          */
11330         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_V          UINT32_C(0x1)
11331         /* opaque is 7 b */
11332         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_MASK UINT32_C(0xfe)
11333         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_SFT 1
11334         /* 8-lsb timestamp from POR (100-msec resolution) */
11335         uint8_t timestamp_lo;
11336         /* 16-lsb timestamp from POR (100-msec resolution) */
11337         uint16_t        timestamp_hi;
11338         /* Event specific data */
11339         uint32_t        event_data1;
11340         /* Time stamp for error event */
11341         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA1_TIMESTAMP \
11342                 UINT32_C(0x1)
11343 } __rte_packed;
11344
11345 /* hwrm_async_event_cmpl_deferred_response (size:128b/16B) */
11346 struct hwrm_async_event_cmpl_deferred_response {
11347         uint16_t        type;
11348         /*
11349          * This field indicates the exact type of the completion.
11350          * By convention, the LSB identifies the length of the
11351          * record in 16B units. Even values indicate 16B
11352          * records. Odd values indicate 32B
11353          * records.
11354          */
11355         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_MASK \
11356                 UINT32_C(0x3f)
11357         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_SFT             0
11358         /* HWRM Asynchronous Event Information */
11359         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT \
11360                 UINT32_C(0x2e)
11361         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_LAST \
11362                 HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT
11363         /* Identifiers of events. */
11364         uint16_t        event_id;
11365         /*
11366          * An event signifying a HWRM command is in progress and its
11367          * response will be deferred
11368          */
11369         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE \
11370                 UINT32_C(0x40)
11371         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_LAST \
11372                 HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE
11373         /* Event specific data */
11374         uint32_t        event_data2;
11375         /*
11376          * The PF's mailbox is clear to issue another command.
11377          * A command with this seq_id is still in progress
11378          * and will return a regular HWRM completion when done.
11379          * 'event_data1' field, if non-zero, contains the estimated
11380          * execution time for the command.
11381          */
11382         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_MASK \
11383                 UINT32_C(0xffff)
11384         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_SFT \
11385                 0
11386         uint8_t opaque_v;
11387         /*
11388          * This value is written by the NIC such that it will be different
11389          * for each pass through the completion queue. The even passes
11390          * will write 1. The odd passes will write 0.
11391          */
11392         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_V \
11393                 UINT32_C(0x1)
11394         /* opaque is 7 b */
11395         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_MASK \
11396                 UINT32_C(0xfe)
11397         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_SFT 1
11398         /* 8-lsb timestamp from POR (100-msec resolution) */
11399         uint8_t timestamp_lo;
11400         /* 16-lsb timestamp from POR (100-msec resolution) */
11401         uint16_t        timestamp_hi;
11402         /* Estimated remaining time of command execution in ms (if not zero) */
11403         uint32_t        event_data1;
11404 } __rte_packed;
11405
11406 /* hwrm_async_event_cmpl_pfc_watchdog_cfg_change (size:128b/16B) */
11407 struct hwrm_async_event_cmpl_pfc_watchdog_cfg_change {
11408         uint16_t        type;
11409         /*
11410          * This field indicates the exact type of the completion.
11411          * By convention, the LSB identifies the length of the
11412          * record in 16B units. Even values indicate 16B
11413          * records. Odd values indicate 32B
11414          * records.
11415          */
11416         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_MASK \
11417                 UINT32_C(0x3f)
11418         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_SFT \
11419                 0
11420         /* HWRM Asynchronous Event Information */
11421         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
11422                 UINT32_C(0x2e)
11423         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_LAST \
11424                 HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
11425         /* Identifiers of events. */
11426         uint16_t        event_id;
11427         /* PFC watchdog configuration change for given port/cos */
11428         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE \
11429                 UINT32_C(0x41)
11430         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_LAST \
11431                 HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE
11432         /* Event specific data */
11433         uint32_t        event_data2;
11434         uint8_t opaque_v;
11435         /*
11436          * This value is written by the NIC such that it will be different
11437          * for each pass through the completion queue. The even passes
11438          * will write 1. The odd passes will write 0.
11439          */
11440         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_V \
11441                 UINT32_C(0x1)
11442         /* opaque is 7 b */
11443         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_MASK \
11444                 UINT32_C(0xfe)
11445         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_SFT 1
11446         /* 8-lsb timestamp from POR (100-msec resolution) */
11447         uint8_t timestamp_lo;
11448         /* 16-lsb timestamp from POR (100-msec resolution) */
11449         uint16_t        timestamp_hi;
11450         /* Event specific data */
11451         uint32_t        event_data1;
11452         /*
11453          * 1 in bit position X indicates PFC watchdog should
11454          * be on for COSX
11455          */
11456         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_MASK \
11457                 UINT32_C(0xff)
11458         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_SFT \
11459                 0
11460         /* 1 means PFC WD for COS0 is on, 0 - off. */
11461         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS0 \
11462                 UINT32_C(0x1)
11463         /* 1 means PFC WD for COS1 is on, 0 - off. */
11464         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS1 \
11465                 UINT32_C(0x2)
11466         /* 1 means PFC WD for COS2 is on, 0 - off. */
11467         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS2 \
11468                 UINT32_C(0x4)
11469         /* 1 means PFC WD for COS3 is on, 0 - off. */
11470         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS3 \
11471                 UINT32_C(0x8)
11472         /* 1 means PFC WD for COS4 is on, 0 - off. */
11473         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS4 \
11474                 UINT32_C(0x10)
11475         /* 1 means PFC WD for COS5 is on, 0 - off. */
11476         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS5 \
11477                 UINT32_C(0x20)
11478         /* 1 means PFC WD for COS6 is on, 0 - off. */
11479         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS6 \
11480                 UINT32_C(0x40)
11481         /* 1 means PFC WD for COS7 is on, 0 - off. */
11482         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS7 \
11483                 UINT32_C(0x80)
11484         /* PORT ID */
11485         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
11486                 UINT32_C(0xffff00)
11487         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
11488                 8
11489 } __rte_packed;
11490
11491 /* hwrm_async_event_cmpl_echo_request (size:128b/16B) */
11492 struct hwrm_async_event_cmpl_echo_request {
11493         uint16_t        type;
11494         /*
11495          * This field indicates the exact type of the completion.
11496          * By convention, the LSB identifies the length of the
11497          * record in 16B units. Even values indicate 16B
11498          * records. Odd values indicate 32B
11499          * records.
11500          */
11501         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_MASK \
11502                 UINT32_C(0x3f)
11503         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_SFT             0
11504         /* HWRM Asynchronous Event Information */
11505         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_HWRM_ASYNC_EVENT \
11506                 UINT32_C(0x2e)
11507         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_LAST \
11508                 HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_HWRM_ASYNC_EVENT
11509         /* Identifiers of events. */
11510         uint16_t        event_id;
11511         /*
11512          * An echo request from the firmware. An echo response is expected by
11513          * the firmware.
11514          */
11515         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_ECHO_REQUEST \
11516                 UINT32_C(0x42)
11517         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_LAST \
11518                 HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_ECHO_REQUEST
11519         /* Event specific data that should be provided in the echo response */
11520         uint32_t        event_data2;
11521         uint8_t opaque_v;
11522         /*
11523          * This value is written by the NIC such that it will be different
11524          * for each pass through the completion queue. The even passes
11525          * will write 1. The odd passes will write 0.
11526          */
11527         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_V          UINT32_C(0x1)
11528         /* opaque is 7 b */
11529         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_OPAQUE_MASK UINT32_C(0xfe)
11530         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_OPAQUE_SFT 1
11531         /* 8-lsb timestamp from POR (100-msec resolution) */
11532         uint8_t timestamp_lo;
11533         /* 16-lsb timestamp from POR (100-msec resolution) */
11534         uint16_t        timestamp_hi;
11535         /* Event specific data that should be provided in the echo response */
11536         uint32_t        event_data1;
11537 } __rte_packed;
11538
11539 /* hwrm_async_event_cmpl_phc_update (size:128b/16B) */
11540 struct hwrm_async_event_cmpl_phc_update {
11541         uint16_t        type;
11542         /*
11543          * This field indicates the exact type of the completion.
11544          * By convention, the LSB identifies the length of the
11545          * record in 16B units. Even values indicate 16B
11546          * records. Odd values indicate 32B
11547          * records.
11548          */
11549         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_MASK \
11550                 UINT32_C(0x3f)
11551         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_SFT             0
11552         /* HWRM Asynchronous Event Information */
11553         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_HWRM_ASYNC_EVENT \
11554                 UINT32_C(0x2e)
11555         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_LAST \
11556                 HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_TYPE_HWRM_ASYNC_EVENT
11557         /* Identifiers of events. */
11558         uint16_t        event_id;
11559         /*
11560          * This async event is used to notify driver of changes
11561          * in PHC master. Only one master function can configure
11562          * PHC.
11563          */
11564         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_ID_PHC_UPDATE \
11565                 UINT32_C(0x43)
11566         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_ID_LAST \
11567                 HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_ID_PHC_UPDATE
11568         /* Event specific data */
11569         uint32_t        event_data2;
11570         /* This field provides the current master function. */
11571         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_MASTER_FID_MASK \
11572                 UINT32_C(0xffff)
11573         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_MASTER_FID_SFT \
11574                 0
11575         /* This field provides the current secondary function. */
11576         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_SEC_FID_MASK \
11577                 UINT32_C(0xffff0000)
11578         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA2_PHC_SEC_FID_SFT \
11579                 16
11580         uint8_t opaque_v;
11581         /*
11582          * This value is written by the NIC such that it will be different
11583          * for each pass through the completion queue. The even passes
11584          * will write 1. The odd passes will write 0.
11585          */
11586         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_V          UINT32_C(0x1)
11587         /* opaque is 7 b */
11588         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_OPAQUE_MASK UINT32_C(0xfe)
11589         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_OPAQUE_SFT 1
11590         /* 8-lsb timestamp (100-msec resolution) */
11591         uint8_t timestamp_lo;
11592         /* 16-lsb timestamp (100-msec resolution) */
11593         uint16_t        timestamp_hi;
11594         /* Event specific data */
11595         uint32_t        event_data1;
11596         /* Indicates to the driver the type of PHC event. */
11597         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_MASK \
11598                 UINT32_C(0xf)
11599         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_SFT \
11600                 0
11601         /*
11602          * Indicates PHC Master selection event. The master fid is
11603          * specified in event_data2.phc_master_fid.
11604          */
11605         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_MASTER \
11606                 UINT32_C(0x1)
11607         /*
11608          * Indicates PHC Secondary selection event. The secondary fid is
11609          * specified in event_data2.phc_sec_fid.
11610          */
11611         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_SECONDARY \
11612                 UINT32_C(0x2)
11613         /*
11614          * Indicates PHC failover event. Failover happens from
11615          * event_data2.phc_master_fid to event_data2.phc_sec_fid.
11616          */
11617         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_FAILOVER \
11618                 UINT32_C(0x3)
11619         /*
11620          * Indicates that the 64bit Real time clock upper 16bits
11621          * have been updated due to PHC rollover. The updated
11622          * upper 16bits is in event_data1.phc_time_msb
11623          */
11624         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_RTC_UPDATE \
11625                 UINT32_C(0x4)
11626         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_LAST \
11627                 HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_FLAGS_PHC_RTC_UPDATE
11628         /*
11629          * This field provides the upper 16bits of the 64bit real
11630          * time clock.
11631          */
11632         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_PHC_TIME_MSB_MASK \
11633                 UINT32_C(0xffff0)
11634         #define HWRM_ASYNC_EVENT_CMPL_PHC_UPDATE_EVENT_DATA1_PHC_TIME_MSB_SFT \
11635                 4
11636 } __rte_packed;
11637
11638 /* hwrm_async_event_cmpl_pps_timestamp (size:128b/16B) */
11639 struct hwrm_async_event_cmpl_pps_timestamp {
11640         uint16_t        type;
11641         /*
11642          * This field indicates the exact type of the completion.
11643          * By convention, the LSB identifies the length of the
11644          * record in 16B units. Even values indicate 16B
11645          * records. Odd values indicate 32B
11646          * records.
11647          */
11648         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_MASK \
11649                 UINT32_C(0x3f)
11650         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_SFT             0
11651         /* HWRM Asynchronous Event Information */
11652         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_HWRM_ASYNC_EVENT \
11653                 UINT32_C(0x2e)
11654         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_LAST \
11655                 HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_TYPE_HWRM_ASYNC_EVENT
11656         /* Identifiers of events. */
11657         uint16_t        event_id;
11658         /*
11659          * This async notification message can be used to inform
11660          * driver of the latest PPS timestamp that has been latched.
11661          * When driver enables PPS event, Firmware will generate
11662          * PPS timestamps every second, Firmware informs driver
11663          * of this timestamp through the async event.
11664          */
11665         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_PPS_TIMESTAMP \
11666                 UINT32_C(0x44)
11667         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_LAST \
11668                 HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_ID_PPS_TIMESTAMP
11669         /* Event specific data */
11670         uint32_t        event_data2;
11671         /* Indicates the PPS event type */
11672         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE \
11673                 UINT32_C(0x1)
11674         /* This is an internal event. */
11675         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_INTERNAL \
11676                 UINT32_C(0x0)
11677         /* This is an external event. */
11678         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_EXTERNAL \
11679                 UINT32_C(0x1)
11680         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_LAST \
11681                 HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_EVENT_TYPE_EXTERNAL
11682         /*
11683          * Indicates the pin number on which the event is
11684          * received.
11685          */
11686         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PIN_NUMBER_MASK \
11687                 UINT32_C(0xe)
11688         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PIN_NUMBER_SFT \
11689                 1
11690         /*
11691          * Contains bits[47:32] of the upper PPS timestamp.
11692          * Lower 32 bits are in event_data1. Together they
11693          * provide the 48 bit PPS timestamp.
11694          */
11695         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PPS_TIMESTAMP_UPPER_MASK \
11696                 UINT32_C(0xffff0)
11697         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA2_PPS_TIMESTAMP_UPPER_SFT \
11698                 4
11699         uint8_t opaque_v;
11700         /*
11701          * This value is written by the NIC such that it will be different
11702          * for each pass through the completion queue. The even passes
11703          * will write 1. The odd passes will write 0.
11704          */
11705         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_V          UINT32_C(0x1)
11706         /* opaque is 7 b */
11707         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_OPAQUE_MASK UINT32_C(0xfe)
11708         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_OPAQUE_SFT 1
11709         /* 8-lsb timestamp (100-msec resolution) */
11710         uint8_t timestamp_lo;
11711         /* 16-lsb timestamp (100-msec resolution) */
11712         uint16_t        timestamp_hi;
11713         /* Contains the lower 32 bits of the PPS timestamp. */
11714         uint32_t        event_data1;
11715         /* Contains the lower 32 bit PPS timestamp */
11716         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA1_PPS_TIMESTAMP_LOWER_MASK \
11717                 UINT32_C(0xffffffff)
11718         #define HWRM_ASYNC_EVENT_CMPL_PPS_TIMESTAMP_EVENT_DATA1_PPS_TIMESTAMP_LOWER_SFT \
11719                 0
11720 } __rte_packed;
11721
11722 /* hwrm_async_event_cmpl_error_report (size:128b/16B) */
11723 struct hwrm_async_event_cmpl_error_report {
11724         uint16_t        type;
11725         /*
11726          * This field indicates the exact type of the completion.
11727          * By convention, the LSB identifies the length of the
11728          * record in 16B units. Even values indicate 16B
11729          * records. Odd values indicate 32B
11730          * records.
11731          */
11732         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_MASK \
11733                 UINT32_C(0x3f)
11734         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_SFT             0
11735         /* HWRM Asynchronous Event Information */
11736         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_HWRM_ASYNC_EVENT \
11737                 UINT32_C(0x2e)
11738         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_LAST \
11739                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_TYPE_HWRM_ASYNC_EVENT
11740         /* Identifiers of events. */
11741         uint16_t        event_id;
11742         /*
11743          * This async notification message is used to inform
11744          * the driver that an error has occurred which may need
11745          * the attention of the administrator.
11746          */
11747         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_ID_ERROR_REPORT \
11748                 UINT32_C(0x45)
11749         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_ID_LAST \
11750                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_ID_ERROR_REPORT
11751         /* Event specific data. */
11752         uint32_t        event_data2;
11753         uint8_t opaque_v;
11754         /*
11755          * This value is written by the NIC such that it will be different
11756          * for each pass through the completion queue. The even passes
11757          * will write 1. The odd passes will write 0.
11758          */
11759         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_V          UINT32_C(0x1)
11760         /* opaque is 7 b */
11761         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_OPAQUE_MASK UINT32_C(0xfe)
11762         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_OPAQUE_SFT 1
11763         /* 8-lsb timestamp (100-msec resolution) */
11764         uint8_t timestamp_lo;
11765         /* 16-lsb timestamp (100-msec resolution) */
11766         uint16_t        timestamp_hi;
11767         /* Event specific data */
11768         uint32_t        event_data1;
11769         /*
11770          * Indicates the type of error being reported. See section on Error
11771          * Report event error_types for details on each error.
11772          */
11773         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_DATA1_ERROR_TYPE_MASK \
11774                 UINT32_C(0xff)
11775         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_EVENT_DATA1_ERROR_TYPE_SFT 0
11776 } __rte_packed;
11777
11778 /* hwrm_async_event_cmpl_doorbell_pacing_threshold (size:128b/16B) */
11779 struct hwrm_async_event_cmpl_doorbell_pacing_threshold {
11780         uint16_t        type;
11781         /*
11782          * This field indicates the exact type of the completion.
11783          * By convention, the LSB identifies the length of the
11784          * record in 16B units. Even values indicate 16B
11785          * records. Odd values indicate 32B
11786          * records.
11787          */
11788         #define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_MASK \
11789                 UINT32_C(0x3f)
11790         #define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_SFT \
11791                 0
11792         /* HWRM Asynchronous Event Information */
11793         #define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_HWRM_ASYNC_EVENT \
11794                 UINT32_C(0x2e)
11795         #define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_LAST \
11796                 HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_TYPE_HWRM_ASYNC_EVENT
11797         /* Identifiers of events. */
11798         uint16_t        event_id;
11799         /*
11800          * This async notification message is used to inform the driver
11801          * that the programmable pacing threshold for the doorbell FIFO is
11802          * reached. The driver will take appropriate action to pace the
11803          * doorbells when this async event is received from the firmware.
11804          */
11805         #define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_EVENT_ID_DOORBELL_PACING_THRESHOLD \
11806                 UINT32_C(0x46)
11807         #define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_EVENT_ID_LAST \
11808                 HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_EVENT_ID_DOORBELL_PACING_THRESHOLD
11809         /* Event specific data. */
11810         uint32_t        event_data2;
11811         uint8_t opaque_v;
11812         /*
11813          * This value is written by the NIC such that it will be different
11814          * for each pass through the completion queue. The even passes
11815          * will write 1. The odd passes will write 0.
11816          */
11817         #define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_V \
11818                 UINT32_C(0x1)
11819         /* opaque is 7 b */
11820         #define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_OPAQUE_MASK \
11821                 UINT32_C(0xfe)
11822         #define HWRM_ASYNC_EVENT_CMPL_DOORBELL_PACING_THRESHOLD_OPAQUE_SFT 1
11823         /* 8-lsb timestamp (100-msec resolution) */
11824         uint8_t timestamp_lo;
11825         /* 16-lsb timestamp (100-msec resolution) */
11826         uint16_t        timestamp_hi;
11827         /* Event specific data */
11828         uint32_t        event_data1;
11829 } __rte_packed;
11830
11831 /* hwrm_async_event_cmpl_fw_trace_msg (size:128b/16B) */
11832 struct hwrm_async_event_cmpl_fw_trace_msg {
11833         uint16_t        type;
11834         /*
11835          * This field indicates the exact type of the completion.
11836          * By convention, the LSB identifies the length of the
11837          * record in 16B units. Even values indicate 16B
11838          * records. Odd values indicate 32B
11839          * records.
11840          */
11841         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_MASK \
11842                 UINT32_C(0x3f)
11843         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_SFT             0
11844         /* HWRM Asynchronous Event Information */
11845         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT \
11846                 UINT32_C(0x2e)
11847         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_LAST \
11848                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT
11849         /* Identifiers of events. */
11850         uint16_t        event_id;
11851         /* Firmware trace log message */
11852         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG \
11853                 UINT32_C(0xfe)
11854         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_LAST \
11855                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG
11856         /* Trace byte 0 to 3 */
11857         uint32_t        event_data2;
11858         /* Trace byte0 */
11859         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_MASK \
11860                 UINT32_C(0xff)
11861         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_SFT 0
11862         /* Trace byte1 */
11863         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_MASK \
11864                 UINT32_C(0xff00)
11865         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_SFT 8
11866         /* Trace byte2 */
11867         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_MASK \
11868                 UINT32_C(0xff0000)
11869         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_SFT 16
11870         /* Trace byte3 */
11871         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_MASK \
11872                 UINT32_C(0xff000000)
11873         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_SFT 24
11874         uint8_t opaque_v;
11875         /*
11876          * This value is written by the NIC such that it will be different
11877          * for each pass through the completion queue. The even passes
11878          * will write 1. The odd passes will write 0.
11879          */
11880         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_V          UINT32_C(0x1)
11881         /* opaque is 7 b */
11882         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_MASK UINT32_C(0xfe)
11883         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_SFT 1
11884         /* Trace flags */
11885         uint8_t timestamp_lo;
11886         /* Indicates if the string is partial or complete. */
11887         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING \
11888                 UINT32_C(0x1)
11889         /* Complete string */
11890         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_COMPLETE \
11891                 UINT32_C(0x0)
11892         /* Partial string */
11893         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL \
11894                 UINT32_C(0x1)
11895         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_LAST \
11896                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL
11897         /* Indicates the firmware that sent the trace message. */
11898         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE \
11899                 UINT32_C(0x2)
11900         /* Primary firmware */
11901         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_PRIMARY \
11902                 (UINT32_C(0x0) << 1)
11903         /* Secondary firmware */
11904         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY \
11905                 (UINT32_C(0x1) << 1)
11906         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_LAST \
11907                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY
11908         /* Trace byte 4 to 5 */
11909         uint16_t        timestamp_hi;
11910         /* Trace byte4 */
11911         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_MASK \
11912                 UINT32_C(0xff)
11913         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_SFT 0
11914         /* Trace byte5 */
11915         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_MASK \
11916                 UINT32_C(0xff00)
11917         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_SFT 8
11918         /* Trace byte 6 to 9 */
11919         uint32_t        event_data1;
11920         /* Trace byte6 */
11921         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_MASK \
11922                 UINT32_C(0xff)
11923         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_SFT 0
11924         /* Trace byte7 */
11925         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_MASK \
11926                 UINT32_C(0xff00)
11927         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_SFT 8
11928         /* Trace byte8 */
11929         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_MASK \
11930                 UINT32_C(0xff0000)
11931         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_SFT 16
11932         /* Trace byte9 */
11933         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_MASK \
11934                 UINT32_C(0xff000000)
11935         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_SFT 24
11936 } __rte_packed;
11937
11938 /* hwrm_async_event_cmpl_hwrm_error (size:128b/16B) */
11939 struct hwrm_async_event_cmpl_hwrm_error {
11940         uint16_t        type;
11941         /*
11942          * This field indicates the exact type of the completion.
11943          * By convention, the LSB identifies the length of the
11944          * record in 16B units. Even values indicate 16B
11945          * records. Odd values indicate 32B
11946          * records.
11947          */
11948         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK \
11949                 UINT32_C(0x3f)
11950         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT             0
11951         /* HWRM Asynchronous Event Information */
11952         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT \
11953                 UINT32_C(0x2e)
11954         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_LAST \
11955                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT
11956         /* Identifiers of events. */
11957         uint16_t        event_id;
11958         /* HWRM Error */
11959         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR \
11960                 UINT32_C(0xff)
11961         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_LAST \
11962                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR
11963         /* Event specific data */
11964         uint32_t        event_data2;
11965         /* Severity of HWRM Error */
11966         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK \
11967                 UINT32_C(0xff)
11968         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT     0
11969         /* Warning */
11970         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING \
11971                 UINT32_C(0x0)
11972         /* Non-fatal Error */
11973         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL \
11974                 UINT32_C(0x1)
11975         /* Fatal Error */
11976         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL \
11977                 UINT32_C(0x2)
11978         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST \
11979                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL
11980         uint8_t opaque_v;
11981         /*
11982          * This value is written by the NIC such that it will be different
11983          * for each pass through the completion queue. The even passes
11984          * will write 1. The odd passes will write 0.
11985          */
11986         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V          UINT32_C(0x1)
11987         /* opaque is 7 b */
11988         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK UINT32_C(0xfe)
11989         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT 1
11990         /* 8-lsb timestamp from POR (100-msec resolution) */
11991         uint8_t timestamp_lo;
11992         /* 16-lsb timestamp from POR (100-msec resolution) */
11993         uint16_t        timestamp_hi;
11994         /* Event specific data */
11995         uint32_t        event_data1;
11996         /* Time stamp for error event */
11997         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP \
11998                 UINT32_C(0x1)
11999 } __rte_packed;
12000
12001 /* hwrm_async_event_cmpl_error_report_base (size:128b/16B) */
12002 struct hwrm_async_event_cmpl_error_report_base {
12003         uint16_t        type;
12004         /*
12005          * This field indicates the exact type of the completion.
12006          * By convention, the LSB identifies the length of the
12007          * record in 16B units. Even values indicate 16B
12008          * records. Odd values indicate 32B
12009          * records.
12010          */
12011         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_MASK \
12012                 UINT32_C(0x3f)
12013         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_SFT             0
12014         /* HWRM Asynchronous Event Information */
12015         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_HWRM_ASYNC_EVENT \
12016                 UINT32_C(0x2e)
12017         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_LAST \
12018                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_TYPE_HWRM_ASYNC_EVENT
12019         /* Identifiers of events. */
12020         uint16_t        event_id;
12021         /*
12022          * This async notification message is used to inform
12023          * the driver that an error has occurred which may need
12024          * the attention of the administrator.
12025          */
12026         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_ID_ERROR_REPORT \
12027                 UINT32_C(0x45)
12028         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_ID_LAST \
12029                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_ID_ERROR_REPORT
12030         /* Event specific data. */
12031         uint32_t        event_data2;
12032         uint8_t opaque_v;
12033         /*
12034          * This value is written by the NIC such that it will be different
12035          * for each pass through the completion queue. The even passes
12036          * will write 1. The odd passes will write 0.
12037          */
12038         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_V \
12039                 UINT32_C(0x1)
12040         /* opaque is 7 b */
12041         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_OPAQUE_MASK \
12042                 UINT32_C(0xfe)
12043         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_OPAQUE_SFT 1
12044         /* 8-lsb timestamp (100-msec resolution) */
12045         uint8_t timestamp_lo;
12046         /* 16-lsb timestamp (100-msec resolution) */
12047         uint16_t        timestamp_hi;
12048         /* Event specific data */
12049         uint32_t        event_data1;
12050         /* Indicates the type of error being reported. */
12051         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_MASK \
12052                 UINT32_C(0xff)
12053         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_SFT \
12054                 0
12055         /* Reserved */
12056         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_RESERVED \
12057                 UINT32_C(0x0)
12058         /*
12059          * The NIC was subjected to an extended pause storm which caused it
12060          * to disable flow control in order to avoid stalling the Tx path.
12061          */
12062         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM \
12063                 UINT32_C(0x1)
12064         /*
12065          * The NIC received an interrupt storm on a TSIO pin being used as
12066          * PPS_IN which caused it to disable the interrupt. The signal
12067          * should be fixed to be a proper 1 PPS signal before re-enabling
12068          * it. The pin number on which this signal was received is stored
12069          * in event_data2 as pin_id.
12070          */
12071         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL \
12072                 UINT32_C(0x2)
12073         /*
12074          * There was a low level error with an NVM write or erase.
12075          * See nvm_err_type for more details.
12076          */
12077         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_NVM \
12078                 UINT32_C(0x3)
12079         /*
12080          * This indicates doorbell drop threshold was hit. When this
12081          * threshold is crossed, it indicates one or more doorbells for
12082          * the function were dropped by hardware.
12083          */
12084         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD \
12085                 UINT32_C(0x4)
12086         /*
12087          * Indicates the NIC's temperature has crossed one of the thermal
12088          * thresholds.
12089          */
12090         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD \
12091                 UINT32_C(0x5)
12092         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST \
12093                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD
12094 } __rte_packed;
12095
12096 /* hwrm_async_event_cmpl_error_report_pause_storm (size:128b/16B) */
12097 struct hwrm_async_event_cmpl_error_report_pause_storm {
12098         uint16_t        type;
12099         /*
12100          * This field indicates the exact type of the completion.
12101          * By convention, the LSB identifies the length of the
12102          * record in 16B units. Even values indicate 16B
12103          * records. Odd values indicate 32B
12104          * records.
12105          */
12106         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_MASK \
12107                 UINT32_C(0x3f)
12108         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_SFT \
12109                 0
12110         /* HWRM Asynchronous Event Information */
12111         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_HWRM_ASYNC_EVENT \
12112                 UINT32_C(0x2e)
12113         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_LAST \
12114                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_TYPE_HWRM_ASYNC_EVENT
12115         /* Identifiers of events. */
12116         uint16_t        event_id;
12117         /*
12118          * This async notification message is used to inform
12119          * the driver that an error has occurred which may need
12120          * the attention of the administrator.
12121          */
12122         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_ID_ERROR_REPORT \
12123                 UINT32_C(0x45)
12124         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_ID_LAST \
12125                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_ID_ERROR_REPORT
12126         /* Event specific data. */
12127         uint32_t        event_data2;
12128         uint8_t opaque_v;
12129         /*
12130          * This value is written by the NIC such that it will be different
12131          * for each pass through the completion queue. The even passes
12132          * will write 1. The odd passes will write 0.
12133          */
12134         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_V \
12135                 UINT32_C(0x1)
12136         /* opaque is 7 b */
12137         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_OPAQUE_MASK \
12138                 UINT32_C(0xfe)
12139         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_OPAQUE_SFT 1
12140         /* 8-lsb timestamp (100-msec resolution) */
12141         uint8_t timestamp_lo;
12142         /* 16-lsb timestamp (100-msec resolution) */
12143         uint16_t        timestamp_hi;
12144         /* Event specific data */
12145         uint32_t        event_data1;
12146         /* Indicates the type of error being reported. */
12147         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_MASK \
12148                 UINT32_C(0xff)
12149         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_SFT \
12150                 0
12151         /*
12152          * The NIC was subjected to an extended pause storm which caused it
12153          * to disable flow control in order to avoid stalling the Tx path.
12154          */
12155         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM \
12156                 UINT32_C(0x1)
12157         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_LAST \
12158                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_PAUSE_STORM_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM
12159 } __rte_packed;
12160
12161 /* hwrm_async_event_cmpl_error_report_invalid_signal (size:128b/16B) */
12162 struct hwrm_async_event_cmpl_error_report_invalid_signal {
12163         uint16_t        type;
12164         /*
12165          * This field indicates the exact type of the completion.
12166          * By convention, the LSB identifies the length of the
12167          * record in 16B units. Even values indicate 16B
12168          * records. Odd values indicate 32B
12169          * records.
12170          */
12171         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_MASK \
12172                 UINT32_C(0x3f)
12173         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_SFT \
12174                 0
12175         /* HWRM Asynchronous Event Information */
12176         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_HWRM_ASYNC_EVENT \
12177                 UINT32_C(0x2e)
12178         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_LAST \
12179                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_TYPE_HWRM_ASYNC_EVENT
12180         /* Identifiers of events. */
12181         uint16_t        event_id;
12182         /*
12183          * This async notification message is used to inform
12184          * the driver that an error has occurred which may need
12185          * the attention of the administrator.
12186          */
12187         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_ID_ERROR_REPORT \
12188                 UINT32_C(0x45)
12189         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_ID_LAST \
12190                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_ID_ERROR_REPORT
12191         /* Event specific data. */
12192         uint32_t        event_data2;
12193         /* Indicates the TSIO pin on which invalid signal is detected. */
12194         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA2_PIN_ID_MASK \
12195                 UINT32_C(0xff)
12196         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA2_PIN_ID_SFT \
12197                 0
12198         uint8_t opaque_v;
12199         /*
12200          * This value is written by the NIC such that it will be different
12201          * for each pass through the completion queue. The even passes
12202          * will write 1. The odd passes will write 0.
12203          */
12204         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_V \
12205                 UINT32_C(0x1)
12206         /* opaque is 7 b */
12207         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_OPAQUE_MASK \
12208                 UINT32_C(0xfe)
12209         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_OPAQUE_SFT 1
12210         /* 8-lsb timestamp (100-msec resolution) */
12211         uint8_t timestamp_lo;
12212         /* 16-lsb timestamp (100-msec resolution) */
12213         uint16_t        timestamp_hi;
12214         /* Event specific data */
12215         uint32_t        event_data1;
12216         /* Indicates the type of error being reported. */
12217         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_MASK \
12218                 UINT32_C(0xff)
12219         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_SFT \
12220                 0
12221         /*
12222          * The NIC received an interrupt storm on a TSIO pin being used as
12223          * PPS_IN which caused it to disable the interrupt. The signal
12224          * should be fixed to be a proper 1 PPS signal before re-enabling
12225          * it. The pin number on which this signal was received is stored
12226          * in event_data2 as pin_id.
12227          */
12228         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL \
12229                 UINT32_C(0x2)
12230         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_LAST \
12231                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_INVALID_SIGNAL_EVENT_DATA1_ERROR_TYPE_INVALID_SIGNAL
12232 } __rte_packed;
12233
12234 /* hwrm_async_event_cmpl_error_report_nvm (size:128b/16B) */
12235 struct hwrm_async_event_cmpl_error_report_nvm {
12236         uint16_t        type;
12237         /*
12238          * This field indicates the exact type of the completion.
12239          * By convention, the LSB identifies the length of the
12240          * record in 16B units. Even values indicate 16B
12241          * records. Odd values indicate 32B
12242          * records.
12243          */
12244         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_MASK \
12245                 UINT32_C(0x3f)
12246         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_SFT             0
12247         /* HWRM Asynchronous Event Information */
12248         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_HWRM_ASYNC_EVENT \
12249                 UINT32_C(0x2e)
12250         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_LAST \
12251                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_TYPE_HWRM_ASYNC_EVENT
12252         /* Identifiers of events. */
12253         uint16_t        event_id;
12254         /*
12255          * This async notification message is used to inform
12256          * the driver that an error has occurred which may need
12257          * the attention of the administrator.
12258          */
12259         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_ID_ERROR_REPORT \
12260                 UINT32_C(0x45)
12261         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_ID_LAST \
12262                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_ID_ERROR_REPORT
12263         /* Event specific data. */
12264         uint32_t        event_data2;
12265         /* Indicates the address where error was detected */
12266         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA2_ERR_ADDR_MASK \
12267                 UINT32_C(0xffffffff)
12268         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA2_ERR_ADDR_SFT \
12269                 0
12270         uint8_t opaque_v;
12271         /*
12272          * This value is written by the NIC such that it will be different
12273          * for each pass through the completion queue. The even passes
12274          * will write 1. The odd passes will write 0.
12275          */
12276         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_V          UINT32_C(0x1)
12277         /* opaque is 7 b */
12278         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_OPAQUE_MASK \
12279                 UINT32_C(0xfe)
12280         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_OPAQUE_SFT 1
12281         /* 8-lsb timestamp (100-msec resolution) */
12282         uint8_t timestamp_lo;
12283         /* 16-lsb timestamp (100-msec resolution) */
12284         uint16_t        timestamp_hi;
12285         /* Event specific data */
12286         uint32_t        event_data1;
12287         /* Indicates the type of error being reported. */
12288         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_MASK \
12289                 UINT32_C(0xff)
12290         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_SFT \
12291                 0
12292         /*
12293          * There was a low level error with an NVM operation.
12294          * See nvm_err_type for more details.
12295          */
12296         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_NVM_ERROR \
12297                 UINT32_C(0x3)
12298         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_LAST \
12299                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_ERROR_TYPE_NVM_ERROR
12300         /* The specific type of NVM error */
12301         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_MASK \
12302                 UINT32_C(0xff00)
12303         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_SFT \
12304                 8
12305         /*
12306          * There was a low level error with an NVM write operation.
12307          * Verification of written data did not match.
12308          * event_data2 will be the failing address.
12309          */
12310         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_WRITE \
12311                 (UINT32_C(0x1) << 8)
12312         /*
12313          * There was a low level error with an NVM erase operation.
12314          * All the bits were not erased.
12315          * event_data2 will be the failing address.
12316          */
12317         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_ERASE \
12318                 (UINT32_C(0x2) << 8)
12319         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_LAST \
12320                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_NVM_EVENT_DATA1_NVM_ERR_TYPE_ERASE
12321 } __rte_packed;
12322
12323 /* hwrm_async_event_cmpl_error_report_doorbell_drop_threshold (size:128b/16B) */
12324 struct hwrm_async_event_cmpl_error_report_doorbell_drop_threshold {
12325         uint16_t        type;
12326         /*
12327          * This field indicates the exact type of the completion.
12328          * By convention, the LSB identifies the length of the
12329          * record in 16B units. Even values indicate 16B
12330          * records. Odd values indicate 32B
12331          * records.
12332          */
12333         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_MASK \
12334                 UINT32_C(0x3f)
12335         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_SFT \
12336                 0
12337         /* HWRM Asynchronous Event Information */
12338         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_HWRM_ASYNC_EVENT \
12339                 UINT32_C(0x2e)
12340         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_LAST \
12341                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_TYPE_HWRM_ASYNC_EVENT
12342         /* Identifiers of events. */
12343         uint16_t        event_id;
12344         /*
12345          * This async notification message is used to inform
12346          * the driver that an error has occurred which may need
12347          * the attention of the administrator.
12348          */
12349         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_ID_ERROR_REPORT \
12350                 UINT32_C(0x45)
12351         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_ID_LAST \
12352                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_ID_ERROR_REPORT
12353         /* Event specific data. */
12354         uint32_t        event_data2;
12355         uint8_t opaque_v;
12356         /*
12357          * This value is written by the NIC such that it will be different
12358          * for each pass through the completion queue. The even passes
12359          * will write 1. The odd passes will write 0.
12360          */
12361         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_V \
12362                 UINT32_C(0x1)
12363         /* opaque is 7 b */
12364         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_OPAQUE_MASK \
12365                 UINT32_C(0xfe)
12366         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_OPAQUE_SFT \
12367                 1
12368         /* 8-lsb timestamp (100-msec resolution) */
12369         uint8_t timestamp_lo;
12370         /* 16-lsb timestamp (100-msec resolution) */
12371         uint16_t        timestamp_hi;
12372         /* Event specific data */
12373         uint32_t        event_data1;
12374         /* Indicates the type of error being reported. */
12375         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_MASK \
12376                 UINT32_C(0xff)
12377         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_SFT \
12378                 0
12379         /*
12380          * This indicates doorbell drop threshold was hit. When this
12381          * threshold is crossed, it indicates one or more doorbells for
12382          * the function were dropped by hardware.
12383          */
12384         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD \
12385                 UINT32_C(0x4)
12386         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_LAST \
12387                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD
12388 } __rte_packed;
12389
12390 /* hwrm_async_event_cmpl_error_report_thermal (size:128b/16B) */
12391 struct hwrm_async_event_cmpl_error_report_thermal {
12392         uint16_t        type;
12393         /*
12394          * This field indicates the exact type of the completion.
12395          * By convention, the LSB identifies the length of the
12396          * record in 16B units. Even values indicate 16B
12397          * records. Odd values indicate 32B
12398          * records.
12399          */
12400         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_MASK \
12401                 UINT32_C(0x3f)
12402         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_SFT \
12403                 0
12404         /* HWRM Asynchronous Event Information */
12405         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_HWRM_ASYNC_EVENT \
12406                 UINT32_C(0x2e)
12407         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_LAST \
12408                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_HWRM_ASYNC_EVENT
12409         /* Identifiers of events. */
12410         uint16_t        event_id;
12411         /*
12412          * This async notification message is used to inform
12413          * the driver that an error has occurred which may need
12414          * the attention of the administrator.
12415          */
12416         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_ERROR_REPORT \
12417                 UINT32_C(0x45)
12418         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_LAST \
12419                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_ERROR_REPORT
12420         /* Event specific data. */
12421         uint32_t        event_data2;
12422         /* Current temperature.  In Celsius */
12423         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_MASK \
12424                 UINT32_C(0xff)
12425         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_SFT \
12426                 0
12427         /*
12428          * The temperature setting of the threshold that was just crossed.
12429          * In Celsius
12430          */
12431         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_MASK \
12432                 UINT32_C(0xff00)
12433         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_SFT \
12434                 8
12435         uint8_t opaque_v;
12436         /*
12437          * This value is written by the NIC such that it will be different
12438          * for each pass through the completion queue. The even passes
12439          * will write 1. The odd passes will write 0.
12440          */
12441         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_V \
12442                 UINT32_C(0x1)
12443         /* opaque is 7 b */
12444         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_OPAQUE_MASK \
12445                 UINT32_C(0xfe)
12446         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_OPAQUE_SFT 1
12447         /* 8-lsb timestamp (100-msec resolution) */
12448         uint8_t timestamp_lo;
12449         /* 16-lsb timestamp (100-msec resolution) */
12450         uint16_t        timestamp_hi;
12451         /* Event specific data */
12452         uint32_t        event_data1;
12453         /* Indicates the type of error being reported. */
12454         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_MASK \
12455                 UINT32_C(0xff)
12456         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_SFT \
12457                 0
12458         /*
12459          * There was thermal event. The type will be specified in the
12460          * field threshold_type. event_data2 will contain the current
12461          * temperature and the configured value for the threshold that
12462          * was just crossed. The threshold values are lower thresholds,
12463          * so the event will trigger with an active flag when the
12464          * temperature is on an increasing trajectory.
12465          */
12466         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_THERMAL_EVENT \
12467                 UINT32_C(0x5)
12468         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_LAST \
12469                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_THERMAL_EVENT
12470         /* The specific type of thermal threshold error */
12471         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_MASK \
12472                 UINT32_C(0x700)
12473         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SFT \
12474                 8
12475         /* Warning thermal threshold was crossed */
12476         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_WARN \
12477                 (UINT32_C(0x0) << 8)
12478         /* Critical thermal threshold was crossed */
12479         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_CRITICAL \
12480                 (UINT32_C(0x1) << 8)
12481         /* Fatal thermal threshold was crossed */
12482         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_FATAL \
12483                 (UINT32_C(0x2) << 8)
12484         /*
12485          * Thermal shutdown threshold was crossed and a shutdown is
12486          * imminent. This event will not occur if self shutdown
12487          * is disabled.
12488          */
12489         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SHUTDOWN \
12490                 (UINT32_C(0x3) << 8)
12491         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_LAST \
12492                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SHUTDOWN
12493         /*
12494          * Indicates if the thermal crossing occurs while the temperature is
12495          * increasing or decreasing.
12496          */
12497         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR \
12498                 UINT32_C(0x800)
12499         /* Threshold is crossed while the temperature is falling. */
12500         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_DECREASING \
12501                 (UINT32_C(0x0) << 11)
12502         /* Threshold is crossed while the temperature is rising. */
12503         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_INCREASING \
12504                 (UINT32_C(0x1) << 11)
12505         #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_LAST \
12506                 HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_INCREASING
12507 } __rte_packed;
12508
12509 /* metadata_base_msg (size:64b/8B) */
12510 struct metadata_base_msg {
12511         uint16_t        md_type_link;
12512         /* This field classifies the data present in the meta-data. */
12513         #define METADATA_BASE_MSG_MD_TYPE_MASK      UINT32_C(0x1f)
12514         #define METADATA_BASE_MSG_MD_TYPE_SFT       0
12515         /* Meta data fields are not valid */
12516         #define METADATA_BASE_MSG_MD_TYPE_NONE        UINT32_C(0x0)
12517         /*
12518          * This setting is used when packets are coming in-order. Depending on
12519          * the state of the receive context, the meta-data will carry different
12520          * information.
12521          */
12522         #define METADATA_BASE_MSG_MD_TYPE_TLS_INSYNC  UINT32_C(0x1)
12523         /*
12524          * With this setting HW passes the TCP sequence number of the TLS
12525          * record that it is requesting a resync on in the meta data.
12526          */
12527         #define METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC  UINT32_C(0x2)
12528         #define METADATA_BASE_MSG_MD_TYPE_LAST \
12529                 METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC
12530         /*
12531          * This field indicates where the next metadata block starts. It is
12532          * counted in 16B units. A value of zero indicates that there is no
12533          * metadata.
12534          */
12535         #define METADATA_BASE_MSG_LINK_MASK         UINT32_C(0x1e0)
12536         #define METADATA_BASE_MSG_LINK_SFT          5
12537         uint16_t        unused0;
12538         uint32_t        unused1;
12539 } __rte_packed;
12540
12541 /* tls_metadata_base_msg (size:64b/8B) */
12542 struct tls_metadata_base_msg {
12543         uint32_t        md_type_link_flags_kid_lo;
12544         /* This field classifies the data present in the meta-data. */
12545         #define TLS_METADATA_BASE_MSG_MD_TYPE_MASK \
12546                 UINT32_C(0x1f)
12547         #define TLS_METADATA_BASE_MSG_MD_TYPE_SFT                  0
12548         /*
12549          * This setting is used when packets are coming in-order. Depending on
12550          * the state of the receive context, the meta-data will carry different
12551          * information.
12552          */
12553         #define TLS_METADATA_BASE_MSG_MD_TYPE_TLS_INSYNC \
12554                 UINT32_C(0x1)
12555         /*
12556          * With this setting HW passes the TCP sequence number of the TLS
12557          * record that it is requesting a resync on in the meta data.
12558          */
12559         #define TLS_METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC \
12560                 UINT32_C(0x2)
12561         #define TLS_METADATA_BASE_MSG_MD_TYPE_LAST \
12562                 TLS_METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC
12563         /*
12564          * This field indicates where the next metadata block starts. It is
12565          * counted in 16B units. A value of zero indicates that there is no
12566          * metadata.
12567          */
12568         #define TLS_METADATA_BASE_MSG_LINK_MASK \
12569                 UINT32_C(0x1e0)
12570         #define TLS_METADATA_BASE_MSG_LINK_SFT                     5
12571         /* These are flags present in the metadata. */
12572         #define TLS_METADATA_BASE_MSG_FLAGS_MASK \
12573                 UINT32_C(0x1fffe00)
12574         #define TLS_METADATA_BASE_MSG_FLAGS_SFT                    9
12575         /*
12576          * A value of 1 implies that the packet was decrypted by HW. Otherwise
12577          * the packet is passed on as it came in on the wire.
12578          */
12579         #define TLS_METADATA_BASE_MSG_FLAGS_DECRYPTED \
12580                 UINT32_C(0x200)
12581         /*
12582          * This field indicates the state of the ghash field passed in the
12583          * meta-data.
12584          */
12585         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_MASK \
12586                 UINT32_C(0xc00)
12587         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_SFT               10
12588         /*
12589          * This enumeration states that the ghash is not valid in the
12590          * meta-data.
12591          */
12592         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_NOT_VALID \
12593                 (UINT32_C(0x0) << 10)
12594         /*
12595          * This enumeration indicates that this pkt contains the record's
12596          * tag and this pkt was received ooo, the partial_ghash field
12597          * contains the ghash.
12598          */
12599         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_CUR_REC \
12600                 (UINT32_C(0x1) << 10)
12601         /*
12602          * This enumeration indicates that the current record's tag wasn't
12603          * seen and the chip is moving on to the next record, the
12604          * partial_ghash field contains the ghash.
12605          */
12606         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_PRIOR_REC \
12607                 (UINT32_C(0x2) << 10)
12608         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_LAST \
12609                 TLS_METADATA_BASE_MSG_FLAGS_GHASH_PRIOR_REC
12610         /* This field indicates the status of tag authentication. */
12611         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_MASK \
12612                 UINT32_C(0x3000)
12613         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_SFT     12
12614         /*
12615          * This enumeration is set when there is no tags present in the
12616          * packet.
12617          */
12618         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_NONE \
12619                 (UINT32_C(0x0) << 12)
12620         /*
12621          * This enumeration states that there is at least one tag in the
12622          * packet and every tag is valid.
12623          */
12624         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_SUCCESS \
12625                 (UINT32_C(0x1) << 12)
12626         /*
12627          * This enumeration states that there is at least one tag in the
12628          * packet and at least one of the tag is invalid. The entire packet
12629          * is sent decrypted to the host.
12630          */
12631         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE \
12632                 (UINT32_C(0x2) << 12)
12633         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_LAST \
12634                 TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE
12635         /*
12636          * A value of 1 indicates that this packet contains a record that
12637          * starts in the packet and extends beyond the packet.
12638          */
12639         #define TLS_METADATA_BASE_MSG_FLAGS_HEADER_FLDS_VALID \
12640                 UINT32_C(0x4000)
12641         /*
12642          * This value indicates the lower 7-bit of the Crypto Key ID
12643          * associated with this operation.
12644          */
12645         #define TLS_METADATA_BASE_MSG_KID_LO_MASK \
12646                 UINT32_C(0xfe000000)
12647         #define TLS_METADATA_BASE_MSG_KID_LO_SFT                   25
12648         uint16_t        kid_hi;
12649         /*
12650          * This value indicates the upper 13-bit of the Crypto Key ID
12651          * associated with this operation.
12652          */
12653         #define TLS_METADATA_BASE_MSG_KID_HI_MASK UINT32_C(0x1fff)
12654         #define TLS_METADATA_BASE_MSG_KID_HI_SFT 0
12655         uint16_t        unused0;
12656 } __rte_packed;
12657
12658 /* tls_metadata_insync_msg (size:192b/24B) */
12659 struct tls_metadata_insync_msg {
12660         uint32_t        md_type_link_flags_kid_lo;
12661         /* This field classifies the data present in the meta-data. */
12662         #define TLS_METADATA_INSYNC_MSG_MD_TYPE_MASK \
12663                 UINT32_C(0x1f)
12664         #define TLS_METADATA_INSYNC_MSG_MD_TYPE_SFT                  0
12665         /*
12666          * This setting is used when packets are coming in-order. Depending on
12667          * the state of the receive context, the meta-data will carry different
12668          * information.
12669          */
12670         #define TLS_METADATA_INSYNC_MSG_MD_TYPE_TLS_INSYNC \
12671                 UINT32_C(0x1)
12672         #define TLS_METADATA_INSYNC_MSG_MD_TYPE_LAST \
12673                 TLS_METADATA_INSYNC_MSG_MD_TYPE_TLS_INSYNC
12674         /*
12675          * This field indicates where the next metadata block starts. It is
12676          * counted in 16B units. A value of zero indicates that there is no
12677          * metadata.
12678          */
12679         #define TLS_METADATA_INSYNC_MSG_LINK_MASK \
12680                 UINT32_C(0x1e0)
12681         #define TLS_METADATA_INSYNC_MSG_LINK_SFT                     5
12682         /* These are flags present in the metadata. */
12683         #define TLS_METADATA_INSYNC_MSG_FLAGS_MASK \
12684                 UINT32_C(0x1fffe00)
12685         #define TLS_METADATA_INSYNC_MSG_FLAGS_SFT                    9
12686         /*
12687          * A value of 1 implies that the packet was decrypted by HW. Otherwise
12688          * the packet is passed on as it came in on the wire.
12689          */
12690         #define TLS_METADATA_INSYNC_MSG_FLAGS_DECRYPTED \
12691                 UINT32_C(0x200)
12692         /*
12693          * This field indicates the state of the ghash field passed in the
12694          * meta-data.
12695          */
12696         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_MASK \
12697                 UINT32_C(0xc00)
12698         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_SFT               10
12699         /*
12700          * This enumeration states that the ghash is not valid in the
12701          * meta-data.
12702          */
12703         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_NOT_VALID \
12704                 (UINT32_C(0x0) << 10)
12705         /*
12706          * This enumeration indicates that this pkt contains the record's
12707          * tag and this pkt was received ooo, the partial_ghash field
12708          * contains the ghash.
12709          */
12710         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_CUR_REC \
12711                 (UINT32_C(0x1) << 10)
12712         /*
12713          * This enumeration indicates that the current record's tag wasn't
12714          * seen and the chip is moving on to the next record, the
12715          * partial_ghash field contains the ghash.
12716          */
12717         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_PRIOR_REC \
12718                 (UINT32_C(0x2) << 10)
12719         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_LAST \
12720                 TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_PRIOR_REC
12721         /* This field indicates the status of tag authentication. */
12722         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_MASK \
12723                 UINT32_C(0x3000)
12724         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_SFT     12
12725         /*
12726          * This enumeration is set when there is no tags present in the
12727          * packet.
12728          */
12729         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_NONE \
12730                 (UINT32_C(0x0) << 12)
12731         /*
12732          * This enumeration states that there is at least one tag in the
12733          * packet and every tag is valid.
12734          */
12735         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_SUCCESS \
12736                 (UINT32_C(0x1) << 12)
12737         /*
12738          * This enumeration states that there is at least one tag in the
12739          * packet and at least one of the tag is invalid. The entire packet
12740          * is sent decrypted to the host.
12741          */
12742         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE \
12743                 (UINT32_C(0x2) << 12)
12744         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_LAST \
12745                 TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE
12746         /*
12747          * A value of 1 indicates that this packet contains a record that
12748          * starts in the packet and extends beyond the packet.
12749          */
12750         #define TLS_METADATA_INSYNC_MSG_FLAGS_HEADER_FLDS_VALID \
12751                 UINT32_C(0x4000)
12752         /*
12753          * This value indicates the lower 7-bit of the Crypto Key ID
12754          * associated with this operation.
12755          */
12756         #define TLS_METADATA_INSYNC_MSG_KID_LO_MASK \
12757                 UINT32_C(0xfe000000)
12758         #define TLS_METADATA_INSYNC_MSG_KID_LO_SFT                   25
12759         uint16_t        kid_hi;
12760         /*
12761          * This value indicates the upper 13-bit of the Crypto Key ID
12762          * associated with this operation.
12763          */
12764         #define TLS_METADATA_INSYNC_MSG_KID_HI_MASK UINT32_C(0x1fff)
12765         #define TLS_METADATA_INSYNC_MSG_KID_HI_SFT 0
12766         /*
12767          * This field is only valid when md_type is set to tls_insync. This field
12768          * indicates the offset within the current TCP packet where the TLS header
12769          * starts. If there are multiple TLS headers in the packet, this provides
12770          * the offset of the last TLS header.
12771          *
12772          * The field is calculated by subtracting TCP sequence number of the first
12773          * byte of the TCP payload of the packet from the TCP sequence number of
12774          * the last TLS header in the packet.
12775          */
12776         uint16_t        tls_header_offset;
12777         /*
12778          * This is the sequence Number of the record that was processed by the HW.
12779          * If there are multiple records in a packet, this would be the sequence
12780          * number of the last record.
12781          */
12782         uint64_t        record_seq_num;
12783         /*
12784          * This field contains cumulative partial GHASH value of all the packets
12785          * decrypted by the HW associated with a TLS record. This field is valid
12786          * on when packets belonging to have arrived out-of-order and HW could
12787          * not decrypt every packet and authenticate the record. Partial GHASH is
12788          * only sent out with packet having the TAG field.
12789          */
12790         uint64_t        partial_ghash;
12791 } __rte_packed;
12792
12793 /* tls_metadata_resync_msg (size:256b/32B) */
12794 struct tls_metadata_resync_msg {
12795         uint32_t        md_type_link_flags_kid_lo;
12796         /* This field classifies the data present in the meta-data. */
12797         #define TLS_METADATA_RESYNC_MSG_MD_TYPE_MASK \
12798                 UINT32_C(0x1f)
12799         #define TLS_METADATA_RESYNC_MSG_MD_TYPE_SFT                 0
12800         /*
12801          * With this setting HW passes the TCP sequence number of the TLS
12802          * record that it is requesting a resync on in the meta data.
12803          */
12804         #define TLS_METADATA_RESYNC_MSG_MD_TYPE_TLS_RESYNC \
12805                 UINT32_C(0x2)
12806         #define TLS_METADATA_RESYNC_MSG_MD_TYPE_LAST \
12807                 TLS_METADATA_RESYNC_MSG_MD_TYPE_TLS_RESYNC
12808         /*
12809          * This field indicates where the next metadata block starts. It is
12810          * counted in 16B units. A value of zero indicates that there is no
12811          * metadata.
12812          */
12813         #define TLS_METADATA_RESYNC_MSG_LINK_MASK \
12814                 UINT32_C(0x1e0)
12815         #define TLS_METADATA_RESYNC_MSG_LINK_SFT                    5
12816         /* These are flags present in the metadata. */
12817         #define TLS_METADATA_RESYNC_MSG_FLAGS_MASK \
12818                 UINT32_C(0x1fffe00)
12819         #define TLS_METADATA_RESYNC_MSG_FLAGS_SFT                   9
12820         /*
12821          * A value of 1 implies that the packet was decrypted by HW. Otherwise
12822          * the packet is passed on as it came in on the wire.
12823          */
12824         #define TLS_METADATA_RESYNC_MSG_FLAGS_DECRYPTED \
12825                 UINT32_C(0x200)
12826         /*
12827          * This field indicates the state of the ghash field passed in the
12828          * meta-data.
12829          */
12830         #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_MASK \
12831                 UINT32_C(0xc00)
12832         #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_SFT              10
12833         /*
12834          * This enumeration states that the ghash is not valid in the
12835          * meta-data.
12836          */
12837         #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_NOT_VALID \
12838                 (UINT32_C(0x0) << 10)
12839         #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_LAST \
12840                 TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_NOT_VALID
12841         /* This field indicates the status of tag authentication. */
12842         #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_MASK \
12843                 UINT32_C(0x3000)
12844         #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_SFT    12
12845         /*
12846          * This enumeration is set when there is no tags present in the
12847          * packet.
12848          */
12849         #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_NONE \
12850                 (UINT32_C(0x0) << 12)
12851         #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_LAST \
12852                 TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_NONE
12853         /*
12854          * A value of 1 indicates that this packet contains a record that
12855          * starts in the packet and extends beyond the packet.
12856          */
12857         #define TLS_METADATA_RESYNC_MSG_FLAGS_HEADER_FLDS_VALID \
12858                 UINT32_C(0x4000)
12859         /*
12860          * This value indicates the lower 7-bit of the Crypto Key ID
12861          * associated with this operation.
12862          */
12863         #define TLS_METADATA_RESYNC_MSG_KID_LO_MASK \
12864                 UINT32_C(0xfe000000)
12865         #define TLS_METADATA_RESYNC_MSG_KID_LO_SFT                  25
12866         uint16_t        kid_hi;
12867         /*
12868          * This value indicates the upper 13-bit of the Crypto Key ID
12869          * associated with this operation.
12870          */
12871         #define TLS_METADATA_RESYNC_MSG_KID_HI_MASK UINT32_C(0x1fff)
12872         #define TLS_METADATA_RESYNC_MSG_KID_HI_SFT 0
12873         /* This field is unused in this context. */
12874         uint16_t        metadata_0;
12875         /*
12876          * This field indicates the TCP sequence number of the TLS record that HW
12877          * is requesting a resync on from the Driver. HW will keep a count of the
12878          * TLS records it found after this record (delta_records). Driver will
12879          * provide the TLS Record Sequence Number associated with the record. HW
12880          * will add the delta_records to the Record Sequence Number provided by
12881          * the driver and get back on sync.
12882          */
12883         uint32_t        resync_record_tcp_seq_num;
12884         uint32_t        unused0;
12885         /* This field is unused in this context. */
12886         uint64_t        metadata_2;
12887         /* This field is unused in this context. */
12888         uint64_t        metadata_3;
12889 } __rte_packed;
12890
12891 /*******************
12892  * hwrm_func_reset *
12893  *******************/
12894
12895
12896 /* hwrm_func_reset_input (size:192b/24B) */
12897 struct hwrm_func_reset_input {
12898         /* The HWRM command request type. */
12899         uint16_t        req_type;
12900         /*
12901          * The completion ring to send the completion event on. This should
12902          * be the NQ ID returned from the `nq_alloc` HWRM command.
12903          */
12904         uint16_t        cmpl_ring;
12905         /*
12906          * The sequence ID is used by the driver for tracking multiple
12907          * commands. This ID is treated as opaque data by the firmware and
12908          * the value is returned in the `hwrm_resp_hdr` upon completion.
12909          */
12910         uint16_t        seq_id;
12911         /*
12912          * The target ID of the command:
12913          * * 0x0-0xFFF8 - The function ID
12914          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12915          * * 0xFFFD - Reserved for user-space HWRM interface
12916          * * 0xFFFF - HWRM
12917          */
12918         uint16_t        target_id;
12919         /*
12920          * A physical address pointer pointing to a host buffer that the
12921          * command's response data will be written. This can be either a host
12922          * physical address (HPA) or a guest physical address (GPA) and must
12923          * point to a physically contiguous block of memory.
12924          */
12925         uint64_t        resp_addr;
12926         uint32_t        enables;
12927         /*
12928          * This bit must be '1' for the vf_id_valid field to be
12929          * configured.
12930          */
12931         #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
12932         /*
12933          * The ID of the VF that this PF is trying to reset.
12934          * Only the parent PF shall be allowed to reset a child VF.
12935          *
12936          * A parent PF driver shall use this field only when a specific child VF
12937          * is requested to be reset.
12938          */
12939         uint16_t        vf_id;
12940         /* This value indicates the level of a function reset. */
12941         uint8_t func_reset_level;
12942         /*
12943          * Reset the caller function and its children VFs (if any). If no
12944          * children functions exist, then reset the caller function only.
12945          */
12946         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL \
12947                 UINT32_C(0x0)
12948         /* Reset the caller function only */
12949         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME \
12950                 UINT32_C(0x1)
12951         /*
12952          * Reset all children VFs of the caller function driver if the
12953          * caller is a PF driver.
12954          * It is an error to specify this level by a VF driver.
12955          * It is an error to specify this level by a PF driver with
12956          * no children VFs.
12957          */
12958         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \
12959                 UINT32_C(0x2)
12960         /*
12961          * Reset a specific VF of the caller function driver if the caller
12962          * is the parent PF driver.
12963          * It is an error to specify this level by a VF driver.
12964          * It is an error to specify this level by a PF driver that is not
12965          * the parent of the VF that is being requested to reset.
12966          */
12967         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF \
12968                 UINT32_C(0x3)
12969         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST \
12970                 HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF
12971         uint8_t unused_0;
12972 } __rte_packed;
12973
12974 /* hwrm_func_reset_output (size:128b/16B) */
12975 struct hwrm_func_reset_output {
12976         /* The specific error status for the command. */
12977         uint16_t        error_code;
12978         /* The HWRM command request type. */
12979         uint16_t        req_type;
12980         /* The sequence ID from the original command. */
12981         uint16_t        seq_id;
12982         /* The length of the response data in number of bytes. */
12983         uint16_t        resp_len;
12984         uint8_t unused_0[7];
12985         /*
12986          * This field is used in Output records to indicate that the output
12987          * is completely written to RAM.  This field should be read as '1'
12988          * to indicate that the output has been completely written.
12989          * When writing a command completion or response to an internal processor,
12990          * the order of writes has to be such that this field is written last.
12991          */
12992         uint8_t valid;
12993 } __rte_packed;
12994
12995 /********************
12996  * hwrm_func_getfid *
12997  ********************/
12998
12999
13000 /* hwrm_func_getfid_input (size:192b/24B) */
13001 struct hwrm_func_getfid_input {
13002         /* The HWRM command request type. */
13003         uint16_t        req_type;
13004         /*
13005          * The completion ring to send the completion event on. This should
13006          * be the NQ ID returned from the `nq_alloc` HWRM command.
13007          */
13008         uint16_t        cmpl_ring;
13009         /*
13010          * The sequence ID is used by the driver for tracking multiple
13011          * commands. This ID is treated as opaque data by the firmware and
13012          * the value is returned in the `hwrm_resp_hdr` upon completion.
13013          */
13014         uint16_t        seq_id;
13015         /*
13016          * The target ID of the command:
13017          * * 0x0-0xFFF8 - The function ID
13018          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13019          * * 0xFFFD - Reserved for user-space HWRM interface
13020          * * 0xFFFF - HWRM
13021          */
13022         uint16_t        target_id;
13023         /*
13024          * A physical address pointer pointing to a host buffer that the
13025          * command's response data will be written. This can be either a host
13026          * physical address (HPA) or a guest physical address (GPA) and must
13027          * point to a physically contiguous block of memory.
13028          */
13029         uint64_t        resp_addr;
13030         uint32_t        enables;
13031         /*
13032          * This bit must be '1' for the pci_id field to be
13033          * configured.
13034          */
13035         #define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID     UINT32_C(0x1)
13036         /*
13037          * This value is the PCI ID of the queried function.
13038          * If ARI is enabled, then it is
13039          * Bus Number (8b):Function Number(8b). Otherwise, it is
13040          * Bus Number (8b):Device Number (5b):Function Number(3b).
13041          */
13042         uint16_t        pci_id;
13043         uint8_t unused_0[2];
13044 } __rte_packed;
13045
13046 /* hwrm_func_getfid_output (size:128b/16B) */
13047 struct hwrm_func_getfid_output {
13048         /* The specific error status for the command. */
13049         uint16_t        error_code;
13050         /* The HWRM command request type. */
13051         uint16_t        req_type;
13052         /* The sequence ID from the original command. */
13053         uint16_t        seq_id;
13054         /* The length of the response data in number of bytes. */
13055         uint16_t        resp_len;
13056         /*
13057          * FID value.  This value is used to identify operations on the PCI
13058          * bus as belonging to a particular PCI function.
13059          */
13060         uint16_t        fid;
13061         uint8_t unused_0[5];
13062         /*
13063          * This field is used in Output records to indicate that the output
13064          * is completely written to RAM.  This field should be read as '1'
13065          * to indicate that the output has been completely written.
13066          * When writing a command completion or response to an internal processor,
13067          * the order of writes has to be such that this field is written last.
13068          */
13069         uint8_t valid;
13070 } __rte_packed;
13071
13072 /**********************
13073  * hwrm_func_vf_alloc *
13074  **********************/
13075
13076
13077 /* hwrm_func_vf_alloc_input (size:192b/24B) */
13078 struct hwrm_func_vf_alloc_input {
13079         /* The HWRM command request type. */
13080         uint16_t        req_type;
13081         /*
13082          * The completion ring to send the completion event on. This should
13083          * be the NQ ID returned from the `nq_alloc` HWRM command.
13084          */
13085         uint16_t        cmpl_ring;
13086         /*
13087          * The sequence ID is used by the driver for tracking multiple
13088          * commands. This ID is treated as opaque data by the firmware and
13089          * the value is returned in the `hwrm_resp_hdr` upon completion.
13090          */
13091         uint16_t        seq_id;
13092         /*
13093          * The target ID of the command:
13094          * * 0x0-0xFFF8 - The function ID
13095          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13096          * * 0xFFFD - Reserved for user-space HWRM interface
13097          * * 0xFFFF - HWRM
13098          */
13099         uint16_t        target_id;
13100         /*
13101          * A physical address pointer pointing to a host buffer that the
13102          * command's response data will be written. This can be either a host
13103          * physical address (HPA) or a guest physical address (GPA) and must
13104          * point to a physically contiguous block of memory.
13105          */
13106         uint64_t        resp_addr;
13107         uint32_t        enables;
13108         /*
13109          * This bit must be '1' for the first_vf_id field to be
13110          * configured.
13111          */
13112         #define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
13113         /*
13114          * This value is used to identify a Virtual Function (VF).
13115          * The scope of VF ID is local within a PF.
13116          */
13117         uint16_t        first_vf_id;
13118         /* The number of virtual functions requested. */
13119         uint16_t        num_vfs;
13120 } __rte_packed;
13121
13122 /* hwrm_func_vf_alloc_output (size:128b/16B) */
13123 struct hwrm_func_vf_alloc_output {
13124         /* The specific error status for the command. */
13125         uint16_t        error_code;
13126         /* The HWRM command request type. */
13127         uint16_t        req_type;
13128         /* The sequence ID from the original command. */
13129         uint16_t        seq_id;
13130         /* The length of the response data in number of bytes. */
13131         uint16_t        resp_len;
13132         /* The ID of the first VF allocated. */
13133         uint16_t        first_vf_id;
13134         uint8_t unused_0[5];
13135         /*
13136          * This field is used in Output records to indicate that the output
13137          * is completely written to RAM.  This field should be read as '1'
13138          * to indicate that the output has been completely written.
13139          * When writing a command completion or response to an internal processor,
13140          * the order of writes has to be such that this field is written last.
13141          */
13142         uint8_t valid;
13143 } __rte_packed;
13144
13145 /*********************
13146  * hwrm_func_vf_free *
13147  *********************/
13148
13149
13150 /* hwrm_func_vf_free_input (size:192b/24B) */
13151 struct hwrm_func_vf_free_input {
13152         /* The HWRM command request type. */
13153         uint16_t        req_type;
13154         /*
13155          * The completion ring to send the completion event on. This should
13156          * be the NQ ID returned from the `nq_alloc` HWRM command.
13157          */
13158         uint16_t        cmpl_ring;
13159         /*
13160          * The sequence ID is used by the driver for tracking multiple
13161          * commands. This ID is treated as opaque data by the firmware and
13162          * the value is returned in the `hwrm_resp_hdr` upon completion.
13163          */
13164         uint16_t        seq_id;
13165         /*
13166          * The target ID of the command:
13167          * * 0x0-0xFFF8 - The function ID
13168          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13169          * * 0xFFFD - Reserved for user-space HWRM interface
13170          * * 0xFFFF - HWRM
13171          */
13172         uint16_t        target_id;
13173         /*
13174          * A physical address pointer pointing to a host buffer that the
13175          * command's response data will be written. This can be either a host
13176          * physical address (HPA) or a guest physical address (GPA) and must
13177          * point to a physically contiguous block of memory.
13178          */
13179         uint64_t        resp_addr;
13180         uint32_t        enables;
13181         /*
13182          * This bit must be '1' for the first_vf_id field to be
13183          * configured.
13184          */
13185         #define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
13186         /*
13187          * This value is used to identify a Virtual Function (VF).
13188          * The scope of VF ID is local within a PF.
13189          */
13190         uint16_t        first_vf_id;
13191         /*
13192          * The number of virtual functions requested.
13193          * 0xFFFF - Cleanup all children of this PF.
13194          */
13195         uint16_t        num_vfs;
13196 } __rte_packed;
13197
13198 /* hwrm_func_vf_free_output (size:128b/16B) */
13199 struct hwrm_func_vf_free_output {
13200         /* The specific error status for the command. */
13201         uint16_t        error_code;
13202         /* The HWRM command request type. */
13203         uint16_t        req_type;
13204         /* The sequence ID from the original command. */
13205         uint16_t        seq_id;
13206         /* The length of the response data in number of bytes. */
13207         uint16_t        resp_len;
13208         uint8_t unused_0[7];
13209         /*
13210          * This field is used in Output records to indicate that the output
13211          * is completely written to RAM.  This field should be read as '1'
13212          * to indicate that the output has been completely written.
13213          * When writing a command completion or response to an internal processor,
13214          * the order of writes has to be such that this field is written last.
13215          */
13216         uint8_t valid;
13217 } __rte_packed;
13218
13219 /********************
13220  * hwrm_func_vf_cfg *
13221  ********************/
13222
13223
13224 /* hwrm_func_vf_cfg_input (size:448b/56B) */
13225 struct hwrm_func_vf_cfg_input {
13226         /* The HWRM command request type. */
13227         uint16_t        req_type;
13228         /*
13229          * The completion ring to send the completion event on. This should
13230          * be the NQ ID returned from the `nq_alloc` HWRM command.
13231          */
13232         uint16_t        cmpl_ring;
13233         /*
13234          * The sequence ID is used by the driver for tracking multiple
13235          * commands. This ID is treated as opaque data by the firmware and
13236          * the value is returned in the `hwrm_resp_hdr` upon completion.
13237          */
13238         uint16_t        seq_id;
13239         /*
13240          * The target ID of the command:
13241          * * 0x0-0xFFF8 - The function ID
13242          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13243          * * 0xFFFD - Reserved for user-space HWRM interface
13244          * * 0xFFFF - HWRM
13245          */
13246         uint16_t        target_id;
13247         /*
13248          * A physical address pointer pointing to a host buffer that the
13249          * command's response data will be written. This can be either a host
13250          * physical address (HPA) or a guest physical address (GPA) and must
13251          * point to a physically contiguous block of memory.
13252          */
13253         uint64_t        resp_addr;
13254         uint32_t        enables;
13255         /*
13256          * This bit must be '1' for the mtu field to be
13257          * configured.
13258          */
13259         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU \
13260                 UINT32_C(0x1)
13261         /*
13262          * This bit must be '1' for the guest_vlan field to be
13263          * configured.
13264          */
13265         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN \
13266                 UINT32_C(0x2)
13267         /*
13268          * This bit must be '1' for the async_event_cr field to be
13269          * configured.
13270          */
13271         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
13272                 UINT32_C(0x4)
13273         /*
13274          * This bit must be '1' for the dflt_mac_addr field to be
13275          * configured.
13276          */
13277         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
13278                 UINT32_C(0x8)
13279         /*
13280          * This bit must be '1' for the num_rsscos_ctxs field to be
13281          * configured.
13282          */
13283         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
13284                 UINT32_C(0x10)
13285         /*
13286          * This bit must be '1' for the num_cmpl_rings field to be
13287          * configured.
13288          */
13289         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
13290                 UINT32_C(0x20)
13291         /*
13292          * This bit must be '1' for the num_tx_rings field to be
13293          * configured.
13294          */
13295         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS \
13296                 UINT32_C(0x40)
13297         /*
13298          * This bit must be '1' for the num_rx_rings field to be
13299          * configured.
13300          */
13301         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS \
13302                 UINT32_C(0x80)
13303         /*
13304          * This bit must be '1' for the num_l2_ctxs field to be
13305          * configured.
13306          */
13307         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS \
13308                 UINT32_C(0x100)
13309         /*
13310          * This bit must be '1' for the num_vnics field to be
13311          * configured.
13312          */
13313         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS \
13314                 UINT32_C(0x200)
13315         /*
13316          * This bit must be '1' for the num_stat_ctxs field to be
13317          * configured.
13318          */
13319         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
13320                 UINT32_C(0x400)
13321         /*
13322          * This bit must be '1' for the num_hw_ring_grps field to be
13323          * configured.
13324          */
13325         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
13326                 UINT32_C(0x800)
13327         /*
13328          * This bit must be '1' for the num_tx_key_ctxs field to be
13329          * configured.
13330          */
13331         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_KEY_CTXS \
13332                 UINT32_C(0x1000)
13333         /*
13334          * This bit must be '1' for the num_rx_key_ctxs field to be
13335          * configured.
13336          */
13337         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_KEY_CTXS \
13338                 UINT32_C(0x2000)
13339         /*
13340          * The maximum transmission unit requested on the function.
13341          * The HWRM should make sure that the mtu of
13342          * the function does not exceed the mtu of the physical
13343          * port that this function is associated with.
13344          *
13345          * In addition to requesting mtu per function, it is
13346          * possible to configure mtu per transmit ring.
13347          * By default, the mtu of each transmit ring associated
13348          * with a function is equal to the mtu of the function.
13349          * The HWRM should make sure that the mtu of each transmit
13350          * ring that is assigned to a function has a valid mtu.
13351          */
13352         uint16_t        mtu;
13353         /*
13354          * The guest VLAN for the function being configured.
13355          * This field's format is same as 802.1Q Tag's
13356          * Tag Control Information (TCI) format that includes both
13357          * Priority Code Point (PCP) and VLAN Identifier (VID).
13358          */
13359         uint16_t        guest_vlan;
13360         /*
13361          * ID of the target completion ring for receiving asynchronous
13362          * event completions. If this field is not valid, then the
13363          * HWRM shall use the default completion ring of the function
13364          * that is being configured as the target completion ring for
13365          * providing any asynchronous event completions for that
13366          * function.
13367          * If this field is valid, then the HWRM shall use the
13368          * completion ring identified by this ID as the target
13369          * completion ring for providing any asynchronous event
13370          * completions for the function that is being configured.
13371          */
13372         uint16_t        async_event_cr;
13373         /*
13374          * This value is the current MAC address requested by the VF
13375          * driver to be configured on this VF. A value of
13376          * 00-00-00-00-00-00 indicates no MAC address configuration
13377          * is requested by the VF driver.
13378          * The parent PF driver may reject or overwrite this
13379          * MAC address.
13380          */
13381         uint8_t dflt_mac_addr[6];
13382         uint32_t        flags;
13383         /*
13384          * This bit requests that the firmware test to see if all the assets
13385          * requested in this command (i.e. number of TX rings) are available.
13386          * The firmware will return an error if the requested assets are
13387          * not available. The firwmare will NOT reserve the assets if they
13388          * are available.
13389          */
13390         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
13391                 UINT32_C(0x1)
13392         /*
13393          * This bit requests that the firmware test to see if all the assets
13394          * requested in this command (i.e. number of RX rings) are available.
13395          * The firmware will return an error if the requested assets are
13396          * not available. The firwmare will NOT reserve the assets if they
13397          * are available.
13398          */
13399         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
13400                 UINT32_C(0x2)
13401         /*
13402          * This bit requests that the firmware test to see if all the assets
13403          * requested in this command (i.e. number of CMPL rings) are available.
13404          * The firmware will return an error if the requested assets are
13405          * not available. The firwmare will NOT reserve the assets if they
13406          * are available.
13407          */
13408         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
13409                 UINT32_C(0x4)
13410         /*
13411          * This bit requests that the firmware test to see if all the assets
13412          * requested in this command (i.e. number of RSS ctx) are available.
13413          * The firmware will return an error if the requested assets are
13414          * not available. The firwmare will NOT reserve the assets if they
13415          * are available.
13416          */
13417         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
13418                 UINT32_C(0x8)
13419         /*
13420          * This bit requests that the firmware test to see if all the assets
13421          * requested in this command (i.e. number of ring groups) are available.
13422          * The firmware will return an error if the requested assets are
13423          * not available. The firwmare will NOT reserve the assets if they
13424          * are available.
13425          */
13426         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
13427                 UINT32_C(0x10)
13428         /*
13429          * This bit requests that the firmware test to see if all the assets
13430          * requested in this command (i.e. number of stat ctx) are available.
13431          * The firmware will return an error if the requested assets are
13432          * not available. The firwmare will NOT reserve the assets if they
13433          * are available.
13434          */
13435         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
13436                 UINT32_C(0x20)
13437         /*
13438          * This bit requests that the firmware test to see if all the assets
13439          * requested in this command (i.e. number of VNICs) are available.
13440          * The firmware will return an error if the requested assets are
13441          * not available. The firwmare will NOT reserve the assets if they
13442          * are available.
13443          */
13444         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
13445                 UINT32_C(0x40)
13446         /*
13447          * This bit requests that the firmware test to see if all the assets
13448          * requested in this command (i.e. number of L2 ctx) are available.
13449          * The firmware will return an error if the requested assets are
13450          * not available. The firwmare will NOT reserve the assets if they
13451          * are available.
13452          */
13453         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
13454                 UINT32_C(0x80)
13455         /*
13456          * If this bit is set to 1, the VF driver is requesting FW to enable
13457          * PPP TX PUSH feature on all the TX rings specified in the
13458          * num_tx_rings field. By default, the PPP TX push feature is
13459          * disabled for all the TX rings of the VF. This flag is ignored if
13460          * the num_tx_rings field is not specified or the VF doesn't support
13461          * PPP tx push feature.
13462          */
13463         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE \
13464                 UINT32_C(0x100)
13465         /*
13466          * If this bit is set to 1, the VF driver is requesting FW to disable
13467          * PPP TX PUSH feature on all the TX rings of the VF. This flag is
13468          * ignored if the VF doesn't support PPP tx push feature.
13469          */
13470         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE \
13471                 UINT32_C(0x200)
13472         /* The number of RSS/COS contexts requested for the VF. */
13473         uint16_t        num_rsscos_ctxs;
13474         /* The number of completion rings requested for the VF. */
13475         uint16_t        num_cmpl_rings;
13476         /* The number of transmit rings requested for the VF. */
13477         uint16_t        num_tx_rings;
13478         /* The number of receive rings requested for the VF. */
13479         uint16_t        num_rx_rings;
13480         /* The number of L2 contexts requested for the VF. */
13481         uint16_t        num_l2_ctxs;
13482         /* The number of vnics requested for the VF. */
13483         uint16_t        num_vnics;
13484         /* The number of statistic contexts requested for the VF. */
13485         uint16_t        num_stat_ctxs;
13486         /* The number of HW ring groups requested for the VF. */
13487         uint16_t        num_hw_ring_grps;
13488         /* Number of Tx Key Contexts requested. */
13489         uint16_t        num_tx_key_ctxs;
13490         /* Number of Rx Key Contexts requested. */
13491         uint16_t        num_rx_key_ctxs;
13492 } __rte_packed;
13493
13494 /* hwrm_func_vf_cfg_output (size:128b/16B) */
13495 struct hwrm_func_vf_cfg_output {
13496         /* The specific error status for the command. */
13497         uint16_t        error_code;
13498         /* The HWRM command request type. */
13499         uint16_t        req_type;
13500         /* The sequence ID from the original command. */
13501         uint16_t        seq_id;
13502         /* The length of the response data in number of bytes. */
13503         uint16_t        resp_len;
13504         uint8_t unused_0[7];
13505         /*
13506          * This field is used in Output records to indicate that the output
13507          * is completely written to RAM.  This field should be read as '1'
13508          * to indicate that the output has been completely written.
13509          * When writing a command completion or response to an internal processor,
13510          * the order of writes has to be such that this field is written last.
13511          */
13512         uint8_t valid;
13513 } __rte_packed;
13514
13515 /*******************
13516  * hwrm_func_qcaps *
13517  *******************/
13518
13519
13520 /* hwrm_func_qcaps_input (size:192b/24B) */
13521 struct hwrm_func_qcaps_input {
13522         /* The HWRM command request type. */
13523         uint16_t        req_type;
13524         /*
13525          * The completion ring to send the completion event on. This should
13526          * be the NQ ID returned from the `nq_alloc` HWRM command.
13527          */
13528         uint16_t        cmpl_ring;
13529         /*
13530          * The sequence ID is used by the driver for tracking multiple
13531          * commands. This ID is treated as opaque data by the firmware and
13532          * the value is returned in the `hwrm_resp_hdr` upon completion.
13533          */
13534         uint16_t        seq_id;
13535         /*
13536          * The target ID of the command:
13537          * * 0x0-0xFFF8 - The function ID
13538          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13539          * * 0xFFFD - Reserved for user-space HWRM interface
13540          * * 0xFFFF - HWRM
13541          */
13542         uint16_t        target_id;
13543         /*
13544          * A physical address pointer pointing to a host buffer that the
13545          * command's response data will be written. This can be either a host
13546          * physical address (HPA) or a guest physical address (GPA) and must
13547          * point to a physically contiguous block of memory.
13548          */
13549         uint64_t        resp_addr;
13550         /*
13551          * Function ID of the function that is being queried.
13552          * 0xFF... (All Fs) if the query is for the requesting
13553          * function.
13554          * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
13555          * to be used by a trusted VF to query its parent PF.
13556          */
13557         uint16_t        fid;
13558         uint8_t unused_0[6];
13559 } __rte_packed;
13560
13561 /* hwrm_func_qcaps_output (size:768b/96B) */
13562 struct hwrm_func_qcaps_output {
13563         /* The specific error status for the command. */
13564         uint16_t        error_code;
13565         /* The HWRM command request type. */
13566         uint16_t        req_type;
13567         /* The sequence ID from the original command. */
13568         uint16_t        seq_id;
13569         /* The length of the response data in number of bytes. */
13570         uint16_t        resp_len;
13571         /*
13572          * FID value.  This value is used to identify operations on the PCI
13573          * bus as belonging to a particular PCI function.
13574          */
13575         uint16_t        fid;
13576         /*
13577          * Port ID of port that this function is associated with.
13578          * Valid only for the PF.
13579          * 0xFF... (All Fs) if this function is not associated with
13580          * any port.
13581          * 0xFF... (All Fs) if this function is called from a VF.
13582          */
13583         uint16_t        port_id;
13584         uint32_t        flags;
13585         /* If 1, then Push mode is supported on this function. */
13586         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED \
13587                 UINT32_C(0x1)
13588         /*
13589          * If 1, then the global MSI-X auto-masking is enabled for the
13590          * device.
13591          */
13592         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
13593                 UINT32_C(0x2)
13594         /*
13595          * If 1, then the Precision Time Protocol (PTP) processing
13596          * is supported on this function.
13597          * The HWRM should enable PTP on only a single Physical
13598          * Function (PF) per port.
13599          */
13600         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED \
13601                 UINT32_C(0x4)
13602         /*
13603          * If 1, then RDMA over Converged Ethernet (RoCE) v1
13604          * is supported on this function.
13605          */
13606         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED \
13607                 UINT32_C(0x8)
13608         /*
13609          * If 1, then RDMA over Converged Ethernet (RoCE) v2
13610          * is supported on this function.
13611          */
13612         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED \
13613                 UINT32_C(0x10)
13614         /*
13615          * If 1, then control and configuration of WoL magic packet
13616          * are supported on this function.
13617          */
13618         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED \
13619                 UINT32_C(0x20)
13620         /*
13621          * If 1, then control and configuration of bitmap pattern
13622          * packet are supported on this function.
13623          */
13624         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED \
13625                 UINT32_C(0x40)
13626         /*
13627          * If set to 1, then the control and configuration of rate limit
13628          * of an allocated TX ring on the queried function is supported.
13629          */
13630         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED \
13631                 UINT32_C(0x80)
13632         /*
13633          * If 1, then control and configuration of minimum and
13634          * maximum bandwidths are supported on the queried function.
13635          */
13636         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED \
13637                 UINT32_C(0x100)
13638         /*
13639          * If the query is for a VF, then this flag shall be ignored.
13640          * If this query is for a PF and this flag is set to 1,
13641          * then the PF has the capability to set the rate limits
13642          * on the TX rings of its children VFs.
13643          * If this query is for a PF and this flag is set to 0, then
13644          * the PF does not have the capability to set the rate limits
13645          * on the TX rings of its children VFs.
13646          */
13647         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED \
13648                 UINT32_C(0x200)
13649         /*
13650          * If the query is for a VF, then this flag shall be ignored.
13651          * If this query is for a PF and this flag is set to 1,
13652          * then the PF has the capability to set the minimum and/or
13653          * maximum bandwidths for its children VFs.
13654          * If this query is for a PF and this flag is set to 0, then
13655          * the PF does not have the capability to set the minimum or
13656          * maximum bandwidths for its children VFs.
13657          */
13658         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED \
13659                 UINT32_C(0x400)
13660         /*
13661          * Standard TX Ring mode is used for the allocation of TX ring
13662          * and underlying scheduling resources that allow bandwidth
13663          * reservation and limit settings on the queried function.
13664          * If set to 1, then standard TX ring mode is supported
13665          * on the queried function.
13666          * If set to 0, then standard TX ring mode is not available
13667          * on the queried function.
13668          */
13669         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED \
13670                 UINT32_C(0x800)
13671         /*
13672          * If the query is for a VF, then this flag shall be ignored,
13673          * If this query is for a PF and this flag is set to 1,
13674          * then the PF has the capability to detect GENEVE tunnel
13675          * flags.
13676          */
13677         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GENEVE_TUN_FLAGS_SUPPORTED \
13678                 UINT32_C(0x1000)
13679         /*
13680          * If the query is for a VF, then this flag shall be ignored,
13681          * If this query is for a PF and this flag is set to 1,
13682          * then the PF has the capability to detect NVGRE tunnel
13683          * flags.
13684          */
13685         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NVGRE_TUN_FLAGS_SUPPORTED \
13686                 UINT32_C(0x2000)
13687         /*
13688          * If the query is for a VF, then this flag shall be ignored,
13689          * If this query is for a PF and this flag is set to 1,
13690          * then the PF has the capability to detect GRE tunnel
13691          * flags.
13692          */
13693         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GRE_TUN_FLAGS_SUPPORTED \
13694                 UINT32_C(0x4000)
13695         /*
13696          * If the query is for a VF, then this flag shall be ignored,
13697          * If this query is for a PF and this flag is set to 1,
13698          * then the PF has the capability to detect MPLS tunnel
13699          * flags.
13700          */
13701         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_MPLS_TUN_FLAGS_SUPPORTED \
13702                 UINT32_C(0x8000)
13703         /*
13704          * If the query is for a VF, then this flag shall be ignored,
13705          * If this query is for a PF and this flag is set to 1,
13706          * then the PF has the capability to support pcie stats.
13707          */
13708         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PCIE_STATS_SUPPORTED \
13709                 UINT32_C(0x10000)
13710         /*
13711          * If the query is for a VF, then this flag shall be ignored,
13712          * If this query is for a PF and this flag is set to 1,
13713          * then the PF has the capability to adopt the VF's belonging
13714          * to another PF.
13715          */
13716         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADOPTED_PF_SUPPORTED \
13717                 UINT32_C(0x20000)
13718         /*
13719          * If the query is for a VF, then this flag shall be ignored,
13720          * If this query is for a PF and this flag is set to 1,
13721          * then the PF has the administrative privilege to configure another PF
13722          */
13723         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADMIN_PF_SUPPORTED \
13724                 UINT32_C(0x40000)
13725         /*
13726          * If the query is for a VF, then this flag shall be ignored.
13727          * If this query is for a PF and this flag is set to 1, then
13728          * the PF will know that the firmware has the capability to track
13729          * the virtual link status.
13730          */
13731         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_LINK_ADMIN_STATUS_SUPPORTED \
13732                 UINT32_C(0x80000)
13733         /*
13734          * If 1, then this function supports the push mode that uses
13735          * write combine buffers and the long inline tx buffer descriptor.
13736          */
13737         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WCB_PUSH_MODE \
13738                 UINT32_C(0x100000)
13739         /*
13740          * If 1, then FW has capability to allocate TX rings dynamically
13741          * in ring alloc even if PF reserved pool is zero.
13742          * This bit will be used only for PFs.
13743          */
13744         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
13745                 UINT32_C(0x200000)
13746         /*
13747          * When this bit is '1', it indicates that core firmware is
13748          * capable of Hot Reset.
13749          */
13750         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE \
13751                 UINT32_C(0x400000)
13752         /*
13753          * This flag will be set to 1 by the FW if FW supports adapter error
13754          * recovery.
13755          */
13756         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERROR_RECOVERY_CAPABLE \
13757                 UINT32_C(0x800000)
13758         /*
13759          * If the query is for a VF, then this flag shall be ignored.
13760          * If this query is for a PF and this flag is set to 1, then
13761          * the PF has the capability to support extended stats.
13762          */
13763         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED \
13764                 UINT32_C(0x1000000)
13765         /*
13766          * If the query is for a VF, then this flag shall be ignored.
13767          * If this query is for a PF and this flag is set to 1, then host
13768          * must initiate reset or reload (or fastboot) the firmware image
13769          * upon detection of device shutdown state.
13770          */
13771         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERR_RECOVER_RELOAD \
13772                 UINT32_C(0x2000000)
13773         /*
13774          * If the query is for a VF, then this flag (always set to 0) shall
13775          * be ignored. If this query is for a PF and this flag is set to 1,
13776          * host, when registered for the default vnic change async event,
13777          * receives async notification whenever a default vnic state is
13778          * changed for any of child or adopted VFs.
13779          */
13780         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NOTIFY_VF_DEF_VNIC_CHNG_SUPPORTED \
13781                 UINT32_C(0x4000000)
13782         /* If set to 1, then the vlan acceleration for TX is disabled. */
13783         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED \
13784                 UINT32_C(0x8000000)
13785         /*
13786          * When this bit is '1', it indicates that core firmware supports
13787          * DBG_COREDUMP_XXX commands.
13788          */
13789         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_COREDUMP_CMD_SUPPORTED \
13790                 UINT32_C(0x10000000)
13791         /*
13792          * When this bit is '1', it indicates that core firmware supports
13793          * DBG_CRASHDUMP_XXX commands.
13794          */
13795         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_CRASHDUMP_CMD_SUPPORTED \
13796                 UINT32_C(0x20000000)
13797         /*
13798          * If the query is for a VF, then this flag should be ignored.
13799          * If the query is for a PF and this flag is set to 1, then
13800          * the PF has the capability to support retrieval of
13801          * rx_port_stats_ext_pfc_wd statistics (supported by the PFC
13802          * WatchDog feature) via the hwrm_port_qstats_ext_pfc_wd command.
13803          * If this flag is set to 1, only that (supported) command should
13804          * be used for retrieval of PFC related statistics (rather than
13805          * hwrm_port_qstats_ext command, which could previously be used).
13806          */
13807         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PFC_WD_STATS_SUPPORTED \
13808                 UINT32_C(0x40000000)
13809         /*
13810          * When this bit is '1', it indicates that core firmware supports
13811          * DBG_QCAPS command
13812          */
13813         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DBG_QCAPS_CMD_SUPPORTED \
13814                 UINT32_C(0x80000000)
13815         /*
13816          * This value is current MAC address configured for this
13817          * function. A value of 00-00-00-00-00-00 indicates no
13818          * MAC address is currently configured.
13819          */
13820         uint8_t mac_address[6];
13821         /*
13822          * The maximum number of RSS/COS contexts that can be
13823          * allocated to the function.
13824          */
13825         uint16_t        max_rsscos_ctx;
13826         /*
13827          * The maximum number of completion rings that can be
13828          * allocated to the function.
13829          */
13830         uint16_t        max_cmpl_rings;
13831         /*
13832          * The maximum number of transmit rings that can be
13833          * allocated to the function.
13834          */
13835         uint16_t        max_tx_rings;
13836         /*
13837          * The maximum number of receive rings that can be
13838          * allocated to the function.
13839          */
13840         uint16_t        max_rx_rings;
13841         /*
13842          * The maximum number of L2 contexts that can be
13843          * allocated to the function.
13844          */
13845         uint16_t        max_l2_ctxs;
13846         /*
13847          * The maximum number of VNICs that can be
13848          * allocated to the function.
13849          */
13850         uint16_t        max_vnics;
13851         /*
13852          * The identifier for the first VF enabled on a PF. This
13853          * is valid only on the PF with SR-IOV enabled.
13854          * 0xFF... (All Fs) if this command is called on a PF with
13855          * SR-IOV disabled or on a VF.
13856          */
13857         uint16_t        first_vf_id;
13858         /*
13859          * The maximum number of VFs that can be
13860          * allocated to the function. This is valid only on the
13861          * PF with SR-IOV enabled. 0xFF... (All Fs) if this
13862          * command is called on a PF with SR-IOV disabled or
13863          * on a VF.
13864          */
13865         uint16_t        max_vfs;
13866         /*
13867          * The maximum number of statistic contexts that can be
13868          * allocated to the function.
13869          */
13870         uint16_t        max_stat_ctx;
13871         /*
13872          * The maximum number of Encapsulation records that can be
13873          * offloaded by this function.
13874          */
13875         uint32_t        max_encap_records;
13876         /*
13877          * The maximum number of decapsulation records that can
13878          * be offloaded by this function.
13879          */
13880         uint32_t        max_decap_records;
13881         /*
13882          * The maximum number of Exact Match (EM) flows that can be
13883          * offloaded by this function on the TX side.
13884          */
13885         uint32_t        max_tx_em_flows;
13886         /*
13887          * The maximum number of Wildcard Match (WM) flows that can
13888          * be offloaded by this function on the TX side.
13889          */
13890         uint32_t        max_tx_wm_flows;
13891         /*
13892          * The maximum number of Exact Match (EM) flows that can be
13893          * offloaded by this function on the RX side.
13894          */
13895         uint32_t        max_rx_em_flows;
13896         /*
13897          * The maximum number of Wildcard Match (WM) flows that can
13898          * be offloaded by this function on the RX side.
13899          */
13900         uint32_t        max_rx_wm_flows;
13901         /*
13902          * The maximum number of multicast filters that can
13903          * be supported by this function on the RX side.
13904          */
13905         uint32_t        max_mcast_filters;
13906         /*
13907          * The maximum value of flow_id that can be supported
13908          * in completion records.
13909          */
13910         uint32_t        max_flow_id;
13911         /*
13912          * The maximum number of HW ring groups that can be
13913          * supported on this function.
13914          */
13915         uint32_t        max_hw_ring_grps;
13916         /*
13917          * The maximum number of strict priority transmit rings
13918          * that can be allocated to the function.
13919          * This number indicates the maximum number of TX rings
13920          * that can be assigned strict priorities out of the
13921          * maximum number of TX rings that can be allocated
13922          * (max_tx_rings) to the function.
13923          */
13924         uint16_t        max_sp_tx_rings;
13925         /*
13926          * The maximum number of MSI-X vectors that may be allocated across
13927          * all VFs for the function. This is valid only on the PF with SR-IOV
13928          * enabled. Returns zero if this command is called on a PF with
13929          * SR-IOV disabled or on a VF.
13930          */
13931         uint16_t        max_msix_vfs;
13932         uint32_t        flags_ext;
13933         /*
13934          * If 1, the device can be configured to set the ECN bits in the
13935          * IP header of received packets if the receive queue length
13936          * exceeds a given threshold.
13937          */
13938         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_MARK_SUPPORTED \
13939                 UINT32_C(0x1)
13940         /*
13941          * If 1, the device can report the number of received packets
13942          * that it marked as having experienced congestion.
13943          */
13944         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_STATS_SUPPORTED \
13945                 UINT32_C(0x2)
13946         /*
13947          * If 1, the device can report extended hw statistics (including
13948          * additional tpa statistics).
13949          */
13950         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EXT_HW_STATS_SUPPORTED \
13951                 UINT32_C(0x4)
13952         /*
13953          * If set to 1, then the core firmware has support to enable/
13954          * disable hot reset support for interface dynamically through
13955          * HWRM_FUNC_CFG.
13956          */
13957         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_HOT_RESET_IF_SUPPORT \
13958                 UINT32_C(0x8)
13959         /* If 1, the proxy mode is supported on this function */
13960         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PROXY_MODE_SUPPORT \
13961                 UINT32_C(0x10)
13962         /*
13963          * If 1, the tx rings source interface override feature is supported
13964          * on this function.
13965          */
13966         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_PROXY_SRC_INTF_OVERRIDE_SUPPORT \
13967                 UINT32_C(0x20)
13968         /*
13969          * If 1, the device supports scheduler queues. SCHQs can be managed
13970          * using RING_SCHQ_ALLOC/CFG/FREE commands.
13971          */
13972         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SCHQ_SUPPORTED \
13973                 UINT32_C(0x40)
13974         /*
13975          * If set to 1, then this function supports the TX push mode that
13976          * uses ping-pong buffers from the push pages.
13977          */
13978         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PPP_PUSH_MODE_SUPPORTED \
13979                 UINT32_C(0x80)
13980         /*
13981          * If set to 1, then this function doesn't have the privilege to
13982          * configure the EVB mode of the port it uses.
13983          */
13984         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EVB_MODE_CFG_NOT_SUPPORTED \
13985                 UINT32_C(0x100)
13986         /*
13987          * If set to 1, then the HW and FW support the SoC packet DMA
13988          * datapath between SoC and NIC. This function can act as the
13989          * HWRM communication transport agent on behalf of the SoC SPD
13990          * software module. This capability is only advertised to the
13991          * SoC PFs.
13992          */
13993         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SOC_SPD_SUPPORTED \
13994                 UINT32_C(0x200)
13995         /*
13996          * If set to 1, then this function supports FW_LIVEPATCH for
13997          * firmware livepatch commands.
13998          */
13999         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_FW_LIVEPATCH_SUPPORTED \
14000                 UINT32_C(0x400)
14001         /*
14002          * When this bit is '1', it indicates that core firmware is
14003          * capable of fast Reset.
14004          */
14005         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_FAST_RESET_CAPABLE \
14006                 UINT32_C(0x800)
14007         /*
14008          * When this bit is '1', it indicates that firmware and hardware
14009          * are capable of updating tx_metadata via hwrm_ring_cfg command.
14010          */
14011         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_METADATA_CFG_CAPABLE \
14012                 UINT32_C(0x1000)
14013         /*
14014          * If set to 1, then the device can report the action
14015          * needed to activate set nvm options.
14016          */
14017         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_NVM_OPTION_ACTION_SUPPORTED \
14018                 UINT32_C(0x2000)
14019         /*
14020          * When this bit is '1', it indicates that the BD metadata feature
14021          * is supported for this function.
14022          */
14023         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BD_METADATA_SUPPORTED \
14024                 UINT32_C(0x4000)
14025         /*
14026          * When this bit is '1', it indicates that the echo request feature
14027          * is supported for this function. If the driver registers for the
14028          * echo request asynchronous event, then the firmware can send an
14029          * unsolicited echo request to the driver and expect an echo
14030          * response.
14031          */
14032         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECHO_REQUEST_SUPPORTED \
14033                 UINT32_C(0x8000)
14034         /*
14035          * When this bit is '1', it indicates that core firmware supports
14036          * NPAR 1.2 on this function.
14037          */
14038         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_NPAR_1_2_SUPPORTED \
14039                 UINT32_C(0x10000)
14040         /* When this bit is '1', it indicates that PTM feature is supported. */
14041         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_PTM_SUPPORTED \
14042                 UINT32_C(0x20000)
14043         /* When this bit is '1', it indicates that PPS feature is supported. */
14044         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_PPS_SUPPORTED \
14045                 UINT32_C(0x40000)
14046         /*
14047          * When this bit is '1', it indicates that VF config. change
14048          * async event is supported on the parent PF if the async.
14049          * event is registered by the PF.
14050          */
14051         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_VF_CFG_ASYNC_FOR_PF_SUPPORTED \
14052                 UINT32_C(0x80000)
14053         /*
14054          * When this bit is '1', the NIC supports configuration of
14055          * partition_min_bw and partition_max_bw. Configuration of a
14056          * minimum guaranteed bandwidth is only supported if the
14057          * min_bw_supported flag is also set.
14058          */
14059         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PARTITION_BW_SUPPORTED \
14060                 UINT32_C(0x100000)
14061         /*
14062          * When this bit is '1', the FW supports configuration of
14063          * PCP and TPID values of the default VLAN.
14064          */
14065         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DFLT_VLAN_TPID_PCP_SUPPORTED \
14066                 UINT32_C(0x200000)
14067         /* When this bit is '1', it indicates that HW and FW support KTLS. */
14068         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_KTLS_SUPPORTED \
14069                 UINT32_C(0x400000)
14070         /*
14071          * When this bit is '1', the firmware supports HWRM_PORT_EP_TX_CFG
14072          * and HWRM_PORT_EP_TX_QCFG for endpoint rate control, and additions
14073          * to HWRM_QUEUE_GLOBAL_CFG and HWRM_QUEUE_GLOBAL_QCFG for receive
14074          * rate control. Configuration of a minimum guaranteed bandwidth
14075          * is only supported if the min_bw_supported flag is also set.
14076          */
14077         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EP_RATE_CONTROL \
14078                 UINT32_C(0x800000)
14079         /*
14080          * When this bit is '1', the firmware supports enforcement of
14081          * minimum guaranteed bandwidth. A minimum guaranteed bandwidth
14082          * could be configured for a partition or for an endpoint. Firmware
14083          * only sets this flag if one or both of the ep_rate_control and
14084          * partition_bw_supported flags are set.
14085          */
14086         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_MIN_BW_SUPPORTED \
14087                 UINT32_C(0x1000000)
14088         /*
14089          * When this bit is '1', HW supports TX coalesced completion
14090          * records.
14091          */
14092         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_COAL_CMPL_CAP \
14093                 UINT32_C(0x2000000)
14094         /*
14095          * When this bit is '1', it indicates the FW has full support
14096          * for all backing store types with the BACKING_STORE_CFG/QCFG
14097          * V2 APIs.
14098          */
14099         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BS_V2_SUPPORTED \
14100                 UINT32_C(0x4000000)
14101         /*
14102          * When this bit is '1', it indicates the FW forces to use the
14103          * BACKING_STORE_CFG/QCFG V2 APIs.
14104          */
14105         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BS_V2_REQUIRED \
14106                 UINT32_C(0x8000000)
14107         /*
14108          * When this bit is '1', it indicates that FW will support a single
14109          * 64bit real time clock for PTP.
14110          */
14111         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PTP_64BIT_RTC_SUPPORTED \
14112                 UINT32_C(0x10000000)
14113         /*
14114          * When this bit is '1', it indicates the FW is capable of
14115          * supporting Doorbell Pacing.
14116          */
14117         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DBR_PACING_SUPPORTED \
14118                 UINT32_C(0x20000000)
14119         /*
14120          * When this bit is '1', it indicates the FW is capable of
14121          * supporting HW based doorbell drop recovery.
14122          */
14123         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_HW_DBR_DROP_RECOV_SUPPORTED \
14124                 UINT32_C(0x40000000)
14125         /*
14126          * When this bit is '1', it indicates the driver can disable the CQ
14127          * overflow detection and can also skip the index updates for CQ.
14128          */
14129         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_DISABLE_CQ_OVERFLOW_DETECTION_SUPPORTED \
14130                 UINT32_C(0x80000000)
14131         /* The maximum number of SCHQs supported by this device. */
14132         uint8_t max_schqs;
14133         uint8_t mpc_chnls_cap;
14134         /*
14135          * When this bit is '1', it indicates that HW and firmware
14136          * supports the use of a MPC channel with destination set
14137          * to the TX crypto engine block.
14138          */
14139         #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_TCE         UINT32_C(0x1)
14140         /*
14141          * When this bit is '1', it indicates that HW and firmware
14142          * supports the use of a MPC channel with destination set
14143          * to the RX crypto engine block.
14144          */
14145         #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_RCE         UINT32_C(0x2)
14146         /*
14147          * When this bit is '1', it indicates that HW and firmware
14148          * supports the use of a MPC channel with destination set
14149          * to the TX configurable flow processing block.
14150          */
14151         #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_TE_CFA      UINT32_C(0x4)
14152         /*
14153          * When this bit is '1', it indicates that HW and firmware
14154          * supports the use of a MPC channel with destination set
14155          * to the RX configurable flow processing block.
14156          */
14157         #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_RE_CFA      UINT32_C(0x8)
14158         /*
14159          * When this bit is '1', it indicates that HW and firmware
14160          * supports the use of a MPC channel with destination set
14161          * to the primate processor block.
14162          */
14163         #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_PRIMATE     UINT32_C(0x10)
14164         /*
14165          * Maximum number of Key Contexts supported per HWRM
14166          * function call for allocating Key Contexts.
14167          */
14168         uint16_t        max_key_ctxs_alloc;
14169         uint32_t        flags_ext2;
14170         /*
14171          * When this bit is '1', it indicates that FW will support
14172          * timestamping on all RX packets, not just PTP type packets.
14173          */
14174         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED \
14175                 UINT32_C(0x1)
14176         /* When this bit is '1', it indicates that HW and FW support QUIC. */
14177         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_QUIC_SUPPORTED \
14178                 UINT32_C(0x2)
14179         uint16_t        tunnel_disable_flag;
14180         /*
14181          * When this bit is '1', it indicates that the VXLAN parsing
14182          * is disabled in hardware
14183          */
14184         #define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_VXLAN \
14185                 UINT32_C(0x1)
14186         /*
14187          * When this bit is '1', it indicates that the NGE parsing
14188          * is disabled in hardware
14189          */
14190         #define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_NGE \
14191                 UINT32_C(0x2)
14192         /*
14193          * When this bit is '1', it indicates that the NVGRE parsing
14194          * is disabled in hardware
14195          */
14196         #define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_NVGRE \
14197                 UINT32_C(0x4)
14198         /*
14199          * When this bit is '1', it indicates that the L2GRE parsing
14200          * is disabled in hardware
14201          */
14202         #define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_L2GRE \
14203                 UINT32_C(0x8)
14204         /*
14205          * When this bit is '1', it indicates that the GRE parsing
14206          * is disabled in hardware
14207          */
14208         #define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_GRE \
14209                 UINT32_C(0x10)
14210         /*
14211          * When this bit is '1', it indicates that the IPINIP parsing
14212          * is disabled in hardware
14213          */
14214         #define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_IPINIP \
14215                 UINT32_C(0x20)
14216         /*
14217          * When this bit is '1', it indicates that the MPLS parsing
14218          * is disabled in hardware
14219          */
14220         #define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_MPLS \
14221                 UINT32_C(0x40)
14222         /*
14223          * When this bit is '1', it indicates that the PPPOE parsing
14224          * is disabled in hardware
14225          */
14226         #define HWRM_FUNC_QCAPS_OUTPUT_TUNNEL_DISABLE_FLAG_DISABLE_PPPOE \
14227                 UINT32_C(0x80)
14228         uint8_t unused_1;
14229         /*
14230          * This field is used in Output records to indicate that the output
14231          * is completely written to RAM.  This field should be read as '1'
14232          * to indicate that the output has been completely written.
14233          * When writing a command completion or response to an internal
14234          * processor, the order of writes has to be such that this field is
14235          * written last.
14236          */
14237         uint8_t valid;
14238 } __rte_packed;
14239
14240 /******************
14241  * hwrm_func_qcfg *
14242  ******************/
14243
14244
14245 /* hwrm_func_qcfg_input (size:192b/24B) */
14246 struct hwrm_func_qcfg_input {
14247         /* The HWRM command request type. */
14248         uint16_t        req_type;
14249         /*
14250          * The completion ring to send the completion event on. This should
14251          * be the NQ ID returned from the `nq_alloc` HWRM command.
14252          */
14253         uint16_t        cmpl_ring;
14254         /*
14255          * The sequence ID is used by the driver for tracking multiple
14256          * commands. This ID is treated as opaque data by the firmware and
14257          * the value is returned in the `hwrm_resp_hdr` upon completion.
14258          */
14259         uint16_t        seq_id;
14260         /*
14261          * The target ID of the command:
14262          * * 0x0-0xFFF8 - The function ID
14263          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14264          * * 0xFFFD - Reserved for user-space HWRM interface
14265          * * 0xFFFF - HWRM
14266          */
14267         uint16_t        target_id;
14268         /*
14269          * A physical address pointer pointing to a host buffer that the
14270          * command's response data will be written. This can be either a host
14271          * physical address (HPA) or a guest physical address (GPA) and must
14272          * point to a physically contiguous block of memory.
14273          */
14274         uint64_t        resp_addr;
14275         /*
14276          * Function ID of the function that is being queried.
14277          * 0xFF... (All Fs) if the query is for the requesting
14278          * function.
14279          * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
14280          * to be used by a trusted VF to query its parent PF.
14281          */
14282         uint16_t        fid;
14283         uint8_t unused_0[6];
14284 } __rte_packed;
14285
14286 /* hwrm_func_qcfg_output (size:896b/112B) */
14287 struct hwrm_func_qcfg_output {
14288         /* The specific error status for the command. */
14289         uint16_t        error_code;
14290         /* The HWRM command request type. */
14291         uint16_t        req_type;
14292         /* The sequence ID from the original command. */
14293         uint16_t        seq_id;
14294         /* The length of the response data in number of bytes. */
14295         uint16_t        resp_len;
14296         /*
14297          * FID value.  This value is used to identify operations on the PCI
14298          * bus as belonging to a particular PCI function.
14299          */
14300         uint16_t        fid;
14301         /*
14302          * Port ID of port that this function is associated with.
14303          * 0xFF... (All Fs) if this function is not associated with
14304          * any port.
14305          */
14306         uint16_t        port_id;
14307         /*
14308          * This value is the current VLAN setting for this
14309          * function. The value of 0 for this field indicates
14310          * no priority tagging or VLAN is used.
14311          * This field's format is same as 802.1Q Tag's
14312          * Tag Control Information (TCI) format that includes both
14313          * Priority Code Point (PCP) and VLAN Identifier (VID).
14314          */
14315         uint16_t        vlan;
14316         uint16_t        flags;
14317         /*
14318          * If 1, then magic packet based Out-Of-Box WoL is enabled on
14319          * the port associated with this function.
14320          */
14321         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \
14322                 UINT32_C(0x1)
14323         /*
14324          * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled
14325          * on the port associated with this function.
14326          */
14327         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED \
14328                 UINT32_C(0x2)
14329         /*
14330          * If set to 1, then FW based DCBX agent is enabled and running on
14331          * the port associated with this function.
14332          * If set to 0, then DCBX agent is not running in the firmware.
14333          */
14334         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \
14335                 UINT32_C(0x4)
14336         /*
14337          * Standard TX Ring mode is used for the allocation of TX ring
14338          * and underlying scheduling resources that allow bandwidth
14339          * reservation and limit settings on the queried function.
14340          * If set to 1, then standard TX ring mode is enabled
14341          * on the queried function.
14342          * If set to 0, then the standard TX ring mode is disabled
14343          * on the queried function. In this extended TX ring resource
14344          * mode, the minimum and maximum bandwidth settings are not
14345          * supported to allow the allocation of TX rings to span multiple
14346          * scheduler nodes.
14347          */
14348         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \
14349                 UINT32_C(0x8)
14350         /*
14351          * If set to 1 then FW based LLDP agent is enabled and running on
14352          * the port associated with this function.
14353          * If set to 0 then the LLDP agent is not running in the firmware.
14354          */
14355         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED \
14356                 UINT32_C(0x10)
14357         /*
14358          * If set to 1, then multi-host mode is active for this function.
14359          * The NIC is attached to two or more independent host systems
14360          * through two or more PCIe endpoints.
14361          * If set to 0, then multi-host mode is inactive for this function
14362          * or not applicable for this device.
14363          */
14364         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST \
14365                 UINT32_C(0x20)
14366         /*
14367          * If the function that is being queried is a PF, then the HWRM shall
14368          * set this field to 0 and the HWRM client shall ignore this field.
14369          * If the function that is being queried is a VF, then the HWRM shall
14370          * set this field to 1 if the queried VF is trusted, otherwise the HWRM
14371          * shall set this field to 0.
14372          */
14373         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF \
14374                 UINT32_C(0x40)
14375         /*
14376          * If set to 1, then secure mode is enabled for this function or device.
14377          * If set to 0, then secure mode is disabled (or normal mode) for this
14378          * function or device.
14379          */
14380         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_SECURE_MODE_ENABLED \
14381                 UINT32_C(0x80)
14382         /*
14383          * If set to 1, then this PF is enabled with a preboot driver that
14384          * requires access to the legacy L2 ring model and legacy 32b
14385          * doorbells. If set to 0, then this PF is not allowed to use
14386          * the legacy L2 rings. This feature is not allowed on VFs and
14387          * is only relevant for devices that require a context backing
14388          * store.
14389          */
14390         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \
14391                 UINT32_C(0x100)
14392         /*
14393          * If set to 1, then the firmware and all currently registered driver
14394          * instances support hot reset. The hot reset support will be updated
14395          * dynamically based on the driver interface advertisement.
14396          * If set to 0, then the adapter is not currently able to initiate
14397          * hot reset.
14398          */
14399         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_HOT_RESET_ALLOWED \
14400                 UINT32_C(0x200)
14401         /*
14402          * If set to 1, then the PPP tx push mode is enabled for all the
14403          * reserved TX rings of this function. If set to 0, then PPP tx push
14404          * mode is disabled for all the reserved TX rings of this function.
14405          */
14406         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PPP_PUSH_MODE_ENABLED \
14407                 UINT32_C(0x400)
14408         /*
14409          * If set to 1, then the firmware will notify driver using async
14410          * event when a ring is disabled due to a Hardware error.
14411          */
14412         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_RING_MONITOR_ENABLED \
14413                 UINT32_C(0x800)
14414         /*
14415          * If set to 1, then the firmware and all currently registered driver
14416          * instances support fast reset. The fast reset support will be
14417          * updated dynamically based on the driver interface advertisement.
14418          * If set to 0, then the adapter is not currently able to initiate
14419          * fast reset.
14420          */
14421         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FAST_RESET_ALLOWED \
14422                 UINT32_C(0x1000)
14423         /*
14424          * If set to 1, then multi-root mode is active for this function.
14425          * The NIC is attached to a single host with a single operating
14426          * system, but through two or more PCIe endpoints.
14427          * If set to 0, then multi-root mode is inactive for this function
14428          * or not applicable for this device.
14429          */
14430         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_ROOT \
14431                 UINT32_C(0x2000)
14432         /*
14433          * This flag indicates RDMA support for child VFS of
14434          * a physical function.
14435          * If set to 1, RoCE is supported on all child VFs.
14436          * If set to 0, RoCE is disabled on all child VFs.
14437          */
14438         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_ENABLE_RDMA_SRIOV \
14439                 UINT32_C(0x4000)
14440         /*
14441          * This value is current MAC address configured for this
14442          * function. A value of 00-00-00-00-00-00 indicates no
14443          * MAC address is currently configured.
14444          */
14445         uint8_t mac_address[6];
14446         /*
14447          * This value is current PCI ID of this
14448          * function. If ARI is enabled, then it is
14449          * Bus Number (8b):Function Number(8b). Otherwise, it is
14450          * Bus Number (8b):Device Number (4b):Function Number(4b).
14451          * If multi-host mode is active, the 4 lsb will indicate
14452          * the PF index for this function.
14453          */
14454         uint16_t        pci_id;
14455         /*
14456          * The number of RSS/COS contexts currently
14457          * allocated to the function.
14458          */
14459         uint16_t        alloc_rsscos_ctx;
14460         /*
14461          * The number of completion rings currently allocated to
14462          * the function. This does not include the rings allocated
14463          * to any children functions if any.
14464          */
14465         uint16_t        alloc_cmpl_rings;
14466         /*
14467          * The number of transmit rings currently allocated to
14468          * the function. This does not include the rings allocated
14469          * to any children functions if any.
14470          */
14471         uint16_t        alloc_tx_rings;
14472         /*
14473          * The number of receive rings currently allocated to
14474          * the function. This does not include the rings allocated
14475          * to any children functions if any.
14476          */
14477         uint16_t        alloc_rx_rings;
14478         /* The allocated number of L2 contexts to the function. */
14479         uint16_t        alloc_l2_ctx;
14480         /* The allocated number of vnics to the function. */
14481         uint16_t        alloc_vnics;
14482         /*
14483          * The maximum transmission unit of the function
14484          * configured by the admin pf.
14485          * If the reported mtu value is non-zero then it will be used for the
14486          * rings allocated on this function, otherwise the default
14487          * value is used if ring MTU is not specified.
14488          * The driver cannot use any MTU bigger than this value
14489          * if it is non-zero.
14490          */
14491         uint16_t        admin_mtu;
14492         /*
14493          * The maximum receive unit of the function.
14494          * For vnics allocated on this function, this default
14495          * value is used if vnic MRU is not specified.
14496          */
14497         uint16_t        mru;
14498         /* The statistics context assigned to a function. */
14499         uint16_t        stat_ctx_id;
14500         /*
14501          * The HWRM shall return Unknown value for this field
14502          * when this command is used to query VF's configuration.
14503          */
14504         uint8_t port_partition_type;
14505         /* Single physical function */
14506         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF     UINT32_C(0x0)
14507         /* Multiple physical functions */
14508         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS    UINT32_C(0x1)
14509         /* Network Partitioning 1.0 */
14510         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
14511         /* Network Partitioning 1.5 */
14512         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
14513         /* Network Partitioning 2.0 */
14514         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
14515         /* Network Partitioning 1.2 */
14516         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_2 UINT32_C(0x5)
14517         /* Unknown */
14518         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN \
14519                 UINT32_C(0xff)
14520         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST \
14521                 HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN
14522         /*
14523          * This field will indicate number of physical functions on this port_partition.
14524          * HWRM shall return unavail (i.e. value of 0) for this field
14525          * when this command is used to query VF's configuration or
14526          * from older firmware that doesn't support this field.
14527          */
14528         uint8_t port_pf_cnt;
14529         /* number of PFs is not available */
14530         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
14531         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST \
14532                 HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL
14533         /*
14534          * The default VNIC ID assigned to a function that is
14535          * being queried.
14536          */
14537         uint16_t        dflt_vnic_id;
14538         uint16_t        max_mtu_configured;
14539         /*
14540          * Minimum guaranteed transmit bandwidth for this function. When
14541          * specified for a PF, does not affect traffic from the PF's child VFs.
14542          * A value of 0 indicates the minimum bandwidth is not configured.
14543          */
14544         uint32_t        min_bw;
14545         /* The bandwidth value. */
14546         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK \
14547                 UINT32_C(0xfffffff)
14548         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT              0
14549         /* The granularity of the value (bits or bytes). */
14550         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE \
14551                 UINT32_C(0x10000000)
14552         /* Value is in bits. */
14553         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS \
14554                 (UINT32_C(0x0) << 28)
14555         /* Value is in bytes. */
14556         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \
14557                 (UINT32_C(0x1) << 28)
14558         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \
14559                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
14560         /* bw_value_unit is 3 b */
14561         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \
14562                 UINT32_C(0xe0000000)
14563         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
14564         /* Value is in Mb or MB (base 10). */
14565         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
14566                 (UINT32_C(0x0) << 29)
14567         /* Value is in Kb or KB (base 10). */
14568         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \
14569                 (UINT32_C(0x2) << 29)
14570         /* Value is in bits or bytes. */
14571         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \
14572                 (UINT32_C(0x4) << 29)
14573         /* Value is in Gb or GB (base 10). */
14574         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
14575                 (UINT32_C(0x6) << 29)
14576         /* Value is in 1/100th of a percentage of link bandwidth. */
14577         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
14578                 (UINT32_C(0x1) << 29)
14579         /* Invalid unit */
14580         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
14581                 (UINT32_C(0x7) << 29)
14582         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \
14583                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
14584         /*
14585          * Maximum transmit rate for this function. When specified for a PF,
14586          * does not affect traffic from the PF's child VFs.
14587          * A value of 0 indicates that the maximum bandwidth is not configured.
14588          */
14589         uint32_t        max_bw;
14590         /* The bandwidth value. */
14591         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK \
14592                 UINT32_C(0xfffffff)
14593         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT              0
14594         /* The granularity of the value (bits or bytes). */
14595         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE \
14596                 UINT32_C(0x10000000)
14597         /* Value is in bits. */
14598         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS \
14599                 (UINT32_C(0x0) << 28)
14600         /* Value is in bytes. */
14601         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \
14602                 (UINT32_C(0x1) << 28)
14603         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \
14604                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
14605         /* bw_value_unit is 3 b */
14606         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \
14607                 UINT32_C(0xe0000000)
14608         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
14609         /* Value is in Mb or MB (base 10). */
14610         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
14611                 (UINT32_C(0x0) << 29)
14612         /* Value is in Kb or KB (base 10). */
14613         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \
14614                 (UINT32_C(0x2) << 29)
14615         /* Value is in bits or bytes. */
14616         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \
14617                 (UINT32_C(0x4) << 29)
14618         /* Value is in Gb or GB (base 10). */
14619         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
14620                 (UINT32_C(0x6) << 29)
14621         /* Value is in 1/100th of a percentage of link bandwidth. */
14622         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
14623                 (UINT32_C(0x1) << 29)
14624         /* Invalid unit */
14625         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
14626                 (UINT32_C(0x7) << 29)
14627         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \
14628                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
14629         /*
14630          * This value indicates the Edge virtual bridge mode for the
14631          * domain that this function belongs to.
14632          */
14633         uint8_t evb_mode;
14634         /* No Edge Virtual Bridging (EVB) */
14635         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
14636         /* Virtual Ethernet Bridge (VEB) */
14637         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB    UINT32_C(0x1)
14638         /* Virtual Ethernet Port Aggregator (VEPA) */
14639         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA   UINT32_C(0x2)
14640         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST \
14641                 HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA
14642         uint8_t options;
14643         /*
14644          * This value indicates the PCIE device cache line size.
14645          * The cache line size allows the DMA writes to terminate and
14646          * start at the cache boundary.
14647          */
14648         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK \
14649                 UINT32_C(0x3)
14650         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT          0
14651         /* Cache Line Size 64 bytes */
14652         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
14653                 UINT32_C(0x0)
14654         /* Cache Line Size 128 bytes */
14655         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
14656                 UINT32_C(0x1)
14657         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST \
14658                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
14659         /* This value is the virtual link admin state setting. */
14660         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
14661                 UINT32_C(0xc)
14662         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
14663         /* Admin link state is in forced down mode. */
14664         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
14665                 (UINT32_C(0x0) << 2)
14666         /* Admin link state is in forced up mode. */
14667         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
14668                 (UINT32_C(0x1) << 2)
14669         /* Admin link state is in auto mode  - follows the physical link state. */
14670         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
14671                 (UINT32_C(0x2) << 2)
14672         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
14673                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
14674         /* Reserved for future. */
14675         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK \
14676                 UINT32_C(0xf0)
14677         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT                    4
14678         /*
14679          * The number of VFs that are allocated to the function.
14680          * This is valid only on the PF with SR-IOV enabled.
14681          * 0xFF... (All Fs) if this command is called on a PF with
14682          * SR-IOV disabled or on a VF.
14683          */
14684         uint16_t        alloc_vfs;
14685         /*
14686          * The number of allocated multicast filters for this
14687          * function on the RX side.
14688          */
14689         uint32_t        alloc_mcast_filters;
14690         /*
14691          * The number of allocated HW ring groups for this
14692          * function.
14693          */
14694         uint32_t        alloc_hw_ring_grps;
14695         /*
14696          * The number of strict priority transmit rings out of
14697          * currently allocated TX rings to the function
14698          * (alloc_tx_rings).
14699          */
14700         uint16_t        alloc_sp_tx_rings;
14701         /*
14702          * The number of statistics contexts
14703          * currently reserved for the function.
14704          */
14705         uint16_t        alloc_stat_ctx;
14706         /*
14707          * This field specifies how many NQs are reserved for the PF.
14708          * Remaining NQs that belong to the PF are available for VFs.
14709          * Once a PF has created VFs, it cannot change how many NQs are
14710          * reserved for itself (since the NQs must be contiguous in HW).
14711          */
14712         uint16_t        alloc_msix;
14713         /*
14714          * The number of registered VF’s associated with the PF. This field
14715          * should be ignored when the request received on the VF interface.
14716          * This field will be updated on the PF interface to initiate
14717          * the unregister request on PF in the HOT Reset Process.
14718          */
14719         uint16_t        registered_vfs;
14720         /*
14721          * The size of the doorbell BAR in KBytes reserved for L2 including
14722          * any area that is shared between L2 and RoCE.  The L2 driver
14723          * should only map the L2 portion of the doorbell BAR.  Any rounding
14724          * of the BAR size to the native CPU page size should be performed
14725          * by the driver.  If the value is zero, no special partitioning
14726          * of the doorbell BAR between L2 and RoCE is required.
14727          */
14728         uint16_t        l2_doorbell_bar_size_kb;
14729         uint8_t unused_1;
14730         /*
14731          * For backward compatibility this field must be set to 1.
14732          * Older drivers might look for this field to be 1 before
14733          * processing the message.
14734          */
14735         uint8_t always_1;
14736         /*
14737          * This GRC address location is used by the Host driver interfaces to poll
14738          * the adapter ready state to re-initiate the registration process again
14739          * after receiving the RESET Notify event.
14740          */
14741         uint32_t        reset_addr_poll;
14742         /*
14743          * This field specifies legacy L2 doorbell size in KBytes. Drivers should use
14744          * this value to find out the doorbell page offset from the BAR.
14745          */
14746         uint16_t        legacy_l2_db_size_kb;
14747         uint16_t        svif_info;
14748         /*
14749          * This field specifies the source virtual interface of the function being
14750          * queried. Drivers can use this to program svif field in the L2 context
14751          * table
14752          */
14753         #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_MASK      UINT32_C(0x7fff)
14754         #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_SFT       0
14755         /* This field specifies whether svif is valid or not */
14756         #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_VALID     UINT32_C(0x8000)
14757         uint8_t mpc_chnls;
14758         /*
14759          * When this bit is '1', it indicates that a MPC channel with
14760          * destination set to the TX crypto engine block is enabled.
14761          */
14762         #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_TCE_ENABLED \
14763                 UINT32_C(0x1)
14764         /*
14765          * When this bit is '1', it indicates that a MPC channel with
14766          * destination set to the RX crypto engine block is enabled.
14767          */
14768         #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_RCE_ENABLED \
14769                 UINT32_C(0x2)
14770         /*
14771          * When this bit is '1', it indicates that a MPC channel with
14772          * destination set to the TX configurable flow processing block is
14773          * enabled.
14774          */
14775         #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_TE_CFA_ENABLED \
14776                 UINT32_C(0x4)
14777         /*
14778          * When this bit is '1', it indicates that a MPC channel with
14779          * destination set to the RX configurable flow processing block is
14780          * enabled.
14781          */
14782         #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_RE_CFA_ENABLED \
14783                 UINT32_C(0x8)
14784         /*
14785          * When this bit is '1', it indicates that a MPC channel with
14786          * destination set to the primate processor block is enabled.
14787          */
14788         #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_PRIMATE_ENABLED \
14789                 UINT32_C(0x10)
14790         uint8_t unused_2[3];
14791         /*
14792          * Minimum guaranteed bandwidth for the network partition made up
14793          * of the caller physical function and all its child virtual
14794          * functions. The rate is specified as a percentage of the bandwidth
14795          * of the link the partition is associated with. A value of 0
14796          * indicates that no minimum bandwidth is configured.
14797          * The format of this field is defined to match min_bw, even though
14798          * the partition minimum rate is always specified as a percentage.
14799          */
14800         uint32_t        partition_min_bw;
14801         /* The bandwidth value. */
14802         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_MASK \
14803                 UINT32_C(0xfffffff)
14804         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_SFT \
14805                 0
14806         /*
14807          * The granularity of the value (bits or bytes). Firmware never sets
14808          * this field.
14809          */
14810         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE \
14811                 UINT32_C(0x10000000)
14812         /* Value is in bits. */
14813         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BITS \
14814                 (UINT32_C(0x0) << 28)
14815         /* Value is in bytes. */
14816         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BYTES \
14817                 (UINT32_C(0x1) << 28)
14818         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_LAST \
14819                 HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_SCALE_BYTES
14820         /* Always percentage of link bandwidth. */
14821         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_MASK \
14822                 UINT32_C(0xe0000000)
14823         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_SFT \
14824                 29
14825         /* Bandwidth value is in hundredths of a percent of link bandwidth. */
14826         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
14827                 (UINT32_C(0x1) << 29)
14828         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_LAST \
14829                 HWRM_FUNC_QCFG_OUTPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100
14830         /*
14831          * The maximum bandwidth that may be used by the network partition
14832          * made up of the caller physical function and all its child virtual
14833          * functions. The rate is specified as a percentage of the bandwidth
14834          * of the link the partition is associated with. A value of 0
14835          * indicates that no maximum bandwidth is configured.
14836          * The format of this field is defined to match max_bw, even though
14837          * the partition bandwidth must be specified as a percentage.
14838          */
14839         uint32_t        partition_max_bw;
14840         /* The bandwidth value. */
14841         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_MASK \
14842                 UINT32_C(0xfffffff)
14843         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_SFT \
14844                 0
14845         /*
14846          * The granularity of the value (bits or bytes). Firmware never sets
14847          * this field.
14848          */
14849         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE \
14850                 UINT32_C(0x10000000)
14851         /* Value is in bits. */
14852         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BITS \
14853                 (UINT32_C(0x0) << 28)
14854         /* Value is in bytes. */
14855         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BYTES \
14856                 (UINT32_C(0x1) << 28)
14857         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_LAST \
14858                 HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_SCALE_BYTES
14859         /* Always a percentage of link bandwidth. */
14860         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_MASK \
14861                 UINT32_C(0xe0000000)
14862         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_SFT \
14863                 29
14864         /* Value is in hundredths of a percent of link bandwidth. */
14865         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
14866                 (UINT32_C(0x1) << 29)
14867         #define HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_LAST \
14868                 HWRM_FUNC_QCFG_OUTPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100
14869         /*
14870          * The maximum transmission unit of the function
14871          * configured by the host pf/vf.
14872          * If the reported mtu value is non-zero then it will be used for the
14873          * rings allocated on this function, otherwise the default
14874          * value is used if ring MTU is not specified.
14875          */
14876         uint16_t        host_mtu;
14877         /* Number of Tx Key Contexts allocated. */
14878         uint16_t        alloc_tx_key_ctxs;
14879         /* Number of Rx Key Contexts allocated. */
14880         uint16_t        alloc_rx_key_ctxs;
14881         uint8_t unused_3[5];
14882         /*
14883          * This field is used in Output records to indicate that the output
14884          * is completely written to RAM.  This field should be read as '1'
14885          * to indicate that the output has been completely written.
14886          * When writing a command completion or response to an internal processor,
14887          * the order of writes has to be such that this field is written last.
14888          */
14889         uint8_t valid;
14890 } __rte_packed;
14891
14892 /*****************
14893  * hwrm_func_cfg *
14894  *****************/
14895
14896
14897 /* hwrm_func_cfg_input (size:896b/112B) */
14898 struct hwrm_func_cfg_input {
14899         /* The HWRM command request type. */
14900         uint16_t        req_type;
14901         /*
14902          * The completion ring to send the completion event on. This should
14903          * be the NQ ID returned from the `nq_alloc` HWRM command.
14904          */
14905         uint16_t        cmpl_ring;
14906         /*
14907          * The sequence ID is used by the driver for tracking multiple
14908          * commands. This ID is treated as opaque data by the firmware and
14909          * the value is returned in the `hwrm_resp_hdr` upon completion.
14910          */
14911         uint16_t        seq_id;
14912         /*
14913          * The target ID of the command:
14914          * * 0x0-0xFFF8 - The function ID
14915          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14916          * * 0xFFFD - Reserved for user-space HWRM interface
14917          * * 0xFFFF - HWRM
14918          */
14919         uint16_t        target_id;
14920         /*
14921          * A physical address pointer pointing to a host buffer that the
14922          * command's response data will be written. This can be either a host
14923          * physical address (HPA) or a guest physical address (GPA) and must
14924          * point to a physically contiguous block of memory.
14925          */
14926         uint64_t        resp_addr;
14927         /*
14928          * Function ID of the function that is being
14929          * configured.
14930          * If set to 0xFF... (All Fs), then the configuration is
14931          * for the requesting function.
14932          */
14933         uint16_t        fid;
14934         /*
14935          * This field specifies how many NQs will be reserved for the PF.
14936          * Remaining NQs that belong to the PF become available for VFs.
14937          * Once a PF has created VFs, it cannot change how many NQs are
14938          * reserved for itself (since the NQs must be contiguous in HW).
14939          */
14940         uint16_t        num_msix;
14941         uint32_t        flags;
14942         /*
14943          * When this bit is '1', the function is disabled with
14944          * source MAC address check.
14945          * This is an anti-spoofing check. If this flag is set,
14946          * then the function shall be configured to disallow
14947          * transmission of frames with the source MAC address that
14948          * is configured for this function.
14949          */
14950         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \
14951                 UINT32_C(0x1)
14952         /*
14953          * When this bit is '1', the function is enabled with
14954          * source MAC address check.
14955          * This is an anti-spoofing check. If this flag is set,
14956          * then the function shall be configured to allow
14957          * transmission of frames with the source MAC address that
14958          * is configured for this function.
14959          */
14960         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \
14961                 UINT32_C(0x2)
14962         /* reserved. */
14963         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK \
14964                 UINT32_C(0x1fc)
14965         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT                       2
14966         /*
14967          * Standard TX Ring mode is used for the allocation of TX ring
14968          * and underlying scheduling resources that allow bandwidth
14969          * reservation and limit settings on the queried function.
14970          * If set to 1, then standard TX ring mode is requested to be
14971          * enabled on the function being configured.
14972          */
14973         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \
14974                 UINT32_C(0x200)
14975         /*
14976          * Standard TX Ring mode is used for the allocation of TX ring
14977          * and underlying scheduling resources that allow bandwidth
14978          * reservation and limit settings on the queried function.
14979          * If set to 1, then the standard TX ring mode is requested to
14980          * be disabled on the function being configured. In this extended
14981          * TX ring resource mode, the minimum and maximum bandwidth settings
14982          * are not supported to allow the allocation of TX rings to
14983          * span multiple scheduler nodes.
14984          */
14985         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \
14986                 UINT32_C(0x400)
14987         /*
14988          * If this bit is set, virtual mac address configured
14989          * in this command will be persistent over warm boot.
14990          */
14991         #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST \
14992                 UINT32_C(0x800)
14993         /*
14994          * This bit only applies to the VF. If this bit is set, the statistic
14995          * context counters will not be cleared when the statistic context is freed
14996          * or a function reset is called on VF. This bit will be cleared when the PF
14997          * is unloaded or a function reset is called on the PF.
14998          */
14999         #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC \
15000                 UINT32_C(0x1000)
15001         /*
15002          * This bit requests that the firmware test to see if all the assets
15003          * requested in this command (i.e. number of TX rings) are available.
15004          * The firmware will return an error if the requested assets are
15005          * not available. The firwmare will NOT reserve the assets if they
15006          * are available.
15007          */
15008         #define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
15009                 UINT32_C(0x2000)
15010         /*
15011          * This bit requests that the firmware test to see if all the assets
15012          * requested in this command (i.e. number of RX rings) are available.
15013          * The firmware will return an error if the requested assets are
15014          * not available. The firwmare will NOT reserve the assets if they
15015          * are available.
15016          */
15017         #define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
15018                 UINT32_C(0x4000)
15019         /*
15020          * This bit requests that the firmware test to see if all the assets
15021          * requested in this command (i.e. number of CMPL rings) are available.
15022          * The firmware will return an error if the requested assets are
15023          * not available. The firwmare will NOT reserve the assets if they
15024          * are available.
15025          */
15026         #define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
15027                 UINT32_C(0x8000)
15028         /*
15029          * This bit requests that the firmware test to see if all the assets
15030          * requested in this command (i.e. number of RSS ctx) are available.
15031          * The firmware will return an error if the requested assets are
15032          * not available. The firwmare will NOT reserve the assets if they
15033          * are available.
15034          */
15035         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
15036                 UINT32_C(0x10000)
15037         /*
15038          * This bit requests that the firmware test to see if all the assets
15039          * requested in this command (i.e. number of ring groups) are available.
15040          * The firmware will return an error if the requested assets are
15041          * not available. The firwmare will NOT reserve the assets if they
15042          * are available.
15043          */
15044         #define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
15045                 UINT32_C(0x20000)
15046         /*
15047          * This bit requests that the firmware test to see if all the assets
15048          * requested in this command (i.e. number of stat ctx) are available.
15049          * The firmware will return an error if the requested assets are
15050          * not available. The firwmare will NOT reserve the assets if they
15051          * are available.
15052          */
15053         #define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
15054                 UINT32_C(0x40000)
15055         /*
15056          * This bit requests that the firmware test to see if all the assets
15057          * requested in this command (i.e. number of VNICs) are available.
15058          * The firmware will return an error if the requested assets are
15059          * not available. The firwmare will NOT reserve the assets if they
15060          * are available.
15061          */
15062         #define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
15063                 UINT32_C(0x80000)
15064         /*
15065          * This bit requests that the firmware test to see if all the assets
15066          * requested in this command (i.e. number of L2 ctx) are available.
15067          * The firmware will return an error if the requested assets are
15068          * not available. The firwmare will NOT reserve the assets if they
15069          * are available.
15070          */
15071         #define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
15072                 UINT32_C(0x100000)
15073         /*
15074          * This configuration change can be initiated by a PF driver. This
15075          * configuration request shall be targeted to a VF. From local host
15076          * resident HWRM clients, only the parent PF driver shall be allowed
15077          * to initiate this change on one of its children VFs. If this bit is
15078          * set to 1, then the VF that is being configured is requested to be
15079          * trusted.
15080          */
15081         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_ENABLE \
15082                 UINT32_C(0x200000)
15083         /*
15084          * When this bit it set, even if PF reserved pool size is zero,
15085          * FW will allow driver to create TX rings in ring alloc,
15086          * by reserving TX ring, S3 node dynamically.
15087          */
15088         #define HWRM_FUNC_CFG_INPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
15089                 UINT32_C(0x400000)
15090         /*
15091          * This bit requests that the firmware test to see if all the assets
15092          * requested in this command (i.e. number of NQ rings) are available.
15093          * The firmware will return an error if the requested assets are
15094          * not available. The firwmare will NOT reserve the assets if they
15095          * are available.
15096          */
15097         #define HWRM_FUNC_CFG_INPUT_FLAGS_NQ_ASSETS_TEST \
15098                 UINT32_C(0x800000)
15099         /*
15100          * This configuration change can be initiated by a PF driver. This
15101          * configuration request shall be targeted to a VF. From local host
15102          * resident HWRM clients, only the parent PF driver shall be allowed
15103          * to initiate this change on one of its children VFs. If this bit is
15104          * set to 1, then the VF that is being configured is requested to be
15105          * untrusted.
15106          */
15107         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_DISABLE \
15108                 UINT32_C(0x1000000)
15109         /*
15110          * This bit is used by preboot drivers on a PF that require access
15111          * to the legacy L2 ring model and legacy 32b doorbells. This
15112          * feature is not allowed on VFs and is only relevant for devices
15113          * that require a context backing store.
15114          */
15115         #define HWRM_FUNC_CFG_INPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \
15116                 UINT32_C(0x2000000)
15117         /*
15118          * If this bit is set to 0, then the interface does not support hot
15119          * reset capability which it advertised with the hot_reset_support
15120          * flag in HWRM_FUNC_DRV_RGTR. If any of the function has set this
15121          * flag to 0, adapter cannot do the hot reset. In this state, if the
15122          * firmware receives a hot reset request, firmware must fail the
15123          * request. If this bit is set to 1, then interface is renabling the
15124          * hot reset capability.
15125          */
15126         #define HWRM_FUNC_CFG_INPUT_FLAGS_HOT_RESET_IF_EN_DIS \
15127                 UINT32_C(0x4000000)
15128         /*
15129          * If this bit is set to 1, the PF driver is requesting FW
15130          * to enable PPP TX PUSH feature on all the TX rings specified in
15131          * the num_tx_rings field. By default, the PPP TX push feature is
15132          * disabled for all the TX rings of the function. This flag is
15133          * ignored if num_tx_rings field is not specified or the function
15134          * doesn't support PPP tx push feature.
15135          */
15136         #define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE \
15137                 UINT32_C(0x8000000)
15138         /*
15139          * If this bit is set to 1, the PF driver is requesting FW
15140          * to disable PPP TX PUSH feature on all the TX rings specified in
15141          * the num_tx_rings field. This flag is ignored if num_tx_rings
15142          * field is not specified or the function doesn't support PPP tx
15143          * push feature.
15144          */
15145         #define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE \
15146                 UINT32_C(0x10000000)
15147         /*
15148          * If this bit is set to 1, the driver is requesting FW to enable
15149          * the BD_METADATA feature for this function. The FW returns error
15150          * on this request if the TX_METADATA is enabled for this function.
15151          */
15152         #define HWRM_FUNC_CFG_INPUT_FLAGS_BD_METADATA_ENABLE \
15153                 UINT32_C(0x20000000)
15154         /*
15155          * If this bit is set to 1, the driver is requesting FW to disable
15156          * the BD_METADATA feature for this function. The FW returns error
15157          * on this request if the TX_METADATA is enabled for this function.
15158          */
15159         #define HWRM_FUNC_CFG_INPUT_FLAGS_BD_METADATA_DISABLE \
15160                 UINT32_C(0x40000000)
15161         uint32_t        enables;
15162         /*
15163          * This bit must be '1' for the admin_mtu field to be
15164          * configured.
15165          */
15166         #define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_MTU \
15167                 UINT32_C(0x1)
15168         /*
15169          * This bit must be '1' for the mru field to be
15170          * configured.
15171          */
15172         #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU \
15173                 UINT32_C(0x2)
15174         /*
15175          * This bit must be '1' for the num_rsscos_ctxs field to be
15176          * configured.
15177          */
15178         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
15179                 UINT32_C(0x4)
15180         /*
15181          * This bit must be '1' for the num_cmpl_rings field to be
15182          * configured.
15183          */
15184         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
15185                 UINT32_C(0x8)
15186         /*
15187          * This bit must be '1' for the num_tx_rings field to be
15188          * configured.
15189          */
15190         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS \
15191                 UINT32_C(0x10)
15192         /*
15193          * This bit must be '1' for the num_rx_rings field to be
15194          * configured.
15195          */
15196         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS \
15197                 UINT32_C(0x20)
15198         /*
15199          * This bit must be '1' for the num_l2_ctxs field to be
15200          * configured.
15201          */
15202         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS \
15203                 UINT32_C(0x40)
15204         /*
15205          * This bit must be '1' for the num_vnics field to be
15206          * configured.
15207          */
15208         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS \
15209                 UINT32_C(0x80)
15210         /*
15211          * This bit must be '1' for the num_stat_ctxs field to be
15212          * configured.
15213          */
15214         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
15215                 UINT32_C(0x100)
15216         /*
15217          * This bit must be '1' for the dflt_mac_addr field to be
15218          * configured.
15219          */
15220         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
15221                 UINT32_C(0x200)
15222         /*
15223          * This bit must be '1' for the dflt_vlan field to be
15224          * configured.
15225          */
15226         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN \
15227                 UINT32_C(0x400)
15228         /*
15229          * This bit must be '1' for the dflt_ip_addr field to be
15230          * configured.
15231          */
15232         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR \
15233                 UINT32_C(0x800)
15234         /*
15235          * This bit must be '1' for the min_bw field to be
15236          * configured.
15237          */
15238         #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW \
15239                 UINT32_C(0x1000)
15240         /*
15241          * This bit must be '1' for the max_bw field to be
15242          * configured.
15243          */
15244         #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW \
15245                 UINT32_C(0x2000)
15246         /*
15247          * This bit must be '1' for the async_event_cr field to be
15248          * configured.
15249          */
15250         #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
15251                 UINT32_C(0x4000)
15252         /*
15253          * This bit must be '1' for the vlan_antispoof_mode field to be
15254          * configured.
15255          */
15256         #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE \
15257                 UINT32_C(0x8000)
15258         /*
15259          * This bit must be '1' for the allowed_vlan_pris field to be
15260          * configured.
15261          */
15262         #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS \
15263                 UINT32_C(0x10000)
15264         /*
15265          * This bit must be '1' for the evb_mode field to be
15266          * configured.
15267          */
15268         #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE \
15269                 UINT32_C(0x20000)
15270         /*
15271          * This bit must be '1' for the num_mcast_filters field to be
15272          * configured.
15273          */
15274         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS \
15275                 UINT32_C(0x40000)
15276         /*
15277          * This bit must be '1' for the num_hw_ring_grps field to be
15278          * configured.
15279          */
15280         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
15281                 UINT32_C(0x80000)
15282         /*
15283          * This bit must be '1' for the cache_linesize field to be
15284          * configured.
15285          */
15286         #define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE \
15287                 UINT32_C(0x100000)
15288         /*
15289          * This bit must be '1' for the num_msix field to be
15290          * configured.
15291          */
15292         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX \
15293                 UINT32_C(0x200000)
15294         /*
15295          * This bit must be '1' for the link admin state field to be
15296          * configured.
15297          */
15298         #define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE \
15299                 UINT32_C(0x400000)
15300         /*
15301          * This bit must be '1' for the hot_reset_if_en_dis field to be
15302          * configured.
15303          */
15304         #define HWRM_FUNC_CFG_INPUT_ENABLES_HOT_RESET_IF_SUPPORT \
15305                 UINT32_C(0x800000)
15306         /*
15307          * This bit must be '1' for the schq_id field to be
15308          * configured.
15309          */
15310         #define HWRM_FUNC_CFG_INPUT_ENABLES_SCHQ_ID \
15311                 UINT32_C(0x1000000)
15312         /*
15313          * This bit must be '1' for the mpc_chnls field to be
15314          * configured.
15315          */
15316         #define HWRM_FUNC_CFG_INPUT_ENABLES_MPC_CHNLS \
15317                 UINT32_C(0x2000000)
15318         /*
15319          * This bit must be '1' for the partition_min_bw field to be
15320          * configured.
15321          */
15322         #define HWRM_FUNC_CFG_INPUT_ENABLES_PARTITION_MIN_BW \
15323                 UINT32_C(0x4000000)
15324         /*
15325          * This bit must be '1' for the partition_max_bw field to be
15326          * configured.
15327          */
15328         #define HWRM_FUNC_CFG_INPUT_ENABLES_PARTITION_MAX_BW \
15329                 UINT32_C(0x8000000)
15330         /*
15331          * This bit must be '1' for the tpid field to be
15332          * configured. This bit is only valid when dflt_vlan enable
15333          * bit is set.
15334          */
15335         #define HWRM_FUNC_CFG_INPUT_ENABLES_TPID \
15336                 UINT32_C(0x10000000)
15337         /*
15338          * This bit must be '1' for the host_mtu field to be
15339          * configured.
15340          */
15341         #define HWRM_FUNC_CFG_INPUT_ENABLES_HOST_MTU \
15342                 UINT32_C(0x20000000)
15343         /*
15344          * This bit must be '1' for the number of Tx Key Contexts
15345          * field to be configured.
15346          */
15347         #define HWRM_FUNC_CFG_INPUT_ENABLES_TX_KEY_CTXS \
15348                 UINT32_C(0x40000000)
15349         /*
15350          * This bit must be '1' for the number of Rx Key Contexts
15351          * field to be configured.
15352          */
15353         #define HWRM_FUNC_CFG_INPUT_ENABLES_RX_KEY_CTXS \
15354                 UINT32_C(0x80000000)
15355         /*
15356          * This field can be used by the admin PF to configure
15357          * mtu of foster PFs.
15358          * The maximum transmission unit of the function.
15359          * The HWRM should make sure that the mtu of
15360          * the function does not exceed the mtu of the physical
15361          * port that this function is associated with.
15362          *
15363          * In addition to configuring mtu per function, it is
15364          * possible to configure mtu per transmit ring.
15365          * By default, the mtu of each transmit ring associated
15366          * with a function is equal to the mtu of the function.
15367          * The HWRM should make sure that the mtu of each transmit
15368          * ring that is assigned to a function has a valid mtu.
15369          */
15370         uint16_t        admin_mtu;
15371         /*
15372          * The maximum receive unit of the function.
15373          * The HWRM should make sure that the mru of
15374          * the function does not exceed the mru of the physical
15375          * port that this function is associated with.
15376          *
15377          * In addition to configuring mru per function, it is
15378          * possible to configure mru per vnic.
15379          * By default, the mru of each vnic associated
15380          * with a function is equal to the mru of the function.
15381          * The HWRM should make sure that the mru of each vnic
15382          * that is assigned to a function has a valid mru.
15383          */
15384         uint16_t        mru;
15385         /*
15386          * The number of RSS/COS contexts requested for the
15387          * function.
15388          */
15389         uint16_t        num_rsscos_ctxs;
15390         /*
15391          * The number of completion rings requested for the
15392          * function. This does not include the rings allocated
15393          * to any children functions if any.
15394          */
15395         uint16_t        num_cmpl_rings;
15396         /*
15397          * The number of transmit rings requested for the function.
15398          * This does not include the rings allocated to any
15399          * children functions if any.
15400          */
15401         uint16_t        num_tx_rings;
15402         /*
15403          * The number of receive rings requested for the function.
15404          * This does not include the rings allocated
15405          * to any children functions if any.
15406          */
15407         uint16_t        num_rx_rings;
15408         /* The requested number of L2 contexts for the function. */
15409         uint16_t        num_l2_ctxs;
15410         /* The requested number of vnics for the function. */
15411         uint16_t        num_vnics;
15412         /* The requested number of statistic contexts for the function. */
15413         uint16_t        num_stat_ctxs;
15414         /*
15415          * The number of HW ring groups that should
15416          * be reserved for this function.
15417          */
15418         uint16_t        num_hw_ring_grps;
15419         /* The default MAC address for the function being configured. */
15420         uint8_t dflt_mac_addr[6];
15421         /*
15422          * The default VLAN for the function being configured.
15423          * This field's format is same as 802.1Q Tag's
15424          * Tag Control Information (TCI) format that includes both
15425          * Priority Code Point (PCP) and VLAN Identifier (VID).
15426          */
15427         uint16_t        dflt_vlan;
15428         /*
15429          * The default IP address for the function being configured.
15430          * This address is only used in enabling source property check.
15431          */
15432         uint32_t        dflt_ip_addr[4];
15433         /*
15434          * Minimum guaranteed transmit bandwidth for this function. When
15435          * specified for a PF, does not affect traffic from the PF's child VFs.
15436          * A value of 0 indicates the minimum bandwidth is not configured.
15437          */
15438         uint32_t        min_bw;
15439         /* The bandwidth value. */
15440         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK \
15441                 UINT32_C(0xfffffff)
15442         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT              0
15443         /* The granularity of the value (bits or bytes). */
15444         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE \
15445                 UINT32_C(0x10000000)
15446         /* Value is in bits. */
15447         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS \
15448                 (UINT32_C(0x0) << 28)
15449         /* Value is in bytes. */
15450         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES \
15451                 (UINT32_C(0x1) << 28)
15452         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \
15453                 HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
15454         /* bw_value_unit is 3 b */
15455         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \
15456                 UINT32_C(0xe0000000)
15457         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
15458         /* Value is in Mb or MB (base 10). */
15459         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
15460                 (UINT32_C(0x0) << 29)
15461         /* Value is in Kb or KB (base 10). */
15462         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \
15463                 (UINT32_C(0x2) << 29)
15464         /* Value is in bits or bytes. */
15465         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \
15466                 (UINT32_C(0x4) << 29)
15467         /* Value is in Gb or GB (base 10). */
15468         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
15469                 (UINT32_C(0x6) << 29)
15470         /* Value is in 1/100th of a percentage of total bandwidth. */
15471         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
15472                 (UINT32_C(0x1) << 29)
15473         /* Invalid unit */
15474         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
15475                 (UINT32_C(0x7) << 29)
15476         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \
15477                 HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
15478         /*
15479          * Maximum transmit rate for this function. When specified for a PF,
15480          * does not affect traffic from the PF's child VFs.
15481          * A value of 0 indicates that the maximum bandwidth is not configured.
15482          */
15483         uint32_t        max_bw;
15484         /* The bandwidth value. */
15485         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \
15486                 UINT32_C(0xfffffff)
15487         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT              0
15488         /* The granularity of the value (bits or bytes). */
15489         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE \
15490                 UINT32_C(0x10000000)
15491         /* Value is in bits. */
15492         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS \
15493                 (UINT32_C(0x0) << 28)
15494         /* Value is in bytes. */
15495         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES \
15496                 (UINT32_C(0x1) << 28)
15497         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \
15498                 HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
15499         /* bw_value_unit is 3 b */
15500         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
15501                 UINT32_C(0xe0000000)
15502         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
15503         /* Value is in Mb or MB (base 10). */
15504         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
15505                 (UINT32_C(0x0) << 29)
15506         /* Value is in Kb or KB (base 10). */
15507         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
15508                 (UINT32_C(0x2) << 29)
15509         /* Value is in bits or bytes. */
15510         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
15511                 (UINT32_C(0x4) << 29)
15512         /* Value is in Gb or GB (base 10). */
15513         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
15514                 (UINT32_C(0x6) << 29)
15515         /* Value is in 1/100th of a percentage of total bandwidth. */
15516         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
15517                 (UINT32_C(0x1) << 29)
15518         /* Invalid unit */
15519         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
15520                 (UINT32_C(0x7) << 29)
15521         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
15522                 HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
15523         /*
15524          * ID of the target completion ring for receiving asynchronous
15525          * event completions. If this field is not valid, then the
15526          * HWRM shall use the default completion ring of the function
15527          * that is being configured as the target completion ring for
15528          * providing any asynchronous event completions for that
15529          * function.
15530          * If this field is valid, then the HWRM shall use the
15531          * completion ring identified by this ID as the target
15532          * completion ring for providing any asynchronous event
15533          * completions for the function that is being configured.
15534          */
15535         uint16_t        async_event_cr;
15536         /* VLAN Anti-spoofing mode. */
15537         uint8_t vlan_antispoof_mode;
15538         /* No VLAN anti-spoofing checks are enabled */
15539         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK \
15540                 UINT32_C(0x0)
15541         /* Validate VLAN against the configured VLAN(s) */
15542         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \
15543                 UINT32_C(0x1)
15544         /* Insert VLAN if it does not exist, otherwise discard */
15545         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \
15546                 UINT32_C(0x2)
15547         /* Insert VLAN if it does not exist, override VLAN if it exists */
15548         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \
15549                 UINT32_C(0x3)
15550         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST \
15551                 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN
15552         /*
15553          * This bit field defines VLAN PRIs that are allowed on
15554          * this function.
15555          * If nth bit is set, then VLAN PRI n is allowed on this
15556          * function.
15557          */
15558         uint8_t allowed_vlan_pris;
15559         /*
15560          * The evb_mode is configured on a per port basis. The default evb_mode
15561          * is configured based on the NVM EVB mode setting upon firmware
15562          * initialization. The HWRM allows a PF driver to change EVB mode for a
15563          * port used by the PF only when one of the following conditions is
15564          * satisfied.
15565          * 1. The current operating mode is single function mode.
15566          *    (ie. one PF per port)
15567          * 2. For SmartNIC, any one of the PAXC PFs is permitted to change the
15568          *    EVB mode of the port used by the PAXC PF. None of the X86 PFs
15569          *    should have privileges.
15570          * The HWRM doesn't permit any PFs to change the underlying EVB mode
15571          * when running as MHB or NPAR mode in performance NIC configuration.
15572          * The HWRM doesn't permit a VF driver to change the EVB mode.
15573          * Once the HWRM determines a function doesn't meet the conditions
15574          * to configure the EVB mode, it sets the evb_mode_cfg_not_supported
15575          * flag in HWRM_FUNC_QCAPS command response for the function.
15576          * The HWRM takes into account the switching of EVB mode from one to
15577          * another and reconfigure hardware resources as reqiured. The
15578          * switching from VEB to VEPA mode requires the disabling of the
15579          * loopback traffic. Additionally, source knockouts are handled
15580          * differently in VEB and VEPA modes.
15581          */
15582         uint8_t evb_mode;
15583         /* No Edge Virtual Bridging (EVB) */
15584         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
15585         /* Virtual Ethernet Bridge (VEB) */
15586         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB    UINT32_C(0x1)
15587         /* Virtual Ethernet Port Aggregator (VEPA) */
15588         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA   UINT32_C(0x2)
15589         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST \
15590                 HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA
15591         uint8_t options;
15592         /*
15593          * This value indicates the PCIE device cache line size.
15594          * The cache line size allows the DMA writes to terminate and
15595          * start at the cache boundary.
15596          */
15597         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK \
15598                 UINT32_C(0x3)
15599         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT          0
15600         /* Cache Line Size 64 bytes */
15601         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
15602                 UINT32_C(0x0)
15603         /* Cache Line Size 128 bytes */
15604         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
15605                 UINT32_C(0x1)
15606         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST \
15607                 HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
15608         /* This value is the virtual link admin state setting. */
15609         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
15610                 UINT32_C(0xc)
15611         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
15612         /* Admin state is forced down. */
15613         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
15614                 (UINT32_C(0x0) << 2)
15615         /* Admin state is forced up. */
15616         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
15617                 (UINT32_C(0x1) << 2)
15618         /* Admin state is in auto mode - is to follow the physical link state. */
15619         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
15620                 (UINT32_C(0x2) << 2)
15621         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
15622                 HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
15623         /* Reserved for future. */
15624         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK \
15625                 UINT32_C(0xf0)
15626         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT                    4
15627         /*
15628          * The number of multicast filters that should
15629          * be reserved for this function on the RX side.
15630          */
15631         uint16_t        num_mcast_filters;
15632         /* Used by a PF driver to associate a SCHQ with a VF. */
15633         uint16_t        schq_id;
15634         uint16_t        mpc_chnls;
15635         /*
15636          * When this bit is '1', the caller requests to enable a MPC
15637          * channel with destination to the TX crypto engine block.
15638          * When this bit is ‘0’, this flag has no effect.
15639          */
15640         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TCE_ENABLE          UINT32_C(0x1)
15641         /*
15642          * When this bit is '1', the caller requests to disable a MPC
15643          * channel with destination to the TX crypto engine block.
15644          * When this bit is ‘0’, this flag has no effect.
15645          */
15646         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TCE_DISABLE         UINT32_C(0x2)
15647         /*
15648          * When this bit is '1', the caller requests to enable a MPC
15649          * channel with destination to the RX crypto engine block.
15650          * When this bit is ‘0’, this flag has no effect.
15651          */
15652         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RCE_ENABLE          UINT32_C(0x4)
15653         /*
15654          * When this bit is '1', the caller requests to disable a MPC
15655          * channel with destination to the RX crypto engine block.
15656          * When this bit is ‘0’, this flag has no effect.
15657          */
15658         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RCE_DISABLE         UINT32_C(0x8)
15659         /*
15660          * When this bit is '1', the caller requests to enable a MPC
15661          * channel with destination to the TX configurable flow processing
15662          * block. When this bit is ‘0’, this flag has no effect.
15663          */
15664         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TE_CFA_ENABLE \
15665                 UINT32_C(0x10)
15666         /*
15667          * When this bit is '1', the caller requests to disable a MPC
15668          * channel with destination to the TX configurable flow processing
15669          * block. When this bit is ‘0’, this flag has no effect.
15670          */
15671         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TE_CFA_DISABLE \
15672                 UINT32_C(0x20)
15673         /*
15674          * When this bit is '1', the caller requests to enable a MPC
15675          * channel with destination to the RX configurable flow processing
15676          * block. When this bit is ‘0’, this flag has no effect.
15677          */
15678         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RE_CFA_ENABLE \
15679                 UINT32_C(0x40)
15680         /*
15681          * When this bit is '1', the caller requests to disable a MPC
15682          * channel with destination to the RX configurable flow processing
15683          * block. When this bit is ‘0’, this flag has no effect.
15684          */
15685         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RE_CFA_DISABLE \
15686                 UINT32_C(0x80)
15687         /*
15688          * When this bit is '1', the caller requests to enable a MPC
15689          * channel with destination to the primate processor block.
15690          * When this bit is ‘0’, this flag has no effect.
15691          */
15692         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_PRIMATE_ENABLE \
15693                 UINT32_C(0x100)
15694         /*
15695          * When this bit is '1', the caller requests to disable a MPC
15696          * channel with destination to the primate processor block.
15697          * When this bit is ‘0’, this flag has no effect.
15698          */
15699         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_PRIMATE_DISABLE \
15700                 UINT32_C(0x200)
15701         /*
15702          * Minimum guaranteed bandwidth for the network partition made up
15703          * of the caller physical function and all its child virtual
15704          * functions. The rate is specified as a percentage of the bandwidth
15705          * of the link the partition is associated with. A value of 0
15706          * indicates that no minimum bandwidth is configured. The sum of the
15707          * minimum bandwidths for all partitions on a link must not exceed
15708          * 100%.
15709          * The format of this field is defined to match min_bw, even though
15710          * it does not allow all the options for min_bw at this time.
15711          */
15712         uint32_t        partition_min_bw;
15713         /* The bandwidth value. */
15714         #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_MASK \
15715                 UINT32_C(0xfffffff)
15716         #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_SFT \
15717                 0
15718         /*
15719          * The granularity of the value (bits or bytes). Firmware ignores
15720          * this field.
15721          */
15722         #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE \
15723                 UINT32_C(0x10000000)
15724         /* Value is in bits. */
15725         #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BITS \
15726                 (UINT32_C(0x0) << 28)
15727         /* Value is in bytes. */
15728         #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BYTES \
15729                 (UINT32_C(0x1) << 28)
15730         #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_LAST \
15731                 HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_SCALE_BYTES
15732         /* Bandwidth units. Must be set to percent1_100. */
15733         #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_MASK \
15734                 UINT32_C(0xe0000000)
15735         #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_SFT \
15736                 29
15737         /* Value is in hundredths of a percent of link bandwidth. */
15738         #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
15739                 (UINT32_C(0x1) << 29)
15740         #define HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_LAST \
15741                 HWRM_FUNC_CFG_INPUT_PARTITION_MIN_BW_BW_VALUE_UNIT_PERCENT1_100
15742         /*
15743          * The maximum bandwidth that may be used by the network partition
15744          * made up of the caller physical function and all its child virtual
15745          * functions. The rate is specified as a percentage of the bandwidth
15746          * of the link the partition is associated with. A value of 0
15747          * indicates that no maximum bandwidth is configured.
15748          * The format of this field is defined to match max_bw, even though it
15749          * does not allow all the options for max_bw at this time.
15750          */
15751         uint32_t        partition_max_bw;
15752         /* The bandwidth value. */
15753         #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_MASK \
15754                 UINT32_C(0xfffffff)
15755         #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_SFT \
15756                 0
15757         /*
15758          * The granularity of the value (bits or bytes). Firmware ignores
15759          * this field.
15760          */
15761         #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE \
15762                 UINT32_C(0x10000000)
15763         /* Value is in bits. */
15764         #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BITS \
15765                 (UINT32_C(0x0) << 28)
15766         /* Value is in bytes. */
15767         #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BYTES \
15768                 (UINT32_C(0x1) << 28)
15769         #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_LAST \
15770                 HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_SCALE_BYTES
15771         /* Bandwidth units. Must be set to percent1_100. */
15772         #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_MASK \
15773                 UINT32_C(0xe0000000)
15774         #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_SFT \
15775                 29
15776         /* Value is in hundredths of a percent of link bandwidth. */
15777         #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
15778                 (UINT32_C(0x1) << 29)
15779         #define HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_LAST \
15780                 HWRM_FUNC_CFG_INPUT_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100
15781         /*
15782          * The TPID for the function for which default VLAN
15783          * is configured. If the dflt_vlan is not specified
15784          * with the TPID, FW returns error. If the TPID is
15785          * not specified with dflt_vlan, the default TPID of
15786          * 0x8100 will be used. This field is specified in
15787          * network byte order.
15788          */
15789         uint16_t        tpid;
15790         /*
15791          * This field can be used by the host PF to configure
15792          * mtu value.
15793          * The maximum transmission unit of the function.
15794          * The HWRM should make sure that the mtu of
15795          * the function does not exceed the mtu of the physical
15796          * port that this function is associated with.
15797          *
15798          * In addition to configuring mtu per function, it is
15799          * possible to configure mtu per transmit ring.
15800          * By default, the mtu of each transmit ring associated
15801          * with a function is equal to the mtu of the function.
15802          * The HWRM should make sure that the mtu of each transmit
15803          * ring that is assigned to a function has a valid mtu.
15804          */
15805         uint16_t        host_mtu;
15806         /* Number of Tx Key Contexts requested. */
15807         uint16_t        num_tx_key_ctxs;
15808         /* Number of Rx Key Contexts requested. */
15809         uint16_t        num_rx_key_ctxs;
15810         uint8_t unused_0[4];
15811 } __rte_packed;
15812
15813 /* hwrm_func_cfg_output (size:128b/16B) */
15814 struct hwrm_func_cfg_output {
15815         /* The specific error status for the command. */
15816         uint16_t        error_code;
15817         /* The HWRM command request type. */
15818         uint16_t        req_type;
15819         /* The sequence ID from the original command. */
15820         uint16_t        seq_id;
15821         /* The length of the response data in number of bytes. */
15822         uint16_t        resp_len;
15823         uint8_t unused_0[7];
15824         /*
15825          * This field is used in Output records to indicate that the output
15826          * is completely written to RAM.  This field should be read as '1'
15827          * to indicate that the output has been completely written.
15828          * When writing a command completion or response to an internal processor,
15829          * the order of writes has to be such that this field is written last.
15830          */
15831         uint8_t valid;
15832 } __rte_packed;
15833
15834 /* hwrm_func_cfg_cmd_err (size:64b/8B) */
15835 struct hwrm_func_cfg_cmd_err {
15836         /* command specific error codes for the cmd_err field in hwrm_err_output */
15837         uint8_t code;
15838         /* Unknown error. */
15839         #define HWRM_FUNC_CFG_CMD_ERR_CODE_UNKNOWN \
15840                 UINT32_C(0x0)
15841         /* The partition minimum bandwidth is out of range. */
15842         #define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_MIN_BW_RANGE \
15843                 UINT32_C(0x1)
15844         /* The minimum bandwidth is more than the maximum bandwidth. */
15845         #define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_MIN_MORE_THAN_MAX \
15846                 UINT32_C(0x2)
15847         /*
15848          * The NIC does not support enforcement of a minimum guaranteed
15849          * bandwidth for a partition.
15850          */
15851         #define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_MIN_BW_UNSUPPORTED \
15852                 UINT32_C(0x3)
15853         /* Partition bandwidths must be specified as a percentage. */
15854         #define HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_BW_PERCENT \
15855                 UINT32_C(0x4)
15856         #define HWRM_FUNC_CFG_CMD_ERR_CODE_LAST \
15857                 HWRM_FUNC_CFG_CMD_ERR_CODE_PARTITION_BW_PERCENT
15858         uint8_t unused_0[7];
15859 } __rte_packed;
15860
15861 /********************
15862  * hwrm_func_qstats *
15863  ********************/
15864
15865
15866 /* hwrm_func_qstats_input (size:192b/24B) */
15867 struct hwrm_func_qstats_input {
15868         /* The HWRM command request type. */
15869         uint16_t        req_type;
15870         /*
15871          * The completion ring to send the completion event on. This should
15872          * be the NQ ID returned from the `nq_alloc` HWRM command.
15873          */
15874         uint16_t        cmpl_ring;
15875         /*
15876          * The sequence ID is used by the driver for tracking multiple
15877          * commands. This ID is treated as opaque data by the firmware and
15878          * the value is returned in the `hwrm_resp_hdr` upon completion.
15879          */
15880         uint16_t        seq_id;
15881         /*
15882          * The target ID of the command:
15883          * * 0x0-0xFFF8 - The function ID
15884          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15885          * * 0xFFFD - Reserved for user-space HWRM interface
15886          * * 0xFFFF - HWRM
15887          */
15888         uint16_t        target_id;
15889         /*
15890          * A physical address pointer pointing to a host buffer that the
15891          * command's response data will be written. This can be either a host
15892          * physical address (HPA) or a guest physical address (GPA) and must
15893          * point to a physically contiguous block of memory.
15894          */
15895         uint64_t        resp_addr;
15896         /*
15897          * Function ID of the function that is being queried.
15898          * 0xFF... (All Fs) if the query is for the requesting
15899          * function.
15900          * A privileged PF can query for other function's statistics.
15901          */
15902         uint16_t        fid;
15903         /* This flags indicates the type of statistics request. */
15904         uint8_t flags;
15905         /* This value is not used to avoid backward compatibility issues. */
15906         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
15907         /*
15908          * flags should be set to 1 when request is for only RoCE statistics.
15909          * This will be honored only if the caller_fid is a privileged PF.
15910          * In all other cases FID and caller_fid should be the same.
15911          */
15912         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_ROCE_ONLY    UINT32_C(0x1)
15913         /*
15914          * flags should be set to 2 when request is for the counter mask,
15915          * representing the width of each of the stats counters, rather
15916          * than counters themselves.
15917          */
15918         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x2)
15919         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_LAST \
15920                 HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK
15921         uint8_t unused_0[5];
15922 } __rte_packed;
15923
15924 /* hwrm_func_qstats_output (size:1408b/176B) */
15925 struct hwrm_func_qstats_output {
15926         /* The specific error status for the command. */
15927         uint16_t        error_code;
15928         /* The HWRM command request type. */
15929         uint16_t        req_type;
15930         /* The sequence ID from the original command. */
15931         uint16_t        seq_id;
15932         /* The length of the response data in number of bytes. */
15933         uint16_t        resp_len;
15934         /* Number of transmitted unicast packets on the function. */
15935         uint64_t        tx_ucast_pkts;
15936         /* Number of transmitted multicast packets on the function. */
15937         uint64_t        tx_mcast_pkts;
15938         /* Number of transmitted broadcast packets on the function. */
15939         uint64_t        tx_bcast_pkts;
15940         /*
15941          * Number of transmitted packets that were discarded due to
15942          * internal NIC resource problems.  For transmit, this
15943          * can only happen if TMP is configured to allow dropping
15944          * in HOL blocking conditions, which is not a normal
15945          * configuration.
15946          */
15947         uint64_t        tx_discard_pkts;
15948         /*
15949          * Number of dropped packets on transmit path on the function.
15950          * These are packets that have been marked for drop by
15951          * the TE CFA block or are packets that exceeded the
15952          * transmit MTU limit for the function.
15953          */
15954         uint64_t        tx_drop_pkts;
15955         /* Number of transmitted bytes for unicast traffic on the function. */
15956         uint64_t        tx_ucast_bytes;
15957         /* Number of transmitted bytes for multicast traffic on the function. */
15958         uint64_t        tx_mcast_bytes;
15959         /* Number of transmitted bytes for broadcast traffic on the function. */
15960         uint64_t        tx_bcast_bytes;
15961         /* Number of received unicast packets on the function. */
15962         uint64_t        rx_ucast_pkts;
15963         /* Number of received multicast packets on the function. */
15964         uint64_t        rx_mcast_pkts;
15965         /* Number of received broadcast packets on the function. */
15966         uint64_t        rx_bcast_pkts;
15967         /*
15968          * Number of received packets that were discarded on the function
15969          * due to resource limitations.  This can happen for 3 reasons.
15970          * # The BD used for the packet has a bad format.
15971          * # There were no BDs available in the ring for the packet.
15972          * # There were no BDs available on-chip for the packet.
15973          */
15974         uint64_t        rx_discard_pkts;
15975         /*
15976          * Number of dropped packets on received path on the function.
15977          * These are packets that have been marked for drop by the
15978          * RE CFA.
15979          */
15980         uint64_t        rx_drop_pkts;
15981         /* Number of received bytes for unicast traffic on the function. */
15982         uint64_t        rx_ucast_bytes;
15983         /* Number of received bytes for multicast traffic on the function. */
15984         uint64_t        rx_mcast_bytes;
15985         /* Number of received bytes for broadcast traffic on the function. */
15986         uint64_t        rx_bcast_bytes;
15987         /* Number of aggregated unicast packets on the function. */
15988         uint64_t        rx_agg_pkts;
15989         /* Number of aggregated unicast bytes on the function. */
15990         uint64_t        rx_agg_bytes;
15991         /* Number of aggregation events on the function. */
15992         uint64_t        rx_agg_events;
15993         /* Number of aborted aggregations on the function. */
15994         uint64_t        rx_agg_aborts;
15995         uint8_t unused_0[7];
15996         /*
15997          * This field is used in Output records to indicate that the output
15998          * is completely written to RAM.  This field should be read as '1'
15999          * to indicate that the output has been completely written.
16000          * When writing a command completion or response to an internal processor,
16001          * the order of writes has to be such that this field is written last.
16002          */
16003         uint8_t valid;
16004 } __rte_packed;
16005
16006 /************************
16007  * hwrm_func_qstats_ext *
16008  ************************/
16009
16010
16011 /* hwrm_func_qstats_ext_input (size:256b/32B) */
16012 struct hwrm_func_qstats_ext_input {
16013         /* The HWRM command request type. */
16014         uint16_t        req_type;
16015         /*
16016          * The completion ring to send the completion event on. This should
16017          * be the NQ ID returned from the `nq_alloc` HWRM command.
16018          */
16019         uint16_t        cmpl_ring;
16020         /*
16021          * The sequence ID is used by the driver for tracking multiple
16022          * commands. This ID is treated as opaque data by the firmware and
16023          * the value is returned in the `hwrm_resp_hdr` upon completion.
16024          */
16025         uint16_t        seq_id;
16026         /*
16027          * The target ID of the command:
16028          * * 0x0-0xFFF8 - The function ID
16029          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16030          * * 0xFFFD - Reserved for user-space HWRM interface
16031          * * 0xFFFF - HWRM
16032          */
16033         uint16_t        target_id;
16034         /*
16035          * A physical address pointer pointing to a host buffer that the
16036          * command's response data will be written. This can be either a host
16037          * physical address (HPA) or a guest physical address (GPA) and must
16038          * point to a physically contiguous block of memory.
16039          */
16040         uint64_t        resp_addr;
16041         /*
16042          * Function ID of the function that is being queried.
16043          * 0xFF... (All Fs) if the query is for the requesting
16044          * function.
16045          * A privileged PF can query for other function's statistics.
16046          */
16047         uint16_t        fid;
16048         /* This flags indicates the type of statistics request. */
16049         uint8_t flags;
16050         /* This value is not used to avoid backward compatibility issues. */
16051         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
16052         /*
16053          * flags should be set to 1 when request is for only RoCE statistics.
16054          * This will be honored only if the caller_fid is a privileged PF.
16055          * In all other cases FID and caller_fid should be the same.
16056          */
16057         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_ROCE_ONLY    UINT32_C(0x1)
16058         /*
16059          * flags should be set to 2 when request is for the counter mask
16060          * representing the width of each of the stats counters, rather
16061          * than counters themselves.
16062          */
16063         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x2)
16064         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_LAST \
16065                 HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK
16066         uint8_t unused_0[1];
16067         uint32_t        enables;
16068         /*
16069          * This bit must be '1' for the schq_id and traffic_class fields to
16070          * be configured.
16071          */
16072         #define HWRM_FUNC_QSTATS_EXT_INPUT_ENABLES_SCHQ_ID     UINT32_C(0x1)
16073         /* Specifies the SCHQ for which to gather statistics */
16074         uint16_t        schq_id;
16075         /*
16076          * Specifies the traffic class for which to gather statistics. Valid
16077          * values are 0 through (max_configurable_queues - 1), where
16078          * max_configurable_queues is in the response of HWRM_QUEUE_QPORTCFG
16079          */
16080         uint16_t        traffic_class;
16081         uint8_t unused_1[4];
16082 } __rte_packed;
16083
16084 /* hwrm_func_qstats_ext_output (size:1536b/192B) */
16085 struct hwrm_func_qstats_ext_output {
16086         /* The specific error status for the command. */
16087         uint16_t        error_code;
16088         /* The HWRM command request type. */
16089         uint16_t        req_type;
16090         /* The sequence ID from the original command. */
16091         uint16_t        seq_id;
16092         /* The length of the response data in number of bytes. */
16093         uint16_t        resp_len;
16094         /* Number of received unicast packets */
16095         uint64_t        rx_ucast_pkts;
16096         /* Number of received multicast packets */
16097         uint64_t        rx_mcast_pkts;
16098         /* Number of received broadcast packets */
16099         uint64_t        rx_bcast_pkts;
16100         /* Number of discarded packets on received path */
16101         uint64_t        rx_discard_pkts;
16102         /* Number of packets on receive path with error */
16103         uint64_t        rx_error_pkts;
16104         /* Number of received bytes for unicast traffic */
16105         uint64_t        rx_ucast_bytes;
16106         /* Number of received bytes for multicast traffic */
16107         uint64_t        rx_mcast_bytes;
16108         /* Number of received bytes for broadcast traffic */
16109         uint64_t        rx_bcast_bytes;
16110         /* Number of transmitted unicast packets */
16111         uint64_t        tx_ucast_pkts;
16112         /* Number of transmitted multicast packets */
16113         uint64_t        tx_mcast_pkts;
16114         /* Number of transmitted broadcast packets */
16115         uint64_t        tx_bcast_pkts;
16116         /* Number of packets on transmit path with error */
16117         uint64_t        tx_error_pkts;
16118         /* Number of discarded packets on transmit path */
16119         uint64_t        tx_discard_pkts;
16120         /* Number of transmitted bytes for unicast traffic */
16121         uint64_t        tx_ucast_bytes;
16122         /* Number of transmitted bytes for multicast traffic */
16123         uint64_t        tx_mcast_bytes;
16124         /* Number of transmitted bytes for broadcast traffic */
16125         uint64_t        tx_bcast_bytes;
16126         /* Number of TPA eligible packets */
16127         uint64_t        rx_tpa_eligible_pkt;
16128         /* Number of TPA eligible bytes */
16129         uint64_t        rx_tpa_eligible_bytes;
16130         /* Number of TPA packets */
16131         uint64_t        rx_tpa_pkt;
16132         /* Number of TPA bytes */
16133         uint64_t        rx_tpa_bytes;
16134         /* Number of TPA errors */
16135         uint64_t        rx_tpa_errors;
16136         /* Number of TPA errors */
16137         uint64_t        rx_tpa_events;
16138         uint8_t unused_0[7];
16139         /*
16140          * This field is used in Output records to indicate that the output
16141          * is completely written to RAM.  This field should be read as '1'
16142          * to indicate that the output has been completely written.
16143          * When writing a command completion or response to an internal processor,
16144          * the order of writes has to be such that this field is written last.
16145          */
16146         uint8_t valid;
16147 } __rte_packed;
16148
16149 /***********************
16150  * hwrm_func_clr_stats *
16151  ***********************/
16152
16153
16154 /* hwrm_func_clr_stats_input (size:192b/24B) */
16155 struct hwrm_func_clr_stats_input {
16156         /* The HWRM command request type. */
16157         uint16_t        req_type;
16158         /*
16159          * The completion ring to send the completion event on. This should
16160          * be the NQ ID returned from the `nq_alloc` HWRM command.
16161          */
16162         uint16_t        cmpl_ring;
16163         /*
16164          * The sequence ID is used by the driver for tracking multiple
16165          * commands. This ID is treated as opaque data by the firmware and
16166          * the value is returned in the `hwrm_resp_hdr` upon completion.
16167          */
16168         uint16_t        seq_id;
16169         /*
16170          * The target ID of the command:
16171          * * 0x0-0xFFF8 - The function ID
16172          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16173          * * 0xFFFD - Reserved for user-space HWRM interface
16174          * * 0xFFFF - HWRM
16175          */
16176         uint16_t        target_id;
16177         /*
16178          * A physical address pointer pointing to a host buffer that the
16179          * command's response data will be written. This can be either a host
16180          * physical address (HPA) or a guest physical address (GPA) and must
16181          * point to a physically contiguous block of memory.
16182          */
16183         uint64_t        resp_addr;
16184         /*
16185          * Function ID of the function.
16186          * 0xFF... (All Fs) if the query is for the requesting
16187          * function.
16188          */
16189         uint16_t        fid;
16190         uint8_t unused_0[6];
16191 } __rte_packed;
16192
16193 /* hwrm_func_clr_stats_output (size:128b/16B) */
16194 struct hwrm_func_clr_stats_output {
16195         /* The specific error status for the command. */
16196         uint16_t        error_code;
16197         /* The HWRM command request type. */
16198         uint16_t        req_type;
16199         /* The sequence ID from the original command. */
16200         uint16_t        seq_id;
16201         /* The length of the response data in number of bytes. */
16202         uint16_t        resp_len;
16203         uint8_t unused_0[7];
16204         /*
16205          * This field is used in Output records to indicate that the output
16206          * is completely written to RAM.  This field should be read as '1'
16207          * to indicate that the output has been completely written.
16208          * When writing a command completion or response to an internal processor,
16209          * the order of writes has to be such that this field is written last.
16210          */
16211         uint8_t valid;
16212 } __rte_packed;
16213
16214 /**************************
16215  * hwrm_func_vf_resc_free *
16216  **************************/
16217
16218
16219 /* hwrm_func_vf_resc_free_input (size:192b/24B) */
16220 struct hwrm_func_vf_resc_free_input {
16221         /* The HWRM command request type. */
16222         uint16_t        req_type;
16223         /*
16224          * The completion ring to send the completion event on. This should
16225          * be the NQ ID returned from the `nq_alloc` HWRM command.
16226          */
16227         uint16_t        cmpl_ring;
16228         /*
16229          * The sequence ID is used by the driver for tracking multiple
16230          * commands. This ID is treated as opaque data by the firmware and
16231          * the value is returned in the `hwrm_resp_hdr` upon completion.
16232          */
16233         uint16_t        seq_id;
16234         /*
16235          * The target ID of the command:
16236          * * 0x0-0xFFF8 - The function ID
16237          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16238          * * 0xFFFD - Reserved for user-space HWRM interface
16239          * * 0xFFFF - HWRM
16240          */
16241         uint16_t        target_id;
16242         /*
16243          * A physical address pointer pointing to a host buffer that the
16244          * command's response data will be written. This can be either a host
16245          * physical address (HPA) or a guest physical address (GPA) and must
16246          * point to a physically contiguous block of memory.
16247          */
16248         uint64_t        resp_addr;
16249         /*
16250          * This value is used to identify a Virtual Function (VF).
16251          * The scope of VF ID is local within a PF.
16252          */
16253         uint16_t        vf_id;
16254         uint8_t unused_0[6];
16255 } __rte_packed;
16256
16257 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
16258 struct hwrm_func_vf_resc_free_output {
16259         /* The specific error status for the command. */
16260         uint16_t        error_code;
16261         /* The HWRM command request type. */
16262         uint16_t        req_type;
16263         /* The sequence ID from the original command. */
16264         uint16_t        seq_id;
16265         /* The length of the response data in number of bytes. */
16266         uint16_t        resp_len;
16267         uint8_t unused_0[7];
16268         /*
16269          * This field is used in Output records to indicate that the output
16270          * is completely written to RAM.  This field should be read as '1'
16271          * to indicate that the output has been completely written.
16272          * When writing a command completion or response to an internal processor,
16273          * the order of writes has to be such that this field is written last.
16274          */
16275         uint8_t valid;
16276 } __rte_packed;
16277
16278 /**********************
16279  * hwrm_func_drv_rgtr *
16280  **********************/
16281
16282
16283 /* hwrm_func_drv_rgtr_input (size:896b/112B) */
16284 struct hwrm_func_drv_rgtr_input {
16285         /* The HWRM command request type. */
16286         uint16_t        req_type;
16287         /*
16288          * The completion ring to send the completion event on. This should
16289          * be the NQ ID returned from the `nq_alloc` HWRM command.
16290          */
16291         uint16_t        cmpl_ring;
16292         /*
16293          * The sequence ID is used by the driver for tracking multiple
16294          * commands. This ID is treated as opaque data by the firmware and
16295          * the value is returned in the `hwrm_resp_hdr` upon completion.
16296          */
16297         uint16_t        seq_id;
16298         /*
16299          * The target ID of the command:
16300          * * 0x0-0xFFF8 - The function ID
16301          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16302          * * 0xFFFD - Reserved for user-space HWRM interface
16303          * * 0xFFFF - HWRM
16304          */
16305         uint16_t        target_id;
16306         /*
16307          * A physical address pointer pointing to a host buffer that the
16308          * command's response data will be written. This can be either a host
16309          * physical address (HPA) or a guest physical address (GPA) and must
16310          * point to a physically contiguous block of memory.
16311          */
16312         uint64_t        resp_addr;
16313         uint32_t        flags;
16314         /*
16315          * When this bit is '1', the function driver is requesting
16316          * all requests from its children VF drivers to be
16317          * forwarded to itself.
16318          * This flag can only be set by the PF driver.
16319          * If a VF driver sets this flag, it should be ignored
16320          * by the HWRM.
16321          */
16322         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE \
16323                 UINT32_C(0x1)
16324         /*
16325          * When this bit is '1', the function is requesting none of
16326          * the requests from its children VF drivers to be
16327          * forwarded to itself.
16328          * This flag can only be set by the PF driver.
16329          * If a VF driver sets this flag, it should be ignored
16330          * by the HWRM.
16331          */
16332         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE \
16333                 UINT32_C(0x2)
16334         /*
16335          * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b
16336          * fields shall be ignored and ver_maj, ver_min, ver_upd
16337          * and ver_patch shall be used for the driver version information.
16338          * When this bit is '0', then ver_maj_8b, ver_min_8b, ver_upd_8b
16339          * fields shall be used for the driver version information and
16340          * ver_maj, ver_min, ver_upd and ver_patch shall be ignored.
16341          */
16342         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE \
16343                 UINT32_C(0x4)
16344         /*
16345          * When this bit is '1', the function is indicating support of
16346          * 64bit flow handle.  The firmware that only supports 64bit flow
16347          * handle should check this bit before allowing processing of
16348          * HWRM_CFA_FLOW_XXX commands from the requesting function as firmware
16349          * with 64bit flow handle support can only be compatible with drivers
16350          * that support 64bit flow handle. The legacy drivers that don't support
16351          * 64bit flow handle won't be able to use HWRM_CFA_FLOW_XXX commands when
16352          * running with new firmware that only supports 64bit flow handle. The new
16353          * firmware support 64bit flow handle returns HWRM_ERR_CODE_CMD_NOT_SUPPORTED
16354          * status to the legacy driver when encounters these commands.
16355          */
16356         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE \
16357                 UINT32_C(0x8)
16358         /*
16359          * When this bit is '1', the function is indicating support of
16360          * Hot Reset. The driver interface will destroy the resources,
16361          * unregister the function and register again up on receiving
16362          * the RESET_NOTIFY Async notification from the core firmware.
16363          * The core firmware will this use flag and trigger the Hot Reset
16364          * process only if all the registered driver instances are capable
16365          * of this support.
16366          */
16367         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT \
16368                 UINT32_C(0x10)
16369         /*
16370          * When this bit is 1, the function is indicating the support of the
16371          * error recovery capability. Error recovery support will be used by
16372          * firmware only if all the driver instances support error recovery
16373          * process. By setting this bit, driver is indicating support for
16374          * corresponding async event completion message. These will be
16375          * delivered to the driver even if they did not register for it.
16376          * If supported, after receiving reset notify async event with fatal
16377          * flag set in event data1, then all the drivers have to tear down
16378          * their resources without sending any HWRM commands to FW.
16379          */
16380         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT \
16381                 UINT32_C(0x20)
16382         /*
16383          * When this bit is 1, the function is indicating the support of the
16384          * Master capability. The Firmware will use this capability to select the
16385          * Master function. The master function will be used to initiate
16386          * designated functionality like error recovery etc… If none of the
16387          * registered PF’s or trusted VF’s indicate this support, then
16388          * firmware will select the 1st registered PF as Master capable instance.
16389          */
16390         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_MASTER_SUPPORT \
16391                 UINT32_C(0x40)
16392         /*
16393          * When this bit is 1, the function is indicating the support of the
16394          * fast reset capability. Fast reset support will be used by
16395          * firmware only if all the driver instances support fast reset
16396          * process. By setting this bit, driver is indicating support for
16397          * corresponding async event completion message. These will be
16398          * delivered to the driver even if they did not register for it.
16399          * If supported, after receiving reset notify async event with fast
16400          * reset flag set in event data1, then all the drivers have to tear
16401          * down their resources without sending any HWRM commands to FW.
16402          */
16403         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FAST_RESET_SUPPORT \
16404                 UINT32_C(0x80)
16405         /*
16406          * When this bit is 1, the function's driver is indicating the
16407          * support of handling the vnic_rss_cfg's INVALID_PARAM error
16408          * returned by firmware. Firmware returns error, if host driver
16409          * configures the invalid hash_types bit combination for a given
16410          * IP version.
16411          */
16412         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_RSS_STRICT_HASH_TYPE_SUPPORT \
16413                 UINT32_C(0x100)
16414         /*
16415          * When this bit is 1, the function's driver is indicating the
16416          * support of handling the NPAR 1.2 feature where the s-tag may be
16417          * a value other than 0x8100 or 0x88a8.
16418          */
16419         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_NPAR_1_2_SUPPORT \
16420                 UINT32_C(0x200)
16421         uint32_t        enables;
16422         /*
16423          * This bit must be '1' for the os_type field to be
16424          * configured.
16425          */
16426         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE \
16427                 UINT32_C(0x1)
16428         /*
16429          * This bit must be '1' for the ver field to be
16430          * configured.
16431          */
16432         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER \
16433                 UINT32_C(0x2)
16434         /*
16435          * This bit must be '1' for the timestamp field to be
16436          * configured.
16437          */
16438         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP \
16439                 UINT32_C(0x4)
16440         /*
16441          * This bit must be '1' for the vf_req_fwd field to be
16442          * configured.
16443          */
16444         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD \
16445                 UINT32_C(0x8)
16446         /*
16447          * This bit must be '1' for the async_event_fwd field to be
16448          * configured.
16449          */
16450         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
16451                 UINT32_C(0x10)
16452         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
16453         uint16_t        os_type;
16454         /* Unknown */
16455         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
16456         /* Other OS not listed below. */
16457         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER     UINT32_C(0x1)
16458         /* MSDOS OS. */
16459         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
16460         /* Windows OS. */
16461         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
16462         /* Solaris OS. */
16463         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
16464         /* Linux OS. */
16465         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX     UINT32_C(0x24)
16466         /* FreeBSD OS. */
16467         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
16468         /* VMware ESXi OS. */
16469         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI      UINT32_C(0x68)
16470         /* Microsoft Windows 8 64-bit OS. */
16471         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864    UINT32_C(0x73)
16472         /* Microsoft Windows Server 2012 R2 OS. */
16473         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
16474         /* UEFI driver. */
16475         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
16476         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST \
16477                 HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
16478         /* This is the 8bit major version of the driver. */
16479         uint8_t ver_maj_8b;
16480         /* This is the 8bit minor version of the driver. */
16481         uint8_t ver_min_8b;
16482         /* This is the 8bit update version of the driver. */
16483         uint8_t ver_upd_8b;
16484         uint8_t unused_0[3];
16485         /*
16486          * This is a 32-bit timestamp provided by the driver for
16487          * keep alive.
16488          * The timestamp is in multiples of 1ms.
16489          */
16490         uint32_t        timestamp;
16491         uint8_t unused_1[4];
16492         /*
16493          * This is a 256-bit bit mask provided by the PF driver for
16494          * letting the HWRM know what commands issued by the VF driver
16495          * to the HWRM should be forwarded to the PF driver.
16496          * Nth bit refers to the Nth req_type.
16497          *
16498          * Setting Nth bit to 1 indicates that requests from the
16499          * VF driver with req_type equal to N shall be forwarded to
16500          * the parent PF driver.
16501          *
16502          * This field is not valid for the VF driver.
16503          */
16504         uint32_t        vf_req_fwd[8];
16505         /*
16506          * This is a 256-bit bit mask provided by the function driver
16507          * (PF or VF driver) to indicate the list of asynchronous event
16508          * completions to be forwarded.
16509          *
16510          * Nth bit refers to the Nth event_id.
16511          *
16512          * Setting Nth bit to 1 by the function driver shall result in
16513          * the HWRM forwarding asynchronous event completion with
16514          * event_id equal to N.
16515          *
16516          * If all bits are set to 0 (value of 0), then the HWRM shall
16517          * not forward any asynchronous event completion to this
16518          * function driver.
16519          */
16520         uint32_t        async_event_fwd[8];
16521         /* This is the 16bit major version of the driver. */
16522         uint16_t        ver_maj;
16523         /* This is the 16bit minor version of the driver. */
16524         uint16_t        ver_min;
16525         /* This is the 16bit update version of the driver. */
16526         uint16_t        ver_upd;
16527         /* This is the 16bit patch version of the driver. */
16528         uint16_t        ver_patch;
16529 } __rte_packed;
16530
16531 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
16532 struct hwrm_func_drv_rgtr_output {
16533         /* The specific error status for the command. */
16534         uint16_t        error_code;
16535         /* The HWRM command request type. */
16536         uint16_t        req_type;
16537         /* The sequence ID from the original command. */
16538         uint16_t        seq_id;
16539         /* The length of the response data in number of bytes. */
16540         uint16_t        resp_len;
16541         uint32_t        flags;
16542         /*
16543          * When this bit is '1', it indicates that the
16544          * HWRM_FUNC_DRV_IF_CHANGE call is supported.
16545          */
16546         #define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED \
16547                 UINT32_C(0x1)
16548         uint8_t unused_0[3];
16549         /*
16550          * This field is used in Output records to indicate that the output
16551          * is completely written to RAM.  This field should be read as '1'
16552          * to indicate that the output has been completely written.
16553          * When writing a command completion or response to an internal processor,
16554          * the order of writes has to be such that this field is written last.
16555          */
16556         uint8_t valid;
16557 } __rte_packed;
16558
16559 /************************
16560  * hwrm_func_drv_unrgtr *
16561  ************************/
16562
16563
16564 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
16565 struct hwrm_func_drv_unrgtr_input {
16566         /* The HWRM command request type. */
16567         uint16_t        req_type;
16568         /*
16569          * The completion ring to send the completion event on. This should
16570          * be the NQ ID returned from the `nq_alloc` HWRM command.
16571          */
16572         uint16_t        cmpl_ring;
16573         /*
16574          * The sequence ID is used by the driver for tracking multiple
16575          * commands. This ID is treated as opaque data by the firmware and
16576          * the value is returned in the `hwrm_resp_hdr` upon completion.
16577          */
16578         uint16_t        seq_id;
16579         /*
16580          * The target ID of the command:
16581          * * 0x0-0xFFF8 - The function ID
16582          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16583          * * 0xFFFD - Reserved for user-space HWRM interface
16584          * * 0xFFFF - HWRM
16585          */
16586         uint16_t        target_id;
16587         /*
16588          * A physical address pointer pointing to a host buffer that the
16589          * command's response data will be written. This can be either a host
16590          * physical address (HPA) or a guest physical address (GPA) and must
16591          * point to a physically contiguous block of memory.
16592          */
16593         uint64_t        resp_addr;
16594         uint32_t        flags;
16595         /*
16596          * When this bit is '1', the function driver is notifying
16597          * the HWRM to prepare for the shutdown.
16598          */
16599         #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
16600                 UINT32_C(0x1)
16601         uint8_t unused_0[4];
16602 } __rte_packed;
16603
16604 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
16605 struct hwrm_func_drv_unrgtr_output {
16606         /* The specific error status for the command. */
16607         uint16_t        error_code;
16608         /* The HWRM command request type. */
16609         uint16_t        req_type;
16610         /* The sequence ID from the original command. */
16611         uint16_t        seq_id;
16612         /* The length of the response data in number of bytes. */
16613         uint16_t        resp_len;
16614         uint8_t unused_0[7];
16615         /*
16616          * This field is used in Output records to indicate that the output
16617          * is completely written to RAM.  This field should be read as '1'
16618          * to indicate that the output has been completely written.
16619          * When writing a command completion or response to an internal processor,
16620          * the order of writes has to be such that this field is written last.
16621          */
16622         uint8_t valid;
16623 } __rte_packed;
16624
16625 /**********************
16626  * hwrm_func_buf_rgtr *
16627  **********************/
16628
16629
16630 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
16631 struct hwrm_func_buf_rgtr_input {
16632         /* The HWRM command request type. */
16633         uint16_t        req_type;
16634         /*
16635          * The completion ring to send the completion event on. This should
16636          * be the NQ ID returned from the `nq_alloc` HWRM command.
16637          */
16638         uint16_t        cmpl_ring;
16639         /*
16640          * The sequence ID is used by the driver for tracking multiple
16641          * commands. This ID is treated as opaque data by the firmware and
16642          * the value is returned in the `hwrm_resp_hdr` upon completion.
16643          */
16644         uint16_t        seq_id;
16645         /*
16646          * The target ID of the command:
16647          * * 0x0-0xFFF8 - The function ID
16648          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16649          * * 0xFFFD - Reserved for user-space HWRM interface
16650          * * 0xFFFF - HWRM
16651          */
16652         uint16_t        target_id;
16653         /*
16654          * A physical address pointer pointing to a host buffer that the
16655          * command's response data will be written. This can be either a host
16656          * physical address (HPA) or a guest physical address (GPA) and must
16657          * point to a physically contiguous block of memory.
16658          */
16659         uint64_t        resp_addr;
16660         uint32_t        enables;
16661         /*
16662          * This bit must be '1' for the vf_id field to be
16663          * configured.
16664          */
16665         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID            UINT32_C(0x1)
16666         /*
16667          * This bit must be '1' for the err_buf_addr field to be
16668          * configured.
16669          */
16670         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR     UINT32_C(0x2)
16671         /*
16672          * This value is used to identify a Virtual Function (VF).
16673          * The scope of VF ID is local within a PF.
16674          */
16675         uint16_t        vf_id;
16676         /*
16677          * This field represents the number of pages used for request
16678          * buffer(s).
16679          */
16680         uint16_t        req_buf_num_pages;
16681         /*
16682          * This field represents the page size used for request
16683          * buffer(s).
16684          */
16685         uint16_t        req_buf_page_size;
16686         /* 16 bytes */
16687         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
16688         /* 4 Kbytes */
16689         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K  UINT32_C(0xc)
16690         /* 8 Kbytes */
16691         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K  UINT32_C(0xd)
16692         /* 64 Kbytes */
16693         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
16694         /* 2 Mbytes */
16695         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M  UINT32_C(0x15)
16696         /* 4 Mbytes */
16697         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M  UINT32_C(0x16)
16698         /* 1 Gbytes */
16699         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G  UINT32_C(0x1e)
16700         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST \
16701                 HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
16702         /* The length of the request buffer per VF in bytes. */
16703         uint16_t        req_buf_len;
16704         /* The length of the response buffer in bytes. */
16705         uint16_t        resp_buf_len;
16706         uint8_t unused_0[2];
16707         /* This field represents the page address of page #0. */
16708         uint64_t        req_buf_page_addr0;
16709         /* This field represents the page address of page #1. */
16710         uint64_t        req_buf_page_addr1;
16711         /* This field represents the page address of page #2. */
16712         uint64_t        req_buf_page_addr2;
16713         /* This field represents the page address of page #3. */
16714         uint64_t        req_buf_page_addr3;
16715         /* This field represents the page address of page #4. */
16716         uint64_t        req_buf_page_addr4;
16717         /* This field represents the page address of page #5. */
16718         uint64_t        req_buf_page_addr5;
16719         /* This field represents the page address of page #6. */
16720         uint64_t        req_buf_page_addr6;
16721         /* This field represents the page address of page #7. */
16722         uint64_t        req_buf_page_addr7;
16723         /* This field represents the page address of page #8. */
16724         uint64_t        req_buf_page_addr8;
16725         /* This field represents the page address of page #9. */
16726         uint64_t        req_buf_page_addr9;
16727         /*
16728          * This field is used to receive the error reporting from
16729          * the chipset. Only applicable for PFs.
16730          */
16731         uint64_t        error_buf_addr;
16732         /*
16733          * This field is used to receive the response forwarded by the
16734          * HWRM.
16735          */
16736         uint64_t        resp_buf_addr;
16737 } __rte_packed;
16738
16739 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
16740 struct hwrm_func_buf_rgtr_output {
16741         /* The specific error status for the command. */
16742         uint16_t        error_code;
16743         /* The HWRM command request type. */
16744         uint16_t        req_type;
16745         /* The sequence ID from the original command. */
16746         uint16_t        seq_id;
16747         /* The length of the response data in number of bytes. */
16748         uint16_t        resp_len;
16749         uint8_t unused_0[7];
16750         /*
16751          * This field is used in Output records to indicate that the output
16752          * is completely written to RAM.  This field should be read as '1'
16753          * to indicate that the output has been completely written.
16754          * When writing a command completion or response to an internal processor,
16755          * the order of writes has to be such that this field is written last.
16756          */
16757         uint8_t valid;
16758 } __rte_packed;
16759
16760 /************************
16761  * hwrm_func_buf_unrgtr *
16762  ************************/
16763
16764
16765 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
16766 struct hwrm_func_buf_unrgtr_input {
16767         /* The HWRM command request type. */
16768         uint16_t        req_type;
16769         /*
16770          * The completion ring to send the completion event on. This should
16771          * be the NQ ID returned from the `nq_alloc` HWRM command.
16772          */
16773         uint16_t        cmpl_ring;
16774         /*
16775          * The sequence ID is used by the driver for tracking multiple
16776          * commands. This ID is treated as opaque data by the firmware and
16777          * the value is returned in the `hwrm_resp_hdr` upon completion.
16778          */
16779         uint16_t        seq_id;
16780         /*
16781          * The target ID of the command:
16782          * * 0x0-0xFFF8 - The function ID
16783          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16784          * * 0xFFFD - Reserved for user-space HWRM interface
16785          * * 0xFFFF - HWRM
16786          */
16787         uint16_t        target_id;
16788         /*
16789          * A physical address pointer pointing to a host buffer that the
16790          * command's response data will be written. This can be either a host
16791          * physical address (HPA) or a guest physical address (GPA) and must
16792          * point to a physically contiguous block of memory.
16793          */
16794         uint64_t        resp_addr;
16795         uint32_t        enables;
16796         /*
16797          * This bit must be '1' for the vf_id field to be
16798          * configured.
16799          */
16800         #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID     UINT32_C(0x1)
16801         /*
16802          * This value is used to identify a Virtual Function (VF).
16803          * The scope of VF ID is local within a PF.
16804          */
16805         uint16_t        vf_id;
16806         uint8_t unused_0[2];
16807 } __rte_packed;
16808
16809 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
16810 struct hwrm_func_buf_unrgtr_output {
16811         /* The specific error status for the command. */
16812         uint16_t        error_code;
16813         /* The HWRM command request type. */
16814         uint16_t        req_type;
16815         /* The sequence ID from the original command. */
16816         uint16_t        seq_id;
16817         /* The length of the response data in number of bytes. */
16818         uint16_t        resp_len;
16819         uint8_t unused_0[7];
16820         /*
16821          * This field is used in Output records to indicate that the output
16822          * is completely written to RAM.  This field should be read as '1'
16823          * to indicate that the output has been completely written.
16824          * When writing a command completion or response to an internal processor,
16825          * the order of writes has to be such that this field is written last.
16826          */
16827         uint8_t valid;
16828 } __rte_packed;
16829
16830 /**********************
16831  * hwrm_func_drv_qver *
16832  **********************/
16833
16834
16835 /* hwrm_func_drv_qver_input (size:192b/24B) */
16836 struct hwrm_func_drv_qver_input {
16837         /* The HWRM command request type. */
16838         uint16_t        req_type;
16839         /*
16840          * The completion ring to send the completion event on. This should
16841          * be the NQ ID returned from the `nq_alloc` HWRM command.
16842          */
16843         uint16_t        cmpl_ring;
16844         /*
16845          * The sequence ID is used by the driver for tracking multiple
16846          * commands. This ID is treated as opaque data by the firmware and
16847          * the value is returned in the `hwrm_resp_hdr` upon completion.
16848          */
16849         uint16_t        seq_id;
16850         /*
16851          * The target ID of the command:
16852          * * 0x0-0xFFF8 - The function ID
16853          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16854          * * 0xFFFD - Reserved for user-space HWRM interface
16855          * * 0xFFFF - HWRM
16856          */
16857         uint16_t        target_id;
16858         /*
16859          * A physical address pointer pointing to a host buffer that the
16860          * command's response data will be written. This can be either a host
16861          * physical address (HPA) or a guest physical address (GPA) and must
16862          * point to a physically contiguous block of memory.
16863          */
16864         uint64_t        resp_addr;
16865         /* Reserved for future use. */
16866         uint32_t        reserved;
16867         /*
16868          * Function ID of the function that is being queried.
16869          * 0xFF... (All Fs) if the query is for the requesting
16870          * function.
16871          */
16872         uint16_t        fid;
16873         uint8_t unused_0[2];
16874 } __rte_packed;
16875
16876 /* hwrm_func_drv_qver_output (size:256b/32B) */
16877 struct hwrm_func_drv_qver_output {
16878         /* The specific error status for the command. */
16879         uint16_t        error_code;
16880         /* The HWRM command request type. */
16881         uint16_t        req_type;
16882         /* The sequence ID from the original command. */
16883         uint16_t        seq_id;
16884         /* The length of the response data in number of bytes. */
16885         uint16_t        resp_len;
16886         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
16887         uint16_t        os_type;
16888         /* Unknown */
16889         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
16890         /* Other OS not listed below. */
16891         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER     UINT32_C(0x1)
16892         /* MSDOS OS. */
16893         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
16894         /* Windows OS. */
16895         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
16896         /* Solaris OS. */
16897         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
16898         /* Linux OS. */
16899         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX     UINT32_C(0x24)
16900         /* FreeBSD OS. */
16901         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
16902         /* VMware ESXi OS. */
16903         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI      UINT32_C(0x68)
16904         /* Microsoft Windows 8 64-bit OS. */
16905         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864    UINT32_C(0x73)
16906         /* Microsoft Windows Server 2012 R2 OS. */
16907         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
16908         /* UEFI driver. */
16909         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
16910         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST \
16911                 HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
16912         /* This is the 8bit major version of the driver. */
16913         uint8_t ver_maj_8b;
16914         /* This is the 8bit minor version of the driver. */
16915         uint8_t ver_min_8b;
16916         /* This is the 8bit update version of the driver. */
16917         uint8_t ver_upd_8b;
16918         uint8_t unused_0[3];
16919         /* This is the 16bit major version of the driver. */
16920         uint16_t        ver_maj;
16921         /* This is the 16bit minor version of the driver. */
16922         uint16_t        ver_min;
16923         /* This is the 16bit update version of the driver. */
16924         uint16_t        ver_upd;
16925         /* This is the 16bit patch version of the driver. */
16926         uint16_t        ver_patch;
16927         uint8_t unused_1[7];
16928         /*
16929          * This field is used in Output records to indicate that the output
16930          * is completely written to RAM.  This field should be read as '1'
16931          * to indicate that the output has been completely written.
16932          * When writing a command completion or response to an internal processor,
16933          * the order of writes has to be such that this field is written last.
16934          */
16935         uint8_t valid;
16936 } __rte_packed;
16937
16938 /****************************
16939  * hwrm_func_resource_qcaps *
16940  ****************************/
16941
16942
16943 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
16944 struct hwrm_func_resource_qcaps_input {
16945         /* The HWRM command request type. */
16946         uint16_t        req_type;
16947         /*
16948          * The completion ring to send the completion event on. This should
16949          * be the NQ ID returned from the `nq_alloc` HWRM command.
16950          */
16951         uint16_t        cmpl_ring;
16952         /*
16953          * The sequence ID is used by the driver for tracking multiple
16954          * commands. This ID is treated as opaque data by the firmware and
16955          * the value is returned in the `hwrm_resp_hdr` upon completion.
16956          */
16957         uint16_t        seq_id;
16958         /*
16959          * The target ID of the command:
16960          * * 0x0-0xFFF8 - The function ID
16961          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16962          * * 0xFFFD - Reserved for user-space HWRM interface
16963          * * 0xFFFF - HWRM
16964          */
16965         uint16_t        target_id;
16966         /*
16967          * A physical address pointer pointing to a host buffer that the
16968          * command's response data will be written. This can be either a host
16969          * physical address (HPA) or a guest physical address (GPA) and must
16970          * point to a physically contiguous block of memory.
16971          */
16972         uint64_t        resp_addr;
16973         /*
16974          * Function ID of the function that is being queried.
16975          * 0xFF... (All Fs) if the query is for the requesting
16976          * function.
16977          */
16978         uint16_t        fid;
16979         uint8_t unused_0[6];
16980 } __rte_packed;
16981
16982 /* hwrm_func_resource_qcaps_output (size:512b/64B) */
16983 struct hwrm_func_resource_qcaps_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         /* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */
16993         uint16_t        max_vfs;
16994         /* Maximum guaranteed number of MSI-X vectors supported by function */
16995         uint16_t        max_msix;
16996         /* Hint of strategy to be used by PF driver to reserve resources for its VF */
16997         uint16_t        vf_reservation_strategy;
16998         /* The PF driver should evenly divide its remaining resources among all VFs. */
16999         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL \
17000                 UINT32_C(0x0)
17001         /* The PF driver should only reserve minimal resources for each VF. */
17002         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL \
17003                 UINT32_C(0x1)
17004         /*
17005          * The PF driver should not reserve any resources for each VF until
17006          * the VF interface is brought up.
17007          */
17008         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC \
17009                 UINT32_C(0x2)
17010         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST \
17011                 HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
17012         /* Minimum guaranteed number of RSS/COS contexts */
17013         uint16_t        min_rsscos_ctx;
17014         /* Maximum non-guaranteed number of RSS/COS contexts */
17015         uint16_t        max_rsscos_ctx;
17016         /* Minimum guaranteed number of completion rings */
17017         uint16_t        min_cmpl_rings;
17018         /* Maximum non-guaranteed number of completion rings */
17019         uint16_t        max_cmpl_rings;
17020         /* Minimum guaranteed number of transmit rings */
17021         uint16_t        min_tx_rings;
17022         /* Maximum non-guaranteed number of transmit rings */
17023         uint16_t        max_tx_rings;
17024         /* Minimum guaranteed number of receive rings */
17025         uint16_t        min_rx_rings;
17026         /* Maximum non-guaranteed number of receive rings */
17027         uint16_t        max_rx_rings;
17028         /* Minimum guaranteed number of L2 contexts */
17029         uint16_t        min_l2_ctxs;
17030         /* Maximum non-guaranteed number of L2 contexts */
17031         uint16_t        max_l2_ctxs;
17032         /* Minimum guaranteed number of VNICs */
17033         uint16_t        min_vnics;
17034         /* Maximum non-guaranteed number of VNICs */
17035         uint16_t        max_vnics;
17036         /* Minimum guaranteed number of statistic contexts */
17037         uint16_t        min_stat_ctx;
17038         /* Maximum non-guaranteed number of statistic contexts */
17039         uint16_t        max_stat_ctx;
17040         /* Minimum guaranteed number of ring groups */
17041         uint16_t        min_hw_ring_grps;
17042         /* Maximum non-guaranteed number of ring groups */
17043         uint16_t        max_hw_ring_grps;
17044         /*
17045          * Maximum number of inputs into the transmit scheduler for this function.
17046          * The number of TX rings assigned to the function cannot exceed this value.
17047          */
17048         uint16_t        max_tx_scheduler_inputs;
17049         uint16_t        flags;
17050         /*
17051          * When this bit is '1', it indicates that VF_RESOURCE_CFG supports
17052          * feature to reserve all minimum resources when minimum >= 1, otherwise
17053          * returns an error.
17054          */
17055         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED \
17056                 UINT32_C(0x1)
17057         /* Minimum guaranteed number of Tx Key Contexts */
17058         uint16_t        min_tx_key_ctxs;
17059         /* Maximum non-guaranteed number of Tx Key Contexts */
17060         uint16_t        max_tx_key_ctxs;
17061         /* Minimum guaranteed number of Rx Key Contexts */
17062         uint16_t        min_rx_key_ctxs;
17063         /* Maximum non-guaranteed number of Rx Key Contexts */
17064         uint16_t        max_rx_key_ctxs;
17065         uint8_t unused_0[5];
17066         /*
17067          * This field is used in Output records to indicate that the output
17068          * is completely written to RAM.  This field should be read as '1'
17069          * to indicate that the output has been completely written.
17070          * When writing a command completion or response to an internal processor,
17071          * the order of writes has to be such that this field is written last.
17072          */
17073         uint8_t valid;
17074 } __rte_packed;
17075
17076 /*****************************
17077  * hwrm_func_vf_resource_cfg *
17078  *****************************/
17079
17080
17081 /* hwrm_func_vf_resource_cfg_input (size:512b/64B) */
17082 struct hwrm_func_vf_resource_cfg_input {
17083         /* The HWRM command request type. */
17084         uint16_t        req_type;
17085         /*
17086          * The completion ring to send the completion event on. This should
17087          * be the NQ ID returned from the `nq_alloc` HWRM command.
17088          */
17089         uint16_t        cmpl_ring;
17090         /*
17091          * The sequence ID is used by the driver for tracking multiple
17092          * commands. This ID is treated as opaque data by the firmware and
17093          * the value is returned in the `hwrm_resp_hdr` upon completion.
17094          */
17095         uint16_t        seq_id;
17096         /*
17097          * The target ID of the command:
17098          * * 0x0-0xFFF8 - The function ID
17099          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17100          * * 0xFFFD - Reserved for user-space HWRM interface
17101          * * 0xFFFF - HWRM
17102          */
17103         uint16_t        target_id;
17104         /*
17105          * A physical address pointer pointing to a host buffer that the
17106          * command's response data will be written. This can be either a host
17107          * physical address (HPA) or a guest physical address (GPA) and must
17108          * point to a physically contiguous block of memory.
17109          */
17110         uint64_t        resp_addr;
17111         /* VF ID that is being configured by PF */
17112         uint16_t        vf_id;
17113         /* Maximum guaranteed number of MSI-X vectors for the function */
17114         uint16_t        max_msix;
17115         /* Minimum guaranteed number of RSS/COS contexts */
17116         uint16_t        min_rsscos_ctx;
17117         /* Maximum non-guaranteed number of RSS/COS contexts */
17118         uint16_t        max_rsscos_ctx;
17119         /* Minimum guaranteed number of completion rings */
17120         uint16_t        min_cmpl_rings;
17121         /* Maximum non-guaranteed number of completion rings */
17122         uint16_t        max_cmpl_rings;
17123         /* Minimum guaranteed number of transmit rings */
17124         uint16_t        min_tx_rings;
17125         /* Maximum non-guaranteed number of transmit rings */
17126         uint16_t        max_tx_rings;
17127         /* Minimum guaranteed number of receive rings */
17128         uint16_t        min_rx_rings;
17129         /* Maximum non-guaranteed number of receive rings */
17130         uint16_t        max_rx_rings;
17131         /* Minimum guaranteed number of L2 contexts */
17132         uint16_t        min_l2_ctxs;
17133         /* Maximum non-guaranteed number of L2 contexts */
17134         uint16_t        max_l2_ctxs;
17135         /* Minimum guaranteed number of VNICs */
17136         uint16_t        min_vnics;
17137         /* Maximum non-guaranteed number of VNICs */
17138         uint16_t        max_vnics;
17139         /* Minimum guaranteed number of statistic contexts */
17140         uint16_t        min_stat_ctx;
17141         /* Maximum non-guaranteed number of statistic contexts */
17142         uint16_t        max_stat_ctx;
17143         /* Minimum guaranteed number of ring groups */
17144         uint16_t        min_hw_ring_grps;
17145         /* Maximum non-guaranteed number of ring groups */
17146         uint16_t        max_hw_ring_grps;
17147         uint16_t        flags;
17148         /*
17149          * If this bit is set, all minimum resources requested should be
17150          * reserved if minimum >= 1, otherwise return error. In case of
17151          * error, keep all existing reservations before the call.
17152          */
17153         #define HWRM_FUNC_VF_RESOURCE_CFG_INPUT_FLAGS_MIN_GUARANTEED \
17154                 UINT32_C(0x1)
17155         /* Minimum guaranteed number of Tx Key Contexts */
17156         uint16_t        min_tx_key_ctxs;
17157         /* Maximum non-guaranteed number of Tx Key Contexts */
17158         uint16_t        max_tx_key_ctxs;
17159         /* Minimum guaranteed number of Rx Key Contexts */
17160         uint16_t        min_rx_key_ctxs;
17161         /* Maximum non-guaranteed number of Rx Key Contexts */
17162         uint16_t        max_rx_key_ctxs;
17163         uint8_t unused_0[2];
17164 } __rte_packed;
17165
17166 /* hwrm_func_vf_resource_cfg_output (size:256b/32B) */
17167 struct hwrm_func_vf_resource_cfg_output {
17168         /* The specific error status for the command. */
17169         uint16_t        error_code;
17170         /* The HWRM command request type. */
17171         uint16_t        req_type;
17172         /* The sequence ID from the original command. */
17173         uint16_t        seq_id;
17174         /* The length of the response data in number of bytes. */
17175         uint16_t        resp_len;
17176         /* Reserved number of RSS/COS contexts */
17177         uint16_t        reserved_rsscos_ctx;
17178         /* Reserved number of completion rings */
17179         uint16_t        reserved_cmpl_rings;
17180         /* Reserved number of transmit rings */
17181         uint16_t        reserved_tx_rings;
17182         /* Reserved number of receive rings */
17183         uint16_t        reserved_rx_rings;
17184         /* Reserved number of L2 contexts */
17185         uint16_t        reserved_l2_ctxs;
17186         /* Reserved number of VNICs */
17187         uint16_t        reserved_vnics;
17188         /* Reserved number of statistic contexts */
17189         uint16_t        reserved_stat_ctx;
17190         /* Reserved number of ring groups */
17191         uint16_t        reserved_hw_ring_grps;
17192         /* Actual number of Tx Key Contexts reserved */
17193         uint16_t        reserved_tx_key_ctxs;
17194         /* Actual number of Rx Key Contexts reserved */
17195         uint16_t        reserved_rx_key_ctxs;
17196         uint8_t unused_0[3];
17197         /*
17198          * This field is used in Output records to indicate that the output
17199          * is completely written to RAM.  This field should be read as '1'
17200          * to indicate that the output has been completely written.
17201          * When writing a command completion or response to an internal processor,
17202          * the order of writes has to be such that this field is written last.
17203          */
17204         uint8_t valid;
17205 } __rte_packed;
17206
17207 /*********************************
17208  * hwrm_func_backing_store_qcaps *
17209  *********************************/
17210
17211
17212 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
17213 struct hwrm_func_backing_store_qcaps_input {
17214         /* The HWRM command request type. */
17215         uint16_t        req_type;
17216         /*
17217          * The completion ring to send the completion event on. This should
17218          * be the NQ ID returned from the `nq_alloc` HWRM command.
17219          */
17220         uint16_t        cmpl_ring;
17221         /*
17222          * The sequence ID is used by the driver for tracking multiple
17223          * commands. This ID is treated as opaque data by the firmware and
17224          * the value is returned in the `hwrm_resp_hdr` upon completion.
17225          */
17226         uint16_t        seq_id;
17227         /*
17228          * The target ID of the command:
17229          * * 0x0-0xFFF8 - The function ID
17230          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17231          * * 0xFFFD - Reserved for user-space HWRM interface
17232          * * 0xFFFF - HWRM
17233          */
17234         uint16_t        target_id;
17235         /*
17236          * A physical address pointer pointing to a host buffer that the
17237          * command's response data will be written. This can be either a host
17238          * physical address (HPA) or a guest physical address (GPA) and must
17239          * point to a physically contiguous block of memory.
17240          */
17241         uint64_t        resp_addr;
17242 } __rte_packed;
17243
17244 /* hwrm_func_backing_store_qcaps_output (size:832b/104B) */
17245 struct hwrm_func_backing_store_qcaps_output {
17246         /* The specific error status for the command. */
17247         uint16_t        error_code;
17248         /* The HWRM command request type. */
17249         uint16_t        req_type;
17250         /* The sequence ID from the original command. */
17251         uint16_t        seq_id;
17252         /* The length of the response data in number of bytes. */
17253         uint16_t        resp_len;
17254         /* Maximum number of QP context entries supported for this function. */
17255         uint32_t        qp_max_entries;
17256         /*
17257          * Minimum number of QP context entries that are needed to be reserved
17258          * for QP1 for the PF and its VFs. PF drivers must allocate at least
17259          * this many QP context entries, even if RoCE will not be used.
17260          */
17261         uint16_t        qp_min_qp1_entries;
17262         /*
17263          * Maximum number of QP context entries that can be used for L2 and
17264          * mid-path.
17265          */
17266         uint16_t        qp_max_l2_entries;
17267         /* Number of bytes that must be allocated for each context entry. */
17268         uint16_t        qp_entry_size;
17269         /* Maximum number of SRQ context entries that can be used for L2. */
17270         uint16_t        srq_max_l2_entries;
17271         /* Maximum number of SRQ context entries supported for this function. */
17272         uint32_t        srq_max_entries;
17273         /* Number of bytes that must be allocated for each context entry. */
17274         uint16_t        srq_entry_size;
17275         /* Maximum number of CQ context entries that can be used for L2. */
17276         uint16_t        cq_max_l2_entries;
17277         /* Maximum number of CQ context entries supported for this function. */
17278         uint32_t        cq_max_entries;
17279         /* Number of bytes that must be allocated for each context entry. */
17280         uint16_t        cq_entry_size;
17281         /* Maximum number of VNIC context entries supported for this function. */
17282         uint16_t        vnic_max_vnic_entries;
17283         /* Maximum number of Ring table context entries supported for this function. */
17284         uint16_t        vnic_max_ring_table_entries;
17285         /* Number of bytes that must be allocated for each context entry. */
17286         uint16_t        vnic_entry_size;
17287         /* Maximum number of statistic context entries supported for this function. */
17288         uint32_t        stat_max_entries;
17289         /* Number of bytes that must be allocated for each context entry. */
17290         uint16_t        stat_entry_size;
17291         /* Number of bytes that must be allocated for each context entry. */
17292         uint16_t        tqm_entry_size;
17293         /* Minimum number of TQM context entries required per ring. */
17294         uint32_t        tqm_min_entries_per_ring;
17295         /*
17296          * Maximum number of TQM context entries supported per ring. This is
17297          * actually a recommended TQM queue size based on worst case usage of
17298          * the TQM queue.
17299          *
17300          * TQM fastpath rings should be sized large enough to accommodate the
17301          * maximum number of QPs (either L2 or RoCE, or both if shared)
17302          * that can be enqueued to the TQM ring.
17303          *
17304          * TQM slowpath rings should be sized as follows:
17305          *
17306          * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
17307          *
17308          * Where:
17309          *   num_vnics is the number of VNICs allocated in the VNIC backing store
17310          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
17311          *   num_roce_qps is the number of RoCE QPs in the QP backing store
17312          *   tqm_min_size is tqm_min_entries_per_ring reported by
17313          *     HWRM_FUNC_BACKING_STORE_QCAPS
17314          *
17315          * Note that TQM ring sizes cannot be extended while the system is
17316          * operational. If a PF driver needs to extend a TQM ring, it needs
17317          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
17318          * the backing store.
17319          */
17320         uint32_t        tqm_max_entries_per_ring;
17321         /*
17322          * Maximum number of MR plus AV context entries supported for this
17323          * function.
17324          */
17325         uint32_t        mrav_max_entries;
17326         /* Number of bytes that must be allocated for each context entry. */
17327         uint16_t        mrav_entry_size;
17328         /* Number of bytes that must be allocated for each context entry. */
17329         uint16_t        tim_entry_size;
17330         /* Maximum number of Timer context entries supported for this function. */
17331         uint32_t        tim_max_entries;
17332         /*
17333          * When this field is zero, the 32b `mrav_num_entries` field in the
17334          * `backing_store_cfg` and `backing_store_qcfg` commands represents
17335          * the total number of MR plus AV entries allowed in the MR/AV backing
17336          * store PBL.
17337          *
17338          * When this field is non-zero, the 32b `mrav_num_entries` field in
17339          * the `backing_store_cfg` and `backing_store_qcfg` commands is
17340          * logically divided into two 16b fields. Bits `[31:16]` represents
17341          * the `mr_num_entries` and bits `[15:0]` represents `av_num_entries`.
17342          * Both of these values are represented in a unit granularity
17343          * specified by this field. For example, if this field is 16 and
17344          * `mrav_num_entries` is `0x02000100`, then the number of MR entries
17345          * is 8192 and the number of AV entries is 4096.
17346          */
17347         uint16_t        mrav_num_entries_units;
17348         /*
17349          * The number of entries specified for any TQM ring must be a
17350          * multiple of this value to prevent any resource allocation
17351          * limitations.
17352          */
17353         uint8_t tqm_entries_multiple;
17354         /*
17355          * Initializer to be used by drivers
17356          * to initialize context memory to ensure
17357          * context subsystem flags an error for an attack
17358          * before the first time context load.
17359          */
17360         uint8_t ctx_kind_initializer;
17361         /*
17362          * Specifies which context kinds need to be initialized with the
17363          * ctx_kind_initializer.
17364          */
17365         uint16_t        ctx_init_mask;
17366         /*
17367          * If this bit is '1' then this context type should be initialized
17368          * with the ctx_kind_initializer at the specified offset.
17369          */
17370         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_QP \
17371                 UINT32_C(0x1)
17372         /*
17373          * If this bit is '1' then this context type should be initialized
17374          * with the ctx_kind_initializer at the specified offset.
17375          */
17376         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_SRQ \
17377                 UINT32_C(0x2)
17378         /*
17379          * If this bit is '1' then this context type should be initialized
17380          * with the ctx_kind_initializer at the specified offset.
17381          */
17382         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_CQ \
17383                 UINT32_C(0x4)
17384         /*
17385          * If this bit is '1' then this context type should be initialized
17386          * with the ctx_kind_initializer at the specified offset.
17387          */
17388         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_VNIC \
17389                 UINT32_C(0x8)
17390         /*
17391          * If this bit is '1' then this context type should be initialized
17392          * with the ctx_kind_initializer at the specified offset.
17393          */
17394         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_STAT \
17395                 UINT32_C(0x10)
17396         /*
17397          * If this bit is '1' then this context type should be initialized
17398          * with the ctx_kind_initializer at the specified offset.
17399          */
17400         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_MRAV \
17401                 UINT32_C(0x20)
17402         /*
17403          * If this bit is '1' then the Tx KTLS context type should be
17404          * initialized with the ctx_kind_initializer at the specified offset.
17405          */
17406         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_TKC \
17407                 UINT32_C(0x40)
17408         /*
17409          * If this bit is '1' then the Rx KTLS context type should be
17410          * initialized with the ctx_kind_initializer at the specified offset.
17411          */
17412         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_RKC \
17413                 UINT32_C(0x80)
17414         /*
17415          * Specifies the doubleword offset of ctx_kind_initializer for this
17416          * context type.
17417          */
17418         uint8_t qp_init_offset;
17419         /*
17420          * Specifies the doubleword offset of ctx_kind_initializer for this
17421          * context type.
17422          */
17423         uint8_t srq_init_offset;
17424         /*
17425          * Specifies the doubleword offset of ctx_kind_initializer for this
17426          * context type.
17427          */
17428         uint8_t cq_init_offset;
17429         /*
17430          * Specifies the doubleword offset of ctx_kind_initializer for this
17431          * context type.
17432          */
17433         uint8_t vnic_init_offset;
17434         /*
17435          * Count of TQM fastpath rings to be used for allocating backing store.
17436          * Backing store configuration must be specified for each TQM ring from
17437          * this count in `backing_store_cfg`.
17438          * Only first 8 TQM FP rings will be advertised with this field.
17439          */
17440         uint8_t tqm_fp_rings_count;
17441         /*
17442          * Specifies the doubleword offset of ctx_kind_initializer for this
17443          * context type.
17444          */
17445         uint8_t stat_init_offset;
17446         /*
17447          * Specifies the doubleword offset of ctx_kind_initializer for this
17448          * context type.
17449          */
17450         uint8_t mrav_init_offset;
17451         /*
17452          * Count of TQM extended fastpath rings to be used for allocating
17453          * backing store beyond 8 rings(rings 9,10,11)
17454          * Backing store configuration must be specified for each TQM ring from
17455          * this count in `backing_store_cfg`.
17456          */
17457         uint8_t tqm_fp_rings_count_ext;
17458         /*
17459          * Specifies the doubleword offset of ctx_kind_initializer for Tx
17460          * KTLS context type.
17461          */
17462         uint8_t tkc_init_offset;
17463         /*
17464          * Specifies the doubleword offset of ctx_kind_initializer for Rx
17465          * KTLS context type.
17466          */
17467         uint8_t rkc_init_offset;
17468         /* Tx KTLS context entry size in bytes. */
17469         uint16_t        tkc_entry_size;
17470         /* Rx KTLS context entry size in bytes. */
17471         uint16_t        rkc_entry_size;
17472         /*
17473          * Maximum number of Tx KTLS context entries supported for this
17474          * function.
17475          */
17476         uint32_t        tkc_max_entries;
17477         /*
17478          * Maximum number of Rx KTLS context entries supported for this
17479          * function.
17480          */
17481         uint32_t        rkc_max_entries;
17482         /* Reserved for future. */
17483         uint8_t rsvd1[7];
17484         /*
17485          * This field is used in Output records to indicate that the output
17486          * is completely written to RAM.  This field should be read as '1'
17487          * to indicate that the output has been completely written.
17488          * When writing a command completion or response to an internal processor,
17489          * the order of writes has to be such that this field is written last.
17490          */
17491         uint8_t valid;
17492 } __rte_packed;
17493
17494 /* tqm_fp_ring_cfg (size:128b/16B) */
17495 struct tqm_fp_ring_cfg {
17496         /* TQM ring page size and level. */
17497         uint8_t tqm_ring_pg_size_tqm_ring_lvl;
17498         /* TQM ring PBL indirect levels. */
17499         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_MASK \
17500                 UINT32_C(0xf)
17501         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_SFT       0
17502         /* PBL pointer is physical start address. */
17503         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_0 \
17504                 UINT32_C(0x0)
17505         /* PBL pointer points to PTE table. */
17506         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_1 \
17507                 UINT32_C(0x1)
17508         /*
17509          * PBL pointer points to PDE table with each entry pointing to
17510          * PTE tables.
17511          */
17512         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_2 \
17513                 UINT32_C(0x2)
17514         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LAST \
17515                 TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_2
17516         /* TQM ring page size. */
17517         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_MASK \
17518                 UINT32_C(0xf0)
17519         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_SFT   4
17520         /* 4KB. */
17521         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_4K \
17522                 (UINT32_C(0x0) << 4)
17523         /* 8KB. */
17524         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_8K \
17525                 (UINT32_C(0x1) << 4)
17526         /* 64KB. */
17527         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_64K \
17528                 (UINT32_C(0x2) << 4)
17529         /* 2MB. */
17530         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_2M \
17531                 (UINT32_C(0x3) << 4)
17532         /* 8MB. */
17533         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_8M \
17534                 (UINT32_C(0x4) << 4)
17535         /* 1GB. */
17536         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_1G \
17537                 (UINT32_C(0x5) << 4)
17538         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_LAST \
17539                 TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_1G
17540         uint8_t unused[3];
17541         /* Number of TQM ring entries. */
17542         uint32_t        tqm_ring_num_entries;
17543         /* TQM ring page directory. */
17544         uint64_t        tqm_ring_page_dir;
17545 } __rte_packed;
17546
17547 /*******************************
17548  * hwrm_func_backing_store_cfg *
17549  *******************************/
17550
17551
17552 /* hwrm_func_backing_store_cfg_input (size:2688b/336B) */
17553 struct hwrm_func_backing_store_cfg_input {
17554         /* The HWRM command request type. */
17555         uint16_t        req_type;
17556         /*
17557          * The completion ring to send the completion event on. This should
17558          * be the NQ ID returned from the `nq_alloc` HWRM command.
17559          */
17560         uint16_t        cmpl_ring;
17561         /*
17562          * The sequence ID is used by the driver for tracking multiple
17563          * commands. This ID is treated as opaque data by the firmware and
17564          * the value is returned in the `hwrm_resp_hdr` upon completion.
17565          */
17566         uint16_t        seq_id;
17567         /*
17568          * The target ID of the command:
17569          * * 0x0-0xFFF8 - The function ID
17570          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17571          * * 0xFFFD - Reserved for user-space HWRM interface
17572          * * 0xFFFF - HWRM
17573          */
17574         uint16_t        target_id;
17575         /*
17576          * A physical address pointer pointing to a host buffer that the
17577          * command's response data will be written. This can be either a host
17578          * physical address (HPA) or a guest physical address (GPA) and must
17579          * point to a physically contiguous block of memory.
17580          */
17581         uint64_t        resp_addr;
17582         uint32_t        flags;
17583         /*
17584          * When set, the firmware only uses on-chip resources and does not
17585          * expect any backing store to be provided by the host driver. This
17586          * mode provides minimal L2 functionality (e.g. limited L2 resources,
17587          * no RoCE).
17588          */
17589         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE \
17590                 UINT32_C(0x1)
17591         /*
17592          * When set, the 32b `mrav_num_entries` field is logically divided
17593          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
17594          */
17595         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_MRAV_RESERVATION_SPLIT \
17596                 UINT32_C(0x2)
17597         uint32_t        enables;
17598         /*
17599          * This bit must be '1' for the qp fields to be
17600          * configured.
17601          */
17602         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP \
17603                 UINT32_C(0x1)
17604         /*
17605          * This bit must be '1' for the srq fields to be
17606          * configured.
17607          */
17608         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ \
17609                 UINT32_C(0x2)
17610         /*
17611          * This bit must be '1' for the cq fields to be
17612          * configured.
17613          */
17614         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ \
17615                 UINT32_C(0x4)
17616         /*
17617          * This bit must be '1' for the vnic fields to be
17618          * configured.
17619          */
17620         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC \
17621                 UINT32_C(0x8)
17622         /*
17623          * This bit must be '1' for the stat fields to be
17624          * configured.
17625          */
17626         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT \
17627                 UINT32_C(0x10)
17628         /*
17629          * This bit must be '1' for the tqm_sp fields to be
17630          * configured.
17631          */
17632         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP \
17633                 UINT32_C(0x20)
17634         /*
17635          * This bit must be '1' for the tqm_ring0 fields to be
17636          * configured.
17637          */
17638         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0 \
17639                 UINT32_C(0x40)
17640         /*
17641          * This bit must be '1' for the tqm_ring1 fields to be
17642          * configured.
17643          */
17644         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1 \
17645                 UINT32_C(0x80)
17646         /*
17647          * This bit must be '1' for the tqm_ring2 fields to be
17648          * configured.
17649          */
17650         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2 \
17651                 UINT32_C(0x100)
17652         /*
17653          * This bit must be '1' for the tqm_ring3 fields to be
17654          * configured.
17655          */
17656         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3 \
17657                 UINT32_C(0x200)
17658         /*
17659          * This bit must be '1' for the tqm_ring4 fields to be
17660          * configured.
17661          */
17662         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4 \
17663                 UINT32_C(0x400)
17664         /*
17665          * This bit must be '1' for the tqm_ring5 fields to be
17666          * configured.
17667          */
17668         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5 \
17669                 UINT32_C(0x800)
17670         /*
17671          * This bit must be '1' for the tqm_ring6 fields to be
17672          * configured.
17673          */
17674         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6 \
17675                 UINT32_C(0x1000)
17676         /*
17677          * This bit must be '1' for the tqm_ring7 fields to be
17678          * configured.
17679          */
17680         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7 \
17681                 UINT32_C(0x2000)
17682         /*
17683          * This bit must be '1' for the mrav fields to be
17684          * configured.
17685          */
17686         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV \
17687                 UINT32_C(0x4000)
17688         /*
17689          * This bit must be '1' for the tim fields to be
17690          * configured.
17691          */
17692         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM \
17693                 UINT32_C(0x8000)
17694         /*
17695          * This bit must be '1' for the tqm_ring8 fields to be
17696          * configured.
17697          */
17698         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING8 \
17699                 UINT32_C(0x10000)
17700         /*
17701          * This bit must be '1' for the tqm_ring9 fields to be
17702          * configured.
17703          */
17704         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING9 \
17705                 UINT32_C(0x20000)
17706         /*
17707          * This bit must be '1' for the tqm_ring10 fields to be
17708          * configured.
17709          */
17710         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING10 \
17711                 UINT32_C(0x40000)
17712         /*
17713          * This bit must be '1' for the Tx KTLS context
17714          * fields to be configured.
17715          */
17716         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TKC \
17717                 UINT32_C(0x80000)
17718         /*
17719          * This bit must be '1' for the Rx KTLS context
17720          * fields to be configured.
17721          */
17722         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_RKC \
17723                 UINT32_C(0x100000)
17724         /* QPC page size and level. */
17725         uint8_t qpc_pg_size_qpc_lvl;
17726         /* QPC PBL indirect levels. */
17727         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK \
17728                 UINT32_C(0xf)
17729         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT       0
17730         /* PBL pointer is physical start address. */
17731         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0 \
17732                 UINT32_C(0x0)
17733         /* PBL pointer points to PTE table. */
17734         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1 \
17735                 UINT32_C(0x1)
17736         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
17737         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 \
17738                 UINT32_C(0x2)
17739         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST \
17740                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
17741         /* QPC page size. */
17742         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK \
17743                 UINT32_C(0xf0)
17744         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT   4
17745         /* 4KB. */
17746         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K \
17747                 (UINT32_C(0x0) << 4)
17748         /* 8KB. */
17749         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K \
17750                 (UINT32_C(0x1) << 4)
17751         /* 64KB. */
17752         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K \
17753                 (UINT32_C(0x2) << 4)
17754         /* 2MB. */
17755         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M \
17756                 (UINT32_C(0x3) << 4)
17757         /* 8MB. */
17758         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M \
17759                 (UINT32_C(0x4) << 4)
17760         /* 1GB. */
17761         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G \
17762                 (UINT32_C(0x5) << 4)
17763         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST \
17764                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
17765         /* SRQ page size and level. */
17766         uint8_t srq_pg_size_srq_lvl;
17767         /* SRQ PBL indirect levels. */
17768         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK \
17769                 UINT32_C(0xf)
17770         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT       0
17771         /* PBL pointer is physical start address. */
17772         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0 \
17773                 UINT32_C(0x0)
17774         /* PBL pointer points to PTE table. */
17775         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1 \
17776                 UINT32_C(0x1)
17777         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
17778         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 \
17779                 UINT32_C(0x2)
17780         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST \
17781                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
17782         /* SRQ page size. */
17783         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK \
17784                 UINT32_C(0xf0)
17785         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT   4
17786         /* 4KB. */
17787         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K \
17788                 (UINT32_C(0x0) << 4)
17789         /* 8KB. */
17790         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K \
17791                 (UINT32_C(0x1) << 4)
17792         /* 64KB. */
17793         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K \
17794                 (UINT32_C(0x2) << 4)
17795         /* 2MB. */
17796         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M \
17797                 (UINT32_C(0x3) << 4)
17798         /* 8MB. */
17799         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M \
17800                 (UINT32_C(0x4) << 4)
17801         /* 1GB. */
17802         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G \
17803                 (UINT32_C(0x5) << 4)
17804         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST \
17805                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
17806         /* CQ page size and level. */
17807         uint8_t cq_pg_size_cq_lvl;
17808         /* CQ PBL indirect levels. */
17809         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK \
17810                 UINT32_C(0xf)
17811         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT       0
17812         /* PBL pointer is physical start address. */
17813         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0 \
17814                 UINT32_C(0x0)
17815         /* PBL pointer points to PTE table. */
17816         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1 \
17817                 UINT32_C(0x1)
17818         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
17819         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 \
17820                 UINT32_C(0x2)
17821         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST \
17822                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
17823         /* CQ page size. */
17824         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK \
17825                 UINT32_C(0xf0)
17826         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT   4
17827         /* 4KB. */
17828         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K \
17829                 (UINT32_C(0x0) << 4)
17830         /* 8KB. */
17831         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K \
17832                 (UINT32_C(0x1) << 4)
17833         /* 64KB. */
17834         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K \
17835                 (UINT32_C(0x2) << 4)
17836         /* 2MB. */
17837         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M \
17838                 (UINT32_C(0x3) << 4)
17839         /* 8MB. */
17840         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M \
17841                 (UINT32_C(0x4) << 4)
17842         /* 1GB. */
17843         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G \
17844                 (UINT32_C(0x5) << 4)
17845         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST \
17846                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
17847         /* VNIC page size and level. */
17848         uint8_t vnic_pg_size_vnic_lvl;
17849         /* VNIC PBL indirect levels. */
17850         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK \
17851                 UINT32_C(0xf)
17852         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT       0
17853         /* PBL pointer is physical start address. */
17854         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0 \
17855                 UINT32_C(0x0)
17856         /* PBL pointer points to PTE table. */
17857         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1 \
17858                 UINT32_C(0x1)
17859         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
17860         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 \
17861                 UINT32_C(0x2)
17862         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST \
17863                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
17864         /* VNIC page size. */
17865         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK \
17866                 UINT32_C(0xf0)
17867         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT   4
17868         /* 4KB. */
17869         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K \
17870                 (UINT32_C(0x0) << 4)
17871         /* 8KB. */
17872         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K \
17873                 (UINT32_C(0x1) << 4)
17874         /* 64KB. */
17875         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K \
17876                 (UINT32_C(0x2) << 4)
17877         /* 2MB. */
17878         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M \
17879                 (UINT32_C(0x3) << 4)
17880         /* 8MB. */
17881         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M \
17882                 (UINT32_C(0x4) << 4)
17883         /* 1GB. */
17884         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G \
17885                 (UINT32_C(0x5) << 4)
17886         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST \
17887                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
17888         /* Stat page size and level. */
17889         uint8_t stat_pg_size_stat_lvl;
17890         /* Stat PBL indirect levels. */
17891         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK \
17892                 UINT32_C(0xf)
17893         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT       0
17894         /* PBL pointer is physical start address. */
17895         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0 \
17896                 UINT32_C(0x0)
17897         /* PBL pointer points to PTE table. */
17898         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1 \
17899                 UINT32_C(0x1)
17900         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
17901         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 \
17902                 UINT32_C(0x2)
17903         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST \
17904                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
17905         /* Stat page size. */
17906         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK \
17907                 UINT32_C(0xf0)
17908         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT   4
17909         /* 4KB. */
17910         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K \
17911                 (UINT32_C(0x0) << 4)
17912         /* 8KB. */
17913         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K \
17914                 (UINT32_C(0x1) << 4)
17915         /* 64KB. */
17916         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K \
17917                 (UINT32_C(0x2) << 4)
17918         /* 2MB. */
17919         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M \
17920                 (UINT32_C(0x3) << 4)
17921         /* 8MB. */
17922         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M \
17923                 (UINT32_C(0x4) << 4)
17924         /* 1GB. */
17925         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G \
17926                 (UINT32_C(0x5) << 4)
17927         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST \
17928                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
17929         /* TQM slow path page size and level. */
17930         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
17931         /* TQM slow path PBL indirect levels. */
17932         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK \
17933                 UINT32_C(0xf)
17934         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT       0
17935         /* PBL pointer is physical start address. */
17936         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0 \
17937                 UINT32_C(0x0)
17938         /* PBL pointer points to PTE table. */
17939         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1 \
17940                 UINT32_C(0x1)
17941         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
17942         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 \
17943                 UINT32_C(0x2)
17944         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST \
17945                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
17946         /* TQM slow path page size. */
17947         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK \
17948                 UINT32_C(0xf0)
17949         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT   4
17950         /* 4KB. */
17951         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K \
17952                 (UINT32_C(0x0) << 4)
17953         /* 8KB. */
17954         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K \
17955                 (UINT32_C(0x1) << 4)
17956         /* 64KB. */
17957         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K \
17958                 (UINT32_C(0x2) << 4)
17959         /* 2MB. */
17960         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M \
17961                 (UINT32_C(0x3) << 4)
17962         /* 8MB. */
17963         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M \
17964                 (UINT32_C(0x4) << 4)
17965         /* 1GB. */
17966         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G \
17967                 (UINT32_C(0x5) << 4)
17968         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST \
17969                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
17970         /* TQM ring 0 page size and level. */
17971         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
17972         /* TQM ring 0 PBL indirect levels. */
17973         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK \
17974                 UINT32_C(0xf)
17975         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT       0
17976         /* PBL pointer is physical start address. */
17977         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0 \
17978                 UINT32_C(0x0)
17979         /* PBL pointer points to PTE table. */
17980         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1 \
17981                 UINT32_C(0x1)
17982         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
17983         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 \
17984                 UINT32_C(0x2)
17985         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST \
17986                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
17987         /* TQM ring 0 page size. */
17988         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK \
17989                 UINT32_C(0xf0)
17990         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT   4
17991         /* 4KB. */
17992         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K \
17993                 (UINT32_C(0x0) << 4)
17994         /* 8KB. */
17995         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K \
17996                 (UINT32_C(0x1) << 4)
17997         /* 64KB. */
17998         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K \
17999                 (UINT32_C(0x2) << 4)
18000         /* 2MB. */
18001         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M \
18002                 (UINT32_C(0x3) << 4)
18003         /* 8MB. */
18004         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M \
18005                 (UINT32_C(0x4) << 4)
18006         /* 1GB. */
18007         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G \
18008                 (UINT32_C(0x5) << 4)
18009         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST \
18010                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
18011         /* TQM ring 1 page size and level. */
18012         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
18013         /* TQM ring 1 PBL indirect levels. */
18014         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK \
18015                 UINT32_C(0xf)
18016         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT       0
18017         /* PBL pointer is physical start address. */
18018         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0 \
18019                 UINT32_C(0x0)
18020         /* PBL pointer points to PTE table. */
18021         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1 \
18022                 UINT32_C(0x1)
18023         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18024         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 \
18025                 UINT32_C(0x2)
18026         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST \
18027                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
18028         /* TQM ring 1 page size. */
18029         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK \
18030                 UINT32_C(0xf0)
18031         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT   4
18032         /* 4KB. */
18033         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K \
18034                 (UINT32_C(0x0) << 4)
18035         /* 8KB. */
18036         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K \
18037                 (UINT32_C(0x1) << 4)
18038         /* 64KB. */
18039         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K \
18040                 (UINT32_C(0x2) << 4)
18041         /* 2MB. */
18042         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M \
18043                 (UINT32_C(0x3) << 4)
18044         /* 8MB. */
18045         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M \
18046                 (UINT32_C(0x4) << 4)
18047         /* 1GB. */
18048         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G \
18049                 (UINT32_C(0x5) << 4)
18050         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST \
18051                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
18052         /* TQM ring 2 page size and level. */
18053         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
18054         /* TQM ring 2 PBL indirect levels. */
18055         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK \
18056                 UINT32_C(0xf)
18057         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT       0
18058         /* PBL pointer is physical start address. */
18059         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0 \
18060                 UINT32_C(0x0)
18061         /* PBL pointer points to PTE table. */
18062         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1 \
18063                 UINT32_C(0x1)
18064         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18065         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 \
18066                 UINT32_C(0x2)
18067         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST \
18068                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
18069         /* TQM ring 2 page size. */
18070         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK \
18071                 UINT32_C(0xf0)
18072         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT   4
18073         /* 4KB. */
18074         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K \
18075                 (UINT32_C(0x0) << 4)
18076         /* 8KB. */
18077         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K \
18078                 (UINT32_C(0x1) << 4)
18079         /* 64KB. */
18080         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K \
18081                 (UINT32_C(0x2) << 4)
18082         /* 2MB. */
18083         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M \
18084                 (UINT32_C(0x3) << 4)
18085         /* 8MB. */
18086         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M \
18087                 (UINT32_C(0x4) << 4)
18088         /* 1GB. */
18089         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G \
18090                 (UINT32_C(0x5) << 4)
18091         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST \
18092                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
18093         /* TQM ring 3 page size and level. */
18094         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
18095         /* TQM ring 3 PBL indirect levels. */
18096         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK \
18097                 UINT32_C(0xf)
18098         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT       0
18099         /* PBL pointer is physical start address. */
18100         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0 \
18101                 UINT32_C(0x0)
18102         /* PBL pointer points to PTE table. */
18103         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1 \
18104                 UINT32_C(0x1)
18105         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18106         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 \
18107                 UINT32_C(0x2)
18108         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST \
18109                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
18110         /* TQM ring 3 page size. */
18111         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK \
18112                 UINT32_C(0xf0)
18113         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT   4
18114         /* 4KB. */
18115         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K \
18116                 (UINT32_C(0x0) << 4)
18117         /* 8KB. */
18118         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K \
18119                 (UINT32_C(0x1) << 4)
18120         /* 64KB. */
18121         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K \
18122                 (UINT32_C(0x2) << 4)
18123         /* 2MB. */
18124         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M \
18125                 (UINT32_C(0x3) << 4)
18126         /* 8MB. */
18127         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M \
18128                 (UINT32_C(0x4) << 4)
18129         /* 1GB. */
18130         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G \
18131                 (UINT32_C(0x5) << 4)
18132         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST \
18133                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
18134         /* TQM ring 4 page size and level. */
18135         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
18136         /* TQM ring 4 PBL indirect levels. */
18137         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK \
18138                 UINT32_C(0xf)
18139         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT       0
18140         /* PBL pointer is physical start address. */
18141         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0 \
18142                 UINT32_C(0x0)
18143         /* PBL pointer points to PTE table. */
18144         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1 \
18145                 UINT32_C(0x1)
18146         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18147         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 \
18148                 UINT32_C(0x2)
18149         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST \
18150                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
18151         /* TQM ring 4 page size. */
18152         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK \
18153                 UINT32_C(0xf0)
18154         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT   4
18155         /* 4KB. */
18156         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K \
18157                 (UINT32_C(0x0) << 4)
18158         /* 8KB. */
18159         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K \
18160                 (UINT32_C(0x1) << 4)
18161         /* 64KB. */
18162         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K \
18163                 (UINT32_C(0x2) << 4)
18164         /* 2MB. */
18165         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M \
18166                 (UINT32_C(0x3) << 4)
18167         /* 8MB. */
18168         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M \
18169                 (UINT32_C(0x4) << 4)
18170         /* 1GB. */
18171         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G \
18172                 (UINT32_C(0x5) << 4)
18173         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST \
18174                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
18175         /* TQM ring 5 page size and level. */
18176         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
18177         /* TQM ring 5 PBL indirect levels. */
18178         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK \
18179                 UINT32_C(0xf)
18180         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT       0
18181         /* PBL pointer is physical start address. */
18182         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0 \
18183                 UINT32_C(0x0)
18184         /* PBL pointer points to PTE table. */
18185         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1 \
18186                 UINT32_C(0x1)
18187         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18188         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 \
18189                 UINT32_C(0x2)
18190         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST \
18191                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
18192         /* TQM ring 5 page size. */
18193         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK \
18194                 UINT32_C(0xf0)
18195         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT   4
18196         /* 4KB. */
18197         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K \
18198                 (UINT32_C(0x0) << 4)
18199         /* 8KB. */
18200         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K \
18201                 (UINT32_C(0x1) << 4)
18202         /* 64KB. */
18203         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K \
18204                 (UINT32_C(0x2) << 4)
18205         /* 2MB. */
18206         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M \
18207                 (UINT32_C(0x3) << 4)
18208         /* 8MB. */
18209         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M \
18210                 (UINT32_C(0x4) << 4)
18211         /* 1GB. */
18212         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G \
18213                 (UINT32_C(0x5) << 4)
18214         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST \
18215                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
18216         /* TQM ring 6 page size and level. */
18217         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
18218         /* TQM ring 6 PBL indirect levels. */
18219         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK \
18220                 UINT32_C(0xf)
18221         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT       0
18222         /* PBL pointer is physical start address. */
18223         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0 \
18224                 UINT32_C(0x0)
18225         /* PBL pointer points to PTE table. */
18226         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1 \
18227                 UINT32_C(0x1)
18228         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18229         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 \
18230                 UINT32_C(0x2)
18231         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST \
18232                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
18233         /* TQM ring 6 page size. */
18234         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK \
18235                 UINT32_C(0xf0)
18236         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT   4
18237         /* 4KB. */
18238         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K \
18239                 (UINT32_C(0x0) << 4)
18240         /* 8KB. */
18241         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K \
18242                 (UINT32_C(0x1) << 4)
18243         /* 64KB. */
18244         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K \
18245                 (UINT32_C(0x2) << 4)
18246         /* 2MB. */
18247         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M \
18248                 (UINT32_C(0x3) << 4)
18249         /* 8MB. */
18250         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M \
18251                 (UINT32_C(0x4) << 4)
18252         /* 1GB. */
18253         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G \
18254                 (UINT32_C(0x5) << 4)
18255         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST \
18256                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
18257         /* TQM ring 7 page size and level. */
18258         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
18259         /* TQM ring 7 PBL indirect levels. */
18260         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK \
18261                 UINT32_C(0xf)
18262         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT       0
18263         /* PBL pointer is physical start address. */
18264         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0 \
18265                 UINT32_C(0x0)
18266         /* PBL pointer points to PTE table. */
18267         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1 \
18268                 UINT32_C(0x1)
18269         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18270         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 \
18271                 UINT32_C(0x2)
18272         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST \
18273                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
18274         /* TQM ring 7 page size. */
18275         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK \
18276                 UINT32_C(0xf0)
18277         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT   4
18278         /* 4KB. */
18279         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K \
18280                 (UINT32_C(0x0) << 4)
18281         /* 8KB. */
18282         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K \
18283                 (UINT32_C(0x1) << 4)
18284         /* 64KB. */
18285         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K \
18286                 (UINT32_C(0x2) << 4)
18287         /* 2MB. */
18288         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M \
18289                 (UINT32_C(0x3) << 4)
18290         /* 8MB. */
18291         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M \
18292                 (UINT32_C(0x4) << 4)
18293         /* 1GB. */
18294         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G \
18295                 (UINT32_C(0x5) << 4)
18296         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST \
18297                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
18298         /* MR/AV page size and level. */
18299         uint8_t mrav_pg_size_mrav_lvl;
18300         /* MR/AV PBL indirect levels. */
18301         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK \
18302                 UINT32_C(0xf)
18303         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT       0
18304         /* PBL pointer is physical start address. */
18305         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0 \
18306                 UINT32_C(0x0)
18307         /* PBL pointer points to PTE table. */
18308         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1 \
18309                 UINT32_C(0x1)
18310         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18311         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 \
18312                 UINT32_C(0x2)
18313         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST \
18314                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
18315         /* MR/AV page size. */
18316         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK \
18317                 UINT32_C(0xf0)
18318         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT   4
18319         /* 4KB. */
18320         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K \
18321                 (UINT32_C(0x0) << 4)
18322         /* 8KB. */
18323         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K \
18324                 (UINT32_C(0x1) << 4)
18325         /* 64KB. */
18326         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K \
18327                 (UINT32_C(0x2) << 4)
18328         /* 2MB. */
18329         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M \
18330                 (UINT32_C(0x3) << 4)
18331         /* 8MB. */
18332         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M \
18333                 (UINT32_C(0x4) << 4)
18334         /* 1GB. */
18335         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G \
18336                 (UINT32_C(0x5) << 4)
18337         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST \
18338                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
18339         /* Timer page size and level. */
18340         uint8_t tim_pg_size_tim_lvl;
18341         /* Timer PBL indirect levels. */
18342         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK \
18343                 UINT32_C(0xf)
18344         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT       0
18345         /* PBL pointer is physical start address. */
18346         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0 \
18347                 UINT32_C(0x0)
18348         /* PBL pointer points to PTE table. */
18349         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1 \
18350                 UINT32_C(0x1)
18351         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18352         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 \
18353                 UINT32_C(0x2)
18354         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST \
18355                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
18356         /* Timer page size. */
18357         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK \
18358                 UINT32_C(0xf0)
18359         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT   4
18360         /* 4KB. */
18361         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K \
18362                 (UINT32_C(0x0) << 4)
18363         /* 8KB. */
18364         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K \
18365                 (UINT32_C(0x1) << 4)
18366         /* 64KB. */
18367         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K \
18368                 (UINT32_C(0x2) << 4)
18369         /* 2MB. */
18370         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M \
18371                 (UINT32_C(0x3) << 4)
18372         /* 8MB. */
18373         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M \
18374                 (UINT32_C(0x4) << 4)
18375         /* 1GB. */
18376         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G \
18377                 (UINT32_C(0x5) << 4)
18378         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST \
18379                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
18380         /* QP page directory. */
18381         uint64_t        qpc_page_dir;
18382         /* SRQ page directory. */
18383         uint64_t        srq_page_dir;
18384         /* CQ page directory. */
18385         uint64_t        cq_page_dir;
18386         /* VNIC page directory. */
18387         uint64_t        vnic_page_dir;
18388         /* Stat page directory. */
18389         uint64_t        stat_page_dir;
18390         /* TQM slowpath page directory. */
18391         uint64_t        tqm_sp_page_dir;
18392         /* TQM ring 0 page directory. */
18393         uint64_t        tqm_ring0_page_dir;
18394         /* TQM ring 1 page directory. */
18395         uint64_t        tqm_ring1_page_dir;
18396         /* TQM ring 2 page directory. */
18397         uint64_t        tqm_ring2_page_dir;
18398         /* TQM ring 3 page directory. */
18399         uint64_t        tqm_ring3_page_dir;
18400         /* TQM ring 4 page directory. */
18401         uint64_t        tqm_ring4_page_dir;
18402         /* TQM ring 5 page directory. */
18403         uint64_t        tqm_ring5_page_dir;
18404         /* TQM ring 6 page directory. */
18405         uint64_t        tqm_ring6_page_dir;
18406         /* TQM ring 7 page directory. */
18407         uint64_t        tqm_ring7_page_dir;
18408         /* MR/AV page directory. */
18409         uint64_t        mrav_page_dir;
18410         /* Timer page directory. */
18411         uint64_t        tim_page_dir;
18412         /* Number of QPs. */
18413         uint32_t        qp_num_entries;
18414         /* Number of SRQs. */
18415         uint32_t        srq_num_entries;
18416         /* Number of CQs. */
18417         uint32_t        cq_num_entries;
18418         /* Number of Stats. */
18419         uint32_t        stat_num_entries;
18420         /*
18421          * Number of TQM slowpath entries.
18422          *
18423          * TQM slowpath rings should be sized as follows:
18424          *
18425          * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
18426          *
18427          * Where:
18428          *   num_vnics is the number of VNICs allocated in the VNIC backing store
18429          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
18430          *   num_roce_qps is the number of RoCE QPs in the QP backing store
18431          *   tqm_min_size is tqm_min_entries_per_ring reported by
18432          *     HWRM_FUNC_BACKING_STORE_QCAPS
18433          *
18434          * Note that TQM ring sizes cannot be extended while the system is
18435          * operational. If a PF driver needs to extend a TQM ring, it needs
18436          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18437          * the backing store.
18438          */
18439         uint32_t        tqm_sp_num_entries;
18440         /*
18441          * Number of TQM ring 0 entries.
18442          *
18443          * TQM fastpath rings should be sized large enough to accommodate the
18444          * maximum number of QPs (either L2 or RoCE, or both if shared)
18445          * that can be enqueued to the TQM ring.
18446          *
18447          * Note that TQM ring sizes cannot be extended while the system is
18448          * operational. If a PF driver needs to extend a TQM ring, it needs
18449          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18450          * the backing store.
18451          */
18452         uint32_t        tqm_ring0_num_entries;
18453         /*
18454          * Number of TQM ring 1 entries.
18455          *
18456          * TQM fastpath rings should be sized large enough to accommodate the
18457          * maximum number of QPs (either L2 or RoCE, or both if shared)
18458          * that can be enqueued to the TQM ring.
18459          *
18460          * Note that TQM ring sizes cannot be extended while the system is
18461          * operational. If a PF driver needs to extend a TQM ring, it needs
18462          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18463          * the backing store.
18464          */
18465         uint32_t        tqm_ring1_num_entries;
18466         /*
18467          * Number of TQM ring 2 entries.
18468          *
18469          * TQM fastpath rings should be sized large enough to accommodate the
18470          * maximum number of QPs (either L2 or RoCE, or both if shared)
18471          * that can be enqueued to the TQM ring.
18472          *
18473          * Note that TQM ring sizes cannot be extended while the system is
18474          * operational. If a PF driver needs to extend a TQM ring, it needs
18475          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18476          * the backing store.
18477          */
18478         uint32_t        tqm_ring2_num_entries;
18479         /*
18480          * Number of TQM ring 3 entries.
18481          *
18482          * TQM fastpath rings should be sized large enough to accommodate the
18483          * maximum number of QPs (either L2 or RoCE, or both if shared)
18484          * that can be enqueued to the TQM ring.
18485          *
18486          * Note that TQM ring sizes cannot be extended while the system is
18487          * operational. If a PF driver needs to extend a TQM ring, it needs
18488          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18489          * the backing store.
18490          */
18491         uint32_t        tqm_ring3_num_entries;
18492         /*
18493          * Number of TQM ring 4 entries.
18494          *
18495          * TQM fastpath rings should be sized large enough to accommodate the
18496          * maximum number of QPs (either L2 or RoCE, or both if shared)
18497          * that can be enqueued to the TQM ring.
18498          *
18499          * Note that TQM ring sizes cannot be extended while the system is
18500          * operational. If a PF driver needs to extend a TQM ring, it needs
18501          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18502          * the backing store.
18503          */
18504         uint32_t        tqm_ring4_num_entries;
18505         /*
18506          * Number of TQM ring 5 entries.
18507          *
18508          * TQM fastpath rings should be sized large enough to accommodate the
18509          * maximum number of QPs (either L2 or RoCE, or both if shared)
18510          * that can be enqueued to the TQM ring.
18511          *
18512          * Note that TQM ring sizes cannot be extended while the system is
18513          * operational. If a PF driver needs to extend a TQM ring, it needs
18514          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18515          * the backing store.
18516          */
18517         uint32_t        tqm_ring5_num_entries;
18518         /*
18519          * Number of TQM ring 6 entries.
18520          *
18521          * TQM fastpath rings should be sized large enough to accommodate the
18522          * maximum number of QPs (either L2 or RoCE, or both if shared)
18523          * that can be enqueued to the TQM ring.
18524          *
18525          * Note that TQM ring sizes cannot be extended while the system is
18526          * operational. If a PF driver needs to extend a TQM ring, it needs
18527          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18528          * the backing store.
18529          */
18530         uint32_t        tqm_ring6_num_entries;
18531         /*
18532          * Number of TQM ring 7 entries.
18533          *
18534          * TQM fastpath rings should be sized large enough to accommodate the
18535          * maximum number of QPs (either L2 or RoCE, or both if shared)
18536          * that can be enqueued to the TQM ring.
18537          *
18538          * Note that TQM ring sizes cannot be extended while the system is
18539          * operational. If a PF driver needs to extend a TQM ring, it needs
18540          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
18541          * the backing store.
18542          */
18543         uint32_t        tqm_ring7_num_entries;
18544         /*
18545          * If the MR/AV split reservation flag is not set, then this field
18546          * represents the total number of MR plus AV entries. For versions
18547          * of firmware that support the split reservation, when it is not
18548          * specified half of the entries will be reserved for MRs and the
18549          * other half for AVs.
18550          *
18551          * If the MR/AV split reservation flag is set, then this
18552          * field is logically divided into two 16b fields. Bits `[31:16]`
18553          * represents the `mr_num_entries` and bits `[15:0]` represents
18554          * `av_num_entries`. The granularity of these values is defined by
18555          * the `mrav_num_entries_unit` field returned by the
18556          * `backing_store_qcaps` command.
18557          */
18558         uint32_t        mrav_num_entries;
18559         /* Number of Timer entries. */
18560         uint32_t        tim_num_entries;
18561         /* Number of entries to reserve for QP1 */
18562         uint16_t        qp_num_qp1_entries;
18563         /* Number of entries to reserve for L2 */
18564         uint16_t        qp_num_l2_entries;
18565         /* Number of bytes that have been allocated for each context entry. */
18566         uint16_t        qp_entry_size;
18567         /* Number of entries to reserve for L2 */
18568         uint16_t        srq_num_l2_entries;
18569         /* Number of bytes that have been allocated for each context entry. */
18570         uint16_t        srq_entry_size;
18571         /* Number of entries to reserve for L2 */
18572         uint16_t        cq_num_l2_entries;
18573         /* Number of bytes that have been allocated for each context entry. */
18574         uint16_t        cq_entry_size;
18575         /* Number of entries to reserve for VNIC entries */
18576         uint16_t        vnic_num_vnic_entries;
18577         /* Number of entries to reserve for Ring table entries */
18578         uint16_t        vnic_num_ring_table_entries;
18579         /* Number of bytes that have been allocated for each context entry. */
18580         uint16_t        vnic_entry_size;
18581         /* Number of bytes that have been allocated for each context entry. */
18582         uint16_t        stat_entry_size;
18583         /* Number of bytes that have been allocated for each context entry. */
18584         uint16_t        tqm_entry_size;
18585         /* Number of bytes that have been allocated for each context entry. */
18586         uint16_t        mrav_entry_size;
18587         /* Number of bytes that have been allocated for each context entry. */
18588         uint16_t        tim_entry_size;
18589         /* TQM ring page size and level. */
18590         uint8_t tqm_ring8_pg_size_tqm_ring_lvl;
18591         /* TQM ring PBL indirect levels. */
18592         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_MASK \
18593                 UINT32_C(0xf)
18594         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_SFT \
18595                 0
18596         /* PBL pointer is physical start address. */
18597         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_0 \
18598                 UINT32_C(0x0)
18599         /* PBL pointer points to PTE table. */
18600         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_1 \
18601                 UINT32_C(0x1)
18602         /*
18603          * PBL pointer points to PDE table with each entry pointing to
18604          * PTE tables.
18605          */
18606         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_2 \
18607                 UINT32_C(0x2)
18608         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LAST \
18609                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_2
18610         /* TQM ring page size. */
18611         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_MASK \
18612                 UINT32_C(0xf0)
18613         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_SFT \
18614                 4
18615         /* 4KB. */
18616         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_4K \
18617                 (UINT32_C(0x0) << 4)
18618         /* 8KB. */
18619         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_8K \
18620                 (UINT32_C(0x1) << 4)
18621         /* 64KB. */
18622         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_64K \
18623                 (UINT32_C(0x2) << 4)
18624         /* 2MB. */
18625         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_2M \
18626                 (UINT32_C(0x3) << 4)
18627         /* 8MB. */
18628         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_8M \
18629                 (UINT32_C(0x4) << 4)
18630         /* 1GB. */
18631         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_1G \
18632                 (UINT32_C(0x5) << 4)
18633         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_LAST \
18634                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_1G
18635         uint8_t ring8_unused[3];
18636         /* Number of TQM ring entries. */
18637         uint32_t        tqm_ring8_num_entries;
18638         /* TQM ring page directory. */
18639         uint64_t        tqm_ring8_page_dir;
18640         /* TQM ring page size and level. */
18641         uint8_t tqm_ring9_pg_size_tqm_ring_lvl;
18642         /* TQM ring PBL indirect levels. */
18643         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_MASK \
18644                 UINT32_C(0xf)
18645         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_SFT \
18646                 0
18647         /* PBL pointer is physical start address. */
18648         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_0 \
18649                 UINT32_C(0x0)
18650         /* PBL pointer points to PTE table. */
18651         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_1 \
18652                 UINT32_C(0x1)
18653         /*
18654          * PBL pointer points to PDE table with each entry pointing to
18655          * PTE tables.
18656          */
18657         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_2 \
18658                 UINT32_C(0x2)
18659         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LAST \
18660                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_2
18661         /* TQM ring page size. */
18662         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_MASK \
18663                 UINT32_C(0xf0)
18664         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_SFT \
18665                 4
18666         /* 4KB. */
18667         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_4K \
18668                 (UINT32_C(0x0) << 4)
18669         /* 8KB. */
18670         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_8K \
18671                 (UINT32_C(0x1) << 4)
18672         /* 64KB. */
18673         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_64K \
18674                 (UINT32_C(0x2) << 4)
18675         /* 2MB. */
18676         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_2M \
18677                 (UINT32_C(0x3) << 4)
18678         /* 8MB. */
18679         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_8M \
18680                 (UINT32_C(0x4) << 4)
18681         /* 1GB. */
18682         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_1G \
18683                 (UINT32_C(0x5) << 4)
18684         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_LAST \
18685                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_1G
18686         uint8_t ring9_unused[3];
18687         /* Number of TQM ring entries. */
18688         uint32_t        tqm_ring9_num_entries;
18689         /* TQM ring page directory. */
18690         uint64_t        tqm_ring9_page_dir;
18691         /* TQM ring page size and level. */
18692         uint8_t tqm_ring10_pg_size_tqm_ring_lvl;
18693         /* TQM ring PBL indirect levels. */
18694         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_MASK \
18695                 UINT32_C(0xf)
18696         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_SFT \
18697                 0
18698         /* PBL pointer is physical start address. */
18699         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_0 \
18700                 UINT32_C(0x0)
18701         /* PBL pointer points to PTE table. */
18702         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_1 \
18703                 UINT32_C(0x1)
18704         /*
18705          * PBL pointer points to PDE table with each entry pointing to
18706          * PTE tables.
18707          */
18708         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_2 \
18709                 UINT32_C(0x2)
18710         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LAST \
18711                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_2
18712         /* TQM ring page size. */
18713         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_MASK \
18714                 UINT32_C(0xf0)
18715         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_SFT \
18716                 4
18717         /* 4KB. */
18718         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_4K \
18719                 (UINT32_C(0x0) << 4)
18720         /* 8KB. */
18721         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_8K \
18722                 (UINT32_C(0x1) << 4)
18723         /* 64KB. */
18724         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_64K \
18725                 (UINT32_C(0x2) << 4)
18726         /* 2MB. */
18727         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_2M \
18728                 (UINT32_C(0x3) << 4)
18729         /* 8MB. */
18730         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_8M \
18731                 (UINT32_C(0x4) << 4)
18732         /* 1GB. */
18733         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_1G \
18734                 (UINT32_C(0x5) << 4)
18735         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_LAST \
18736                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_1G
18737         uint8_t ring10_unused[3];
18738         /* Number of TQM ring entries. */
18739         uint32_t        tqm_ring10_num_entries;
18740         /* TQM ring page directory. */
18741         uint64_t        tqm_ring10_page_dir;
18742         /* Number of Tx KTLS context entries allocated. */
18743         uint32_t        tkc_num_entries;
18744         /* Number of Rx KTLS context entries allocated. */
18745         uint32_t        rkc_num_entries;
18746         /* Tx KTLS context page directory. */
18747         uint64_t        tkc_page_dir;
18748         /* Rx KTLS context page directory. */
18749         uint64_t        rkc_page_dir;
18750         /* Number of bytes allocated for each Tx KTLS context entry. */
18751         uint16_t        tkc_entry_size;
18752         /* Number of bytes allocated for each Rx KTLS context entry. */
18753         uint16_t        rkc_entry_size;
18754         /* Tx KTLS context page size and level. */
18755         uint8_t tkc_pg_size_tkc_lvl;
18756         /* Tx KTLS context PBL indirect levels. */
18757         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_MASK \
18758                 UINT32_C(0xf)
18759         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_SFT       0
18760         /* PBL pointer is physical start address. */
18761         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_0 \
18762                 UINT32_C(0x0)
18763         /* PBL pointer points to PTE table. */
18764         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_1 \
18765                 UINT32_C(0x1)
18766         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
18767         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_2 \
18768                 UINT32_C(0x2)
18769         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LAST \
18770                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_LVL_LVL_2
18771         /* Tx KTLS context page size. */
18772         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_MASK \
18773                 UINT32_C(0xf0)
18774         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_SFT   4
18775         /* 4KB. */
18776         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_4K \
18777                 (UINT32_C(0x0) << 4)
18778         /* 8KB. */
18779         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_8K \
18780                 (UINT32_C(0x1) << 4)
18781         /* 64KB. */
18782         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_64K \
18783                 (UINT32_C(0x2) << 4)
18784         /* 2MB. */
18785         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_2M \
18786                 (UINT32_C(0x3) << 4)
18787         /* 8MB. */
18788         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_8M \
18789                 (UINT32_C(0x4) << 4)
18790         /* 1GB. */
18791         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_1G \
18792                 (UINT32_C(0x5) << 4)
18793         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_LAST \
18794                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TKC_PG_SIZE_PG_1G
18795         /* Rx KTLS context page size and level. */
18796         uint8_t rkc_pg_size_rkc_lvl;
18797         /* Rx KTLS context PBL indirect levels. */
18798         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_MASK \
18799                 UINT32_C(0xf)
18800         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_SFT       0
18801         /* PBL pointer is physical start address. */
18802         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_0 \
18803                 UINT32_C(0x0)
18804         /* PBL pointer points to PTE table. */
18805         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_1 \
18806                 UINT32_C(0x1)
18807         /*
18808          * PBL pointer points to PDE table with each entry pointing to
18809          * PTE tables.
18810          */
18811         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_2 \
18812                 UINT32_C(0x2)
18813         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LAST \
18814                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_LVL_LVL_2
18815         /* Rx KTLS context page size. */
18816         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_MASK \
18817                 UINT32_C(0xf0)
18818         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_SFT   4
18819         /* 4KB. */
18820         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_4K \
18821                 (UINT32_C(0x0) << 4)
18822         /* 8KB. */
18823         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_8K \
18824                 (UINT32_C(0x1) << 4)
18825         /* 64KB. */
18826         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_64K \
18827                 (UINT32_C(0x2) << 4)
18828         /* 2MB. */
18829         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_2M \
18830                 (UINT32_C(0x3) << 4)
18831         /* 8MB. */
18832         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_8M \
18833                 (UINT32_C(0x4) << 4)
18834         /* 1GB. */
18835         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_1G \
18836                 (UINT32_C(0x5) << 4)
18837         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_LAST \
18838                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RKC_PG_SIZE_PG_1G
18839         /* Reserved for future. */
18840         uint8_t rsvd[2];
18841 } __rte_packed;
18842
18843 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
18844 struct hwrm_func_backing_store_cfg_output {
18845         /* The specific error status for the command. */
18846         uint16_t        error_code;
18847         /* The HWRM command request type. */
18848         uint16_t        req_type;
18849         /* The sequence ID from the original command. */
18850         uint16_t        seq_id;
18851         /* The length of the response data in number of bytes. */
18852         uint16_t        resp_len;
18853         uint8_t unused_0[7];
18854         /*
18855          * This field is used in Output records to indicate that the output
18856          * is completely written to RAM.  This field should be read as '1'
18857          * to indicate that the output has been completely written.
18858          * When writing a command completion or response to an internal processor,
18859          * the order of writes has to be such that this field is written last.
18860          */
18861         uint8_t valid;
18862 } __rte_packed;
18863
18864 /********************************
18865  * hwrm_func_backing_store_qcfg *
18866  ********************************/
18867
18868
18869 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
18870 struct hwrm_func_backing_store_qcfg_input {
18871         /* The HWRM command request type. */
18872         uint16_t        req_type;
18873         /*
18874          * The completion ring to send the completion event on. This should
18875          * be the NQ ID returned from the `nq_alloc` HWRM command.
18876          */
18877         uint16_t        cmpl_ring;
18878         /*
18879          * The sequence ID is used by the driver for tracking multiple
18880          * commands. This ID is treated as opaque data by the firmware and
18881          * the value is returned in the `hwrm_resp_hdr` upon completion.
18882          */
18883         uint16_t        seq_id;
18884         /*
18885          * The target ID of the command:
18886          * * 0x0-0xFFF8 - The function ID
18887          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18888          * * 0xFFFD - Reserved for user-space HWRM interface
18889          * * 0xFFFF - HWRM
18890          */
18891         uint16_t        target_id;
18892         /*
18893          * A physical address pointer pointing to a host buffer that the
18894          * command's response data will be written. This can be either a host
18895          * physical address (HPA) or a guest physical address (GPA) and must
18896          * point to a physically contiguous block of memory.
18897          */
18898         uint64_t        resp_addr;
18899 } __rte_packed;
18900
18901 /* hwrm_func_backing_store_qcfg_output (size:2496b/312B) */
18902 struct hwrm_func_backing_store_qcfg_output {
18903         /* The specific error status for the command. */
18904         uint16_t        error_code;
18905         /* The HWRM command request type. */
18906         uint16_t        req_type;
18907         /* The sequence ID from the original command. */
18908         uint16_t        seq_id;
18909         /* The length of the response data in number of bytes. */
18910         uint16_t        resp_len;
18911         uint32_t        flags;
18912         /*
18913          * When set, the firmware only uses on-chip resources and does not
18914          * expect any backing store to be provided by the host driver. This
18915          * mode provides minimal L2 functionality (e.g. limited L2 resources,
18916          * no RoCE).
18917          */
18918         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE \
18919                 UINT32_C(0x1)
18920         /*
18921          * When set, the 32b `mrav_num_entries` field is logically divided
18922          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
18923          */
18924         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_MRAV_RESERVATION_SPLIT \
18925                 UINT32_C(0x2)
18926         uint32_t        enables;
18927         /*
18928          * This bit must be '1' for the qp fields to be
18929          * configured.
18930          */
18931         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_QP \
18932                 UINT32_C(0x1)
18933         /*
18934          * This bit must be '1' for the srq fields to be
18935          * configured.
18936          */
18937         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_SRQ \
18938                 UINT32_C(0x2)
18939         /*
18940          * This bit must be '1' for the cq fields to be
18941          * configured.
18942          */
18943         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_CQ \
18944                 UINT32_C(0x4)
18945         /*
18946          * This bit must be '1' for the vnic fields to be
18947          * configured.
18948          */
18949         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_VNIC \
18950                 UINT32_C(0x8)
18951         /*
18952          * This bit must be '1' for the stat fields to be
18953          * configured.
18954          */
18955         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_STAT \
18956                 UINT32_C(0x10)
18957         /*
18958          * This bit must be '1' for the tqm_sp fields to be
18959          * configured.
18960          */
18961         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_SP \
18962                 UINT32_C(0x20)
18963         /*
18964          * This bit must be '1' for the tqm_ring0 fields to be
18965          * configured.
18966          */
18967         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING0 \
18968                 UINT32_C(0x40)
18969         /*
18970          * This bit must be '1' for the tqm_ring1 fields to be
18971          * configured.
18972          */
18973         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING1 \
18974                 UINT32_C(0x80)
18975         /*
18976          * This bit must be '1' for the tqm_ring2 fields to be
18977          * configured.
18978          */
18979         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING2 \
18980                 UINT32_C(0x100)
18981         /*
18982          * This bit must be '1' for the tqm_ring3 fields to be
18983          * configured.
18984          */
18985         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING3 \
18986                 UINT32_C(0x200)
18987         /*
18988          * This bit must be '1' for the tqm_ring4 fields to be
18989          * configured.
18990          */
18991         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING4 \
18992                 UINT32_C(0x400)
18993         /*
18994          * This bit must be '1' for the tqm_ring5 fields to be
18995          * configured.
18996          */
18997         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING5 \
18998                 UINT32_C(0x800)
18999         /*
19000          * This bit must be '1' for the tqm_ring6 fields to be
19001          * configured.
19002          */
19003         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING6 \
19004                 UINT32_C(0x1000)
19005         /*
19006          * This bit must be '1' for the tqm_ring7 fields to be
19007          * configured.
19008          */
19009         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING7 \
19010                 UINT32_C(0x2000)
19011         /*
19012          * This bit must be '1' for the mrav fields to be
19013          * configured.
19014          */
19015         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_MRAV \
19016                 UINT32_C(0x4000)
19017         /*
19018          * This bit must be '1' for the tim fields to be
19019          * configured.
19020          */
19021         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TIM \
19022                 UINT32_C(0x8000)
19023         /*
19024          * This bit must be '1' for the tqm_ring8 fields to be
19025          * configured.
19026          */
19027         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING8 \
19028                 UINT32_C(0x10000)
19029         /*
19030          * This bit must be '1' for the tqm_ring9 fields to be
19031          * configured.
19032          */
19033         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING9 \
19034                 UINT32_C(0x20000)
19035         /*
19036          * This bit must be '1' for the tqm_ring10 fields to be
19037          * configured.
19038          */
19039         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING10 \
19040                 UINT32_C(0x40000)
19041         /*
19042          * This bit must be '1' for the Tx KTLS context
19043          * fields to be configured.
19044          */
19045         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TKC \
19046                 UINT32_C(0x80000)
19047         /*
19048          * This bit must be '1' for the Rx KTLS context
19049          * fields to be configured.
19050          */
19051         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_RKC \
19052                 UINT32_C(0x100000)
19053         /* QPC page size and level. */
19054         uint8_t qpc_pg_size_qpc_lvl;
19055         /* QPC PBL indirect levels. */
19056         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK \
19057                 UINT32_C(0xf)
19058         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT       0
19059         /* PBL pointer is physical start address. */
19060         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0 \
19061                 UINT32_C(0x0)
19062         /* PBL pointer points to PTE table. */
19063         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1 \
19064                 UINT32_C(0x1)
19065         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19066         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 \
19067                 UINT32_C(0x2)
19068         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST \
19069                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
19070         /* QPC page size. */
19071         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK \
19072                 UINT32_C(0xf0)
19073         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT   4
19074         /* 4KB. */
19075         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K \
19076                 (UINT32_C(0x0) << 4)
19077         /* 8KB. */
19078         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K \
19079                 (UINT32_C(0x1) << 4)
19080         /* 64KB. */
19081         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K \
19082                 (UINT32_C(0x2) << 4)
19083         /* 2MB. */
19084         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M \
19085                 (UINT32_C(0x3) << 4)
19086         /* 8MB. */
19087         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M \
19088                 (UINT32_C(0x4) << 4)
19089         /* 1GB. */
19090         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G \
19091                 (UINT32_C(0x5) << 4)
19092         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST \
19093                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
19094         /* SRQ page size and level. */
19095         uint8_t srq_pg_size_srq_lvl;
19096         /* SRQ PBL indirect levels. */
19097         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK \
19098                 UINT32_C(0xf)
19099         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT       0
19100         /* PBL pointer is physical start address. */
19101         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0 \
19102                 UINT32_C(0x0)
19103         /* PBL pointer points to PTE table. */
19104         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1 \
19105                 UINT32_C(0x1)
19106         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19107         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 \
19108                 UINT32_C(0x2)
19109         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST \
19110                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
19111         /* SRQ page size. */
19112         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK \
19113                 UINT32_C(0xf0)
19114         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT   4
19115         /* 4KB. */
19116         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K \
19117                 (UINT32_C(0x0) << 4)
19118         /* 8KB. */
19119         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K \
19120                 (UINT32_C(0x1) << 4)
19121         /* 64KB. */
19122         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K \
19123                 (UINT32_C(0x2) << 4)
19124         /* 2MB. */
19125         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M \
19126                 (UINT32_C(0x3) << 4)
19127         /* 8MB. */
19128         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M \
19129                 (UINT32_C(0x4) << 4)
19130         /* 1GB. */
19131         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G \
19132                 (UINT32_C(0x5) << 4)
19133         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST \
19134                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
19135         /* CQ page size and level. */
19136         uint8_t cq_pg_size_cq_lvl;
19137         /* CQ PBL indirect levels. */
19138         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK \
19139                 UINT32_C(0xf)
19140         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT       0
19141         /* PBL pointer is physical start address. */
19142         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0 \
19143                 UINT32_C(0x0)
19144         /* PBL pointer points to PTE table. */
19145         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1 \
19146                 UINT32_C(0x1)
19147         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19148         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 \
19149                 UINT32_C(0x2)
19150         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST \
19151                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
19152         /* CQ page size. */
19153         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK \
19154                 UINT32_C(0xf0)
19155         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT   4
19156         /* 4KB. */
19157         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K \
19158                 (UINT32_C(0x0) << 4)
19159         /* 8KB. */
19160         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K \
19161                 (UINT32_C(0x1) << 4)
19162         /* 64KB. */
19163         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K \
19164                 (UINT32_C(0x2) << 4)
19165         /* 2MB. */
19166         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M \
19167                 (UINT32_C(0x3) << 4)
19168         /* 8MB. */
19169         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M \
19170                 (UINT32_C(0x4) << 4)
19171         /* 1GB. */
19172         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G \
19173                 (UINT32_C(0x5) << 4)
19174         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST \
19175                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
19176         /* VNIC page size and level. */
19177         uint8_t vnic_pg_size_vnic_lvl;
19178         /* VNIC PBL indirect levels. */
19179         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK \
19180                 UINT32_C(0xf)
19181         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT       0
19182         /* PBL pointer is physical start address. */
19183         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0 \
19184                 UINT32_C(0x0)
19185         /* PBL pointer points to PTE table. */
19186         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1 \
19187                 UINT32_C(0x1)
19188         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19189         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 \
19190                 UINT32_C(0x2)
19191         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST \
19192                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
19193         /* VNIC page size. */
19194         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK \
19195                 UINT32_C(0xf0)
19196         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT   4
19197         /* 4KB. */
19198         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K \
19199                 (UINT32_C(0x0) << 4)
19200         /* 8KB. */
19201         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K \
19202                 (UINT32_C(0x1) << 4)
19203         /* 64KB. */
19204         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K \
19205                 (UINT32_C(0x2) << 4)
19206         /* 2MB. */
19207         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M \
19208                 (UINT32_C(0x3) << 4)
19209         /* 8MB. */
19210         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M \
19211                 (UINT32_C(0x4) << 4)
19212         /* 1GB. */
19213         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G \
19214                 (UINT32_C(0x5) << 4)
19215         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST \
19216                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
19217         /* Stat page size and level. */
19218         uint8_t stat_pg_size_stat_lvl;
19219         /* Stat PBL indirect levels. */
19220         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK \
19221                 UINT32_C(0xf)
19222         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT       0
19223         /* PBL pointer is physical start address. */
19224         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0 \
19225                 UINT32_C(0x0)
19226         /* PBL pointer points to PTE table. */
19227         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1 \
19228                 UINT32_C(0x1)
19229         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19230         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 \
19231                 UINT32_C(0x2)
19232         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST \
19233                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
19234         /* Stat page size. */
19235         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK \
19236                 UINT32_C(0xf0)
19237         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT   4
19238         /* 4KB. */
19239         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K \
19240                 (UINT32_C(0x0) << 4)
19241         /* 8KB. */
19242         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K \
19243                 (UINT32_C(0x1) << 4)
19244         /* 64KB. */
19245         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K \
19246                 (UINT32_C(0x2) << 4)
19247         /* 2MB. */
19248         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M \
19249                 (UINT32_C(0x3) << 4)
19250         /* 8MB. */
19251         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M \
19252                 (UINT32_C(0x4) << 4)
19253         /* 1GB. */
19254         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G \
19255                 (UINT32_C(0x5) << 4)
19256         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST \
19257                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
19258         /* TQM slow path page size and level. */
19259         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
19260         /* TQM slow path PBL indirect levels. */
19261         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK \
19262                 UINT32_C(0xf)
19263         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT       0
19264         /* PBL pointer is physical start address. */
19265         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0 \
19266                 UINT32_C(0x0)
19267         /* PBL pointer points to PTE table. */
19268         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1 \
19269                 UINT32_C(0x1)
19270         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19271         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 \
19272                 UINT32_C(0x2)
19273         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST \
19274                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
19275         /* TQM slow path page size. */
19276         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK \
19277                 UINT32_C(0xf0)
19278         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT   4
19279         /* 4KB. */
19280         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K \
19281                 (UINT32_C(0x0) << 4)
19282         /* 8KB. */
19283         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K \
19284                 (UINT32_C(0x1) << 4)
19285         /* 64KB. */
19286         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K \
19287                 (UINT32_C(0x2) << 4)
19288         /* 2MB. */
19289         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M \
19290                 (UINT32_C(0x3) << 4)
19291         /* 8MB. */
19292         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M \
19293                 (UINT32_C(0x4) << 4)
19294         /* 1GB. */
19295         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G \
19296                 (UINT32_C(0x5) << 4)
19297         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST \
19298                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
19299         /* TQM ring 0 page size and level. */
19300         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
19301         /* TQM ring 0 PBL indirect levels. */
19302         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK \
19303                 UINT32_C(0xf)
19304         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT       0
19305         /* PBL pointer is physical start address. */
19306         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0 \
19307                 UINT32_C(0x0)
19308         /* PBL pointer points to PTE table. */
19309         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1 \
19310                 UINT32_C(0x1)
19311         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19312         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 \
19313                 UINT32_C(0x2)
19314         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST \
19315                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
19316         /* TQM ring 0 page size. */
19317         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK \
19318                 UINT32_C(0xf0)
19319         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT   4
19320         /* 4KB. */
19321         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K \
19322                 (UINT32_C(0x0) << 4)
19323         /* 8KB. */
19324         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K \
19325                 (UINT32_C(0x1) << 4)
19326         /* 64KB. */
19327         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K \
19328                 (UINT32_C(0x2) << 4)
19329         /* 2MB. */
19330         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M \
19331                 (UINT32_C(0x3) << 4)
19332         /* 8MB. */
19333         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M \
19334                 (UINT32_C(0x4) << 4)
19335         /* 1GB. */
19336         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G \
19337                 (UINT32_C(0x5) << 4)
19338         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST \
19339                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
19340         /* TQM ring 1 page size and level. */
19341         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
19342         /* TQM ring 1 PBL indirect levels. */
19343         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK \
19344                 UINT32_C(0xf)
19345         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT       0
19346         /* PBL pointer is physical start address. */
19347         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0 \
19348                 UINT32_C(0x0)
19349         /* PBL pointer points to PTE table. */
19350         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1 \
19351                 UINT32_C(0x1)
19352         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19353         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 \
19354                 UINT32_C(0x2)
19355         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST \
19356                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
19357         /* TQM ring 1 page size. */
19358         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK \
19359                 UINT32_C(0xf0)
19360         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT   4
19361         /* 4KB. */
19362         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K \
19363                 (UINT32_C(0x0) << 4)
19364         /* 8KB. */
19365         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K \
19366                 (UINT32_C(0x1) << 4)
19367         /* 64KB. */
19368         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K \
19369                 (UINT32_C(0x2) << 4)
19370         /* 2MB. */
19371         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M \
19372                 (UINT32_C(0x3) << 4)
19373         /* 8MB. */
19374         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M \
19375                 (UINT32_C(0x4) << 4)
19376         /* 1GB. */
19377         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G \
19378                 (UINT32_C(0x5) << 4)
19379         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST \
19380                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
19381         /* TQM ring 2 page size and level. */
19382         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
19383         /* TQM ring 2 PBL indirect levels. */
19384         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK \
19385                 UINT32_C(0xf)
19386         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT       0
19387         /* PBL pointer is physical start address. */
19388         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0 \
19389                 UINT32_C(0x0)
19390         /* PBL pointer points to PTE table. */
19391         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1 \
19392                 UINT32_C(0x1)
19393         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19394         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 \
19395                 UINT32_C(0x2)
19396         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST \
19397                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
19398         /* TQM ring 2 page size. */
19399         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK \
19400                 UINT32_C(0xf0)
19401         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT   4
19402         /* 4KB. */
19403         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K \
19404                 (UINT32_C(0x0) << 4)
19405         /* 8KB. */
19406         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K \
19407                 (UINT32_C(0x1) << 4)
19408         /* 64KB. */
19409         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K \
19410                 (UINT32_C(0x2) << 4)
19411         /* 2MB. */
19412         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M \
19413                 (UINT32_C(0x3) << 4)
19414         /* 8MB. */
19415         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M \
19416                 (UINT32_C(0x4) << 4)
19417         /* 1GB. */
19418         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G \
19419                 (UINT32_C(0x5) << 4)
19420         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST \
19421                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
19422         /* TQM ring 3 page size and level. */
19423         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
19424         /* TQM ring 3 PBL indirect levels. */
19425         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK \
19426                 UINT32_C(0xf)
19427         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT       0
19428         /* PBL pointer is physical start address. */
19429         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0 \
19430                 UINT32_C(0x0)
19431         /* PBL pointer points to PTE table. */
19432         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1 \
19433                 UINT32_C(0x1)
19434         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19435         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 \
19436                 UINT32_C(0x2)
19437         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST \
19438                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
19439         /* TQM ring 3 page size. */
19440         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK \
19441                 UINT32_C(0xf0)
19442         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT   4
19443         /* 4KB. */
19444         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K \
19445                 (UINT32_C(0x0) << 4)
19446         /* 8KB. */
19447         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K \
19448                 (UINT32_C(0x1) << 4)
19449         /* 64KB. */
19450         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K \
19451                 (UINT32_C(0x2) << 4)
19452         /* 2MB. */
19453         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M \
19454                 (UINT32_C(0x3) << 4)
19455         /* 8MB. */
19456         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M \
19457                 (UINT32_C(0x4) << 4)
19458         /* 1GB. */
19459         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G \
19460                 (UINT32_C(0x5) << 4)
19461         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST \
19462                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
19463         /* TQM ring 4 page size and level. */
19464         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
19465         /* TQM ring 4 PBL indirect levels. */
19466         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK \
19467                 UINT32_C(0xf)
19468         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT       0
19469         /* PBL pointer is physical start address. */
19470         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0 \
19471                 UINT32_C(0x0)
19472         /* PBL pointer points to PTE table. */
19473         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1 \
19474                 UINT32_C(0x1)
19475         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19476         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 \
19477                 UINT32_C(0x2)
19478         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST \
19479                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
19480         /* TQM ring 4 page size. */
19481         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK \
19482                 UINT32_C(0xf0)
19483         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT   4
19484         /* 4KB. */
19485         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K \
19486                 (UINT32_C(0x0) << 4)
19487         /* 8KB. */
19488         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K \
19489                 (UINT32_C(0x1) << 4)
19490         /* 64KB. */
19491         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K \
19492                 (UINT32_C(0x2) << 4)
19493         /* 2MB. */
19494         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M \
19495                 (UINT32_C(0x3) << 4)
19496         /* 8MB. */
19497         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M \
19498                 (UINT32_C(0x4) << 4)
19499         /* 1GB. */
19500         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G \
19501                 (UINT32_C(0x5) << 4)
19502         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST \
19503                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
19504         /* TQM ring 5 page size and level. */
19505         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
19506         /* TQM ring 5 PBL indirect levels. */
19507         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK \
19508                 UINT32_C(0xf)
19509         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT       0
19510         /* PBL pointer is physical start address. */
19511         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0 \
19512                 UINT32_C(0x0)
19513         /* PBL pointer points to PTE table. */
19514         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1 \
19515                 UINT32_C(0x1)
19516         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19517         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 \
19518                 UINT32_C(0x2)
19519         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST \
19520                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
19521         /* TQM ring 5 page size. */
19522         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK \
19523                 UINT32_C(0xf0)
19524         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT   4
19525         /* 4KB. */
19526         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K \
19527                 (UINT32_C(0x0) << 4)
19528         /* 8KB. */
19529         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K \
19530                 (UINT32_C(0x1) << 4)
19531         /* 64KB. */
19532         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K \
19533                 (UINT32_C(0x2) << 4)
19534         /* 2MB. */
19535         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M \
19536                 (UINT32_C(0x3) << 4)
19537         /* 8MB. */
19538         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M \
19539                 (UINT32_C(0x4) << 4)
19540         /* 1GB. */
19541         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G \
19542                 (UINT32_C(0x5) << 4)
19543         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST \
19544                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
19545         /* TQM ring 6 page size and level. */
19546         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
19547         /* TQM ring 6 PBL indirect levels. */
19548         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK \
19549                 UINT32_C(0xf)
19550         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT       0
19551         /* PBL pointer is physical start address. */
19552         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0 \
19553                 UINT32_C(0x0)
19554         /* PBL pointer points to PTE table. */
19555         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1 \
19556                 UINT32_C(0x1)
19557         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19558         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 \
19559                 UINT32_C(0x2)
19560         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST \
19561                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
19562         /* TQM ring 6 page size. */
19563         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK \
19564                 UINT32_C(0xf0)
19565         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT   4
19566         /* 4KB. */
19567         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K \
19568                 (UINT32_C(0x0) << 4)
19569         /* 8KB. */
19570         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K \
19571                 (UINT32_C(0x1) << 4)
19572         /* 64KB. */
19573         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K \
19574                 (UINT32_C(0x2) << 4)
19575         /* 2MB. */
19576         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M \
19577                 (UINT32_C(0x3) << 4)
19578         /* 8MB. */
19579         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M \
19580                 (UINT32_C(0x4) << 4)
19581         /* 1GB. */
19582         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G \
19583                 (UINT32_C(0x5) << 4)
19584         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST \
19585                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
19586         /* TQM ring 7 page size and level. */
19587         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
19588         /* TQM ring 7 PBL indirect levels. */
19589         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK \
19590                 UINT32_C(0xf)
19591         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT       0
19592         /* PBL pointer is physical start address. */
19593         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0 \
19594                 UINT32_C(0x0)
19595         /* PBL pointer points to PTE table. */
19596         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1 \
19597                 UINT32_C(0x1)
19598         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19599         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 \
19600                 UINT32_C(0x2)
19601         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST \
19602                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
19603         /* TQM ring 7 page size. */
19604         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK \
19605                 UINT32_C(0xf0)
19606         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT   4
19607         /* 4KB. */
19608         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K \
19609                 (UINT32_C(0x0) << 4)
19610         /* 8KB. */
19611         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K \
19612                 (UINT32_C(0x1) << 4)
19613         /* 64KB. */
19614         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K \
19615                 (UINT32_C(0x2) << 4)
19616         /* 2MB. */
19617         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M \
19618                 (UINT32_C(0x3) << 4)
19619         /* 8MB. */
19620         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M \
19621                 (UINT32_C(0x4) << 4)
19622         /* 1GB. */
19623         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G \
19624                 (UINT32_C(0x5) << 4)
19625         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST \
19626                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
19627         /* MR/AV page size and level. */
19628         uint8_t mrav_pg_size_mrav_lvl;
19629         /* MR/AV PBL indirect levels. */
19630         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK \
19631                 UINT32_C(0xf)
19632         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT       0
19633         /* PBL pointer is physical start address. */
19634         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0 \
19635                 UINT32_C(0x0)
19636         /* PBL pointer points to PTE table. */
19637         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1 \
19638                 UINT32_C(0x1)
19639         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19640         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 \
19641                 UINT32_C(0x2)
19642         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST \
19643                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
19644         /* MR/AV page size. */
19645         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK \
19646                 UINT32_C(0xf0)
19647         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT   4
19648         /* 4KB. */
19649         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K \
19650                 (UINT32_C(0x0) << 4)
19651         /* 8KB. */
19652         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K \
19653                 (UINT32_C(0x1) << 4)
19654         /* 64KB. */
19655         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K \
19656                 (UINT32_C(0x2) << 4)
19657         /* 2MB. */
19658         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M \
19659                 (UINT32_C(0x3) << 4)
19660         /* 8MB. */
19661         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M \
19662                 (UINT32_C(0x4) << 4)
19663         /* 1GB. */
19664         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G \
19665                 (UINT32_C(0x5) << 4)
19666         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST \
19667                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
19668         /* Timer page size and level. */
19669         uint8_t tim_pg_size_tim_lvl;
19670         /* Timer PBL indirect levels. */
19671         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK \
19672                 UINT32_C(0xf)
19673         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT       0
19674         /* PBL pointer is physical start address. */
19675         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0 \
19676                 UINT32_C(0x0)
19677         /* PBL pointer points to PTE table. */
19678         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1 \
19679                 UINT32_C(0x1)
19680         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
19681         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 \
19682                 UINT32_C(0x2)
19683         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST \
19684                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
19685         /* Timer page size. */
19686         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK \
19687                 UINT32_C(0xf0)
19688         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT   4
19689         /* 4KB. */
19690         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K \
19691                 (UINT32_C(0x0) << 4)
19692         /* 8KB. */
19693         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K \
19694                 (UINT32_C(0x1) << 4)
19695         /* 64KB. */
19696         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K \
19697                 (UINT32_C(0x2) << 4)
19698         /* 2MB. */
19699         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M \
19700                 (UINT32_C(0x3) << 4)
19701         /* 8MB. */
19702         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M \
19703                 (UINT32_C(0x4) << 4)
19704         /* 1GB. */
19705         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G \
19706                 (UINT32_C(0x5) << 4)
19707         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST \
19708                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
19709         /* QP page directory. */
19710         uint64_t        qpc_page_dir;
19711         /* SRQ page directory. */
19712         uint64_t        srq_page_dir;
19713         /* CQ page directory. */
19714         uint64_t        cq_page_dir;
19715         /* VNIC page directory. */
19716         uint64_t        vnic_page_dir;
19717         /* Stat page directory. */
19718         uint64_t        stat_page_dir;
19719         /* TQM slowpath page directory. */
19720         uint64_t        tqm_sp_page_dir;
19721         /* TQM ring 0 page directory. */
19722         uint64_t        tqm_ring0_page_dir;
19723         /* TQM ring 1 page directory. */
19724         uint64_t        tqm_ring1_page_dir;
19725         /* TQM ring 2 page directory. */
19726         uint64_t        tqm_ring2_page_dir;
19727         /* TQM ring 3 page directory. */
19728         uint64_t        tqm_ring3_page_dir;
19729         /* TQM ring 4 page directory. */
19730         uint64_t        tqm_ring4_page_dir;
19731         /* TQM ring 5 page directory. */
19732         uint64_t        tqm_ring5_page_dir;
19733         /* TQM ring 6 page directory. */
19734         uint64_t        tqm_ring6_page_dir;
19735         /* TQM ring 7 page directory. */
19736         uint64_t        tqm_ring7_page_dir;
19737         /* MR/AV page directory. */
19738         uint64_t        mrav_page_dir;
19739         /* Timer page directory. */
19740         uint64_t        tim_page_dir;
19741         /* Number of entries to reserve for QP1 */
19742         uint16_t        qp_num_qp1_entries;
19743         /* Number of entries to reserve for L2 */
19744         uint16_t        qp_num_l2_entries;
19745         /* Number of QPs. */
19746         uint32_t        qp_num_entries;
19747         /* Number of SRQs. */
19748         uint32_t        srq_num_entries;
19749         /* Number of entries to reserve for L2 */
19750         uint16_t        srq_num_l2_entries;
19751         /* Number of entries to reserve for L2 */
19752         uint16_t        cq_num_l2_entries;
19753         /* Number of CQs. */
19754         uint32_t        cq_num_entries;
19755         /* Number of entries to reserve for VNIC entries */
19756         uint16_t        vnic_num_vnic_entries;
19757         /* Number of entries to reserve for Ring table entries */
19758         uint16_t        vnic_num_ring_table_entries;
19759         /* Number of Stats. */
19760         uint32_t        stat_num_entries;
19761         /* Number of TQM slowpath entries. */
19762         uint32_t        tqm_sp_num_entries;
19763         /* Number of TQM ring 0 entries. */
19764         uint32_t        tqm_ring0_num_entries;
19765         /* Number of TQM ring 1 entries. */
19766         uint32_t        tqm_ring1_num_entries;
19767         /* Number of TQM ring 2 entries. */
19768         uint32_t        tqm_ring2_num_entries;
19769         /* Number of TQM ring 3 entries. */
19770         uint32_t        tqm_ring3_num_entries;
19771         /* Number of TQM ring 4 entries. */
19772         uint32_t        tqm_ring4_num_entries;
19773         /* Number of TQM ring 5 entries. */
19774         uint32_t        tqm_ring5_num_entries;
19775         /* Number of TQM ring 6 entries. */
19776         uint32_t        tqm_ring6_num_entries;
19777         /* Number of TQM ring 7 entries. */
19778         uint32_t        tqm_ring7_num_entries;
19779         /*
19780          * If the MR/AV split reservation flag is not set, then this field
19781          * represents the total number of MR plus AV entries. For versions
19782          * of firmware that support the split reservation, when it is not
19783          * specified half of the entries will be reserved for MRs and the
19784          * other half for AVs.
19785          *
19786          * If the MR/AV split reservation flag is set, then this
19787          * field is logically divided into two 16b fields. Bits `[31:16]`
19788          * represents the `mr_num_entries` and bits `[15:0]` represents
19789          * `av_num_entries`. The granularity of these values is defined by
19790          * the `mrav_num_entries_unit` field returned by the
19791          * `backing_store_qcaps` command.
19792          */
19793         uint32_t        mrav_num_entries;
19794         /* Number of Timer entries. */
19795         uint32_t        tim_num_entries;
19796         /* TQM ring page size and level. */
19797         uint8_t tqm_ring8_pg_size_tqm_ring_lvl;
19798         /* TQM ring PBL indirect levels. */
19799         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_MASK \
19800                 UINT32_C(0xf)
19801         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_SFT \
19802                 0
19803         /* PBL pointer is physical start address. */
19804         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_0 \
19805                 UINT32_C(0x0)
19806         /* PBL pointer points to PTE table. */
19807         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_1 \
19808                 UINT32_C(0x1)
19809         /*
19810          * PBL pointer points to PDE table with each entry pointing to
19811          * PTE tables.
19812          */
19813         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_2 \
19814                 UINT32_C(0x2)
19815         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LAST \
19816                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_2
19817         /* TQM ring page size. */
19818         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_MASK \
19819                 UINT32_C(0xf0)
19820         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_SFT \
19821                 4
19822         /* 4KB. */
19823         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_4K \
19824                 (UINT32_C(0x0) << 4)
19825         /* 8KB. */
19826         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_8K \
19827                 (UINT32_C(0x1) << 4)
19828         /* 64KB. */
19829         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_64K \
19830                 (UINT32_C(0x2) << 4)
19831         /* 2MB. */
19832         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_2M \
19833                 (UINT32_C(0x3) << 4)
19834         /* 8MB. */
19835         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_8M \
19836                 (UINT32_C(0x4) << 4)
19837         /* 1GB. */
19838         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_1G \
19839                 (UINT32_C(0x5) << 4)
19840         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_LAST \
19841                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_1G
19842         uint8_t ring8_unused[3];
19843         /* Number of TQM ring entries. */
19844         uint32_t        tqm_ring8_num_entries;
19845         /* TQM ring page directory. */
19846         uint64_t        tqm_ring8_page_dir;
19847         /* TQM ring page size and level. */
19848         uint8_t tqm_ring9_pg_size_tqm_ring_lvl;
19849         /* TQM ring PBL indirect levels. */
19850         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_MASK \
19851                 UINT32_C(0xf)
19852         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_SFT \
19853                 0
19854         /* PBL pointer is physical start address. */
19855         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_0 \
19856                 UINT32_C(0x0)
19857         /* PBL pointer points to PTE table. */
19858         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_1 \
19859                 UINT32_C(0x1)
19860         /*
19861          * PBL pointer points to PDE table with each entry pointing to
19862          * PTE tables.
19863          */
19864         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_2 \
19865                 UINT32_C(0x2)
19866         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LAST \
19867                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_2
19868         /* TQM ring page size. */
19869         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_MASK \
19870                 UINT32_C(0xf0)
19871         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_SFT \
19872                 4
19873         /* 4KB. */
19874         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_4K \
19875                 (UINT32_C(0x0) << 4)
19876         /* 8KB. */
19877         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_8K \
19878                 (UINT32_C(0x1) << 4)
19879         /* 64KB. */
19880         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_64K \
19881                 (UINT32_C(0x2) << 4)
19882         /* 2MB. */
19883         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_2M \
19884                 (UINT32_C(0x3) << 4)
19885         /* 8MB. */
19886         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_8M \
19887                 (UINT32_C(0x4) << 4)
19888         /* 1GB. */
19889         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_1G \
19890                 (UINT32_C(0x5) << 4)
19891         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_LAST \
19892                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_1G
19893         uint8_t ring9_unused[3];
19894         /* Number of TQM ring entries. */
19895         uint32_t        tqm_ring9_num_entries;
19896         /* TQM ring page directory. */
19897         uint64_t        tqm_ring9_page_dir;
19898         /* TQM ring page size and level. */
19899         uint8_t tqm_ring10_pg_size_tqm_ring_lvl;
19900         /* TQM ring PBL indirect levels. */
19901         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_MASK \
19902                 UINT32_C(0xf)
19903         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_SFT \
19904                 0
19905         /* PBL pointer is physical start address. */
19906         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_0 \
19907                 UINT32_C(0x0)
19908         /* PBL pointer points to PTE table. */
19909         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_1 \
19910                 UINT32_C(0x1)
19911         /*
19912          * PBL pointer points to PDE table with each entry pointing to
19913          * PTE tables.
19914          */
19915         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_2 \
19916                 UINT32_C(0x2)
19917         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LAST \
19918                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_2
19919         /* TQM ring page size. */
19920         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_MASK \
19921                 UINT32_C(0xf0)
19922         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_SFT \
19923                 4
19924         /* 4KB. */
19925         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_4K \
19926                 (UINT32_C(0x0) << 4)
19927         /* 8KB. */
19928         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_8K \
19929                 (UINT32_C(0x1) << 4)
19930         /* 64KB. */
19931         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_64K \
19932                 (UINT32_C(0x2) << 4)
19933         /* 2MB. */
19934         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_2M \
19935                 (UINT32_C(0x3) << 4)
19936         /* 8MB. */
19937         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_8M \
19938                 (UINT32_C(0x4) << 4)
19939         /* 1GB. */
19940         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_1G \
19941                 (UINT32_C(0x5) << 4)
19942         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_LAST \
19943                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_1G
19944         uint8_t ring10_unused[3];
19945         /* Number of TQM ring entries. */
19946         uint32_t        tqm_ring10_num_entries;
19947         /* TQM ring page directory. */
19948         uint64_t        tqm_ring10_page_dir;
19949         /* Number of Tx KTLS context entries. */
19950         uint32_t        tkc_num_entries;
19951         /* Number of Rx KTLS context entries. */
19952         uint32_t        rkc_num_entries;
19953         /* Tx KTLS context page directory. */
19954         uint64_t        tkc_page_dir;
19955         /* Rx KTLS context page directory. */
19956         uint64_t        rkc_page_dir;
19957         /* Tx KTLS context page size and level. */
19958         uint8_t tkc_pg_size_tkc_lvl;
19959         /* Tx KTLS context PBL indirect levels. */
19960         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_MASK \
19961                 UINT32_C(0xf)
19962         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_SFT       0
19963         /* PBL pointer is physical start address. */
19964         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_0 \
19965                 UINT32_C(0x0)
19966         /* PBL pointer points to PTE table. */
19967         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_1 \
19968                 UINT32_C(0x1)
19969         /*
19970          * PBL pointer points to PDE table with each entry pointing to
19971          * PTE tables.
19972          */
19973         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_2 \
19974                 UINT32_C(0x2)
19975         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LAST \
19976                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_LVL_LVL_2
19977         /* Tx KTLS context page size. */
19978         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_MASK \
19979                 UINT32_C(0xf0)
19980         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_SFT   4
19981         /* 4KB. */
19982         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_4K \
19983                 (UINT32_C(0x0) << 4)
19984         /* 8KB. */
19985         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_8K \
19986                 (UINT32_C(0x1) << 4)
19987         /* 64KB. */
19988         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_64K \
19989                 (UINT32_C(0x2) << 4)
19990         /* 2MB. */
19991         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_2M \
19992                 (UINT32_C(0x3) << 4)
19993         /* 8MB. */
19994         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_8M \
19995                 (UINT32_C(0x4) << 4)
19996         /* 1GB. */
19997         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_1G \
19998                 (UINT32_C(0x5) << 4)
19999         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_LAST \
20000                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TKC_PG_SIZE_PG_1G
20001         /* Rx KTLS context page size and level. */
20002         uint8_t rkc_pg_size_rkc_lvl;
20003         /* Rx KTLS context PBL indirect levels. */
20004         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_MASK \
20005                 UINT32_C(0xf)
20006         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_SFT       0
20007         /* PBL pointer is physical start address. */
20008         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_0 \
20009                 UINT32_C(0x0)
20010         /* PBL pointer points to PTE table. */
20011         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_1 \
20012                 UINT32_C(0x1)
20013         /*
20014          * PBL pointer points to PDE table with each entry pointing to
20015          * PTE tables.
20016          */
20017         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_2 \
20018                 UINT32_C(0x2)
20019         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LAST \
20020                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_LVL_LVL_2
20021         /* Rx KTLS context page size. */
20022         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_MASK \
20023                 UINT32_C(0xf0)
20024         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_SFT   4
20025         /* 4KB. */
20026         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_4K \
20027                 (UINT32_C(0x0) << 4)
20028         /* 8KB. */
20029         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_8K \
20030                 (UINT32_C(0x1) << 4)
20031         /* 64KB. */
20032         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_64K \
20033                 (UINT32_C(0x2) << 4)
20034         /* 2MB. */
20035         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_2M \
20036                 (UINT32_C(0x3) << 4)
20037         /* 8MB. */
20038         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_8M \
20039                 (UINT32_C(0x4) << 4)
20040         /* 1GB. */
20041         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_1G \
20042                 (UINT32_C(0x5) << 4)
20043         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_LAST \
20044                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RKC_PG_SIZE_PG_1G
20045         uint8_t unused_1[5];
20046         /*
20047          * This field is used in Output records to indicate that the output
20048          * is completely written to RAM.  This field should be read as 1
20049          * to indicate that the output has been completely written.
20050          * When writing a command completion or response to an internal
20051          * processor, the order of writes has to be such that this field
20052          * is written last.
20053          */
20054         uint8_t valid;
20055 } __rte_packed;
20056
20057 /****************************
20058  * hwrm_error_recovery_qcfg *
20059  ****************************/
20060
20061
20062 /* hwrm_error_recovery_qcfg_input (size:192b/24B) */
20063 struct hwrm_error_recovery_qcfg_input {
20064         /* The HWRM command request type. */
20065         uint16_t        req_type;
20066         /*
20067          * The completion ring to send the completion event on. This should
20068          * be the NQ ID returned from the `nq_alloc` HWRM command.
20069          */
20070         uint16_t        cmpl_ring;
20071         /*
20072          * The sequence ID is used by the driver for tracking multiple
20073          * commands. This ID is treated as opaque data by the firmware and
20074          * the value is returned in the `hwrm_resp_hdr` upon completion.
20075          */
20076         uint16_t        seq_id;
20077         /*
20078          * The target ID of the command:
20079          * * 0x0-0xFFF8 - The function ID
20080          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20081          * * 0xFFFD - Reserved for user-space HWRM interface
20082          * * 0xFFFF - HWRM
20083          */
20084         uint16_t        target_id;
20085         /*
20086          * A physical address pointer pointing to a host buffer that the
20087          * command's response data will be written. This can be either a host
20088          * physical address (HPA) or a guest physical address (GPA) and must
20089          * point to a physically contiguous block of memory.
20090          */
20091         uint64_t        resp_addr;
20092         uint8_t unused_0[8];
20093 } __rte_packed;
20094
20095 /* hwrm_error_recovery_qcfg_output (size:1664b/208B) */
20096 struct hwrm_error_recovery_qcfg_output {
20097         /* The specific error status for the command. */
20098         uint16_t        error_code;
20099         /* The HWRM command request type. */
20100         uint16_t        req_type;
20101         /* The sequence ID from the original command. */
20102         uint16_t        seq_id;
20103         /* The length of the response data in number of bytes. */
20104         uint16_t        resp_len;
20105         uint32_t        flags;
20106         /*
20107          * When this flag is set to 1, error recovery will be initiated
20108          * through master function driver.
20109          */
20110         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST       UINT32_C(0x1)
20111         /*
20112          * When this flag is set to 1, error recovery will be performed
20113          * through Co processor.
20114          */
20115         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU     UINT32_C(0x2)
20116         /*
20117          * Driver Polling frequency. This value is in units of 100msec.
20118          * Typical value would be 10 to indicate 1sec.
20119          * Drivers can poll FW health status, Heartbeat, reset_counter with
20120          * this frequency.
20121          */
20122         uint32_t        driver_polling_freq;
20123         /*
20124          * This value is in units of 100msec.
20125          * Typical value would be 30 to indicate 3sec.
20126          * Master function wait period from detecting a fatal error to
20127          * initiating reset. In this time period Master PF expects every
20128          * active driver will detect fatal error.
20129          */
20130         uint32_t        master_func_wait_period;
20131         /*
20132          * This value is in units of 100msec.
20133          * Typical value would be 50 to indicate 5sec.
20134          * Normal function wait period from fatal error detection to
20135          * polling FW health status. In this time period, drivers should not
20136          * do any PCIe MMIO transaction and should not send any HWRM commands.
20137          */
20138         uint32_t        normal_func_wait_period;
20139         /*
20140          * This value is in units of 100msec.
20141          * Typical value would be 20 to indicate 2sec.
20142          * This field indicates that, master function wait period after chip
20143          * reset. After this time, master function should reinitialize with
20144          * FW.
20145          */
20146         uint32_t        master_func_wait_period_after_reset;
20147         /*
20148          * This value is in units of 100msec.
20149          * Typical value would be 60 to indicate 6sec.
20150          * This field is applicable to both master and normal functions.
20151          * Even after chip reset, if FW status not changed to ready,
20152          * then all the functions can poll for this much time and bailout.
20153          */
20154         uint32_t        max_bailout_time_after_reset;
20155         /*
20156          * FW health status register.
20157          * Lower 2 bits indicates address space location and upper 30 bits
20158          * indicates upper 30bits of the register address.
20159          * A value of 0xFFFF-FFFF indicates this register does not exist.
20160          */
20161         uint32_t        fw_health_status_reg;
20162         /* Lower 2 bits indicates address space location. */
20163         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_MASK \
20164                 UINT32_C(0x3)
20165         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_SFT \
20166                 0
20167         /*
20168          * If value is 0, this register is located in PCIe config space.
20169          * Drivers have to map appropriate window to access this
20170          * register.
20171          */
20172         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_PCIE_CFG \
20173                 UINT32_C(0x0)
20174         /*
20175          * If value is 1, this register is located in GRC address space.
20176          * Drivers have to map appropriate window to access this
20177          * register.
20178          */
20179         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_GRC \
20180                 UINT32_C(0x1)
20181         /*
20182          * If value is 2, this register is located in first BAR address
20183          * space. Drivers have to map appropriate window to access this
20184          * register.
20185          */
20186         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR0 \
20187                 UINT32_C(0x2)
20188         /*
20189          * If value is 3, this register is located in second BAR address
20190          * space. Drivers have to map appropriate window to access this
20191          * Drivers have to map appropriate window to access this
20192          * register.
20193          */
20194         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1 \
20195                 UINT32_C(0x3)
20196         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_LAST \
20197                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1
20198         /* Upper 30bits of the register address. */
20199         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_MASK \
20200                 UINT32_C(0xfffffffc)
20201         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SFT \
20202                 2
20203         /*
20204          * FW HeartBeat register.
20205          * Lower 2 bits indicates address space location and upper 30 bits
20206          * indicates actual address.
20207          * A value of 0xFFFF-FFFF indicates this register does not exist.
20208          */
20209         uint32_t        fw_heartbeat_reg;
20210         /* Lower 2 bits indicates address space location. */
20211         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_MASK \
20212                 UINT32_C(0x3)
20213         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_SFT \
20214                 0
20215         /*
20216          * If value is 0, this register is located in PCIe config space.
20217          * Drivers have to map appropriate window to access this
20218          * register.
20219          */
20220         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_PCIE_CFG \
20221                 UINT32_C(0x0)
20222         /*
20223          * If value is 1, this register is located in GRC address space.
20224          * Drivers have to map appropriate window to access this
20225          * register.
20226          */
20227         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_GRC \
20228                 UINT32_C(0x1)
20229         /*
20230          * If value is 2, this register is located in first BAR address
20231          * space. Drivers have to map appropriate window to access this
20232          * register.
20233          */
20234         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR0 \
20235                 UINT32_C(0x2)
20236         /*
20237          * If value is 3, this register is located in second BAR address
20238          * space. Drivers have to map appropriate window to access this
20239          * register.
20240          */
20241         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1 \
20242                 UINT32_C(0x3)
20243         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_LAST \
20244                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1
20245         /* Upper 30bits of the register address. */
20246         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_MASK \
20247                 UINT32_C(0xfffffffc)
20248         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SFT \
20249                 2
20250         /*
20251          * FW reset counter.
20252          * Lower 2 bits indicates address space location and upper 30 bits
20253          * indicates actual address.
20254          * A value of 0xFFFF-FFFF indicates this register does not exist.
20255          */
20256         uint32_t        fw_reset_cnt_reg;
20257         /* Lower 2 bits indicates address space location. */
20258         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_MASK \
20259                 UINT32_C(0x3)
20260         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_SFT \
20261                 0
20262         /*
20263          * If value is 0, this register is located in PCIe config space.
20264          * Drivers have to map appropriate window to access this
20265          * register.
20266          */
20267         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_PCIE_CFG \
20268                 UINT32_C(0x0)
20269         /*
20270          * If value is 1, this register is located in GRC address space.
20271          * Drivers have to map appropriate window to access this
20272          * register.
20273          */
20274         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_GRC \
20275                 UINT32_C(0x1)
20276         /*
20277          * If value is 2, this register is located in first BAR address
20278          * space. Drivers have to map appropriate window to access this
20279          * register.
20280          */
20281         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR0 \
20282                 UINT32_C(0x2)
20283         /*
20284          * If value is 3, this register is located in second BAR address
20285          * space. Drivers have to map appropriate window to access this
20286          * register.
20287          */
20288         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1 \
20289                 UINT32_C(0x3)
20290         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_LAST \
20291                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1
20292         /* Upper 30bits of the register address. */
20293         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_MASK \
20294                 UINT32_C(0xfffffffc)
20295         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SFT \
20296                 2
20297         /*
20298          * Reset Inprogress Register address for PFs.
20299          * Lower 2 bits indicates address space location and upper 30 bits
20300          * indicates actual address.
20301          * A value of 0xFFFF-FFFF indicates this register does not exist.
20302          */
20303         uint32_t        reset_inprogress_reg;
20304         /* Lower 2 bits indicates address space location. */
20305         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_MASK \
20306                 UINT32_C(0x3)
20307         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_SFT \
20308                 0
20309         /*
20310          * If value is 0, this register is located in PCIe config space.
20311          * Drivers have to map appropriate window to access this
20312          * register.
20313          */
20314         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_PCIE_CFG \
20315                 UINT32_C(0x0)
20316         /*
20317          * If value is 1, this register is located in GRC address space.
20318          * Drivers have to map appropriate window to access this
20319          * register.
20320          */
20321         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_GRC \
20322                 UINT32_C(0x1)
20323         /*
20324          * If value is 2, this register is located in first BAR address
20325          * space. Drivers have to map appropriate window to access this
20326          * register.
20327          */
20328         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR0 \
20329                 UINT32_C(0x2)
20330         /*
20331          * If value is 3, this register is located in second BAR address
20332          * space. Drivers have to map appropriate window to access this
20333          * register.
20334          */
20335         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1 \
20336                 UINT32_C(0x3)
20337         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_LAST \
20338                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1
20339         /* Upper 30bits of the register address. */
20340         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_MASK \
20341                 UINT32_C(0xfffffffc)
20342         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SFT \
20343                 2
20344         /* This field indicates the mask value for reset_inprogress_reg. */
20345         uint32_t        reset_inprogress_reg_mask;
20346         uint8_t unused_0[3];
20347         /*
20348          * Array of registers and value count to reset the Chip
20349          * Each array count has reset_reg, reset_reg_val, delay_after_reset
20350          * in TLV format. Depending upon Chip type, number of reset registers
20351          * will vary. Drivers have to write reset_reg_val in the reset_reg
20352          * location in the same sequence in order to recover from a fatal
20353          * error.
20354          */
20355         uint8_t reg_array_cnt;
20356         /*
20357          * Reset register.
20358          * Lower 2 bits indicates address space location and upper 30 bits
20359          * indicates actual address.
20360          * A value of 0xFFFF-FFFF indicates this register does not exist.
20361          */
20362         uint32_t        reset_reg[16];
20363         /* Lower 2 bits indicates address space location. */
20364         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_MASK \
20365                 UINT32_C(0x3)
20366         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_SFT     0
20367         /*
20368          * If value is 0, this register is located in PCIe config space.
20369          * Drivers have to map appropriate window to access this
20370          * register.
20371          */
20372         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_PCIE_CFG \
20373                 UINT32_C(0x0)
20374         /*
20375          * If value is 1, this register is located in GRC address space.
20376          * Drivers have to map appropriate window to access this
20377          * register.
20378          */
20379         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_GRC \
20380                 UINT32_C(0x1)
20381         /*
20382          * If value is 2, this register is located in first BAR address
20383          * space. Drivers have to map appropriate window to access this
20384          * register.
20385          */
20386         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR0 \
20387                 UINT32_C(0x2)
20388         /*
20389          * If value is 3, this register is located in second BAR address
20390          * space. Drivers have to map appropriate window to access this
20391          * register.
20392          */
20393         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1 \
20394                 UINT32_C(0x3)
20395         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_LAST \
20396                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1
20397         /* Upper 30bits of the register address. */
20398         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_MASK \
20399                 UINT32_C(0xfffffffc)
20400         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SFT           2
20401         /* Value to be written in reset_reg to reset the controller. */
20402         uint32_t        reset_reg_val[16];
20403         /*
20404          * This value is in units of 1msec.
20405          * Typical value would be 10 to indicate 10msec.
20406          * Some of the operations like Core reset require delay before
20407          * accessing PCIE MMIO register space.
20408          * If this value is non-zero, drivers have to wait for
20409          * this much time after writing reset_reg_val in reset_reg.
20410          */
20411         uint8_t delay_after_reset[16];
20412         /*
20413          * Error recovery counter.
20414          * Lower 2 bits indicates address space location and upper 30 bits
20415          * indicates actual address.
20416          * A value of 0xFFFF-FFFF indicates this register does not exist.
20417          */
20418         uint32_t        err_recovery_cnt_reg;
20419         /* Lower 2 bits indicates address space location. */
20420         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_MASK \
20421                 UINT32_C(0x3)
20422         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_SFT \
20423                 0
20424         /*
20425          * If value is 0, this register is located in PCIe config space.
20426          * Drivers have to map appropriate window to access this
20427          * register.
20428          */
20429         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_PCIE_CFG \
20430                 UINT32_C(0x0)
20431         /*
20432          * If value is 1, this register is located in GRC address space.
20433          * Drivers have to map appropriate window to access this
20434          * register.
20435          */
20436         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_GRC \
20437                 UINT32_C(0x1)
20438         /*
20439          * If value is 2, this register is located in first BAR address
20440          * space. Drivers have to map appropriate window to access this
20441          * register.
20442          */
20443         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR0 \
20444                 UINT32_C(0x2)
20445         /*
20446          * If value is 3, this register is located in second BAR address
20447          * space. Drivers have to map appropriate window to access this
20448          * register.
20449          */
20450         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1 \
20451                 UINT32_C(0x3)
20452         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_LAST \
20453                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1
20454         /* Upper 30bits of the register address. */
20455         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_MASK \
20456                 UINT32_C(0xfffffffc)
20457         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SFT \
20458                 2
20459         uint8_t unused_1[3];
20460         /*
20461          * This field is used in Output records to indicate that the output
20462          * is completely written to RAM.  This field should be read as '1'
20463          * to indicate that the output has been completely written.
20464          * When writing a command completion or response to an internal
20465          * processor, the order of writes has to be such that this field
20466          * is written last.
20467          */
20468         uint8_t valid;
20469 } __rte_packed;
20470
20471 /***************************
20472  * hwrm_func_echo_response *
20473  ***************************/
20474
20475
20476 /* hwrm_func_echo_response_input (size:192b/24B) */
20477 struct hwrm_func_echo_response_input {
20478         /* The HWRM command request type. */
20479         uint16_t        req_type;
20480         /*
20481          * The completion ring to send the completion event on. This should
20482          * be the NQ ID returned from the `nq_alloc` HWRM command.
20483          */
20484         uint16_t        cmpl_ring;
20485         /*
20486          * The sequence ID is used by the driver for tracking multiple
20487          * commands. This ID is treated as opaque data by the firmware and
20488          * the value is returned in the `hwrm_resp_hdr` upon completion.
20489          */
20490         uint16_t        seq_id;
20491         /*
20492          * The target ID of the command:
20493          * * 0x0-0xFFF8 - The function ID
20494          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20495          * * 0xFFFD - Reserved for user-space HWRM interface
20496          * * 0xFFFF - HWRM
20497          */
20498         uint16_t        target_id;
20499         /*
20500          * A physical address pointer pointing to a host buffer that the
20501          * command's response data will be written. This can be either a host
20502          * physical address (HPA) or a guest physical address (GPA) and must
20503          * point to a physically contiguous block of memory.
20504          */
20505         uint64_t        resp_addr;
20506         uint32_t        event_data1;
20507         uint32_t        event_data2;
20508 } __rte_packed;
20509
20510 /* hwrm_func_echo_response_output (size:128b/16B) */
20511 struct hwrm_func_echo_response_output {
20512         /* The specific error status for the command. */
20513         uint16_t        error_code;
20514         /* The HWRM command request type. */
20515         uint16_t        req_type;
20516         /* The sequence ID from the original command. */
20517         uint16_t        seq_id;
20518         /* The length of the response data in number of bytes. */
20519         uint16_t        resp_len;
20520         uint8_t unused_0[7];
20521         /*
20522          * This field is used in Output records to indicate that the output
20523          * is completely written to RAM.  This field should be read as '1'
20524          * to indicate that the output has been completely written.
20525          * When writing a command completion or response to an internal processor,
20526          * the order of writes has to be such that this field is written last.
20527          */
20528         uint8_t valid;
20529 } __rte_packed;
20530
20531 /**************************
20532  * hwrm_func_ptp_pin_qcfg *
20533  **************************/
20534
20535
20536 /* hwrm_func_ptp_pin_qcfg_input (size:192b/24B) */
20537 struct hwrm_func_ptp_pin_qcfg_input {
20538         /* The HWRM command request type. */
20539         uint16_t        req_type;
20540         /*
20541          * The completion ring to send the completion event on. This should
20542          * be the NQ ID returned from the `nq_alloc` HWRM command.
20543          */
20544         uint16_t        cmpl_ring;
20545         /*
20546          * The sequence ID is used by the driver for tracking multiple
20547          * commands. This ID is treated as opaque data by the firmware and
20548          * the value is returned in the `hwrm_resp_hdr` upon completion.
20549          */
20550         uint16_t        seq_id;
20551         /*
20552          * The target ID of the command:
20553          * * 0x0-0xFFF8 - The function ID
20554          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20555          * * 0xFFFD - Reserved for user-space HWRM interface
20556          * * 0xFFFF - HWRM
20557          */
20558         uint16_t        target_id;
20559         /*
20560          * A physical address pointer pointing to a host buffer that the
20561          * command's response data will be written. This can be either a host
20562          * physical address (HPA) or a guest physical address (GPA) and must
20563          * point to a physically contiguous block of memory.
20564          */
20565         uint64_t        resp_addr;
20566         uint8_t unused_0[8];
20567 } __rte_packed;
20568
20569 /* hwrm_func_ptp_pin_qcfg_output (size:128b/16B) */
20570 struct hwrm_func_ptp_pin_qcfg_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          * The number of TSIO pins that are configured on this board
20581          * Up to 4 pins can be returned in the response.
20582          */
20583         uint8_t num_pins;
20584         /* Pin state */
20585         uint8_t state;
20586         /*
20587          * When this bit is '1', TSIO pin 0 is enabled.
20588          * When this bit is '0', TSIO pin 0 is disabled.
20589          */
20590         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN0_ENABLED \
20591                 UINT32_C(0x1)
20592         /*
20593          * When this bit is '1', TSIO pin 1 is enabled.
20594          * When this bit is '0', TSIO pin 1 is disabled.
20595          */
20596         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN1_ENABLED \
20597                 UINT32_C(0x2)
20598         /*
20599          * When this bit is '1', TSIO pin 2 is enabled.
20600          * When this bit is '0', TSIO pin 2 is disabled.
20601          */
20602         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN2_ENABLED \
20603                 UINT32_C(0x4)
20604         /*
20605          * When this bit is '1', TSIO pin 3 is enabled.
20606          * When this bit is '0', TSIO pin 3 is disabled.
20607          */
20608         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_STATE_PIN3_ENABLED \
20609                 UINT32_C(0x8)
20610         /* Type of function for Pin #0. */
20611         uint8_t pin0_usage;
20612         /* No function is configured. */
20613         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_NONE     UINT32_C(0x0)
20614         /* PPS IN is configured. */
20615         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_PPS_IN   UINT32_C(0x1)
20616         /* PPS OUT is configured. */
20617         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_PPS_OUT  UINT32_C(0x2)
20618         /* SYNC IN is configured. */
20619         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_IN  UINT32_C(0x3)
20620         /* SYNC OUT is configured. */
20621         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_OUT UINT32_C(0x4)
20622         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_LAST \
20623                 HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN0_USAGE_SYNC_OUT
20624         /* Type of function for Pin #1. */
20625         uint8_t pin1_usage;
20626         /* No function is configured. */
20627         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_NONE     UINT32_C(0x0)
20628         /* PPS IN is configured. */
20629         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_PPS_IN   UINT32_C(0x1)
20630         /* PPS OUT is configured. */
20631         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_PPS_OUT  UINT32_C(0x2)
20632         /* SYNC IN is configured. */
20633         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_IN  UINT32_C(0x3)
20634         /* SYNC OUT is configured. */
20635         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_OUT UINT32_C(0x4)
20636         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_LAST \
20637                 HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN1_USAGE_SYNC_OUT
20638         /* Type of function for Pin #2. */
20639         uint8_t pin2_usage;
20640         /* No function is configured. */
20641         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_NONE     UINT32_C(0x0)
20642         /* PPS IN is configured. */
20643         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_PPS_IN   UINT32_C(0x1)
20644         /* PPS OUT is configured. */
20645         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_PPS_OUT  UINT32_C(0x2)
20646         /* SYNC IN is configured. */
20647         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNC_IN  UINT32_C(0x3)
20648         /* SYNC OUT is configured. */
20649         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNC_OUT UINT32_C(0x4)
20650         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_LAST \
20651                 HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN2_USAGE_SYNC_OUT
20652         /* Type of function for Pin #3. */
20653         uint8_t pin3_usage;
20654         /* No function is configured. */
20655         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_NONE     UINT32_C(0x0)
20656         /* PPS IN is configured. */
20657         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_PPS_IN   UINT32_C(0x1)
20658         /* PPS OUT is configured. */
20659         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_PPS_OUT  UINT32_C(0x2)
20660         /* SYNC IN is configured. */
20661         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNC_IN  UINT32_C(0x3)
20662         /* SYNC OUT is configured. */
20663         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNC_OUT UINT32_C(0x4)
20664         #define HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_LAST \
20665                 HWRM_FUNC_PTP_PIN_QCFG_OUTPUT_PIN3_USAGE_SYNC_OUT
20666         uint8_t unused_0;
20667         /*
20668          * This field is used in Output records to indicate that the output
20669          * is completely written to RAM.  This field should be read as '1'
20670          * to indicate that the output has been completely written.
20671          * When writing a command completion or response to an internal processor,
20672          * the order of writes has to be such that this field is written last.
20673          */
20674         uint8_t valid;
20675 } __rte_packed;
20676
20677 /*************************
20678  * hwrm_func_ptp_pin_cfg *
20679  *************************/
20680
20681
20682 /* hwrm_func_ptp_pin_cfg_input (size:256b/32B) */
20683 struct hwrm_func_ptp_pin_cfg_input {
20684         /* The HWRM command request type. */
20685         uint16_t        req_type;
20686         /*
20687          * The completion ring to send the completion event on. This should
20688          * be the NQ ID returned from the `nq_alloc` HWRM command.
20689          */
20690         uint16_t        cmpl_ring;
20691         /*
20692          * The sequence ID is used by the driver for tracking multiple
20693          * commands. This ID is treated as opaque data by the firmware and
20694          * the value is returned in the `hwrm_resp_hdr` upon completion.
20695          */
20696         uint16_t        seq_id;
20697         /*
20698          * The target ID of the command:
20699          * * 0x0-0xFFF8 - The function ID
20700          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20701          * * 0xFFFD - Reserved for user-space HWRM interface
20702          * * 0xFFFF - HWRM
20703          */
20704         uint16_t        target_id;
20705         /*
20706          * A physical address pointer pointing to a host buffer that the
20707          * command's response data will be written. This can be either a host
20708          * physical address (HPA) or a guest physical address (GPA) and must
20709          * point to a physically contiguous block of memory.
20710          */
20711         uint64_t        resp_addr;
20712         uint32_t        enables;
20713         /*
20714          * This bit must be '1' for the pin0_state field to be
20715          * configured.
20716          */
20717         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN0_STATE \
20718                 UINT32_C(0x1)
20719         /*
20720          * This bit must be '1' for the pin0_usage field to be
20721          * configured.
20722          */
20723         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN0_USAGE \
20724                 UINT32_C(0x2)
20725         /*
20726          * This bit must be '1' for the pin1_state field to be
20727          * configured.
20728          */
20729         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN1_STATE \
20730                 UINT32_C(0x4)
20731         /*
20732          * This bit must be '1' for the pin1_usage field to be
20733          * configured.
20734          */
20735         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN1_USAGE \
20736                 UINT32_C(0x8)
20737         /*
20738          * This bit must be '1' for the pin2_state field to be
20739          * configured.
20740          */
20741         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN2_STATE \
20742                 UINT32_C(0x10)
20743         /*
20744          * This bit must be '1' for the pin2_usage field to be
20745          * configured.
20746          */
20747         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN2_USAGE \
20748                 UINT32_C(0x20)
20749         /*
20750          * This bit must be '1' for the pin3_state field to be
20751          * configured.
20752          */
20753         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN3_STATE \
20754                 UINT32_C(0x40)
20755         /*
20756          * This bit must be '1' for the pin3_usage field to be
20757          * configured.
20758          */
20759         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_ENABLES_PIN3_USAGE \
20760                 UINT32_C(0x80)
20761         /* Enable or disable functionality of Pin #0. */
20762         uint8_t pin0_state;
20763         /* Disabled */
20764         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_DISABLED UINT32_C(0x0)
20765         /* Enabled */
20766         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_ENABLED  UINT32_C(0x1)
20767         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_LAST \
20768                 HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_STATE_ENABLED
20769         /* Configure function for TSIO pin#0. */
20770         uint8_t pin0_usage;
20771         /* No function is configured. */
20772         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_NONE     UINT32_C(0x0)
20773         /* PPS IN is configured. */
20774         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_PPS_IN   UINT32_C(0x1)
20775         /* PPS OUT is configured. */
20776         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_PPS_OUT  UINT32_C(0x2)
20777         /* SYNC IN is configured. */
20778         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_IN  UINT32_C(0x3)
20779         /* SYNC OUT is configured. */
20780         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_OUT UINT32_C(0x4)
20781         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_LAST \
20782                 HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN0_USAGE_SYNC_OUT
20783         /* Enable or disable functionality of Pin #1. */
20784         uint8_t pin1_state;
20785         /* Disabled */
20786         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_DISABLED UINT32_C(0x0)
20787         /* Enabled */
20788         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_ENABLED  UINT32_C(0x1)
20789         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_LAST \
20790                 HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_STATE_ENABLED
20791         /* Configure function for TSIO pin#1. */
20792         uint8_t pin1_usage;
20793         /* No function is configured. */
20794         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_NONE     UINT32_C(0x0)
20795         /* PPS IN is configured. */
20796         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_PPS_IN   UINT32_C(0x1)
20797         /* PPS OUT is configured. */
20798         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_PPS_OUT  UINT32_C(0x2)
20799         /* SYNC IN is configured. */
20800         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_IN  UINT32_C(0x3)
20801         /* SYNC OUT is configured. */
20802         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_OUT UINT32_C(0x4)
20803         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_LAST \
20804                 HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN1_USAGE_SYNC_OUT
20805         /* Enable or disable functionality of Pin #2. */
20806         uint8_t pin2_state;
20807         /* Disabled */
20808         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_DISABLED UINT32_C(0x0)
20809         /* Enabled */
20810         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_ENABLED  UINT32_C(0x1)
20811         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_LAST \
20812                 HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_STATE_ENABLED
20813         /* Configure function for TSIO pin#2. */
20814         uint8_t pin2_usage;
20815         /* No function is configured. */
20816         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_NONE     UINT32_C(0x0)
20817         /* PPS IN is configured. */
20818         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_PPS_IN   UINT32_C(0x1)
20819         /* PPS OUT is configured. */
20820         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_PPS_OUT  UINT32_C(0x2)
20821         /* SYNC IN is configured. */
20822         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNC_IN  UINT32_C(0x3)
20823         /* SYNC OUT is configured. */
20824         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNC_OUT UINT32_C(0x4)
20825         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_LAST \
20826                 HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN2_USAGE_SYNC_OUT
20827         /* Enable or disable functionality of Pin #3. */
20828         uint8_t pin3_state;
20829         /* Disabled */
20830         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_DISABLED UINT32_C(0x0)
20831         /* Enabled */
20832         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_ENABLED  UINT32_C(0x1)
20833         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_LAST \
20834                 HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_STATE_ENABLED
20835         /* Configure function for TSIO pin#3. */
20836         uint8_t pin3_usage;
20837         /* No function is configured. */
20838         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_NONE     UINT32_C(0x0)
20839         /* PPS IN is configured. */
20840         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_PPS_IN   UINT32_C(0x1)
20841         /* PPS OUT is configured. */
20842         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_PPS_OUT  UINT32_C(0x2)
20843         /* SYNC IN is configured. */
20844         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNC_IN  UINT32_C(0x3)
20845         /* SYNC OUT is configured. */
20846         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNC_OUT UINT32_C(0x4)
20847         #define HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_LAST \
20848                 HWRM_FUNC_PTP_PIN_CFG_INPUT_PIN3_USAGE_SYNC_OUT
20849         uint8_t unused_0[4];
20850 } __rte_packed;
20851
20852 /* hwrm_func_ptp_pin_cfg_output (size:128b/16B) */
20853 struct hwrm_func_ptp_pin_cfg_output {
20854         /* The specific error status for the command. */
20855         uint16_t        error_code;
20856         /* The HWRM command request type. */
20857         uint16_t        req_type;
20858         /* The sequence ID from the original command. */
20859         uint16_t        seq_id;
20860         /* The length of the response data in number of bytes. */
20861         uint16_t        resp_len;
20862         uint8_t unused_0[7];
20863         /*
20864          * This field is used in Output records to indicate that the output
20865          * is completely written to RAM.  This field should be read as '1'
20866          * to indicate that the output has been completely written.
20867          * When writing a command completion or response to an internal processor,
20868          * the order of writes has to be such that this field is written last.
20869          */
20870         uint8_t valid;
20871 } __rte_packed;
20872
20873 /*********************
20874  * hwrm_func_ptp_cfg *
20875  *********************/
20876
20877
20878 /* hwrm_func_ptp_cfg_input (size:384b/48B) */
20879 struct hwrm_func_ptp_cfg_input {
20880         /* The HWRM command request type. */
20881         uint16_t        req_type;
20882         /*
20883          * The completion ring to send the completion event on. This should
20884          * be the NQ ID returned from the `nq_alloc` HWRM command.
20885          */
20886         uint16_t        cmpl_ring;
20887         /*
20888          * The sequence ID is used by the driver for tracking multiple
20889          * commands. This ID is treated as opaque data by the firmware and
20890          * the value is returned in the `hwrm_resp_hdr` upon completion.
20891          */
20892         uint16_t        seq_id;
20893         /*
20894          * The target ID of the command:
20895          * * 0x0-0xFFF8 - The function ID
20896          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20897          * * 0xFFFD - Reserved for user-space HWRM interface
20898          * * 0xFFFF - HWRM
20899          */
20900         uint16_t        target_id;
20901         /*
20902          * A physical address pointer pointing to a host buffer that the
20903          * command's response data will be written. This can be either a host
20904          * physical address (HPA) or a guest physical address (GPA) and must
20905          * point to a physically contiguous block of memory.
20906          */
20907         uint64_t        resp_addr;
20908         uint16_t        enables;
20909         /*
20910          * This bit must be '1' for the ptp_pps_event field to be
20911          * configured.
20912          */
20913         #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_PPS_EVENT \
20914                 UINT32_C(0x1)
20915         /*
20916          * This bit must be '1' for the ptp_freq_adj_dll_source field to be
20917          * configured.
20918          */
20919         #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_DLL_SOURCE \
20920                 UINT32_C(0x2)
20921         /*
20922          * This bit must be '1' for the ptp_freq_adj_dll_phase field to be
20923          * configured.
20924          */
20925         #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_DLL_PHASE \
20926                 UINT32_C(0x4)
20927         /*
20928          * This bit must be '1' for the ptp_freq_adj_ext_period field to be
20929          * configured.
20930          */
20931         #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_PERIOD \
20932                 UINT32_C(0x8)
20933         /*
20934          * This bit must be '1' for the ptp_freq_adj_ext_up field to be
20935          * configured.
20936          */
20937         #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_UP \
20938                 UINT32_C(0x10)
20939         /*
20940          * This bit must be '1' for the ptp_freq_adj_ext_phase field to be
20941          * configured.
20942          */
20943         #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_EXT_PHASE \
20944                 UINT32_C(0x20)
20945         /* This bit must be '1' for ptp_set_time field to be configured. */
20946         #define HWRM_FUNC_PTP_CFG_INPUT_ENABLES_PTP_SET_TIME \
20947                 UINT32_C(0x40)
20948         /* This field is used to enable interrupt for a specific PPS event. */
20949         uint8_t ptp_pps_event;
20950         /*
20951          * When this bit is set to '1', interrupt is enabled for internal
20952          * PPS event. Latches timestamp on PPS_OUT TSIO Pin. If user does
20953          * not configure PPS_OUT on a TSIO pin, then firmware will allocate
20954          * PPS_OUT to an unallocated pin.
20955          */
20956         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_PPS_EVENT_INTERNAL \
20957                 UINT32_C(0x1)
20958         /*
20959          * When this bit is set to '1', interrupt is enabled for external
20960          * PPS event. Latches timestamp on PPS_IN TSIO pin.
20961          */
20962         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_PPS_EVENT_EXTERNAL \
20963                 UINT32_C(0x2)
20964         /*
20965          * This field is used to set the source signal used to discipline
20966          * PHC (PTP Hardware Clock)
20967          */
20968         uint8_t ptp_freq_adj_dll_source;
20969         /* No source is selected. Use servo to discipline PHC */
20970         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_NONE \
20971                 UINT32_C(0x0)
20972         /* TSIO Pin #0 is selected as source signal. */
20973         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_0 \
20974                 UINT32_C(0x1)
20975         /* TSIO Pin #1 is selected as source signal. */
20976         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_1 \
20977                 UINT32_C(0x2)
20978         /* TSIO Pin #2 is selected as source signal. */
20979         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_2 \
20980                 UINT32_C(0x3)
20981         /* TSIO Pin #3 is selected as source signal. */
20982         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_TSIO_3 \
20983                 UINT32_C(0x4)
20984         /* Port #0 is selected as source signal. */
20985         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_0 \
20986                 UINT32_C(0x5)
20987         /* Port #1 is selected as source signal. */
20988         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_1 \
20989                 UINT32_C(0x6)
20990         /* Port #2 is selected as source signal. */
20991         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_2 \
20992                 UINT32_C(0x7)
20993         /* Port #3 is selected as source signal. */
20994         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_PORT_3 \
20995                 UINT32_C(0x8)
20996         /* Invalid signal. */
20997         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_INVALID \
20998                 UINT32_C(0xff)
20999         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_LAST \
21000                 HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_SOURCE_INVALID
21001         /*
21002          * This field is used to provide phase adjustment for DLL
21003          * used to discipline PHC (PTP Hardware clock)
21004          */
21005         uint8_t ptp_freq_adj_dll_phase;
21006         /* No Phase adjustment. */
21007         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_NONE \
21008                 UINT32_C(0x0)
21009         /* 4Khz sync in frequency. */
21010         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_4K \
21011                 UINT32_C(0x1)
21012         /* 8Khz sync in frequency. */
21013         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_8K \
21014                 UINT32_C(0x2)
21015         /* 10Mhz sync in frequency. */
21016         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_10M \
21017                 UINT32_C(0x3)
21018         #define HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_LAST \
21019                 HWRM_FUNC_PTP_CFG_INPUT_PTP_FREQ_ADJ_DLL_PHASE_10M
21020         uint8_t unused_0[3];
21021         /*
21022          * Period in nanoseconds (ns) for external signal
21023          * input.
21024          */
21025         uint32_t        ptp_freq_adj_ext_period;
21026         /*
21027          * Up time in nanoseconds (ns) of the duty cycle
21028          * of the external signal. This value should be
21029          * less than ptp_freq_adj_ext_period.
21030          */
21031         uint32_t        ptp_freq_adj_ext_up;
21032         /*
21033          * Phase value is provided. This field provides the
21034          * least significant 32 bits of the phase input. The
21035          * most significant 16 bits come from
21036          * ptp_freq_adj_ext_phase_upper field. Setting this
21037          * field requires setting ptp_freq_adj_ext_period
21038          * field as well to identify the external signal
21039          * pin.
21040          */
21041         uint32_t        ptp_freq_adj_ext_phase_lower;
21042         /*
21043          * Phase value is provided. The lower 16 bits of this field is used
21044          * with the 32 bit value from ptp_freq_adj_ext_phase_lower
21045          * to provide a 48 bit value input for Phase.
21046          */
21047         uint32_t        ptp_freq_adj_ext_phase_upper;
21048         /*
21049          * Allows driver to set the full 64bit time in FW. The upper 16 bits
21050          * will be stored in FW and the lower 48bits will be programmed in
21051          * PHC. Firmware will send a broadcast async event to all functions
21052          * to indicate the programmed upper 16 bits.
21053          */
21054         uint64_t        ptp_set_time;
21055 } __rte_packed;
21056
21057 /* hwrm_func_ptp_cfg_output (size:128b/16B) */
21058 struct hwrm_func_ptp_cfg_output {
21059         /* The specific error status for the command. */
21060         uint16_t        error_code;
21061         /* The HWRM command request type. */
21062         uint16_t        req_type;
21063         /* The sequence ID from the original command. */
21064         uint16_t        seq_id;
21065         /* The length of the response data in number of bytes. */
21066         uint16_t        resp_len;
21067         uint8_t unused_0[7];
21068         /*
21069          * This field is used in Output records to indicate that the output
21070          * is completely written to RAM.  This field should be read as '1'
21071          * to indicate that the output has been completely written.
21072          * When writing a command completion or response to an internal processor,
21073          * the order of writes has to be such that this field is written last.
21074          */
21075         uint8_t valid;
21076 } __rte_packed;
21077
21078 /**************************
21079  * hwrm_func_ptp_ts_query *
21080  **************************/
21081
21082
21083 /* hwrm_func_ptp_ts_query_input (size:192b/24B) */
21084 struct hwrm_func_ptp_ts_query_input {
21085         /* The HWRM command request type. */
21086         uint16_t        req_type;
21087         /*
21088          * The completion ring to send the completion event on. This should
21089          * be the NQ ID returned from the `nq_alloc` HWRM command.
21090          */
21091         uint16_t        cmpl_ring;
21092         /*
21093          * The sequence ID is used by the driver for tracking multiple
21094          * commands. This ID is treated as opaque data by the firmware and
21095          * the value is returned in the `hwrm_resp_hdr` upon completion.
21096          */
21097         uint16_t        seq_id;
21098         /*
21099          * The target ID of the command:
21100          * * 0x0-0xFFF8 - The function ID
21101          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21102          * * 0xFFFD - Reserved for user-space HWRM interface
21103          * * 0xFFFF - HWRM
21104          */
21105         uint16_t        target_id;
21106         /*
21107          * A physical address pointer pointing to a host buffer that the
21108          * command's response data will be written. This can be either a host
21109          * physical address (HPA) or a guest physical address (GPA) and must
21110          * point to a physically contiguous block of memory.
21111          */
21112         uint64_t        resp_addr;
21113         uint32_t        flags;
21114         /* If set, the response includes PPS event timestamps */
21115         #define HWRM_FUNC_PTP_TS_QUERY_INPUT_FLAGS_PPS_TIME     UINT32_C(0x1)
21116         /* If set, the response includes PTM timestamps */
21117         #define HWRM_FUNC_PTP_TS_QUERY_INPUT_FLAGS_PTM_TIME     UINT32_C(0x2)
21118         uint8_t unused_0[4];
21119 } __rte_packed;
21120
21121 /* hwrm_func_ptp_ts_query_output (size:320b/40B) */
21122 struct hwrm_func_ptp_ts_query_output {
21123         /* The specific error status for the command. */
21124         uint16_t        error_code;
21125         /* The HWRM command request type. */
21126         uint16_t        req_type;
21127         /* The sequence ID from the original command. */
21128         uint16_t        seq_id;
21129         /* The length of the response data in number of bytes. */
21130         uint16_t        resp_len;
21131         /* Timestamp value of last PPS event latched. */
21132         uint64_t        pps_event_ts;
21133         /* PTM local timestamp value. */
21134         uint64_t        ptm_res_local_ts;
21135         /* PTM Master timestamp value. */
21136         uint64_t        ptm_pmstr_ts;
21137         /* PTM Master propagation delay */
21138         uint32_t        ptm_mstr_prop_dly;
21139         uint8_t unused_0[3];
21140         /*
21141          * This field is used in Output records to indicate that the output
21142          * is completely written to RAM.  This field should be read as '1'
21143          * to indicate that the output has been completely written.
21144          * When writing a command completion or response to an internal processor,
21145          * the order of writes has to be such that this field is written last.
21146          */
21147         uint8_t valid;
21148 } __rte_packed;
21149
21150 /*************************
21151  * hwrm_func_ptp_ext_cfg *
21152  *************************/
21153
21154
21155 /* hwrm_func_ptp_ext_cfg_input (size:256b/32B) */
21156 struct hwrm_func_ptp_ext_cfg_input {
21157         /* The HWRM command request type. */
21158         uint16_t        req_type;
21159         /*
21160          * The completion ring to send the completion event on. This should
21161          * be the NQ ID returned from the `nq_alloc` HWRM command.
21162          */
21163         uint16_t        cmpl_ring;
21164         /*
21165          * The sequence ID is used by the driver for tracking multiple
21166          * commands. This ID is treated as opaque data by the firmware and
21167          * the value is returned in the `hwrm_resp_hdr` upon completion.
21168          */
21169         uint16_t        seq_id;
21170         /*
21171          * The target ID of the command:
21172          * * 0x0-0xFFF8 - The function ID
21173          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21174          * * 0xFFFD - Reserved for user-space HWRM interface
21175          * * 0xFFFF - HWRM
21176          */
21177         uint16_t        target_id;
21178         /*
21179          * A physical address pointer pointing to a host buffer that the
21180          * command's response data will be written. This can be either a host
21181          * physical address (HPA) or a guest physical address (GPA) and must
21182          * point to a physically contiguous block of memory.
21183          */
21184         uint64_t        resp_addr;
21185         uint16_t        enables;
21186         /*
21187          * This bit must be '1' for the phc_master_fid field to be
21188          * configured.
21189          */
21190         #define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_PHC_MASTER_FID \
21191                 UINT32_C(0x1)
21192         /*
21193          * This bit must be '1' for the phc_sec_fid field to be
21194          * configured.
21195          */
21196         #define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_PHC_SEC_FID \
21197                 UINT32_C(0x2)
21198         /*
21199          * This bit must be '1' for the phc_sec_mode field to be
21200          * configured.
21201          */
21202         #define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_PHC_SEC_MODE \
21203                 UINT32_C(0x4)
21204         /*
21205          * This bit must be '1' for the failover_timer field to be
21206          * configured.
21207          */
21208         #define HWRM_FUNC_PTP_EXT_CFG_INPUT_ENABLES_FAILOVER_TIMER \
21209                 UINT32_C(0x8)
21210         /*
21211          * This field is used to configure the Master function. Only this
21212          * function can modify or condition the PHC. Only driver calls from
21213          * this function are allowed to adjust frequency of PHC or configure
21214          * PPS functionality.
21215          * If driver does not specify this FID, then firmware will auto select
21216          * the first function that makes the call to modify PHC as the Master.
21217          */
21218         uint16_t        phc_master_fid;
21219         /*
21220          * This field is used to configure the secondary function. This
21221          * function becomes the Master function in case of failover from
21222          * Master function.
21223          * If driver does not specify this FID, firmware will auto select
21224          * the last non-master function to make a call to condition PHC as
21225          * secondary.
21226          */
21227         uint16_t        phc_sec_fid;
21228         /*
21229          * This field is used to configure conditions under which a function
21230          * can become a secondary function.
21231          */
21232         uint8_t phc_sec_mode;
21233         /*
21234          * Immediately failover to the current secondary function. If there
21235          * is no secondary function available, failover does not happen.
21236          */
21237         #define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_SWITCH  UINT32_C(0x0)
21238         /*
21239          * All functions (PF and VF) can be used during auto selection
21240          * of a secondary function. This is not used in case of admin
21241          * configured secondary function.
21242          */
21243         #define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_ALL     UINT32_C(0x1)
21244         /*
21245          * Only PF's can be selected as a secondary function during auto
21246          * selection. This is not used in case of admin configured secondary
21247          * function.
21248          */
21249         #define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_PF_ONLY UINT32_C(0x2)
21250         #define HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_LAST \
21251                 HWRM_FUNC_PTP_EXT_CFG_INPUT_PHC_SEC_MODE_PF_ONLY
21252         uint8_t unused_0;
21253         /*
21254          * This field indicates the failover time is milliseconds. If the
21255          * timeout expires, firmware will failover PTP configurability from
21256          * current master to secondary fid.
21257          * 0 - Failover timer is automatically selected based on the last
21258          * adjFreq() call. If adjFreq() is not called for 3 * (last interval)
21259          * the failover kicks in. For example, if last interval between
21260          * adjFreq() calls was 2 seconds and the next adjFreq() is not made for
21261          * at least 6 seconds, then secondary takes over as master to condition
21262          * PHC. Firmware rounds up the failover timer to be a multiple of 250
21263          * ms. Firmware checks every 250 ms to see if timer expired.
21264          * 0xFFFFFFFF - If driver specifies this value, then failover never
21265          * happens. Admin or auto selected Master will always be used for
21266          * conditioning PHC.
21267          * X - If driver specifies any other value, this is admin indicated
21268          * failover timeout. If no adjFreq() call is made within this timeout
21269          * value, then failover happens. This value should be a multiple of
21270          * 250 ms. Firmware checks every 250 ms to see if timer expired.
21271          */
21272         uint32_t        failover_timer;
21273         uint8_t unused_1[4];
21274 } __rte_packed;
21275
21276 /* hwrm_func_ptp_ext_cfg_output (size:128b/16B) */
21277 struct hwrm_func_ptp_ext_cfg_output {
21278         /* The specific error status for the command. */
21279         uint16_t        error_code;
21280         /* The HWRM command request type. */
21281         uint16_t        req_type;
21282         /* The sequence ID from the original command. */
21283         uint16_t        seq_id;
21284         /* The length of the response data in number of bytes. */
21285         uint16_t        resp_len;
21286         uint8_t unused_0[7];
21287         /*
21288          * This field is used in Output records to indicate that the output
21289          * is completely written to RAM.  This field should be read as '1'
21290          * to indicate that the output has been completely written.
21291          * When writing a command completion or response to an internal processor,
21292          * the order of writes has to be such that this field is written last.
21293          */
21294         uint8_t valid;
21295 } __rte_packed;
21296
21297 /**************************
21298  * hwrm_func_ptp_ext_qcfg *
21299  **************************/
21300
21301
21302 /* hwrm_func_ptp_ext_qcfg_input (size:192b/24B) */
21303 struct hwrm_func_ptp_ext_qcfg_input {
21304         /* The HWRM command request type. */
21305         uint16_t        req_type;
21306         /*
21307          * The completion ring to send the completion event on. This should
21308          * be the NQ ID returned from the `nq_alloc` HWRM command.
21309          */
21310         uint16_t        cmpl_ring;
21311         /*
21312          * The sequence ID is used by the driver for tracking multiple
21313          * commands. This ID is treated as opaque data by the firmware and
21314          * the value is returned in the `hwrm_resp_hdr` upon completion.
21315          */
21316         uint16_t        seq_id;
21317         /*
21318          * The target ID of the command:
21319          * * 0x0-0xFFF8 - The function ID
21320          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21321          * * 0xFFFD - Reserved for user-space HWRM interface
21322          * * 0xFFFF - HWRM
21323          */
21324         uint16_t        target_id;
21325         /*
21326          * A physical address pointer pointing to a host buffer that the
21327          * command's response data will be written. This can be either a host
21328          * physical address (HPA) or a guest physical address (GPA) and must
21329          * point to a physically contiguous block of memory.
21330          */
21331         uint64_t        resp_addr;
21332         uint8_t unused_0[8];
21333 } __rte_packed;
21334
21335 /* hwrm_func_ptp_ext_qcfg_output (size:256b/32B) */
21336 struct hwrm_func_ptp_ext_qcfg_output {
21337         /* The specific error status for the command. */
21338         uint16_t        error_code;
21339         /* The HWRM command request type. */
21340         uint16_t        req_type;
21341         /* The sequence ID from the original command. */
21342         uint16_t        seq_id;
21343         /* The length of the response data in number of bytes. */
21344         uint16_t        resp_len;
21345         /*
21346          * Firmware returns the current PHC master function. This function
21347          * could either be admin selected or auto selected.
21348          */
21349         uint16_t        phc_master_fid;
21350         /*
21351          * Firmware returns the current PHC secondary function. This function
21352          * could either be admin selected or auto selected.
21353          */
21354         uint16_t        phc_sec_fid;
21355         /*
21356          * Firmware returns the last non-master/non-secondary function to
21357          * make a call to condition PHC.
21358          */
21359         uint16_t        phc_active_fid0;
21360         /*
21361          * Firmware returns the second last non-master/non-secondary function
21362          * to make a call to condition PHC.
21363          */
21364         uint16_t        phc_active_fid1;
21365         /*
21366          * Timestamp indicating the last time a failover happened. The master
21367          * and secondary functions in the failover event is indicated in the
21368          * next two fields.
21369          */
21370         uint32_t        last_failover_event;
21371         /*
21372          * Last failover happened from this function. This was the master
21373          * function at the time of failover.
21374          */
21375         uint16_t        from_fid;
21376         /*
21377          * Last failover happened to this function. This was the secondary
21378          * function at the time of failover.
21379          */
21380         uint16_t        to_fid;
21381         uint8_t unused_0[7];
21382         /*
21383          * This field is used in Output records to indicate that the output
21384          * is completely written to RAM.  This field should be read as '1'
21385          * to indicate that the output has been completely written.
21386          * When writing a command completion or response to an internal processor,
21387          * the order of writes has to be such that this field is written last.
21388          */
21389         uint8_t valid;
21390 } __rte_packed;
21391
21392 /***************************
21393  * hwrm_func_key_ctx_alloc *
21394  ***************************/
21395
21396
21397 /* hwrm_func_key_ctx_alloc_input (size:320b/40B) */
21398 struct hwrm_func_key_ctx_alloc_input {
21399         /* The HWRM command request type. */
21400         uint16_t        req_type;
21401         /*
21402          * The completion ring to send the completion event on. This should
21403          * be the NQ ID returned from the `nq_alloc` HWRM command.
21404          */
21405         uint16_t        cmpl_ring;
21406         /*
21407          * The sequence ID is used by the driver for tracking multiple
21408          * commands. This ID is treated as opaque data by the firmware and
21409          * the value is returned in the `hwrm_resp_hdr` upon completion.
21410          */
21411         uint16_t        seq_id;
21412         /*
21413          * The target ID of the command:
21414          * * 0x0-0xFFF8 - The function ID
21415          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21416          * * 0xFFFD - Reserved for user-space HWRM interface
21417          * * 0xFFFF - HWRM
21418          */
21419         uint16_t        target_id;
21420         /*
21421          * A physical address pointer pointing to a host buffer that the
21422          * command's response data will be written. This can be either a host
21423          * physical address (HPA) or a guest physical address (GPA) and must
21424          * point to a physically contiguous block of memory.
21425          */
21426         uint64_t        resp_addr;
21427         /* Function ID. */
21428         uint16_t        fid;
21429         /* Number of Key Contexts to be allocated. */
21430         uint16_t        num_key_ctxs;
21431         /* DMA buffer size in bytes. */
21432         uint32_t        dma_bufr_size_bytes;
21433         /* Key Context type. */
21434         uint8_t key_ctx_type;
21435         /* KTLS Tx Key Context type. */
21436         #define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_TX \
21437                 UINT32_C(0x0)
21438         /* KTLS Rx Key Context type. */
21439         #define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_RX \
21440                 UINT32_C(0x1)
21441         /* QUIC Tx Key Context type. */
21442         #define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_QUIC_TX \
21443                 UINT32_C(0x2)
21444         /* QUIC Rx Key Context type. */
21445         #define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_QUIC_RX \
21446                 UINT32_C(0x3)
21447         #define HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_LAST \
21448                 HWRM_FUNC_KEY_CTX_ALLOC_INPUT_KEY_CTX_TYPE_QUIC_RX
21449         uint8_t unused_0[7];
21450         /* Host DMA address to send back KTLS context IDs. */
21451         uint64_t        host_dma_addr;
21452 } __rte_packed;
21453
21454 /* hwrm_func_key_ctx_alloc_output (size:128b/16B) */
21455 struct hwrm_func_key_ctx_alloc_output {
21456         /* The specific error status for the command. */
21457         uint16_t        error_code;
21458         /* The HWRM command request type. */
21459         uint16_t        req_type;
21460         /* The sequence ID from the original command. */
21461         uint16_t        seq_id;
21462         /* The length of the response data in number of bytes. */
21463         uint16_t        resp_len;
21464         /* Actual number of Key Contexts allocated. */
21465         uint16_t        num_key_ctxs_allocated;
21466         uint8_t unused_0[5];
21467         /*
21468          * This field is used in Output records to indicate that the output
21469          * is completely written to RAM.  This field should be read as '1'
21470          * to indicate that the output has been completely written.
21471          * When writing a command completion or response to an internal processor,
21472          * the order of writes has to be such that this field is written last.
21473          */
21474         uint8_t valid;
21475 } __rte_packed;
21476
21477 /**********************************
21478  * hwrm_func_backing_store_cfg_v2 *
21479  **********************************/
21480
21481
21482 /* hwrm_func_backing_store_cfg_v2_input (size:448b/56B) */
21483 struct hwrm_func_backing_store_cfg_v2_input {
21484         /* The HWRM command request type. */
21485         uint16_t        req_type;
21486         /*
21487          * The completion ring to send the completion event on. This should
21488          * be the NQ ID returned from the `nq_alloc` HWRM command.
21489          */
21490         uint16_t        cmpl_ring;
21491         /*
21492          * The sequence ID is used by the driver for tracking multiple
21493          * commands. This ID is treated as opaque data by the firmware and
21494          * the value is returned in the `hwrm_resp_hdr` upon completion.
21495          */
21496         uint16_t        seq_id;
21497         /*
21498          * The target ID of the command:
21499          * * 0x0-0xFFF8 - The function ID
21500          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21501          * * 0xFFFD - Reserved for user-space HWRM interface
21502          * * 0xFFFF - HWRM
21503          */
21504         uint16_t        target_id;
21505         /*
21506          * A physical address pointer pointing to a host buffer that the
21507          * command's response data will be written. This can be either a host
21508          * physical address (HPA) or a guest physical address (GPA) and must
21509          * point to a physically contiguous block of memory.
21510          */
21511         uint64_t        resp_addr;
21512         /* Type of backing store to be configured. */
21513         uint16_t        type;
21514         /* Queue pair. */
21515         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QP \
21516                 UINT32_C(0x0)
21517         /* Shared receive queue. */
21518         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRQ \
21519                 UINT32_C(0x1)
21520         /* Completion queue. */
21521         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CQ \
21522                 UINT32_C(0x2)
21523         /* Virtual NIC. */
21524         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_VNIC \
21525                 UINT32_C(0x3)
21526         /* Statistic context. */
21527         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_STAT \
21528                 UINT32_C(0x4)
21529         /* Slow-path TQM ring. */
21530         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SP_TQM_RING \
21531                 UINT32_C(0x5)
21532         /* Fast-path TQM ring. */
21533         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_FP_TQM_RING \
21534                 UINT32_C(0x6)
21535         /* Memory Region and Memory Address Vector Context. */
21536         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_MRAV \
21537                 UINT32_C(0xe)
21538         /* TIM. */
21539         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TIM \
21540                 UINT32_C(0xf)
21541         /* Tx key context. */
21542         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TKC \
21543                 UINT32_C(0x13)
21544         /* Rx key context. */
21545         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RKC \
21546                 UINT32_C(0x14)
21547         /* Mid-path TQM ring. */
21548         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_MP_TQM_RING \
21549                 UINT32_C(0x15)
21550         /* SQ Doorbell shadow region. */
21551         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SQ_DB_SHADOW \
21552                 UINT32_C(0x16)
21553         /* RQ Doorbell shadow region. */
21554         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RQ_DB_SHADOW \
21555                 UINT32_C(0x17)
21556         /* SRQ Doorbell shadow region. */
21557         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRQ_DB_SHADOW \
21558                 UINT32_C(0x18)
21559         /* CQ Doorbell shadow region. */
21560         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CQ_DB_SHADOW \
21561                 UINT32_C(0x19)
21562         /* QUIC Tx key context. */
21563         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QUIC_TKC \
21564                 UINT32_C(0x1a)
21565         /* QUIC Rx key context. */
21566         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_QUIC_RKC \
21567                 UINT32_C(0x1b)
21568         /* Invalid type. */
21569         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_INVALID \
21570                 UINT32_C(0xffff)
21571         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_LAST \
21572                 HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_INVALID
21573         /*
21574          * Instance of the backing store type. It is zero-based,
21575          * which means "0" indicates the first instance. For backing
21576          * stores with single instance only, leave this field to 0.
21577          */
21578         uint16_t        instance;
21579         /* Control flags. */
21580         uint32_t        flags;
21581         /*
21582          * When set, the firmware only uses on-chip resources and
21583          * does not expect any backing store to be provided by the
21584          * host driver. This mode provides minimal L2 functionality
21585          * (e.g. limited L2 resources, no RoCE).
21586          */
21587         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_FLAGS_PREBOOT_MODE \
21588                 UINT32_C(0x1)
21589         /* Page directory. */
21590         uint64_t        page_dir;
21591         /* Number of entries */
21592         uint32_t        num_entries;
21593         /* Number of bytes allocated for each entry */
21594         uint16_t        entry_size;
21595         /* Page size and pbl level. */
21596         uint8_t page_size_pbl_level;
21597         /* PBL indirect levels. */
21598         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_MASK \
21599                 UINT32_C(0xf)
21600         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_SFT   0
21601         /* PBL pointer is physical start address. */
21602         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_0 \
21603                 UINT32_C(0x0)
21604         /* PBL pointer points to PTE table. */
21605         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_1 \
21606                 UINT32_C(0x1)
21607         /*
21608          * PBL pointer points to PDE table with each entry pointing to
21609          * PTE tables.
21610          */
21611         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_2 \
21612                 UINT32_C(0x2)
21613         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LAST \
21614                 HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PBL_LEVEL_LVL_2
21615         /* Page size. */
21616         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_MASK \
21617                 UINT32_C(0xf0)
21618         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_SFT   4
21619         /* 4KB. */
21620         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_4K \
21621                 (UINT32_C(0x0) << 4)
21622         /* 8KB. */
21623         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_8K \
21624                 (UINT32_C(0x1) << 4)
21625         /* 64KB. */
21626         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_64K \
21627                 (UINT32_C(0x2) << 4)
21628         /* 2MB. */
21629         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_2M \
21630                 (UINT32_C(0x3) << 4)
21631         /* 8MB. */
21632         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_8M \
21633                 (UINT32_C(0x4) << 4)
21634         /* 1GB. */
21635         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_1G \
21636                 (UINT32_C(0x5) << 4)
21637         #define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_LAST \
21638                 HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_PAGE_SIZE_PG_1G
21639         /*
21640          * This field counts how many split entries contain valid data.
21641          * Below is the table that maps the count value:
21642          * | Count |                     Indication                     |
21643          * | ----- | -------------------------------------------------- |
21644          * |   0   | None of the split entries has valid data.          |
21645          * |   1   | Only "split_entry_0" contains valid data.          |
21646          * |   2   | Only "split_entry_0" and "1" have valid data.      |
21647          * |   3   | Only "split_entry_0", "1" and "2" have valid data. |
21648          * |   4   | All four split entries have valid data.            |
21649          */
21650         uint8_t subtype_valid_cnt;
21651         /*
21652          * Split entry #0. Note that the four split entries (as a group)
21653          * must be cast to a type-specific data structure first before
21654          * accessing it! Below is the table that maps a backing store
21655          * type to the associated split entry casting data structure.
21656          * | Type |       Split Entry Casting Data Structure           |
21657          * | ---- | -------------------------------------------------- |
21658          * | QPC  |             qpc_split_entries                      |
21659          * | SRQ  |             srq_split_entries                      |
21660          * | CQ   |             cq_split_entries                       |
21661          * | VINC |            vnic_split_entries                      |
21662          * | MRAV |            marv_split_entries                      |
21663          */
21664         uint32_t        split_entry_0;
21665         /* Split entry #1. */
21666         uint32_t        split_entry_1;
21667         /* Split entry #2. */
21668         uint32_t        split_entry_2;
21669         /* Split entry #3. */
21670         uint32_t        split_entry_3;
21671 } __rte_packed;
21672
21673 /* hwrm_func_backing_store_cfg_v2_output (size:128b/16B) */
21674 struct hwrm_func_backing_store_cfg_v2_output {
21675         /* The specific error status for the command. */
21676         uint16_t        error_code;
21677         /* The HWRM command request type. */
21678         uint16_t        req_type;
21679         /* The sequence ID from the original command. */
21680         uint16_t        seq_id;
21681         /* The length of the response data in number of bytes. */
21682         uint16_t        resp_len;
21683         uint8_t rsvd0[7];
21684         /*
21685          * This field is used in Output records to indicate that the
21686          * output is completely written to RAM.  This field should be
21687          * read as '1' to indicate that the output has been completely
21688          * written. When writing a command completion or response to
21689          * an internal processor, the order of writes has to be such
21690          * that this field is written last.
21691          */
21692         uint8_t valid;
21693 } __rte_packed;
21694
21695 /***********************************
21696  * hwrm_func_backing_store_qcfg_v2 *
21697  ***********************************/
21698
21699
21700 /* hwrm_func_backing_store_qcfg_v2_input (size:192b/24B) */
21701 struct hwrm_func_backing_store_qcfg_v2_input {
21702         /* The HWRM command request type. */
21703         uint16_t        req_type;
21704         /*
21705          * The completion ring to send the completion event on. This should
21706          * be the NQ ID returned from the `nq_alloc` HWRM command.
21707          */
21708         uint16_t        cmpl_ring;
21709         /*
21710          * The sequence ID is used by the driver for tracking multiple
21711          * commands. This ID is treated as opaque data by the firmware and
21712          * the value is returned in the `hwrm_resp_hdr` upon completion.
21713          */
21714         uint16_t        seq_id;
21715         /*
21716          * The target ID of the command:
21717          * * 0x0-0xFFF8 - The function ID
21718          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21719          * * 0xFFFD - Reserved for user-space HWRM interface
21720          * * 0xFFFF - HWRM
21721          */
21722         uint16_t        target_id;
21723         /*
21724          * A physical address pointer pointing to a host buffer that the
21725          * command's response data will be written. This can be either a host
21726          * physical address (HPA) or a guest physical address (GPA) and must
21727          * point to a physically contiguous block of memory.
21728          */
21729         uint64_t        resp_addr;
21730         /* Type of backing store to be configured. */
21731         uint16_t        type;
21732         /* Queue pair. */
21733         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_QP \
21734                 UINT32_C(0x0)
21735         /* Shared receive queue. */
21736         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SRQ \
21737                 UINT32_C(0x1)
21738         /* Completion queue. */
21739         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CQ \
21740                 UINT32_C(0x2)
21741         /* Virtual NIC. */
21742         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_VNIC \
21743                 UINT32_C(0x3)
21744         /* Statistic context. */
21745         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_STAT \
21746                 UINT32_C(0x4)
21747         /* Slow-path TQM ring. */
21748         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SP_TQM_RING \
21749                 UINT32_C(0x5)
21750         /* Fast-path TQM ring. */
21751         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_FP_TQM_RING \
21752                 UINT32_C(0x6)
21753         /* Memory Region and Memory Address Vector Context. */
21754         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_MRAV \
21755                 UINT32_C(0xe)
21756         /* TIM. */
21757         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_TIM \
21758                 UINT32_C(0xf)
21759         /* Tx key context. */
21760         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_TKC \
21761                 UINT32_C(0x13)
21762         /* Rx key context. */
21763         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_RKC \
21764                 UINT32_C(0x14)
21765         /* Mid-path TQM ring. */
21766         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_MP_TQM_RING \
21767                 UINT32_C(0x15)
21768         /* SQ Doorbell shadow region. */
21769         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SQ_DB_SHADOW \
21770                 UINT32_C(0x16)
21771         /* RQ Doorbell shadow region. */
21772         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_RQ_DB_SHADOW \
21773                 UINT32_C(0x17)
21774         /* SRQ Doorbell shadow region. */
21775         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SRQ_DB_SHADOW \
21776                 UINT32_C(0x18)
21777         /* CQ Doorbell shadow region. */
21778         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CQ_DB_SHADOW \
21779                 UINT32_C(0x19)
21780         /* QUIC Tx key context. */
21781         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_QUIC_TKC \
21782                 UINT32_C(0x1a)
21783         /* QUIC Rx key context. */
21784         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_QUIC_RKC \
21785                 UINT32_C(0x1b)
21786         /* Invalid type. */
21787         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_INVALID \
21788                 UINT32_C(0xffff)
21789         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_LAST \
21790                 HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_INVALID
21791         /*
21792          * Instance of the backing store type. It is zero-based,
21793          * which means "0" indicates the first instance. For backing
21794          * stores with single instance only, leave this field to 0.
21795          */
21796         uint16_t        instance;
21797         uint8_t rsvd[4];
21798 } __rte_packed;
21799
21800 /* hwrm_func_backing_store_qcfg_v2_output (size:448b/56B) */
21801 struct hwrm_func_backing_store_qcfg_v2_output {
21802         /* The specific error status for the command. */
21803         uint16_t        error_code;
21804         /* The HWRM command request type. */
21805         uint16_t        req_type;
21806         /* The sequence ID from the original command. */
21807         uint16_t        seq_id;
21808         /* The length of the response data in number of bytes. */
21809         uint16_t        resp_len;
21810         /* Type of backing store to be configured. */
21811         uint16_t        type;
21812         /* Queue pair. */
21813         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_QP \
21814                 UINT32_C(0x0)
21815         /* Shared receive queue. */
21816         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SRQ \
21817                 UINT32_C(0x1)
21818         /* Completion queue. */
21819         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_CQ \
21820                 UINT32_C(0x2)
21821         /* Virtual NIC. */
21822         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_VNIC \
21823                 UINT32_C(0x3)
21824         /* Statistic context. */
21825         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_STAT \
21826                 UINT32_C(0x4)
21827         /* Slow-path TQM ring. */
21828         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SP_TQM_RING \
21829                 UINT32_C(0x5)
21830         /* Fast-path TQM ring. */
21831         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_FP_TQM_RING \
21832                 UINT32_C(0x6)
21833         /* Memory Region and Memory Address Vector Context. */
21834         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_MRAV \
21835                 UINT32_C(0xe)
21836         /* TIM. */
21837         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_TIM \
21838                 UINT32_C(0xf)
21839         /* Tx key context. */
21840         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_TKC \
21841                 UINT32_C(0x13)
21842         /* Rx key context. */
21843         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_RKC \
21844                 UINT32_C(0x14)
21845         /* Mid-path TQM ring. */
21846         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_MP_TQM_RING \
21847                 UINT32_C(0x15)
21848         /* QUIC Tx key context. */
21849         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_QUIC_TKC \
21850                 UINT32_C(0x1a)
21851         /* QUIC Rx key context. */
21852         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_QUIC_RKC \
21853                 UINT32_C(0x1b)
21854         /* Invalid type. */
21855         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_INVALID \
21856                 UINT32_C(0xffff)
21857         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_LAST \
21858                 HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_INVALID
21859         /*
21860          * Instance of the backing store type. It is zero-based,
21861          * which means "0" indicates the first instance. For backing
21862          * stores with single instance only, leave this field to 0.
21863          */
21864         uint16_t        instance;
21865         /* Control flags. */
21866         uint32_t        flags;
21867         /* Page directory. */
21868         uint64_t        page_dir;
21869         /* Number of entries */
21870         uint32_t        num_entries;
21871         /* Page size and pbl level. */
21872         uint8_t page_size_pbl_level;
21873         /* PBL indirect levels. */
21874         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_MASK \
21875                 UINT32_C(0xf)
21876         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_SFT   0
21877         /* PBL pointer is physical start address. */
21878         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_0 \
21879                 UINT32_C(0x0)
21880         /* PBL pointer points to PTE table. */
21881         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_1 \
21882                 UINT32_C(0x1)
21883         /*
21884          * PBL pointer points to PDE table with each entry pointing to
21885          * PTE tables.
21886          */
21887         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_2 \
21888                 UINT32_C(0x2)
21889         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LAST \
21890                 HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PBL_LEVEL_LVL_2
21891         /* Page size. */
21892         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_MASK \
21893                 UINT32_C(0xf0)
21894         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_SFT   4
21895         /* 4KB. */
21896         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_4K \
21897                 (UINT32_C(0x0) << 4)
21898         /* 8KB. */
21899         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_8K \
21900                 (UINT32_C(0x1) << 4)
21901         /* 64KB. */
21902         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_64K \
21903                 (UINT32_C(0x2) << 4)
21904         /* 2MB. */
21905         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_2M \
21906                 (UINT32_C(0x3) << 4)
21907         /* 8MB. */
21908         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_8M \
21909                 (UINT32_C(0x4) << 4)
21910         /* 1GB. */
21911         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_1G \
21912                 (UINT32_C(0x5) << 4)
21913         #define HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_LAST \
21914                 HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_PAGE_SIZE_PG_1G
21915         /*
21916          * This field counts how many split entries contain valid data.
21917          * Below is the table that maps the count value:
21918          * | count |                     Indication                     |
21919          * | ----- | -------------------------------------------------- |
21920          * |   0   | None of the split entries has valid data.          |
21921          * |   1   | Only "split_entry_0" contains valid data.          |
21922          * |   2   | Only "split_entry_0" and "1" have valid data.      |
21923          * |   3   | Only "split_entry_0", "1" and "2" have valid data. |
21924          * |   4   | All four split entries have valid data.            |
21925          */
21926         uint8_t subtype_valid_cnt;
21927         uint8_t rsvd[2];
21928         /*
21929          * Split entry #0. Note that the four split entries (as a group)
21930          * must be cast to a type-specific data structure first before
21931          * accessing it! Below is the table that maps a backing store
21932          * type to the associated split entry casting data structure.
21933          * | Type |       Split Entry Casting Data Structure           |
21934          * | ---- | -------------------------------------------------- |
21935          * | QPC  |             qpc_split_entries                      |
21936          * | SRQ  |             srq_split_entries                      |
21937          * | CQ   |             cq_split_entries                       |
21938          * | VINC |            vnic_split_entries                      |
21939          * | MRAV |            marv_split_entries                      |
21940          */
21941         uint32_t        split_entry_0;
21942         /* Split entry #1. */
21943         uint32_t        split_entry_1;
21944         /* Split entry #2. */
21945         uint32_t        split_entry_2;
21946         /* Split entry #3. */
21947         uint32_t        split_entry_3;
21948         uint8_t rsvd2[7];
21949         /*
21950          * This field is used in Output records to indicate that the
21951          * output is completely written to RAM.  This field should be
21952          * read as '1' to indicate that the output has been completely
21953          * written. When writing a command completion or response to
21954          * an internal processor, the order of writes has to be such
21955          * that this field is written last.
21956          */
21957         uint8_t valid;
21958 } __rte_packed;
21959
21960 /************************************
21961  * hwrm_func_backing_store_qcaps_v2 *
21962  ************************************/
21963
21964
21965 /* hwrm_func_backing_store_qcaps_v2_input (size:192b/24B) */
21966 struct hwrm_func_backing_store_qcaps_v2_input {
21967         /* The HWRM command request type. */
21968         uint16_t        req_type;
21969         /*
21970          * The completion ring to send the completion event on. This should
21971          * be the NQ ID returned from the `nq_alloc` HWRM command.
21972          */
21973         uint16_t        cmpl_ring;
21974         /*
21975          * The sequence ID is used by the driver for tracking multiple
21976          * commands. This ID is treated as opaque data by the firmware and
21977          * the value is returned in the `hwrm_resp_hdr` upon completion.
21978          */
21979         uint16_t        seq_id;
21980         /*
21981          * The target ID of the command:
21982          * * 0x0-0xFFF8 - The function ID
21983          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21984          * * 0xFFFD - Reserved for user-space HWRM interface
21985          * * 0xFFFF - HWRM
21986          */
21987         uint16_t        target_id;
21988         /*
21989          * A physical address pointer pointing to a host buffer that the
21990          * command's response data will be written. This can be either a host
21991          * physical address (HPA) or a guest physical address (GPA) and must
21992          * point to a physically contiguous block of memory.
21993          */
21994         uint64_t        resp_addr;
21995         /* Type of backing store to be queried. */
21996         uint16_t        type;
21997         /* Queue pair. */
21998         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_QP \
21999                 UINT32_C(0x0)
22000         /* Shared receive queue. */
22001         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SRQ \
22002                 UINT32_C(0x1)
22003         /* Completion queue. */
22004         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CQ \
22005                 UINT32_C(0x2)
22006         /* Virtual NIC. */
22007         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_VNIC \
22008                 UINT32_C(0x3)
22009         /* Statistic context. */
22010         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_STAT \
22011                 UINT32_C(0x4)
22012         /* Slow-path TQM ring. */
22013         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SP_TQM_RING \
22014                 UINT32_C(0x5)
22015         /* Fast-path TQM ring. */
22016         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_FP_TQM_RING \
22017                 UINT32_C(0x6)
22018         /* Memory Region and Memory Address Vector Context. */
22019         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_MRAV \
22020                 UINT32_C(0xe)
22021         /* TIM. */
22022         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_TIM \
22023                 UINT32_C(0xf)
22024         /* Tx key context. */
22025         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_TKC \
22026                 UINT32_C(0x13)
22027         /* Rx key context. */
22028         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_RKC \
22029                 UINT32_C(0x14)
22030         /* Mid-path TQM ring. */
22031         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_MP_TQM_RING \
22032                 UINT32_C(0x15)
22033         /* SQ Doorbell shadow region. */
22034         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SQ_DB_SHADOW \
22035                 UINT32_C(0x16)
22036         /* RQ Doorbell shadow region. */
22037         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_RQ_DB_SHADOW \
22038                 UINT32_C(0x17)
22039         /* SRQ Doorbell shadow region. */
22040         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SRQ_DB_SHADOW \
22041                 UINT32_C(0x18)
22042         /* CQ Doorbell shadow region. */
22043         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CQ_DB_SHADOW \
22044                 UINT32_C(0x19)
22045         /* QUIC Tx key context. */
22046         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_QUIC_TKC \
22047                 UINT32_C(0x1a)
22048         /* QUIC Rx key context. */
22049         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_QUIC_RKC \
22050                 UINT32_C(0x1b)
22051         /* Invalid type. */
22052         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_INVALID \
22053                 UINT32_C(0xffff)
22054         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_LAST \
22055                 HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_INVALID
22056         uint8_t rsvd[6];
22057 } __rte_packed;
22058
22059 /* hwrm_func_backing_store_qcaps_v2_output (size:448b/56B) */
22060 struct hwrm_func_backing_store_qcaps_v2_output {
22061         /* The specific error status for the command. */
22062         uint16_t        error_code;
22063         /* The HWRM command request type. */
22064         uint16_t        req_type;
22065         /* The sequence ID from the original command. */
22066         uint16_t        seq_id;
22067         /* The length of the response data in number of bytes. */
22068         uint16_t        resp_len;
22069         /* Type of backing store to be queried. */
22070         uint16_t        type;
22071         /* Queue pair. */
22072         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_QP \
22073                 UINT32_C(0x0)
22074         /* Shared receive queue. */
22075         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SRQ \
22076                 UINT32_C(0x1)
22077         /* Completion queue. */
22078         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CQ \
22079                 UINT32_C(0x2)
22080         /* Virtual NIC. */
22081         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_VNIC \
22082                 UINT32_C(0x3)
22083         /* Statistic context. */
22084         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_STAT \
22085                 UINT32_C(0x4)
22086         /* Slow-path TQM ring. */
22087         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SP_TQM_RING \
22088                 UINT32_C(0x5)
22089         /* Fast-path TQM ring. */
22090         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_FP_TQM_RING \
22091                 UINT32_C(0x6)
22092         /* Memory Region and Memory Address Vector Context. */
22093         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_MRAV \
22094                 UINT32_C(0xe)
22095         /* TIM. */
22096         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_TIM \
22097                 UINT32_C(0xf)
22098         /* KTLS Tx key context. */
22099         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_TKC \
22100                 UINT32_C(0x13)
22101         /* KTLS Rx key context. */
22102         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_RKC \
22103                 UINT32_C(0x14)
22104         /* Mid-path TQM ring. */
22105         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_MP_TQM_RING \
22106                 UINT32_C(0x15)
22107         /* SQ Doorbell shadow region. */
22108         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SQ_DB_SHADOW \
22109                 UINT32_C(0x16)
22110         /* RQ Doorbell shadow region. */
22111         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_RQ_DB_SHADOW \
22112                 UINT32_C(0x17)
22113         /* SRQ Doorbell shadow region. */
22114         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SRQ_DB_SHADOW \
22115                 UINT32_C(0x18)
22116         /* CQ Doorbell shadow region. */
22117         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CQ_DB_SHADOW \
22118                 UINT32_C(0x19)
22119         /* QUIC Tx key context. */
22120         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_QUIC_TKC \
22121                 UINT32_C(0x1a)
22122         /* QUIC Rx key context. */
22123         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_QUIC_RKC \
22124                 UINT32_C(0x1b)
22125         /* Invalid type. */
22126         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_INVALID \
22127                 UINT32_C(0xffff)
22128         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_LAST \
22129                 HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_INVALID
22130         /* Number of bytes per backing store entry. */
22131         uint16_t        entry_size;
22132         /* Control flags. */
22133         uint32_t        flags;
22134         /*
22135          * When set, it indicates the context type should be initialized
22136          * with the “ctx_init_value” at the specified offset.
22137          */
22138         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_ENABLE_CTX_KIND_INIT \
22139                 UINT32_C(0x1)
22140         /* When set, it indicates the context type is valid. */
22141         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_TYPE_VALID \
22142                 UINT32_C(0x2)
22143         /*
22144          * When set, it indicates the region for this type is not a regular
22145          * context memory but a driver managed memory that is created,
22146          * initialized and managed by the driver.
22147          */
22148         #define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_DRIVER_MANAGED_MEMORY \
22149                 UINT32_C(0x4)
22150         /*
22151          * Bit map of the valid instances associated with the
22152          * backing store type.
22153          */
22154         uint32_t        instance_bit_map;
22155         /*
22156          * Initializer to be used by drivers to initialize context memory
22157          * to ensure context subsystem flags an error for an attack before
22158          * the first time context load.
22159          */
22160         uint8_t ctx_init_value;
22161         /*
22162          * Specifies the doubleword offset of ctx_init_value for this
22163          * context type.
22164          */
22165         uint8_t ctx_init_offset;
22166         /*
22167          * Some backing store types, e.g., TQM rings, require the number
22168          * of entries to be a multiple of this value to prevent any
22169          * resource allocation limitations. If not applicable, leave
22170          * this field with "0".
22171          */
22172         uint8_t entry_multiple;
22173         uint8_t rsvd;
22174         /* Maximum number of backing store entries supported for this type. */
22175         uint32_t        max_num_entries;
22176         /*
22177          * Minimum number of backing store entries required for this type.
22178          * This field is only valid for some backing store types, e.g.,
22179          * TQM rings. If not applicable, leave this field with "0".
22180          */
22181         uint32_t        min_num_entries;
22182         /*
22183          * Next valid backing store type. If current type queried is already
22184          * the last valid type, firmware must set this field to invalid type.
22185          */
22186         uint16_t        next_valid_type;
22187         /*
22188          * This field counts how many split entries contain valid data.
22189          * Below is the table that maps the count value:
22190          * | count |                     Indication                     |
22191          * | ----- | -------------------------------------------------- |
22192          * |   0   | None of the split entries has valid data.          |
22193          * |   1   | Only "split_entry_0" contains valid data.          |
22194          * |   2   | Only "split_entry_0" and "1" have valid data.      |
22195          * |   3   | Only "split_entry_0", "1" and "2" have valid data. |
22196          * |   4   | All four split entries have valid data.            |
22197          */
22198         uint8_t subtype_valid_cnt;
22199         uint8_t rsvd2;
22200         /*
22201          * Split entry #0. Note that the four split entries (as a group)
22202          * must be cast to a type-specific data structure first before
22203          * accessing it! Below is the table that maps a backing store
22204          * type to the associated split entry casting data structure.
22205          * | Type |       Split Entry Casting Data Structure           |
22206          * | ---- | -------------------------------------------------- |
22207          * | QPC  |             qpc_split_entries                      |
22208          * | SRQ  |             srq_split_entries                      |
22209          * | CQ   |             cq_split_entries                       |
22210          * | VINC |            vnic_split_entries                      |
22211          * | MRAV |            marv_split_entries                      |
22212          */
22213         uint32_t        split_entry_0;
22214         /* Split entry #1. */
22215         uint32_t        split_entry_1;
22216         /* Split entry #2. */
22217         uint32_t        split_entry_2;
22218         /* Split entry #3. */
22219         uint32_t        split_entry_3;
22220         uint8_t rsvd3[3];
22221         /*
22222          * This field is used in Output records to indicate that the
22223          * output is completely written to RAM.  This field should be
22224          * read as '1' to indicate that the output has been completely
22225          * written. When writing a command completion or response to
22226          * an internal processor, the order of writes has to be such
22227          * that this field is written last.
22228          */
22229         uint8_t valid;
22230 } __rte_packed;
22231
22232 /****************************
22233  * hwrm_func_dbr_pacing_cfg *
22234  ****************************/
22235
22236
22237 /* hwrm_func_dbr_pacing_cfg_input (size:320b/40B) */
22238 struct hwrm_func_dbr_pacing_cfg_input {
22239         /* The HWRM command request type. */
22240         uint16_t        req_type;
22241         /*
22242          * The completion ring to send the completion event on. This should
22243          * be the NQ ID returned from the `nq_alloc` HWRM command.
22244          */
22245         uint16_t        cmpl_ring;
22246         /*
22247          * The sequence ID is used by the driver for tracking multiple
22248          * commands. This ID is treated as opaque data by the firmware and
22249          * the value is returned in the `hwrm_resp_hdr` upon completion.
22250          */
22251         uint16_t        seq_id;
22252         /*
22253          * The target ID of the command:
22254          * * 0x0-0xFFF8 - The function ID
22255          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22256          * * 0xFFFD - Reserved for user-space HWRM interface
22257          * * 0xFFFF - HWRM
22258          */
22259         uint16_t        target_id;
22260         /*
22261          * A physical address pointer pointing to a host buffer that the
22262          * command's response data will be written. This can be either a host
22263          * physical address (HPA) or a guest physical address (GPA) and must
22264          * point to a physically contiguous block of memory.
22265          */
22266         uint64_t        resp_addr;
22267         uint8_t flags;
22268         /*
22269          * This bit must be '1' to enable DBR NQ events. The NQ ID to
22270          * receive the events must be specified in the primary_nq_id
22271          * field.
22272          */
22273         #define HWRM_FUNC_DBR_PACING_CFG_INPUT_FLAGS_DBR_NQ_EVENT_ENABLE \
22274                 UINT32_C(0x1)
22275         /* This bit must be '1' to disable DBR NQ events. */
22276         #define HWRM_FUNC_DBR_PACING_CFG_INPUT_FLAGS_DBR_NQ_EVENT_DISABLE \
22277                 UINT32_C(0x2)
22278         uint8_t unused_0[7];
22279         uint32_t        enables;
22280         /*
22281          * This bit must be '1' for the primary_nq_id field to be
22282          * configured.
22283          */
22284         #define HWRM_FUNC_DBR_PACING_CFG_INPUT_ENABLES_PRIMARY_NQ_ID_VALID \
22285                 UINT32_C(0x1)
22286         /*
22287          * This bit must be '1' for the pacing_threshold field to be
22288          * configured.
22289          */
22290         #define HWRM_FUNC_DBR_PACING_CFG_INPUT_ENABLES_PACING_THRESHOLD_VALID \
22291                 UINT32_C(0x2)
22292         /*
22293          * Specify primary function’s NQ ID to receive the doorbell pacing
22294          * threshold crossing events.
22295          */
22296         uint32_t        primary_nq_id;
22297         /*
22298          * Specify pacing threshold value, as a percentage of the max
22299          * doorbell FIFO depth. The range is 1 to 36.
22300          */
22301         uint32_t        pacing_threshold;
22302         uint8_t unused_1[4];
22303 } __rte_packed;
22304
22305 /* hwrm_func_dbr_pacing_cfg_output (size:128b/16B) */
22306 struct hwrm_func_dbr_pacing_cfg_output {
22307         /* The specific error status for the command. */
22308         uint16_t        error_code;
22309         /* The HWRM command request type. */
22310         uint16_t        req_type;
22311         /* The sequence ID from the original command. */
22312         uint16_t        seq_id;
22313         /* The length of the response data in number of bytes. */
22314         uint16_t        resp_len;
22315         uint8_t unused_0[7];
22316         /*
22317          * This field is used in Output records to indicate that the output
22318          * is completely written to RAM.  This field should be read as '1'
22319          * to indicate that the output has been completely written.
22320          * When writing a command completion or response to an internal
22321          * processor, the order of writes has to be such that this field is
22322          * written last.
22323          */
22324         uint8_t valid;
22325 } __rte_packed;
22326
22327 /*****************************
22328  * hwrm_func_dbr_pacing_qcfg *
22329  *****************************/
22330
22331
22332 /* hwrm_func_dbr_pacing_qcfg_input (size:128b/16B) */
22333 struct hwrm_func_dbr_pacing_qcfg_input {
22334         /* The HWRM command request type. */
22335         uint16_t        req_type;
22336         /*
22337          * The completion ring to send the completion event on. This should
22338          * be the NQ ID returned from the `nq_alloc` HWRM command.
22339          */
22340         uint16_t        cmpl_ring;
22341         /*
22342          * The sequence ID is used by the driver for tracking multiple
22343          * commands. This ID is treated as opaque data by the firmware and
22344          * the value is returned in the `hwrm_resp_hdr` upon completion.
22345          */
22346         uint16_t        seq_id;
22347         /*
22348          * The target ID of the command:
22349          * * 0x0-0xFFF8 - The function ID
22350          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22351          * * 0xFFFD - Reserved for user-space HWRM interface
22352          * * 0xFFFF - HWRM
22353          */
22354         uint16_t        target_id;
22355         /*
22356          * A physical address pointer pointing to a host buffer that the
22357          * command's response data will be written. This can be either a host
22358          * physical address (HPA) or a guest physical address (GPA) and must
22359          * point to a physically contiguous block of memory.
22360          */
22361         uint64_t        resp_addr;
22362 } __rte_packed;
22363
22364 /* hwrm_func_dbr_pacing_qcfg_output (size:512b/64B) */
22365 struct hwrm_func_dbr_pacing_qcfg_output {
22366         /* The specific error status for the command. */
22367         uint16_t        error_code;
22368         /* The HWRM command request type. */
22369         uint16_t        req_type;
22370         /* The sequence ID from the original command. */
22371         uint16_t        seq_id;
22372         /* The length of the response data in number of bytes. */
22373         uint16_t        resp_len;
22374         uint8_t flags;
22375         /* When this bit is '1', it indicates DBR NQ events are enabled. */
22376         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_FLAGS_DBR_NQ_EVENT_ENABLED \
22377                 UINT32_C(0x1)
22378         uint8_t unused_0[7];
22379         /*
22380          * The Doorbell global FIFO occupancy register. This field should be
22381          * used by the driver and user library in the doorbell pacing
22382          * algorithm. Lower 2 bits indicates address space location and upper
22383          * 30 bits indicates upper 30bits of the register address. A value of
22384          * 0xFFFF-FFFF indicates this register does not exist.
22385          */
22386         uint32_t        dbr_stat_db_fifo_reg;
22387         /* Lower 2 bits indicates address space location. */
22388         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_MASK \
22389                 UINT32_C(0x3)
22390         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_SFT \
22391                 0
22392         /*
22393          * If value is 0, this register is located in PCIe config space.
22394          * Drivers have to map appropriate window to access this
22395          * register.
22396          */
22397         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_PCIE_CFG \
22398                 UINT32_C(0x0)
22399         /*
22400          * If value is 1, this register is located in GRC address space.
22401          * Drivers have to map appropriate window to access this
22402          * register.
22403          */
22404         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_GRC \
22405                 UINT32_C(0x1)
22406         /*
22407          * If value is 2, this register is located in first BAR address
22408          * space. Drivers have to map appropriate window to access this
22409          * register.
22410          */
22411         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_BAR0 \
22412                 UINT32_C(0x2)
22413         /*
22414          * If value is 3, this register is located in second BAR address
22415          * space. Drivers have to map appropriate window to access this
22416          * Drivers have to map appropriate window to access this
22417          * register.
22418          */
22419         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_BAR1 \
22420                 UINT32_C(0x3)
22421         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_LAST \
22422                 HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SPACE_BAR1
22423         /* Upper 30bits of the register address. */
22424         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_MASK \
22425                 UINT32_C(0xfffffffc)
22426         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_STAT_DB_FIFO_REG_ADDR_SFT \
22427                 2
22428         /*
22429          * This field indicates the mask value for dbr_stat_db_fifo_reg
22430          * to get the high watermark for doorbell FIFO.
22431          */
22432         uint32_t        dbr_stat_db_fifo_reg_watermark_mask;
22433         /*
22434          * This field indicates the shift value for dbr_stat_db_fifo_reg
22435          * to get the high watermark for doorbell FIFO.
22436          */
22437         uint8_t dbr_stat_db_fifo_reg_watermark_shift;
22438         uint8_t unused_1[3];
22439         /*
22440          * This field indicates the mask value for dbr_stat_db_fifo_reg
22441          * to get the amount of room left for doorbell FIFO.
22442          */
22443         uint32_t        dbr_stat_db_fifo_reg_fifo_room_mask;
22444         /*
22445          * This field indicates the shift value for dbr_stat_db_fifo_reg
22446          * to get the amount of room left for doorbell FIFO.
22447          */
22448         uint8_t dbr_stat_db_fifo_reg_fifo_room_shift;
22449         uint8_t unused_2[3];
22450         /*
22451          * DBR_REG_AEQ_ARM register. This field should be used by the driver
22452          * to rearm the interrupt for regeneration of a notification to the
22453          * host from the hardware when the global doorbell occupancy threshold
22454          * is above the threshold value. Lower 2 bits indicates address space
22455          * location and upper 30 bits indicates upper 30bits of the register
22456          * address. A value of 0xFFFF-FFFF indicates this register does not
22457          * exist.
22458          */
22459         uint32_t        dbr_throttling_aeq_arm_reg;
22460         /* Lower 2 bits indicates address space location. */
22461         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_MASK \
22462                 UINT32_C(0x3)
22463         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_SFT \
22464                 0
22465         /*
22466          * If value is 0, this register is located in PCIe config space.
22467          * Drivers have to map appropriate window to access this
22468          * register.
22469          */
22470         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_PCIE_CFG \
22471                 UINT32_C(0x0)
22472         /*
22473          * If value is 1, this register is located in GRC address space.
22474          * Drivers have to map appropriate window to access this
22475          * register.
22476          */
22477         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_GRC \
22478                 UINT32_C(0x1)
22479         /*
22480          * If value is 2, this register is located in first BAR address
22481          * space. Drivers have to map appropriate window to access this
22482          * register.
22483          */
22484         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_BAR0 \
22485                 UINT32_C(0x2)
22486         /*
22487          * If value is 3, this register is located in second BAR address
22488          * space. Drivers have to map appropriate window to access this
22489          * Drivers have to map appropriate window to access this
22490          * register.
22491          */
22492         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_BAR1 \
22493                 UINT32_C(0x3)
22494         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_LAST \
22495                 HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SPACE_BAR1
22496         /* Upper 30bits of the register address. */
22497         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_MASK \
22498                 UINT32_C(0xfffffffc)
22499         #define HWRM_FUNC_DBR_PACING_QCFG_OUTPUT_DBR_THROTTLING_AEQ_ARM_REG_ADDR_SFT \
22500                 2
22501         /*
22502          * This field indicates the value to be written for
22503          * dbr_throttling_aeq_arm_reg register.
22504          */
22505         uint8_t dbr_throttling_aeq_arm_reg_val;
22506         uint8_t unused_3[7];
22507         /*
22508          * Specifies primary function’s NQ ID.
22509          * A value of 0xFFFF indicates NQ ID is invalid.
22510          */
22511         uint32_t        primary_nq_id;
22512         /*
22513          * Specifies the pacing threshold value, as a percentage of the
22514          * max doorbell FIFO depth. The range is 1 to 100.
22515          */
22516         uint32_t        pacing_threshold;
22517         uint8_t unused_4[7];
22518         /*
22519          * This field is used in Output records to indicate that the output
22520          * is completely written to RAM.  This field should be read as '1'
22521          * to indicate that the output has been completely written.
22522          * When writing a command completion or response to an internal
22523          * processor, the order of writes has to be such that this field is
22524          * written last.
22525          */
22526         uint8_t valid;
22527 } __rte_packed;
22528
22529 /****************************************
22530  * hwrm_func_dbr_pacing_broadcast_event *
22531  ****************************************/
22532
22533
22534 /* hwrm_func_dbr_pacing_broadcast_event_input (size:128b/16B) */
22535 struct hwrm_func_dbr_pacing_broadcast_event_input {
22536         /* The HWRM command request type. */
22537         uint16_t        req_type;
22538         /*
22539          * The completion ring to send the completion event on. This should
22540          * be the NQ ID returned from the `nq_alloc` HWRM command.
22541          */
22542         uint16_t        cmpl_ring;
22543         /*
22544          * The sequence ID is used by the driver for tracking multiple
22545          * commands. This ID is treated as opaque data by the firmware and
22546          * the value is returned in the `hwrm_resp_hdr` upon completion.
22547          */
22548         uint16_t        seq_id;
22549         /*
22550          * The target ID of the command:
22551          * * 0x0-0xFFF8 - The function ID
22552          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22553          * * 0xFFFD - Reserved for user-space HWRM interface
22554          * * 0xFFFF - HWRM
22555          */
22556         uint16_t        target_id;
22557         /*
22558          * A physical address pointer pointing to a host buffer that the
22559          * command's response data will be written. This can be either a host
22560          * physical address (HPA) or a guest physical address (GPA) and must
22561          * point to a physically contiguous block of memory.
22562          */
22563         uint64_t        resp_addr;
22564 } __rte_packed;
22565
22566 /* hwrm_func_dbr_pacing_broadcast_event_output (size:128b/16B) */
22567 struct hwrm_func_dbr_pacing_broadcast_event_output {
22568         /* The specific error status for the command. */
22569         uint16_t        error_code;
22570         /* The HWRM command request type. */
22571         uint16_t        req_type;
22572         /* The sequence ID from the original command. */
22573         uint16_t        seq_id;
22574         /* The length of the response data in number of bytes. */
22575         uint16_t        resp_len;
22576         uint8_t unused_0[7];
22577         /*
22578          * This field is used in Output records to indicate that the output
22579          * is completely written to RAM.  This field should be read as '1'
22580          * to indicate that the output has been completely written.
22581          * When writing a command completion or response to an internal
22582          * processor, the order of writes has to be such that this field is
22583          * written last.
22584          */
22585         uint8_t valid;
22586 } __rte_packed;
22587
22588 /***********************
22589  * hwrm_func_vlan_qcfg *
22590  ***********************/
22591
22592
22593 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
22594 struct hwrm_func_vlan_qcfg_input {
22595         /* The HWRM command request type. */
22596         uint16_t        req_type;
22597         /*
22598          * The completion ring to send the completion event on. This should
22599          * be the NQ ID returned from the `nq_alloc` HWRM command.
22600          */
22601         uint16_t        cmpl_ring;
22602         /*
22603          * The sequence ID is used by the driver for tracking multiple
22604          * commands. This ID is treated as opaque data by the firmware and
22605          * the value is returned in the `hwrm_resp_hdr` upon completion.
22606          */
22607         uint16_t        seq_id;
22608         /*
22609          * The target ID of the command:
22610          * * 0x0-0xFFF8 - The function ID
22611          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22612          * * 0xFFFD - Reserved for user-space HWRM interface
22613          * * 0xFFFF - HWRM
22614          */
22615         uint16_t        target_id;
22616         /*
22617          * A physical address pointer pointing to a host buffer that the
22618          * command's response data will be written. This can be either a host
22619          * physical address (HPA) or a guest physical address (GPA) and must
22620          * point to a physically contiguous block of memory.
22621          */
22622         uint64_t        resp_addr;
22623         /*
22624          * Function ID of the function that is being
22625          * configured.
22626          * If set to 0xFF... (All Fs), then the configuration is
22627          * for the requesting function.
22628          */
22629         uint16_t        fid;
22630         uint8_t unused_0[6];
22631 } __rte_packed;
22632
22633 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
22634 struct hwrm_func_vlan_qcfg_output {
22635         /* The specific error status for the command. */
22636         uint16_t        error_code;
22637         /* The HWRM command request type. */
22638         uint16_t        req_type;
22639         /* The sequence ID from the original command. */
22640         uint16_t        seq_id;
22641         /* The length of the response data in number of bytes. */
22642         uint16_t        resp_len;
22643         uint64_t        unused_0;
22644         /* S-TAG VLAN identifier configured for the function. */
22645         uint16_t        stag_vid;
22646         /* S-TAG PCP value configured for the function. */
22647         uint8_t stag_pcp;
22648         uint8_t unused_1;
22649         /*
22650          * S-TAG TPID value configured for the function. This field is specified in
22651          * network byte order.
22652          */
22653         uint16_t        stag_tpid;
22654         /* C-TAG VLAN identifier configured for the function. */
22655         uint16_t        ctag_vid;
22656         /* C-TAG PCP value configured for the function. */
22657         uint8_t ctag_pcp;
22658         uint8_t unused_2;
22659         /*
22660          * C-TAG TPID value configured for the function. This field is specified in
22661          * network byte order.
22662          */
22663         uint16_t        ctag_tpid;
22664         /* Future use. */
22665         uint32_t        rsvd2;
22666         /* Future use. */
22667         uint32_t        rsvd3;
22668         uint8_t unused_3[3];
22669         /*
22670          * This field is used in Output records to indicate that the output
22671          * is completely written to RAM.  This field should be read as '1'
22672          * to indicate that the output has been completely written.
22673          * When writing a command completion or response to an internal processor,
22674          * the order of writes has to be such that this field is written last.
22675          */
22676         uint8_t valid;
22677 } __rte_packed;
22678
22679 /**********************
22680  * hwrm_func_vlan_cfg *
22681  **********************/
22682
22683
22684 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
22685 struct hwrm_func_vlan_cfg_input {
22686         /* The HWRM command request type. */
22687         uint16_t        req_type;
22688         /*
22689          * The completion ring to send the completion event on. This should
22690          * be the NQ ID returned from the `nq_alloc` HWRM command.
22691          */
22692         uint16_t        cmpl_ring;
22693         /*
22694          * The sequence ID is used by the driver for tracking multiple
22695          * commands. This ID is treated as opaque data by the firmware and
22696          * the value is returned in the `hwrm_resp_hdr` upon completion.
22697          */
22698         uint16_t        seq_id;
22699         /*
22700          * The target ID of the command:
22701          * * 0x0-0xFFF8 - The function ID
22702          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22703          * * 0xFFFD - Reserved for user-space HWRM interface
22704          * * 0xFFFF - HWRM
22705          */
22706         uint16_t        target_id;
22707         /*
22708          * A physical address pointer pointing to a host buffer that the
22709          * command's response data will be written. This can be either a host
22710          * physical address (HPA) or a guest physical address (GPA) and must
22711          * point to a physically contiguous block of memory.
22712          */
22713         uint64_t        resp_addr;
22714         /*
22715          * Function ID of the function that is being
22716          * configured.
22717          * If set to 0xFF... (All Fs), then the configuration is
22718          * for the requesting function.
22719          */
22720         uint16_t        fid;
22721         uint8_t unused_0[2];
22722         uint32_t        enables;
22723         /*
22724          * This bit must be '1' for the stag_vid field to be
22725          * configured.
22726          */
22727         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID      UINT32_C(0x1)
22728         /*
22729          * This bit must be '1' for the ctag_vid field to be
22730          * configured.
22731          */
22732         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID      UINT32_C(0x2)
22733         /*
22734          * This bit must be '1' for the stag_pcp field to be
22735          * configured.
22736          */
22737         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP      UINT32_C(0x4)
22738         /*
22739          * This bit must be '1' for the ctag_pcp field to be
22740          * configured.
22741          */
22742         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP      UINT32_C(0x8)
22743         /*
22744          * This bit must be '1' for the stag_tpid field to be
22745          * configured.
22746          */
22747         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID     UINT32_C(0x10)
22748         /*
22749          * This bit must be '1' for the ctag_tpid field to be
22750          * configured.
22751          */
22752         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID     UINT32_C(0x20)
22753         /* S-TAG VLAN identifier configured for the function. */
22754         uint16_t        stag_vid;
22755         /* S-TAG PCP value configured for the function. */
22756         uint8_t stag_pcp;
22757         uint8_t unused_1;
22758         /*
22759          * S-TAG TPID value configured for the function. This field is specified in
22760          * network byte order.
22761          */
22762         uint16_t        stag_tpid;
22763         /* C-TAG VLAN identifier configured for the function. */
22764         uint16_t        ctag_vid;
22765         /* C-TAG PCP value configured for the function. */
22766         uint8_t ctag_pcp;
22767         uint8_t unused_2;
22768         /*
22769          * C-TAG TPID value configured for the function. This field is specified in
22770          * network byte order.
22771          */
22772         uint16_t        ctag_tpid;
22773         /* Future use. */
22774         uint32_t        rsvd1;
22775         /* Future use. */
22776         uint32_t        rsvd2;
22777         uint8_t unused_3[4];
22778 } __rte_packed;
22779
22780 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
22781 struct hwrm_func_vlan_cfg_output {
22782         /* The specific error status for the command. */
22783         uint16_t        error_code;
22784         /* The HWRM command request type. */
22785         uint16_t        req_type;
22786         /* The sequence ID from the original command. */
22787         uint16_t        seq_id;
22788         /* The length of the response data in number of bytes. */
22789         uint16_t        resp_len;
22790         uint8_t unused_0[7];
22791         /*
22792          * This field is used in Output records to indicate that the output
22793          * is completely written to RAM.  This field should be read as '1'
22794          * to indicate that the output has been completely written.
22795          * When writing a command completion or response to an internal processor,
22796          * the order of writes has to be such that this field is written last.
22797          */
22798         uint8_t valid;
22799 } __rte_packed;
22800
22801 /*******************************
22802  * hwrm_func_vf_vnic_ids_query *
22803  *******************************/
22804
22805
22806 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
22807 struct hwrm_func_vf_vnic_ids_query_input {
22808         /* The HWRM command request type. */
22809         uint16_t        req_type;
22810         /*
22811          * The completion ring to send the completion event on. This should
22812          * be the NQ ID returned from the `nq_alloc` HWRM command.
22813          */
22814         uint16_t        cmpl_ring;
22815         /*
22816          * The sequence ID is used by the driver for tracking multiple
22817          * commands. This ID is treated as opaque data by the firmware and
22818          * the value is returned in the `hwrm_resp_hdr` upon completion.
22819          */
22820         uint16_t        seq_id;
22821         /*
22822          * The target ID of the command:
22823          * * 0x0-0xFFF8 - The function ID
22824          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22825          * * 0xFFFD - Reserved for user-space HWRM interface
22826          * * 0xFFFF - HWRM
22827          */
22828         uint16_t        target_id;
22829         /*
22830          * A physical address pointer pointing to a host buffer that the
22831          * command's response data will be written. This can be either a host
22832          * physical address (HPA) or a guest physical address (GPA) and must
22833          * point to a physically contiguous block of memory.
22834          */
22835         uint64_t        resp_addr;
22836         /*
22837          * This value is used to identify a Virtual Function (VF).
22838          * The scope of VF ID is local within a PF.
22839          */
22840         uint16_t        vf_id;
22841         uint8_t unused_0[2];
22842         /* Max number of vnic ids in vnic id table */
22843         uint32_t        max_vnic_id_cnt;
22844         /* This is the address for VF VNIC ID table */
22845         uint64_t        vnic_id_tbl_addr;
22846 } __rte_packed;
22847
22848 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
22849 struct hwrm_func_vf_vnic_ids_query_output {
22850         /* The specific error status for the command. */
22851         uint16_t        error_code;
22852         /* The HWRM command request type. */
22853         uint16_t        req_type;
22854         /* The sequence ID from the original command. */
22855         uint16_t        seq_id;
22856         /* The length of the response data in number of bytes. */
22857         uint16_t        resp_len;
22858         /*
22859          * Actual number of vnic ids
22860          *
22861          * Each VNIC ID is written as a 32-bit number.
22862          */
22863         uint32_t        vnic_id_cnt;
22864         uint8_t unused_0[3];
22865         /*
22866          * This field is used in Output records to indicate that the output
22867          * is completely written to RAM.  This field should be read as '1'
22868          * to indicate that the output has been completely written.
22869          * When writing a command completion or response to an internal processor,
22870          * the order of writes has to be such that this field is written last.
22871          */
22872         uint8_t valid;
22873 } __rte_packed;
22874
22875 /***********************
22876  * hwrm_func_vf_bw_cfg *
22877  ***********************/
22878
22879
22880 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */
22881 struct hwrm_func_vf_bw_cfg_input {
22882         /* The HWRM command request type. */
22883         uint16_t        req_type;
22884         /*
22885          * The completion ring to send the completion event on. This should
22886          * be the NQ ID returned from the `nq_alloc` HWRM command.
22887          */
22888         uint16_t        cmpl_ring;
22889         /*
22890          * The sequence ID is used by the driver for tracking multiple
22891          * commands. This ID is treated as opaque data by the firmware and
22892          * the value is returned in the `hwrm_resp_hdr` upon completion.
22893          */
22894         uint16_t        seq_id;
22895         /*
22896          * The target ID of the command:
22897          * * 0x0-0xFFF8 - The function ID
22898          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22899          * * 0xFFFD - Reserved for user-space HWRM interface
22900          * * 0xFFFF - HWRM
22901          */
22902         uint16_t        target_id;
22903         /*
22904          * A physical address pointer pointing to a host buffer that the
22905          * command's response data will be written. This can be either a host
22906          * physical address (HPA) or a guest physical address (GPA) and must
22907          * point to a physically contiguous block of memory.
22908          */
22909         uint64_t        resp_addr;
22910         /*
22911          * The number of VF functions that are being configured.
22912          * The cmd space allows up to 50 VFs' BW to be configured with one cmd.
22913          */
22914         uint16_t        num_vfs;
22915         uint16_t        unused[3];
22916         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
22917         uint16_t        vfn[48];
22918         /* The physical VF id the adjustment will be made to. */
22919         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK     UINT32_C(0xfff)
22920         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT      0
22921         /*
22922          * This field configures the rate scale percentage of the VF as specified
22923          * by the physical VF id.
22924          */
22925         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK     UINT32_C(0xf000)
22926         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT      12
22927         /* 0% of the max tx rate */
22928         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0 \
22929                 (UINT32_C(0x0) << 12)
22930         /* 6.66% of the max tx rate */
22931         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66 \
22932                 (UINT32_C(0x1) << 12)
22933         /* 13.33% of the max tx rate */
22934         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33 \
22935                 (UINT32_C(0x2) << 12)
22936         /* 20% of the max tx rate */
22937         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20 \
22938                 (UINT32_C(0x3) << 12)
22939         /* 26.66% of the max tx rate */
22940         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66 \
22941                 (UINT32_C(0x4) << 12)
22942         /* 33% of the max tx rate */
22943         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33 \
22944                 (UINT32_C(0x5) << 12)
22945         /* 40% of the max tx rate */
22946         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40 \
22947                 (UINT32_C(0x6) << 12)
22948         /* 46.66% of the max tx rate */
22949         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66 \
22950                 (UINT32_C(0x7) << 12)
22951         /* 53.33% of the max tx rate */
22952         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33 \
22953                 (UINT32_C(0x8) << 12)
22954         /* 60% of the max tx rate */
22955         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60 \
22956                 (UINT32_C(0x9) << 12)
22957         /* 66.66% of the max tx rate */
22958         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66 \
22959                 (UINT32_C(0xa) << 12)
22960         /* 53.33% of the max tx rate */
22961         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33 \
22962                 (UINT32_C(0xb) << 12)
22963         /* 80% of the max tx rate */
22964         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80 \
22965                 (UINT32_C(0xc) << 12)
22966         /* 86.66% of the max tx rate */
22967         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66 \
22968                 (UINT32_C(0xd) << 12)
22969         /* 93.33% of the max tx rate */
22970         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33 \
22971                 (UINT32_C(0xe) << 12)
22972         /* 100% of the max tx rate */
22973         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100 \
22974                 (UINT32_C(0xf) << 12)
22975         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST \
22976                 HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
22977 } __rte_packed;
22978
22979 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
22980 struct hwrm_func_vf_bw_cfg_output {
22981         /* The specific error status for the command. */
22982         uint16_t        error_code;
22983         /* The HWRM command request type. */
22984         uint16_t        req_type;
22985         /* The sequence ID from the original command. */
22986         uint16_t        seq_id;
22987         /* The length of the response data in number of bytes. */
22988         uint16_t        resp_len;
22989         uint8_t unused_0[7];
22990         /*
22991          * This field is used in Output records to indicate that the output
22992          * is completely written to RAM.  This field should be read as '1'
22993          * to indicate that the output has been completely written.
22994          * When writing a command completion or response to an internal processor,
22995          * the order of writes has to be such that this field is written last.
22996          */
22997         uint8_t valid;
22998 } __rte_packed;
22999
23000 /************************
23001  * hwrm_func_vf_bw_qcfg *
23002  ************************/
23003
23004
23005 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */
23006 struct hwrm_func_vf_bw_qcfg_input {
23007         /* The HWRM command request type. */
23008         uint16_t        req_type;
23009         /*
23010          * The completion ring to send the completion event on. This should
23011          * be the NQ ID returned from the `nq_alloc` HWRM command.
23012          */
23013         uint16_t        cmpl_ring;
23014         /*
23015          * The sequence ID is used by the driver for tracking multiple
23016          * commands. This ID is treated as opaque data by the firmware and
23017          * the value is returned in the `hwrm_resp_hdr` upon completion.
23018          */
23019         uint16_t        seq_id;
23020         /*
23021          * The target ID of the command:
23022          * * 0x0-0xFFF8 - The function ID
23023          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23024          * * 0xFFFD - Reserved for user-space HWRM interface
23025          * * 0xFFFF - HWRM
23026          */
23027         uint16_t        target_id;
23028         /*
23029          * A physical address pointer pointing to a host buffer that the
23030          * command's response data will be written. This can be either a host
23031          * physical address (HPA) or a guest physical address (GPA) and must
23032          * point to a physically contiguous block of memory.
23033          */
23034         uint64_t        resp_addr;
23035         /*
23036          * The number of VF functions that are being queried.
23037          * The inline response space allows the host to query up to 50 VFs'
23038          * rate scale percentage
23039          */
23040         uint16_t        num_vfs;
23041         uint16_t        unused[3];
23042         /* These 16-bit fields contain the VF fid */
23043         uint16_t        vfn[48];
23044         /* The physical VF id of interest */
23045         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
23046         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
23047 } __rte_packed;
23048
23049 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
23050 struct hwrm_func_vf_bw_qcfg_output {
23051         /* The specific error status for the command. */
23052         uint16_t        error_code;
23053         /* The HWRM command request type. */
23054         uint16_t        req_type;
23055         /* The sequence ID from the original command. */
23056         uint16_t        seq_id;
23057         /* The length of the response data in number of bytes. */
23058         uint16_t        resp_len;
23059         /*
23060          * The number of VF functions that are being queried.
23061          * The inline response space allows the host to query up to 50 VFs' rate
23062          * scale percentage
23063          */
23064         uint16_t        num_vfs;
23065         uint16_t        unused[3];
23066         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
23067         uint16_t        vfn[48];
23068         /* The physical VF id the adjustment will be made to. */
23069         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK     UINT32_C(0xfff)
23070         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT      0
23071         /*
23072          * This field configures the rate scale percentage of the VF as specified
23073          * by the physical VF id.
23074          */
23075         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK     UINT32_C(0xf000)
23076         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT      12
23077         /* 0% of the max tx rate */
23078         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0 \
23079                 (UINT32_C(0x0) << 12)
23080         /* 6.66% of the max tx rate */
23081         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66 \
23082                 (UINT32_C(0x1) << 12)
23083         /* 13.33% of the max tx rate */
23084         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33 \
23085                 (UINT32_C(0x2) << 12)
23086         /* 20% of the max tx rate */
23087         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20 \
23088                 (UINT32_C(0x3) << 12)
23089         /* 26.66% of the max tx rate */
23090         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66 \
23091                 (UINT32_C(0x4) << 12)
23092         /* 33% of the max tx rate */
23093         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33 \
23094                 (UINT32_C(0x5) << 12)
23095         /* 40% of the max tx rate */
23096         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40 \
23097                 (UINT32_C(0x6) << 12)
23098         /* 46.66% of the max tx rate */
23099         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66 \
23100                 (UINT32_C(0x7) << 12)
23101         /* 53.33% of the max tx rate */
23102         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33 \
23103                 (UINT32_C(0x8) << 12)
23104         /* 60% of the max tx rate */
23105         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60 \
23106                 (UINT32_C(0x9) << 12)
23107         /* 66.66% of the max tx rate */
23108         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66 \
23109                 (UINT32_C(0xa) << 12)
23110         /* 53.33% of the max tx rate */
23111         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33 \
23112                 (UINT32_C(0xb) << 12)
23113         /* 80% of the max tx rate */
23114         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80 \
23115                 (UINT32_C(0xc) << 12)
23116         /* 86.66% of the max tx rate */
23117         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66 \
23118                 (UINT32_C(0xd) << 12)
23119         /* 93.33% of the max tx rate */
23120         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33 \
23121                 (UINT32_C(0xe) << 12)
23122         /* 100% of the max tx rate */
23123         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100 \
23124                 (UINT32_C(0xf) << 12)
23125         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST \
23126                 HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100
23127         uint8_t unused_0[7];
23128         /*
23129          * This field is used in Output records to indicate that the output
23130          * is completely written to RAM.  This field should be read as '1'
23131          * to indicate that the output has been completely written.
23132          * When writing a command completion or response to an internal processor,
23133          * the order of writes has to be such that this field is written last.
23134          */
23135         uint8_t valid;
23136 } __rte_packed;
23137
23138 /***************************
23139  * hwrm_func_drv_if_change *
23140  ***************************/
23141
23142
23143 /* hwrm_func_drv_if_change_input (size:192b/24B) */
23144 struct hwrm_func_drv_if_change_input {
23145         /* The HWRM command request type. */
23146         uint16_t        req_type;
23147         /*
23148          * The completion ring to send the completion event on. This should
23149          * be the NQ ID returned from the `nq_alloc` HWRM command.
23150          */
23151         uint16_t        cmpl_ring;
23152         /*
23153          * The sequence ID is used by the driver for tracking multiple
23154          * commands. This ID is treated as opaque data by the firmware and
23155          * the value is returned in the `hwrm_resp_hdr` upon completion.
23156          */
23157         uint16_t        seq_id;
23158         /*
23159          * The target ID of the command:
23160          * * 0x0-0xFFF8 - The function ID
23161          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23162          * * 0xFFFD - Reserved for user-space HWRM interface
23163          * * 0xFFFF - HWRM
23164          */
23165         uint16_t        target_id;
23166         /*
23167          * A physical address pointer pointing to a host buffer that the
23168          * command's response data will be written. This can be either a host
23169          * physical address (HPA) or a guest physical address (GPA) and must
23170          * point to a physically contiguous block of memory.
23171          */
23172         uint64_t        resp_addr;
23173         uint32_t        flags;
23174         /*
23175          * When this bit is '1', the function driver is indicating
23176          * that the IF state is changing to UP state.  The call should
23177          * be made at the beginning of the driver's open call before
23178          * resources are allocated.  After making the call, the driver
23179          * should check the response to see if any resources may have
23180          * changed (see the response below).  If the driver fails
23181          * the open call, the driver should make this call again with
23182          * this bit cleared to indicate that the IF state is not UP.
23183          * During the driver's close call when the IF state is changing
23184          * to DOWN, the driver should make this call with the bit cleared
23185          * after all resources have been freed.
23186          */
23187         #define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP     UINT32_C(0x1)
23188         uint32_t        unused;
23189 } __rte_packed;
23190
23191 /* hwrm_func_drv_if_change_output (size:128b/16B) */
23192 struct hwrm_func_drv_if_change_output {
23193         /* The specific error status for the command. */
23194         uint16_t        error_code;
23195         /* The HWRM command request type. */
23196         uint16_t        req_type;
23197         /* The sequence ID from the original command. */
23198         uint16_t        seq_id;
23199         /* The length of the response data in number of bytes. */
23200         uint16_t        resp_len;
23201         uint32_t        flags;
23202         /*
23203          * When this bit is '1', it indicates that the resources reserved
23204          * for this function may have changed.  The driver should check
23205          * resource capabilities and reserve resources again before
23206          * allocating resources.
23207          */
23208         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE \
23209                 UINT32_C(0x1)
23210         /*
23211          * When this bit is '1', it indicates that the firmware got changed / reset.
23212          * The driver should do complete re-initialization when that bit is set.
23213          */
23214         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE \
23215                 UINT32_C(0x2)
23216         uint8_t unused_0[3];
23217         /*
23218          * This field is used in Output records to indicate that the output
23219          * is completely written to RAM.  This field should be read as '1'
23220          * to indicate that the output has been completely written.
23221          * When writing a command completion or response to an internal processor,
23222          * the order of writes has to be such that this field is written last.
23223          */
23224         uint8_t valid;
23225 } __rte_packed;
23226
23227 /*******************************
23228  * hwrm_func_host_pf_ids_query *
23229  *******************************/
23230
23231
23232 /* hwrm_func_host_pf_ids_query_input (size:192b/24B) */
23233 struct hwrm_func_host_pf_ids_query_input {
23234         /* The HWRM command request type. */
23235         uint16_t        req_type;
23236         /*
23237          * The completion ring to send the completion event on. This should
23238          * be the NQ ID returned from the `nq_alloc` HWRM command.
23239          */
23240         uint16_t        cmpl_ring;
23241         /*
23242          * The sequence ID is used by the driver for tracking multiple
23243          * commands. This ID is treated as opaque data by the firmware and
23244          * the value is returned in the `hwrm_resp_hdr` upon completion.
23245          */
23246         uint16_t        seq_id;
23247         /*
23248          * The target ID of the command:
23249          * * 0x0-0xFFF8 - The function ID
23250          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23251          * * 0xFFFD - Reserved for user-space HWRM interface
23252          * * 0xFFFF - HWRM
23253          */
23254         uint16_t        target_id;
23255         /*
23256          * A physical address pointer pointing to a host buffer that the
23257          * command's response data will be written. This can be either a host
23258          * physical address (HPA) or a guest physical address (GPA) and must
23259          * point to a physically contiguous block of memory.
23260          */
23261         uint64_t        resp_addr;
23262         uint8_t host;
23263         /*
23264          * # If this bit is set to '1', the query will contain PF(s)
23265          * belongs to SOC host.
23266          */
23267         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_SOC      UINT32_C(0x1)
23268         /*
23269          * # If this bit is set to '1', the query will contain PF(s)
23270          * belongs to EP0 host.
23271          */
23272         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_0     UINT32_C(0x2)
23273         /*
23274          * # If this bit is set to '1', the query will contain PF(s)
23275          * belongs to EP1 host.
23276          */
23277         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_1     UINT32_C(0x4)
23278         /*
23279          * # If this bit is set to '1', the query will contain PF(s)
23280          * belongs to EP2 host.
23281          */
23282         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_2     UINT32_C(0x8)
23283         /*
23284          * # If this bit is set to '1', the query will contain PF(s)
23285          * belongs to EP3 host.
23286          */
23287         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_3     UINT32_C(0x10)
23288         /*
23289          * This provides a filter of what PF(s) will be returned in the
23290          * query..
23291          */
23292         uint8_t filter;
23293         /*
23294          * all available PF(s) belong to the host(s) (defined in the
23295          * host field). This includes the hidden PFs.
23296          */
23297         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ALL  UINT32_C(0x0)
23298         /*
23299          * all available PF(s) belong to the host(s) (defined in the
23300          * host field) that is available for L2 traffic.
23301          */
23302         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_L2   UINT32_C(0x1)
23303         /*
23304          * all available PF(s) belong to the host(s) (defined in the
23305          * host field) that is available for ROCE traffic.
23306          */
23307         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE UINT32_C(0x2)
23308         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_LAST \
23309                 HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE
23310         uint8_t unused_1[6];
23311 } __rte_packed;
23312
23313 /* hwrm_func_host_pf_ids_query_output (size:128b/16B) */
23314 struct hwrm_func_host_pf_ids_query_output {
23315         /* The specific error status for the command. */
23316         uint16_t        error_code;
23317         /* The HWRM command request type. */
23318         uint16_t        req_type;
23319         /* The sequence ID from the original command. */
23320         uint16_t        seq_id;
23321         /* The length of the response data in number of bytes. */
23322         uint16_t        resp_len;
23323         /* This provides the first PF ID of the device. */
23324         uint16_t        first_pf_id;
23325         uint16_t        pf_ordinal_mask;
23326         /*
23327          * When this bit is '1', it indicates first PF belongs to one of
23328          * the hosts defined in the input request.
23329          */
23330         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_0 \
23331                 UINT32_C(0x1)
23332         /*
23333          * When this bit is '1', it indicates 2nd PF belongs to one of the
23334          * hosts defined in the input request.
23335          */
23336         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_1 \
23337                 UINT32_C(0x2)
23338         /*
23339          * When this bit is '1', it indicates 3rd PF belongs to one of the
23340          * hosts defined in the input request.
23341          */
23342         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_2 \
23343                 UINT32_C(0x4)
23344         /*
23345          * When this bit is '1', it indicates 4th PF belongs to one of the
23346          * hosts defined in the input request.
23347          */
23348         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_3 \
23349                 UINT32_C(0x8)
23350         /*
23351          * When this bit is '1', it indicates 5th PF belongs to one of the
23352          * hosts defined in the input request.
23353          */
23354         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_4 \
23355                 UINT32_C(0x10)
23356         /*
23357          * When this bit is '1', it indicates 6th PF belongs to one of the
23358          * hosts defined in the input request.
23359          */
23360         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_5 \
23361                 UINT32_C(0x20)
23362         /*
23363          * When this bit is '1', it indicates 7th PF belongs to one of the
23364          * hosts defined in the input request.
23365          */
23366         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_6 \
23367                 UINT32_C(0x40)
23368         /*
23369          * When this bit is '1', it indicates 8th PF belongs to one of the
23370          * hosts defined in the input request.
23371          */
23372         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_7 \
23373                 UINT32_C(0x80)
23374         /*
23375          * When this bit is '1', it indicates 9th PF belongs to one of the
23376          * hosts defined in the input request.
23377          */
23378         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_8 \
23379                 UINT32_C(0x100)
23380         /*
23381          * When this bit is '1', it indicates 10th PF belongs to one of the
23382          * hosts defined in the input request.
23383          */
23384         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_9 \
23385                 UINT32_C(0x200)
23386         /*
23387          * When this bit is '1', it indicates 11th PF belongs to one of the
23388          * hosts defined in the input request.
23389          */
23390         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_10 \
23391                 UINT32_C(0x400)
23392         /*
23393          * When this bit is '1', it indicates 12th PF belongs to one of the
23394          * hosts defined in the input request.
23395          */
23396         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_11 \
23397                 UINT32_C(0x800)
23398         /*
23399          * When this bit is '1', it indicates 13th PF belongs to one of the
23400          * hosts defined in the input request.
23401          */
23402         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_12 \
23403                 UINT32_C(0x1000)
23404         /*
23405          * When this bit is '1', it indicates 14th PF belongs to one of the
23406          * hosts defined in the input request.
23407          */
23408         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_13 \
23409                 UINT32_C(0x2000)
23410         /*
23411          * When this bit is '1', it indicates 15th PF belongs to one of the
23412          * hosts defined in the input request.
23413          */
23414         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_14 \
23415                 UINT32_C(0x4000)
23416         /*
23417          * When this bit is '1', it indicates 16th PF belongs to one of the
23418          * hosts defined in the input request.
23419          */
23420         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_15 \
23421                 UINT32_C(0x8000)
23422         uint8_t unused_1[3];
23423         /*
23424          * This field is used in Output records to indicate that the output
23425          * is completely written to RAM.  This field should be read as '1'
23426          * to indicate that the output has been completely written.
23427          * When writing a command completion or response to an internal processor,
23428          * the order of writes has to be such that this field is written last.
23429          */
23430         uint8_t valid;
23431 } __rte_packed;
23432
23433 /*********************
23434  * hwrm_func_spd_cfg *
23435  *********************/
23436
23437
23438 /* hwrm_func_spd_cfg_input (size:384b/48B) */
23439 struct hwrm_func_spd_cfg_input {
23440         /* The HWRM command request type. */
23441         uint16_t        req_type;
23442         /*
23443          * The completion ring to send the completion event on. This should
23444          * be the NQ ID returned from the `nq_alloc` HWRM command.
23445          */
23446         uint16_t        cmpl_ring;
23447         /*
23448          * The sequence ID is used by the driver for tracking multiple
23449          * commands. This ID is treated as opaque data by the firmware and
23450          * the value is returned in the `hwrm_resp_hdr` upon completion.
23451          */
23452         uint16_t        seq_id;
23453         /*
23454          * The target ID of the command:
23455          * * 0x0-0xFFF8 - The function ID
23456          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23457          * * 0xFFFD - Reserved for user-space HWRM interface
23458          * * 0xFFFF - HWRM
23459          */
23460         uint16_t        target_id;
23461         /*
23462          * A physical address pointer pointing to a host buffer that the
23463          * command's response data will be written. This can be either a host
23464          * physical address (HPA) or a guest physical address (GPA) and must
23465          * point to a physically contiguous block of memory.
23466          */
23467         uint64_t        resp_addr;
23468         uint32_t        flags;
23469         /* Set this bit is '1' to enable the SPD datapath forwarding. */
23470         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_FWD_ENABLE       UINT32_C(0x1)
23471         /* Set this bit is '1' to disable the SPD datapath forwarding. */
23472         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_FWD_DISABLE      UINT32_C(0x2)
23473         /*
23474          * Set this bit is '1' to enable the SPD datapath checksum
23475          * feature.
23476          */
23477         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_CSUM_ENABLE      UINT32_C(0x4)
23478         /*
23479          * Set this bit is '1' to disable the SPD datapath checksum
23480          * feature.
23481          */
23482         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_CSUM_DISABLE     UINT32_C(0x8)
23483         /*
23484          * Set this bit is '1' to enable the SPD datapath debug
23485          * feature.
23486          */
23487         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_DBG_ENABLE       UINT32_C(0x10)
23488         /*
23489          * Set this bit is '1' to disable the SPD datapath debug
23490          * feature.
23491          */
23492         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_DBG_DISABLE      UINT32_C(0x20)
23493         uint32_t        enables;
23494         /*
23495          * This bit must be '1' for the ethertype field to be
23496          * configured.
23497          */
23498         #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_ETHERTYPE \
23499                 UINT32_C(0x1)
23500         /*
23501          * This bit must be '1' for the hash_mode_flags field to be
23502          * configured.
23503          */
23504         #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_MODE_FLAGS \
23505                 UINT32_C(0x2)
23506         /*
23507          * This bit must be '1' for the hash_type field to be
23508          * configured.
23509          */
23510         #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_TYPE \
23511                 UINT32_C(0x4)
23512         /*
23513          * This bit must be '1' for the ring_tbl_addr field to be
23514          * configured.
23515          */
23516         #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_RING_TBL_ADDR \
23517                 UINT32_C(0x8)
23518         /*
23519          * This bit must be '1' for the hash_key_tbl_addr field to be
23520          * configured.
23521          */
23522         #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_KEY_TBL_ADDR \
23523                 UINT32_C(0x10)
23524         /*
23525          * Ethertype value used in the encapsulated SPD packet header.
23526          * The user must choose a value that is not conflicting with
23527          * publicly defined ethertype values. By default, the ethertype
23528          * value of 0xffff is used if there is no user specified value.
23529          */
23530         uint16_t        ethertype;
23531         /* Flags to specify different RSS hash modes. */
23532         uint8_t hash_mode_flags;
23533         /*
23534          * When this bit is '1', it indicates using current RSS
23535          * hash mode setting configured in the device.
23536          */
23537         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \
23538                 UINT32_C(0x1)
23539         /*
23540          * When this bit is '1', it indicates requesting support of
23541          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
23542          * l4.src, l4.dest} for tunnel packets. For none-tunnel
23543          * packets, the RSS hash is computed over the normal
23544          * src/dest l3 and src/dest l4 headers.
23545          */
23546         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \
23547                 UINT32_C(0x2)
23548         /*
23549          * When this bit is '1', it indicates requesting support of
23550          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
23551          * tunnel packets. For none-tunnel packets, the RSS hash is
23552          * computed over the normal src/dest l3 headers.
23553          */
23554         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \
23555                 UINT32_C(0x4)
23556         /*
23557          * When this bit is '1', it indicates requesting support of
23558          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
23559          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
23560          * packets, the RSS hash is computed over the normal
23561          * src/dest l3 and src/dest l4 headers.
23562          */
23563         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
23564                 UINT32_C(0x8)
23565         /*
23566          * When this bit is '1', it indicates requesting support of
23567          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
23568          * tunnel packets. For none-tunnel packets, the RSS hash is
23569          * computed over the normal src/dest l3 headers.
23570          */
23571         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
23572                 UINT32_C(0x10)
23573         uint8_t unused_1;
23574         uint32_t        hash_type;
23575         /*
23576          * When this bit is '1', the RSS hash shall be computed
23577          * over source and destination IPv4 addresses of IPv4
23578          * packets.
23579          */
23580         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
23581         /*
23582          * When this bit is '1', the RSS hash shall be computed
23583          * over source/destination IPv4 addresses and
23584          * source/destination ports of TCP/IPv4 packets.
23585          */
23586         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
23587         /*
23588          * When this bit is '1', the RSS hash shall be computed
23589          * over source/destination IPv4 addresses and
23590          * source/destination ports of UDP/IPv4 packets.
23591          */
23592         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
23593         /*
23594          * When this bit is '1', the RSS hash shall be computed
23595          * over source and destination IPv4 addresses of IPv6
23596          * packets.
23597          */
23598         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
23599         /*
23600          * When this bit is '1', the RSS hash shall be computed
23601          * over source/destination IPv6 addresses and
23602          * source/destination ports of TCP/IPv6 packets.
23603          */
23604         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
23605         /*
23606          * When this bit is '1', the RSS hash shall be computed
23607          * over source/destination IPv6 addresses and
23608          * source/destination ports of UDP/IPv6 packets.
23609          */
23610         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
23611         /* This is the address for rss ring group table */
23612         uint64_t        ring_grp_tbl_addr;
23613         /* This is the address for rss hash key table */
23614         uint64_t        hash_key_tbl_addr;
23615 } __rte_packed;
23616
23617 /* hwrm_func_spd_cfg_output (size:128b/16B) */
23618 struct hwrm_func_spd_cfg_output {
23619         /* The specific error status for the command. */
23620         uint16_t        error_code;
23621         /* The HWRM command request type. */
23622         uint16_t        req_type;
23623         /* The sequence ID from the original command. */
23624         uint16_t        seq_id;
23625         /* The length of the response data in number of bytes. */
23626         uint16_t        resp_len;
23627         uint8_t unused_0[7];
23628         /*
23629          * This field is used in Output records to indicate that the output
23630          * is completely written to RAM.  This field should be read as '1'
23631          * to indicate that the output has been completely written.
23632          * When writing a command completion or response to an internal processor,
23633          * the order of writes has to be such that this field is written last.
23634          */
23635         uint8_t valid;
23636 } __rte_packed;
23637
23638 /**********************
23639  * hwrm_func_spd_qcfg *
23640  **********************/
23641
23642
23643 /* hwrm_func_spd_qcfg_input (size:128b/16B) */
23644 struct hwrm_func_spd_qcfg_input {
23645         /* The HWRM command request type. */
23646         uint16_t        req_type;
23647         /*
23648          * The completion ring to send the completion event on. This should
23649          * be the NQ ID returned from the `nq_alloc` HWRM command.
23650          */
23651         uint16_t        cmpl_ring;
23652         /*
23653          * The sequence ID is used by the driver for tracking multiple
23654          * commands. This ID is treated as opaque data by the firmware and
23655          * the value is returned in the `hwrm_resp_hdr` upon completion.
23656          */
23657         uint16_t        seq_id;
23658         /*
23659          * The target ID of the command:
23660          * * 0x0-0xFFF8 - The function ID
23661          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23662          * * 0xFFFD - Reserved for user-space HWRM interface
23663          * * 0xFFFF - HWRM
23664          */
23665         uint16_t        target_id;
23666         /*
23667          * A physical address pointer pointing to a host buffer that the
23668          * command's response data will be written. This can be either a host
23669          * physical address (HPA) or a guest physical address (GPA) and must
23670          * point to a physically contiguous block of memory.
23671          */
23672         uint64_t        resp_addr;
23673 } __rte_packed;
23674
23675 /* hwrm_func_spd_qcfg_output (size:512b/64B) */
23676 struct hwrm_func_spd_qcfg_output {
23677         /* The specific error status for the command. */
23678         uint16_t        error_code;
23679         /* The HWRM command request type. */
23680         uint16_t        req_type;
23681         /* The sequence ID from the original command. */
23682         uint16_t        seq_id;
23683         /* The length of the response data in number of bytes. */
23684         uint16_t        resp_len;
23685         uint32_t        flags;
23686         /*
23687          * The SPD datapath forwarding is currently enabled when this
23688          * flag is set to '1'.
23689          */
23690         #define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_FWD_ENABLED      UINT32_C(0x1)
23691         /*
23692          * The SPD datapath checksum feature is currently enabled when
23693          * this flag is set to '1'.
23694          */
23695         #define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_CSUM_ENABLED     UINT32_C(0x2)
23696         /*
23697          * The SPD datapath debug feature is currently enabled when
23698          * this flag is set to '1'.
23699          */
23700         #define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_DBG_ENABLED      UINT32_C(0x4)
23701         uint32_t        hash_type;
23702         /*
23703          * When this bit is '1', the RSS hash shall be computed
23704          * over source and destination IPv4 addresses of IPv4
23705          * packets.
23706          */
23707         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
23708         /*
23709          * When this bit is '1', the RSS hash shall be computed
23710          * over source/destination IPv4 addresses and
23711          * source/destination ports of TCP/IPv4 packets.
23712          */
23713         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
23714         /*
23715          * When this bit is '1', the RSS hash shall be computed
23716          * over source/destination IPv4 addresses and
23717          * source/destination ports of UDP/IPv4 packets.
23718          */
23719         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
23720         /*
23721          * When this bit is '1', the RSS hash shall be computed
23722          * over source and destination IPv4 addresses of IPv6
23723          * packets.
23724          */
23725         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
23726         /*
23727          * When this bit is '1', the RSS hash shall be computed
23728          * over source/destination IPv6 addresses and
23729          * source/destination ports of TCP/IPv6 packets.
23730          */
23731         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
23732         /*
23733          * When this bit is '1', the RSS hash shall be computed
23734          * over source/destination IPv6 addresses and
23735          * source/destination ports of UDP/IPv6 packets.
23736          */
23737         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
23738         /* This is the value of rss hash key */
23739         uint32_t        hash_key[10];
23740         /* Flags to specify different RSS hash modes. */
23741         uint8_t hash_mode_flags;
23742         /*
23743          * When this bit is '1', it indicates using current RSS
23744          * hash mode setting configured in the device.
23745          */
23746         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \
23747                 UINT32_C(0x1)
23748         /*
23749          * When this bit is '1', it indicates requesting support of
23750          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
23751          * l4.src, l4.dest} for tunnel packets. For none-tunnel
23752          * packets, the RSS hash is computed over the normal
23753          * src/dest l3 and src/dest l4 headers.
23754          */
23755         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \
23756                 UINT32_C(0x2)
23757         /*
23758          * When this bit is '1', it indicates requesting support of
23759          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
23760          * tunnel packets. For none-tunnel packets, the RSS hash is
23761          * computed over the normal src/dest l3 headers.
23762          */
23763         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \
23764                 UINT32_C(0x4)
23765         /*
23766          * When this bit is '1', it indicates requesting support of
23767          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
23768          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
23769          * packets, the RSS hash is computed over the normal
23770          * src/dest l3 and src/dest l4 headers.
23771          */
23772         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
23773                 UINT32_C(0x8)
23774         /*
23775          * When this bit is '1', it indicates requesting support of
23776          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
23777          * tunnel packets. For none-tunnel packets, the RSS hash is
23778          * computed over the normal src/dest l3 headers.
23779          */
23780         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
23781                 UINT32_C(0x10)
23782         uint8_t unused_1;
23783         /*
23784          * Ethertype value used in the encapsulated SPD packet header.
23785          * The user must choose a value that is not conflicting with
23786          * publicly defined ethertype values. By default, the ethertype
23787          * value of 0xffff is used if there is no user specified value.
23788          */
23789         uint16_t        ethertype;
23790         uint8_t unused_2[3];
23791         /*
23792          * This field is used in Output records to indicate that the output
23793          * is completely written to RAM.  This field should be read as '1'
23794          * to indicate that the output has been completely written.
23795          * When writing a command completion or response to an internal processor,
23796          * the order of writes has to be such that this field is written last.
23797          */
23798         uint8_t valid;
23799 } __rte_packed;
23800
23801 /*********************
23802  * hwrm_port_phy_cfg *
23803  *********************/
23804
23805
23806 /* hwrm_port_phy_cfg_input (size:448b/56B) */
23807 struct hwrm_port_phy_cfg_input {
23808         /* The HWRM command request type. */
23809         uint16_t        req_type;
23810         /*
23811          * The completion ring to send the completion event on. This should
23812          * be the NQ ID returned from the `nq_alloc` HWRM command.
23813          */
23814         uint16_t        cmpl_ring;
23815         /*
23816          * The sequence ID is used by the driver for tracking multiple
23817          * commands. This ID is treated as opaque data by the firmware and
23818          * the value is returned in the `hwrm_resp_hdr` upon completion.
23819          */
23820         uint16_t        seq_id;
23821         /*
23822          * The target ID of the command:
23823          * * 0x0-0xFFF8 - The function ID
23824          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23825          * * 0xFFFD - Reserved for user-space HWRM interface
23826          * * 0xFFFF - HWRM
23827          */
23828         uint16_t        target_id;
23829         /*
23830          * A physical address pointer pointing to a host buffer that the
23831          * command's response data will be written. This can be either a host
23832          * physical address (HPA) or a guest physical address (GPA) and must
23833          * point to a physically contiguous block of memory.
23834          */
23835         uint64_t        resp_addr;
23836         uint32_t        flags;
23837         /*
23838          * When this bit is set to '1', the PHY for the port shall
23839          * be reset.
23840          *
23841          * # If this bit is set to 1, then the HWRM shall reset the
23842          * PHY after applying PHY configuration changes specified
23843          * in this command.
23844          * # In order to guarantee that PHY configuration changes
23845          * specified in this command take effect, the HWRM
23846          * client should set this flag to 1.
23847          * # If this bit is not set to 1, then the HWRM may reset
23848          * the PHY depending on the current PHY configuration and
23849          * settings specified in this command.
23850          */
23851         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY \
23852                 UINT32_C(0x1)
23853         /* deprecated bit.  Do not use!!! */
23854         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED \
23855                 UINT32_C(0x2)
23856         /*
23857          * When this bit is set to '1', and the force_pam4_link_speed
23858          * bit in the 'enables' field is '0', the link shall be forced
23859          * to the force_link_speed value.
23860          *
23861          * When this bit is set to '1', and the force_pam4_link_speed
23862          * bit in the 'enables' field is '1', the link shall be forced
23863          * to the force_pam4_link_speed value.
23864          *
23865          * When this bit is set to '1', the HWRM client should
23866          * not enable any of the auto negotiation related
23867          * fields represented by auto_XXX fields in this command.
23868          * When this bit is set to '1' and the HWRM client has
23869          * enabled a auto_XXX field in this command, then the
23870          * HWRM shall ignore the enabled auto_XXX field.
23871          *
23872          * When this bit is set to zero, the link
23873          * shall be allowed to autoneg.
23874          */
23875         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE \
23876                 UINT32_C(0x4)
23877         /*
23878          * When this bit is set to '1', the auto-negotiation process
23879          * shall be restarted on the link.
23880          */
23881         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG \
23882                 UINT32_C(0x8)
23883         /*
23884          * When this bit is set to '1', Energy Efficient Ethernet
23885          * (EEE) is requested to be enabled on this link.
23886          * If EEE is not supported on this port, then this flag
23887          * shall be ignored by the HWRM.
23888          */
23889         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE \
23890                 UINT32_C(0x10)
23891         /*
23892          * When this bit is set to '1', Energy Efficient Ethernet
23893          * (EEE) is requested to be disabled on this link.
23894          * If EEE is not supported on this port, then this flag
23895          * shall be ignored by the HWRM.
23896          */
23897         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE \
23898                 UINT32_C(0x20)
23899         /*
23900          * When this bit is set to '1' and EEE is enabled on this
23901          * link, then TX LPI is requested to be enabled on the link.
23902          * If EEE is not supported on this port, then this flag
23903          * shall be ignored by the HWRM.
23904          * If EEE is disabled on this port, then this flag shall be
23905          * ignored by the HWRM.
23906          */
23907         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE \
23908                 UINT32_C(0x40)
23909         /*
23910          * When this bit is set to '1' and EEE is enabled on this
23911          * link, then TX LPI is requested to be disabled on the link.
23912          * If EEE is not supported on this port, then this flag
23913          * shall be ignored by the HWRM.
23914          * If EEE is disabled on this port, then this flag shall be
23915          * ignored by the HWRM.
23916          */
23917         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE \
23918                 UINT32_C(0x80)
23919         /*
23920          * When set to 1, then the HWRM shall enable FEC autonegotitation
23921          * on this port if supported.  When enabled, at least one of the
23922          * FEC modes must be advertised by enabling the fec_clause_74_enable,
23923          * fec_clause_91_enable, fec_rs544_1xn_enable, fec_rs544_ieee_enable,
23924          * fec_rs272_1xn_enable, or fec_rs272_ieee_enable flag.  If none
23925          * of the FEC mode is currently enabled, the HWRM shall choose
23926          * a default advertisement setting.
23927          * The default advertisement setting can be queried by calling
23928          * hwrm_port_phy_qcfg.  Note that the link speed must be
23929          * in autonegotiation mode for FEC autonegotiation to take effect.
23930          * When set to 0, then this flag shall be ignored.
23931          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
23932          * flag.
23933          */
23934         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE \
23935                 UINT32_C(0x100)
23936         /*
23937          * When set to 1, then the HWRM shall disable FEC autonegotiation
23938          * on this port and use forced FEC mode.  In forced FEC mode, one
23939          * or more FEC forced settings under the same clause can be set.
23940          * When set to 0, then this flag shall be ignored.
23941          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
23942          * flag.
23943          */
23944         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
23945                 UINT32_C(0x200)
23946         /*
23947          * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
23948          * on this port if supported, by advertising FEC CLAUSE 74 if
23949          * FEC autonegotiation is enabled or force enabled otherwise.
23950          * When set to 0, then this flag shall be ignored.
23951          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
23952          * flag.
23953          */
23954         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
23955                 UINT32_C(0x400)
23956         /*
23957          * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
23958          * on this port if supported, by not advertising FEC CLAUSE 74 if
23959          * FEC autonegotiation is enabled or force disabled otherwise.
23960          * When set to 0, then this flag shall be ignored.
23961          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
23962          * flag.
23963          */
23964         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
23965                 UINT32_C(0x800)
23966         /*
23967          * When set to 1, then the HWRM shall enable FEC CLAUSE 91
23968          * (Reed Solomon RS(528,514) for NRZ) on this port if supported,
23969          * by advertising FEC RS(528,514) if FEC autonegotiation is enabled
23970          * or force enabled otherwise.  In forced FEC mode, this flag
23971          * will only take effect if the speed is NRZ.  Additional
23972          * RS544 or RS272 flags (also under clause 91) may be set for PAM4
23973          * in forced FEC mode.
23974          * When set to 0, then this flag shall be ignored.
23975          * If FEC RS(528,514) is not supported, then the HWRM shall ignore
23976          * this flag.
23977          */
23978         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
23979                 UINT32_C(0x1000)
23980         /*
23981          * When set to 1, then the HWRM shall disable FEC CLAUSE 91
23982          * (Reed Solomon RS(528,514) for NRZ) on this port if supported, by
23983          * not advertising RS(528,514) if FEC autonegotiation is enabled or
23984          * force disabled otherwise.  When set to 0, then this flag shall be
23985          * ignored.  If FEC RS(528,514) is not supported, then the HWRM
23986          * shall ignore this flag.
23987          */
23988         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
23989                 UINT32_C(0x2000)
23990         /*
23991          * When this bit is set to '1', the link shall be forced to
23992          * be taken down.
23993          *
23994          * # When this bit is set to '1", all other
23995          * command input settings related to the link speed shall
23996          * be ignored.
23997          * Once the link state is forced down, it can be
23998          * explicitly cleared from that state by setting this flag
23999          * to '0'.
24000          * # If this flag is set to '0', then the link shall be
24001          * cleared from forced down state if the link is in forced
24002          * down state.
24003          * There may be conditions (e.g. out-of-band or sideband
24004          * configuration changes for the link) outside the scope
24005          * of the HWRM implementation that may clear forced down
24006          * link state.
24007          */
24008         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN \
24009                 UINT32_C(0x4000)
24010         /*
24011          * When set to 1, then the HWRM shall enable FEC RS544_1XN
24012          * on this port if supported, by advertising FEC RS544_1XN if
24013          * FEC autonegotiation is enabled or force enabled otherwise.
24014          * In forced mode, this flag will only take effect if the speed is
24015          * PAM4.  If this flag and fec_rs544_ieee_enable are set, the
24016          * HWRM shall choose one of the RS544 modes.
24017          * When set to 0, then this flag shall be ignored.
24018          * If FEC RS544_1XN is not supported, then the HWRM shall ignore this
24019          * flag.
24020          */
24021         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_ENABLE \
24022                 UINT32_C(0x8000)
24023         /*
24024          * When set to 1, then the HWRM shall disable FEC RS544_1XN
24025          * on this port if supported, by not advertising FEC RS544_1XN if
24026          * FEC autonegotiation is enabled or force disabled otherwise.
24027          * When set to 0, then this flag shall be ignored.
24028          * If FEC RS544_1XN  is not supported, then the HWRM shall ignore this
24029          * flag.
24030          */
24031         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_DISABLE \
24032                 UINT32_C(0x10000)
24033         /*
24034          * When set to 1, then the HWRM shall enable FEC RS(544,514)
24035          * on this port if supported, by advertising FEC RS(544,514) if
24036          * FEC autonegotiation is enabled or force enabled otherwise.
24037          * In forced mode, this flag will only take effect if the speed is
24038          * PAM4.  If this flag and fec_rs544_1xn_enable are set, the
24039          * HWRM shall choose one of the RS544 modes.
24040          * When set to 0, then this flag shall be ignored.
24041          * If FEC RS(544,514) is not supported, then the HWRM shall ignore
24042          * this flag.
24043          */
24044         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_IEEE_ENABLE \
24045                 UINT32_C(0x20000)
24046         /*
24047          * When set to 1, then the HWRM shall disable FEC RS(544,514)
24048          * on this port if supported, by not advertising FEC RS(544,514) if
24049          * FEC autonegotiation is enabled or force disabled otherwise.
24050          * When set to 0, then this flag shall be ignored.
24051          * If FEC RS(544,514) is not supported, then the HWRM shall ignore
24052          * this flag.
24053          */
24054         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_IEEE_DISABLE \
24055                 UINT32_C(0x40000)
24056         /*
24057          * When set to 1, then the HWRM shall enable FEC RS272_1XN
24058          * on this port if supported, by advertising FEC RS272_1XN if
24059          * FEC autonegotiation is enabled or force enabled otherwise.
24060          * In forced mode, this flag will only take effect if the speed is
24061          * PAM4.  If this flag and fec_rs272_ieee_enable are set, the
24062          * HWRM shall choose one of the RS272 modes.  Note that RS272
24063          * and RS544 modes cannot be set at the same time in forced FEC mode.
24064          * When set to 0, then this flag shall be ignored.
24065          * If FEC RS272_1XN is not supported, then the HWRM shall ignore this
24066          * flag.
24067          */
24068         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_1XN_ENABLE \
24069                 UINT32_C(0x80000)
24070         /*
24071          * When set to 1, then the HWRM shall disable FEC RS272_1XN
24072          * on this port if supported, by not advertising FEC RS272_1XN if
24073          * FEC autonegotiation is enabled or force disabled otherwise.
24074          * When set to 0, then this flag shall be ignored.
24075          * If FEC RS272_1XN is not supported, then the HWRM shall ignore
24076          * this flag.
24077          */
24078         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_1XN_DISABLE \
24079                 UINT32_C(0x100000)
24080         /*
24081          * When set to 1, then the HWRM shall enable FEC RS(272,257)
24082          * on this port if supported, by advertising FEC RS(272,257) if
24083          * FEC autonegotiation is enabled or force enabled otherwise.
24084          * In forced mode, this flag will only take effect if the speed is
24085          * PAM4.  If this flag and fec_rs272_1xn_enable are set, the
24086          * HWRM shall choose one of the RS272 modes.  Note that RS272
24087          * and RS544 modes cannot be set at the same time in forced FEC mode.
24088          * When set to 0, then this flag shall be ignored.
24089          * If FEC RS(272,257) is not supported, then the HWRM shall ignore
24090          * this flag.
24091          */
24092         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_IEEE_ENABLE \
24093                 UINT32_C(0x200000)
24094         /*
24095          * When set to 1, then the HWRM shall disable FEC RS(272,257)
24096          * on this port if supported, by not advertising FEC RS(272,257) if
24097          * FEC autonegotiation is enabled or force disabled otherwise.
24098          * When set to 0, then this flag shall be ignored.
24099          * If FEC RS(272,257) is not supported, then the HWRM shall ignore
24100          * this flag.
24101          */
24102         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_IEEE_DISABLE \
24103                 UINT32_C(0x400000)
24104         uint32_t        enables;
24105         /*
24106          * This bit must be '1' for the auto_mode field to be
24107          * configured.
24108          */
24109         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE \
24110                 UINT32_C(0x1)
24111         /*
24112          * This bit must be '1' for the auto_duplex field to be
24113          * configured.
24114          */
24115         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX \
24116                 UINT32_C(0x2)
24117         /*
24118          * This bit must be '1' for the auto_pause field to be
24119          * configured.
24120          */
24121         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE \
24122                 UINT32_C(0x4)
24123         /*
24124          * This bit must be '1' for the auto_link_speed field to be
24125          * configured.
24126          */
24127         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED \
24128                 UINT32_C(0x8)
24129         /*
24130          * This bit must be '1' for the auto_link_speed_mask field to be
24131          * configured.
24132          */
24133         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
24134                 UINT32_C(0x10)
24135         /*
24136          * This bit must be '1' for the wirespeed field to be
24137          * configured.
24138          */
24139         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED \
24140                 UINT32_C(0x20)
24141         /*
24142          * This bit must be '1' for the lpbk field to be
24143          * configured.
24144          */
24145         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK \
24146                 UINT32_C(0x40)
24147         /*
24148          * This bit must be '1' for the preemphasis field to be
24149          * configured.
24150          */
24151         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS \
24152                 UINT32_C(0x80)
24153         /*
24154          * This bit must be '1' for the force_pause field to be
24155          * configured.
24156          */
24157         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE \
24158                 UINT32_C(0x100)
24159         /*
24160          * This bit must be '1' for the eee_link_speed_mask field to be
24161          * configured.
24162          */
24163         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
24164                 UINT32_C(0x200)
24165         /*
24166          * This bit must be '1' for the tx_lpi_timer field to be
24167          * configured.
24168          */
24169         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER \
24170                 UINT32_C(0x400)
24171         /*
24172          * This bit must be '1' for the force_pam4_link_speed field to be
24173          * configured.
24174          */
24175         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAM4_LINK_SPEED \
24176                 UINT32_C(0x800)
24177         /*
24178          * This bit must be '1' for the auto_pam4_link_speed_mask field to
24179          * be configured.
24180          */
24181         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAM4_LINK_SPEED_MASK \
24182                 UINT32_C(0x1000)
24183         /* Port ID of port that is to be configured. */
24184         uint16_t        port_id;
24185         /*
24186          * This is the speed that will be used if the force
24187          * bit is '1'.  If unsupported speed is selected, an error
24188          * will be generated.
24189          */
24190         uint16_t        force_link_speed;
24191         /* 100Mb link speed */
24192         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
24193         /* 1Gb link speed */
24194         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
24195         /* 2Gb link speed */
24196         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
24197         /* 25Gb link speed */
24198         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
24199         /* 10Gb link speed */
24200         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
24201         /* 20Mb link speed */
24202         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
24203         /* 25Gb link speed */
24204         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
24205         /* 40Gb link speed */
24206         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
24207         /* 50Gb link speed */
24208         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
24209         /* 100Gb link speed */
24210         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
24211         /* 10Mb link speed */
24212         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
24213         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST \
24214                 HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
24215         /*
24216          * This value is used to identify what autoneg mode is
24217          * used when the link speed is not being forced.
24218          */
24219         uint8_t auto_mode;
24220         /* Disable autoneg or autoneg disabled. No speeds are selected. */
24221         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE         UINT32_C(0x0)
24222         /* Select all possible speeds for autoneg mode. */
24223         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
24224         /*
24225          * Select only the auto_link_speed speed for autoneg mode. This mode has
24226          * been DEPRECATED. An HWRM client should not use this mode.
24227          */
24228         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
24229         /*
24230          * Select the auto_link_speed or any speed below that speed for autoneg.
24231          * This mode has been DEPRECATED. An HWRM client should not use this mode.
24232          */
24233         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
24234         /*
24235          * Select the speeds based on the corresponding link speed mask values
24236          * that are provided. The included speeds are specified in the
24237          * auto_link_speed and auto_pam4_link_speed fields.
24238          */
24239         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
24240         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST \
24241                 HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
24242         /*
24243          * This is the duplex setting that will be used if the autoneg_mode
24244          * is "one_speed" or "one_or_below".
24245          */
24246         uint8_t auto_duplex;
24247         /* Half Duplex will be requested. */
24248         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
24249         /* Full duplex will be requested. */
24250         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
24251         /* Both Half and Full duplex will be requested. */
24252         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
24253         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST \
24254                 HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
24255         /*
24256          * This value is used to configure the pause that will be
24257          * used for autonegotiation.
24258          * Add text on the usage of auto_pause and force_pause.
24259          */
24260         uint8_t auto_pause;
24261         /*
24262          * When this bit is '1', Generation of tx pause messages
24263          * has been requested. Disabled otherwise.
24264          */
24265         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX \
24266                 UINT32_C(0x1)
24267         /*
24268          * When this bit is '1', Reception of rx pause messages
24269          * has been requested. Disabled otherwise.
24270          */
24271         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX \
24272                 UINT32_C(0x2)
24273         /*
24274          * When set to 1, the advertisement of pause is enabled.
24275          *
24276          * # When the auto_mode is not set to none and this flag is
24277          * set to 1, then the auto_pause bits on this port are being
24278          * advertised and autoneg pause results are being interpreted.
24279          * # When the auto_mode is not set to none and this
24280          * flag is set to 0, the pause is forced as indicated in
24281          * force_pause, and also advertised as auto_pause bits, but
24282          * the autoneg results are not interpreted since the pause
24283          * configuration is being forced.
24284          * # When the auto_mode is set to none and this flag is set to
24285          * 1, auto_pause bits should be ignored and should be set to 0.
24286          */
24287         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE \
24288                 UINT32_C(0x4)
24289         uint8_t unused_0;
24290         /*
24291          * This is the speed that will be used if the autoneg_mode
24292          * is "one_speed" or "one_or_below".  If an unsupported speed
24293          * is selected, an error will be generated.
24294          */
24295         uint16_t        auto_link_speed;
24296         /* 100Mb link speed */
24297         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
24298         /* 1Gb link speed */
24299         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
24300         /* 2Gb link speed */
24301         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
24302         /* 25Gb link speed */
24303         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
24304         /* 10Gb link speed */
24305         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
24306         /* 20Mb link speed */
24307         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
24308         /* 25Gb link speed */
24309         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
24310         /* 40Gb link speed */
24311         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
24312         /* 50Gb link speed */
24313         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
24314         /* 100Gb link speed */
24315         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
24316         /* 10Mb link speed */
24317         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
24318         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST \
24319                 HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
24320         /*
24321          * This is a mask of link speeds that will be used if
24322          * autoneg_mode is "mask".  If unsupported speed is enabled
24323          * an error will be generated.
24324          */
24325         uint16_t        auto_link_speed_mask;
24326         /* 100Mb link speed (Half-duplex) */
24327         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
24328                 UINT32_C(0x1)
24329         /* 100Mb link speed (Full-duplex) */
24330         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
24331                 UINT32_C(0x2)
24332         /* 1Gb link speed (Half-duplex) */
24333         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
24334                 UINT32_C(0x4)
24335         /* 1Gb link speed (Full-duplex) */
24336         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
24337                 UINT32_C(0x8)
24338         /* 2Gb link speed */
24339         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
24340                 UINT32_C(0x10)
24341         /* 25Gb link speed */
24342         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
24343                 UINT32_C(0x20)
24344         /* 10Gb link speed */
24345         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
24346                 UINT32_C(0x40)
24347         /* 20Gb link speed */
24348         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
24349                 UINT32_C(0x80)
24350         /* 25Gb link speed */
24351         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
24352                 UINT32_C(0x100)
24353         /* 40Gb link speed */
24354         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
24355                 UINT32_C(0x200)
24356         /* 50Gb link speed */
24357         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
24358                 UINT32_C(0x400)
24359         /* 100Gb link speed */
24360         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
24361                 UINT32_C(0x800)
24362         /* 10Mb link speed (Half-duplex) */
24363         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
24364                 UINT32_C(0x1000)
24365         /* 10Mb link speed (Full-duplex) */
24366         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
24367                 UINT32_C(0x2000)
24368         /* This value controls the wirespeed feature. */
24369         uint8_t wirespeed;
24370         /* Wirespeed feature is disabled. */
24371         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
24372         /* Wirespeed feature is enabled. */
24373         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON  UINT32_C(0x1)
24374         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST \
24375                 HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
24376         /* This value controls the loopback setting for the PHY. */
24377         uint8_t lpbk;
24378         /* No loopback is selected.  Normal operation. */
24379         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE     UINT32_C(0x0)
24380         /*
24381          * The HW will be configured with local loopback such that
24382          * host data is sent back to the host without modification.
24383          */
24384         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL    UINT32_C(0x1)
24385         /*
24386          * The HW will be configured with remote loopback such that
24387          * port logic will send packets back out the transmitter that
24388          * are received.
24389          */
24390         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE   UINT32_C(0x2)
24391         /*
24392          * The HW will be configured with external loopback such that
24393          * host data is sent on the transmitter and based on the external
24394          * loopback connection the data will be received without modification.
24395          */
24396         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
24397         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST \
24398                 HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
24399         /*
24400          * This value is used to configure the pause that will be
24401          * used for force mode.
24402          */
24403         uint8_t force_pause;
24404         /*
24405          * When this bit is '1', Generation of tx pause messages
24406          * is supported. Disabled otherwise.
24407          */
24408         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
24409         /*
24410          * When this bit is '1', Reception of rx pause messages
24411          * is supported. Disabled otherwise.
24412          */
24413         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
24414         uint8_t unused_1;
24415         /*
24416          * This value controls the pre-emphasis to be used for the
24417          * link.  Driver should not set this value (use
24418          * enable.preemphasis = 0) unless driver is sure of setting.
24419          * Normally HWRM FW will determine proper pre-emphasis.
24420          */
24421         uint32_t        preemphasis;
24422         /*
24423          * Setting for link speed mask that is used to
24424          * advertise speeds during autonegotiation when EEE is enabled.
24425          * This field is valid only when EEE is enabled.
24426          * The speeds specified in this field shall be a subset of
24427          * speeds specified in auto_link_speed_mask.
24428          * If EEE is enabled,then at least one speed shall be provided
24429          * in this mask.
24430          */
24431         uint16_t        eee_link_speed_mask;
24432         /* Reserved */
24433         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 \
24434                 UINT32_C(0x1)
24435         /* 100Mb link speed (Full-duplex) */
24436         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB \
24437                 UINT32_C(0x2)
24438         /* Reserved */
24439         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 \
24440                 UINT32_C(0x4)
24441         /* 1Gb link speed (Full-duplex) */
24442         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB \
24443                 UINT32_C(0x8)
24444         /* Reserved */
24445         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
24446                 UINT32_C(0x10)
24447         /* Reserved */
24448         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
24449                 UINT32_C(0x20)
24450         /* 10Gb link speed */
24451         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
24452                 UINT32_C(0x40)
24453         /*
24454          * This is the speed that will be used if the force and force_pam4
24455          * bits are '1'.  If unsupported speed is selected, an error
24456          * will be generated.
24457          */
24458         uint16_t        force_pam4_link_speed;
24459         /* 50Gb link speed */
24460         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB \
24461                 UINT32_C(0x1f4)
24462         /* 100Gb link speed */
24463         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB \
24464                 UINT32_C(0x3e8)
24465         /* 200Gb link speed */
24466         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB \
24467                 UINT32_C(0x7d0)
24468         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_LAST \
24469                 HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB
24470         /*
24471          * Requested setting of TX LPI timer in microseconds.
24472          * This field is valid only when EEE is enabled and TX LPI is
24473          * enabled.
24474          */
24475         uint32_t        tx_lpi_timer;
24476         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
24477         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
24478         /* This field specifies which PAM4 speeds are enabled for auto mode. */
24479         uint16_t        auto_link_pam4_speed_mask;
24480         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_50G \
24481                 UINT32_C(0x1)
24482         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_100G \
24483                 UINT32_C(0x2)
24484         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_200G \
24485                 UINT32_C(0x4)
24486         uint8_t unused_2[2];
24487 } __rte_packed;
24488
24489 /* hwrm_port_phy_cfg_output (size:128b/16B) */
24490 struct hwrm_port_phy_cfg_output {
24491         /* The specific error status for the command. */
24492         uint16_t        error_code;
24493         /* The HWRM command request type. */
24494         uint16_t        req_type;
24495         /* The sequence ID from the original command. */
24496         uint16_t        seq_id;
24497         /* The length of the response data in number of bytes. */
24498         uint16_t        resp_len;
24499         uint8_t unused_0[7];
24500         /*
24501          * This field is used in Output records to indicate that the output
24502          * is completely written to RAM.  This field should be read as '1'
24503          * to indicate that the output has been completely written.
24504          * When writing a command completion or response to an internal processor,
24505          * the order of writes has to be such that this field is written last.
24506          */
24507         uint8_t valid;
24508 } __rte_packed;
24509
24510 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
24511 struct hwrm_port_phy_cfg_cmd_err {
24512         /*
24513          * command specific error codes that goes to
24514          * the cmd_err field in Common HWRM Error Response.
24515          */
24516         uint8_t code;
24517         /* Unknown error */
24518         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
24519         /* Unable to complete operation due to invalid speed */
24520         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
24521         /*
24522          * retry the command since the phy is not ready.
24523          * retry count is returned in opaque_0.
24524          * This is only valid for the first command and
24525          * this value will not change for successive calls.
24526          * but if a 0 is returned at any time then this should
24527          * be treated as an un recoverable failure,
24528          *
24529          * retry interval in milli seconds is returned in opaque_1.
24530          * This specifies the time that user should wait before
24531          * issuing the next port_phy_cfg command.
24532          */
24533         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY         UINT32_C(0x2)
24534         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST \
24535                 HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
24536         uint8_t unused_0[7];
24537 } __rte_packed;
24538
24539 /**********************
24540  * hwrm_port_phy_qcfg *
24541  **********************/
24542
24543
24544 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
24545 struct hwrm_port_phy_qcfg_input {
24546         /* The HWRM command request type. */
24547         uint16_t        req_type;
24548         /*
24549          * The completion ring to send the completion event on. This should
24550          * be the NQ ID returned from the `nq_alloc` HWRM command.
24551          */
24552         uint16_t        cmpl_ring;
24553         /*
24554          * The sequence ID is used by the driver for tracking multiple
24555          * commands. This ID is treated as opaque data by the firmware and
24556          * the value is returned in the `hwrm_resp_hdr` upon completion.
24557          */
24558         uint16_t        seq_id;
24559         /*
24560          * The target ID of the command:
24561          * * 0x0-0xFFF8 - The function ID
24562          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24563          * * 0xFFFD - Reserved for user-space HWRM interface
24564          * * 0xFFFF - HWRM
24565          */
24566         uint16_t        target_id;
24567         /*
24568          * A physical address pointer pointing to a host buffer that the
24569          * command's response data will be written. This can be either a host
24570          * physical address (HPA) or a guest physical address (GPA) and must
24571          * point to a physically contiguous block of memory.
24572          */
24573         uint64_t        resp_addr;
24574         /* Port ID of port that is to be queried. */
24575         uint16_t        port_id;
24576         uint8_t unused_0[6];
24577 } __rte_packed;
24578
24579 /* hwrm_port_phy_qcfg_output (size:768b/96B) */
24580 struct hwrm_port_phy_qcfg_output {
24581         /* The specific error status for the command. */
24582         uint16_t        error_code;
24583         /* The HWRM command request type. */
24584         uint16_t        req_type;
24585         /* The sequence ID from the original command. */
24586         uint16_t        seq_id;
24587         /* The length of the response data in number of bytes. */
24588         uint16_t        resp_len;
24589         /* This value indicates the current link status. */
24590         uint8_t link;
24591         /* There is no link or cable detected. */
24592         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
24593         /* There is no link, but a cable has been detected. */
24594         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL  UINT32_C(0x1)
24595         /* There is a link. */
24596         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK    UINT32_C(0x2)
24597         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST \
24598                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
24599         uint8_t active_fec_signal_mode;
24600         /*
24601          * This value indicates the current link signaling mode of the
24602          * connection.
24603          */
24604         #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_MASK \
24605                 UINT32_C(0xf)
24606         #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_SFT                 0
24607         /* NRZ signaling */
24608         #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_NRZ \
24609                 UINT32_C(0x0)
24610         /* PAM4 signaling */
24611         #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4 \
24612                 UINT32_C(0x1)
24613         #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_LAST \
24614                 HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4
24615         /* This value indicates the current active FEC mode. */
24616         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_MASK \
24617                 UINT32_C(0xf0)
24618         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_SFT                  4
24619         /* No active FEC */
24620         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_NONE_ACTIVE \
24621                 (UINT32_C(0x0) << 4)
24622         /* FEC CLAUSE 74 (Fire Code) active, autonegotiated or forced. */
24623         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_CLAUSE74_ACTIVE \
24624                 (UINT32_C(0x1) << 4)
24625         /* FEC CLAUSE 91 RS(528,514) active, autonegoatiated or forced. */
24626         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_CLAUSE91_ACTIVE \
24627                 (UINT32_C(0x2) << 4)
24628         /* FEC RS544_1XN active, autonegoatiated or forced. */
24629         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS544_1XN_ACTIVE \
24630                 (UINT32_C(0x3) << 4)
24631         /* FEC RS(544,528) active, autonegoatiated or forced. */
24632         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS544_IEEE_ACTIVE \
24633                 (UINT32_C(0x4) << 4)
24634         /* FEC RS272_1XN active, autonegotiated or forced. */
24635         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_1XN_ACTIVE \
24636                 (UINT32_C(0x5) << 4)
24637         /* FEC RS(272,257) active, autonegoatiated or forced. */
24638         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE \
24639                 (UINT32_C(0x6) << 4)
24640         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_LAST \
24641                 HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE
24642         /*
24643          * This value indicates the current link speed of the connection.
24644          * The signal_mode field indicates if the link is using
24645          * NRZ or PAM4 signaling.
24646          */
24647         uint16_t        link_speed;
24648         /* 100Mb link speed */
24649         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
24650         /* 1Gb link speed */
24651         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB   UINT32_C(0xa)
24652         /* 2Gb link speed */
24653         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB   UINT32_C(0x14)
24654         /* 25Gb link speed */
24655         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
24656         /* 10Gb link speed */
24657         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB  UINT32_C(0x64)
24658         /* 20Mb link speed */
24659         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB  UINT32_C(0xc8)
24660         /* 25Gb link speed */
24661         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB  UINT32_C(0xfa)
24662         /* 40Gb link speed */
24663         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB  UINT32_C(0x190)
24664         /* 50Gb link speed */
24665         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB  UINT32_C(0x1f4)
24666         /* 100Gb link speed */
24667         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
24668         /* 200Gb link speed */
24669         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB UINT32_C(0x7d0)
24670         /* 10Mb link speed */
24671         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB  UINT32_C(0xffff)
24672         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST \
24673                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
24674         /*
24675          * This value is indicates the duplex of the current
24676          * configuration.
24677          */
24678         uint8_t duplex_cfg;
24679         /* Half Duplex connection. */
24680         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
24681         /* Full duplex connection. */
24682         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
24683         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST \
24684                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
24685         /*
24686          * This value is used to indicate the current
24687          * pause configuration. When autoneg is enabled, this value
24688          * represents the autoneg results of pause configuration.
24689          */
24690         uint8_t pause;
24691         /*
24692          * When this bit is '1', Generation of tx pause messages
24693          * is supported. Disabled otherwise.
24694          */
24695         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX     UINT32_C(0x1)
24696         /*
24697          * When this bit is '1', Reception of rx pause messages
24698          * is supported. Disabled otherwise.
24699          */
24700         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX     UINT32_C(0x2)
24701         /*
24702          * The supported speeds for the port. This is a bit mask.
24703          * For each speed that is supported, the corresponding
24704          * bit will be set to '1'.
24705          */
24706         uint16_t        support_speeds;
24707         /* 100Mb link speed (Half-duplex) */
24708         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD \
24709                 UINT32_C(0x1)
24710         /* 100Mb link speed (Full-duplex) */
24711         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB \
24712                 UINT32_C(0x2)
24713         /* 1Gb link speed (Half-duplex) */
24714         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD \
24715                 UINT32_C(0x4)
24716         /* 1Gb link speed (Full-duplex) */
24717         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB \
24718                 UINT32_C(0x8)
24719         /* 2Gb link speed */
24720         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB \
24721                 UINT32_C(0x10)
24722         /* 25Gb link speed */
24723         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB \
24724                 UINT32_C(0x20)
24725         /* 10Gb link speed */
24726         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB \
24727                 UINT32_C(0x40)
24728         /* 20Gb link speed */
24729         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB \
24730                 UINT32_C(0x80)
24731         /* 25Gb link speed */
24732         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB \
24733                 UINT32_C(0x100)
24734         /* 40Gb link speed */
24735         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB \
24736                 UINT32_C(0x200)
24737         /* 50Gb link speed */
24738         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB \
24739                 UINT32_C(0x400)
24740         /* 100Gb link speed */
24741         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB \
24742                 UINT32_C(0x800)
24743         /* 10Mb link speed (Half-duplex) */
24744         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD \
24745                 UINT32_C(0x1000)
24746         /* 10Mb link speed (Full-duplex) */
24747         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB \
24748                 UINT32_C(0x2000)
24749         /*
24750          * Current setting of forced link speed.
24751          * When the link speed is not being forced, this
24752          * value shall be set to 0.
24753          */
24754         uint16_t        force_link_speed;
24755         /* 100Mb link speed */
24756         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
24757         /* 1Gb link speed */
24758         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
24759         /* 2Gb link speed */
24760         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
24761         /* 25Gb link speed */
24762         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
24763         /* 10Gb link speed */
24764         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
24765         /* 20Mb link speed */
24766         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
24767         /* 25Gb link speed */
24768         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
24769         /* 40Gb link speed */
24770         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB \
24771                 UINT32_C(0x190)
24772         /* 50Gb link speed */
24773         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB \
24774                 UINT32_C(0x1f4)
24775         /* 100Gb link speed */
24776         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB \
24777                 UINT32_C(0x3e8)
24778         /* 10Mb link speed */
24779         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB \
24780                 UINT32_C(0xffff)
24781         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST \
24782                 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
24783         /* Current setting of auto negotiation mode. */
24784         uint8_t auto_mode;
24785         /* Disable autoneg or autoneg disabled. No speeds are selected. */
24786         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE         UINT32_C(0x0)
24787         /* Select all possible speeds for autoneg mode. */
24788         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
24789         /*
24790          * Select only the auto_link_speed speed for autoneg mode. This mode has
24791          * been DEPRECATED. An HWRM client should not use this mode.
24792          */
24793         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
24794         /*
24795          * Select the auto_link_speed or any speed below that speed for autoneg.
24796          * This mode has been DEPRECATED. An HWRM client should not use this mode.
24797          */
24798         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
24799         /*
24800          * Select the speeds based on the corresponding link speed mask value
24801          * that is provided.
24802          */
24803         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
24804         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST \
24805                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
24806         /*
24807          * Current setting of pause autonegotiation.
24808          * Move autoneg_pause flag here.
24809          */
24810         uint8_t auto_pause;
24811         /*
24812          * When this bit is '1', Generation of tx pause messages
24813          * has been requested. Disabled otherwise.
24814          */
24815         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX \
24816                 UINT32_C(0x1)
24817         /*
24818          * When this bit is '1', Reception of rx pause messages
24819          * has been requested. Disabled otherwise.
24820          */
24821         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX \
24822                 UINT32_C(0x2)
24823         /*
24824          * When set to 1, the advertisement of pause is enabled.
24825          *
24826          * # When the auto_mode is not set to none and this flag is
24827          * set to 1, then the auto_pause bits on this port are being
24828          * advertised and autoneg pause results are being interpreted.
24829          * # When the auto_mode is not set to none and this
24830          * flag is set to 0, the pause is forced as indicated in
24831          * force_pause, and also advertised as auto_pause bits, but
24832          * the autoneg results are not interpreted since the pause
24833          * configuration is being forced.
24834          * # When the auto_mode is set to none and this flag is set to
24835          * 1, auto_pause bits should be ignored and should be set to 0.
24836          */
24837         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE \
24838                 UINT32_C(0x4)
24839         /*
24840          * Current setting for auto_link_speed. This field is only
24841          * valid when auto_mode is set to "one_speed" or "one_or_below".
24842          */
24843         uint16_t        auto_link_speed;
24844         /* 100Mb link speed */
24845         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
24846         /* 1Gb link speed */
24847         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
24848         /* 2Gb link speed */
24849         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
24850         /* 25Gb link speed */
24851         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
24852         /* 10Gb link speed */
24853         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
24854         /* 20Mb link speed */
24855         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
24856         /* 25Gb link speed */
24857         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
24858         /* 40Gb link speed */
24859         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
24860         /* 50Gb link speed */
24861         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
24862         /* 100Gb link speed */
24863         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
24864         /* 10Mb link speed */
24865         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB \
24866                 UINT32_C(0xffff)
24867         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST \
24868                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
24869         /*
24870          * Current setting for auto_link_speed_mask that is used to
24871          * advertise speeds during autonegotiation.
24872          * This field is only valid when auto_mode is set to "mask".
24873          * The speeds specified in this field shall be a subset of
24874          * supported speeds on this port.
24875          */
24876         uint16_t        auto_link_speed_mask;
24877         /* 100Mb link speed (Half-duplex) */
24878         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
24879                 UINT32_C(0x1)
24880         /* 100Mb link speed (Full-duplex) */
24881         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
24882                 UINT32_C(0x2)
24883         /* 1Gb link speed (Half-duplex) */
24884         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
24885                 UINT32_C(0x4)
24886         /* 1Gb link speed (Full-duplex) */
24887         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB \
24888                 UINT32_C(0x8)
24889         /* 2Gb link speed */
24890         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
24891                 UINT32_C(0x10)
24892         /* 25Gb link speed */
24893         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
24894                 UINT32_C(0x20)
24895         /* 10Gb link speed */
24896         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
24897                 UINT32_C(0x40)
24898         /* 20Gb link speed */
24899         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
24900                 UINT32_C(0x80)
24901         /* 25Gb link speed */
24902         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
24903                 UINT32_C(0x100)
24904         /* 40Gb link speed */
24905         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
24906                 UINT32_C(0x200)
24907         /* 50Gb link speed */
24908         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
24909                 UINT32_C(0x400)
24910         /* 100Gb link speed */
24911         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
24912                 UINT32_C(0x800)
24913         /* 10Mb link speed (Half-duplex) */
24914         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
24915                 UINT32_C(0x1000)
24916         /* 10Mb link speed (Full-duplex) */
24917         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
24918                 UINT32_C(0x2000)
24919         /* Current setting for wirespeed. */
24920         uint8_t wirespeed;
24921         /* Wirespeed feature is disabled. */
24922         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
24923         /* Wirespeed feature is enabled. */
24924         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON  UINT32_C(0x1)
24925         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST \
24926                 HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
24927         /* Current setting for loopback. */
24928         uint8_t lpbk;
24929         /* No loopback is selected.  Normal operation. */
24930         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE     UINT32_C(0x0)
24931         /*
24932          * The HW will be configured with local loopback such that
24933          * host data is sent back to the host without modification.
24934          */
24935         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL    UINT32_C(0x1)
24936         /*
24937          * The HW will be configured with remote loopback such that
24938          * port logic will send packets back out the transmitter that
24939          * are received.
24940          */
24941         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE   UINT32_C(0x2)
24942         /*
24943          * The HW will be configured with external loopback such that
24944          * host data is sent on the transmitter and based on the external
24945          * loopback connection the data will be received without modification.
24946          */
24947         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
24948         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST \
24949                 HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
24950         /*
24951          * Current setting of forced pause.
24952          * When the pause configuration is not being forced, then
24953          * this value shall be set to 0.
24954          */
24955         uint8_t force_pause;
24956         /*
24957          * When this bit is '1', Generation of tx pause messages
24958          * is supported. Disabled otherwise.
24959          */
24960         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
24961         /*
24962          * When this bit is '1', Reception of rx pause messages
24963          * is supported. Disabled otherwise.
24964          */
24965         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
24966         /*
24967          * This value indicates the current status of the optics module on
24968          * this port.
24969          */
24970         uint8_t module_status;
24971         /* Module is inserted and accepted */
24972         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE \
24973                 UINT32_C(0x0)
24974         /* Module is rejected and transmit side Laser is disabled. */
24975         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX \
24976                 UINT32_C(0x1)
24977         /* Module mismatch warning. */
24978         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG \
24979                 UINT32_C(0x2)
24980         /* Module is rejected and powered down. */
24981         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN \
24982                 UINT32_C(0x3)
24983         /* Module is not inserted. */
24984         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
24985                 UINT32_C(0x4)
24986         /* Module is powered down because of over current fault. */
24987         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_CURRENTFAULT \
24988                 UINT32_C(0x5)
24989         /* Module status is not applicable. */
24990         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
24991                 UINT32_C(0xff)
24992         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST \
24993                 HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
24994         /* Current setting for preemphasis. */
24995         uint32_t        preemphasis;
24996         /* This field represents the major version of the PHY. */
24997         uint8_t phy_maj;
24998         /* This field represents the minor version of the PHY. */
24999         uint8_t phy_min;
25000         /* This field represents the build version of the PHY. */
25001         uint8_t phy_bld;
25002         /* This value represents a PHY type. */
25003         uint8_t phy_type;
25004         /* Unknown */
25005         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN \
25006                 UINT32_C(0x0)
25007         /* BASE-CR */
25008         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR \
25009                 UINT32_C(0x1)
25010         /* BASE-KR4 (Deprecated) */
25011         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 \
25012                 UINT32_C(0x2)
25013         /* BASE-LR */
25014         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR \
25015                 UINT32_C(0x3)
25016         /* BASE-SR */
25017         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR \
25018                 UINT32_C(0x4)
25019         /* BASE-KR2 (Deprecated) */
25020         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 \
25021                 UINT32_C(0x5)
25022         /* BASE-KX */
25023         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX \
25024                 UINT32_C(0x6)
25025         /* BASE-KR */
25026         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR \
25027                 UINT32_C(0x7)
25028         /* BASE-T */
25029         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET \
25030                 UINT32_C(0x8)
25031         /* EEE capable BASE-T */
25032         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE \
25033                 UINT32_C(0x9)
25034         /* SGMII connected external PHY */
25035         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY \
25036                 UINT32_C(0xa)
25037         /* 25G_BASECR_CA_L */
25038         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L \
25039                 UINT32_C(0xb)
25040         /* 25G_BASECR_CA_S */
25041         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S \
25042                 UINT32_C(0xc)
25043         /* 25G_BASECR_CA_N */
25044         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N \
25045                 UINT32_C(0xd)
25046         /* 25G_BASESR */
25047         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR \
25048                 UINT32_C(0xe)
25049         /* 100G_BASECR4 */
25050         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 \
25051                 UINT32_C(0xf)
25052         /* 100G_BASESR4 */
25053         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 \
25054                 UINT32_C(0x10)
25055         /* 100G_BASELR4 */
25056         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 \
25057                 UINT32_C(0x11)
25058         /* 100G_BASEER4 */
25059         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 \
25060                 UINT32_C(0x12)
25061         /* 100G_BASESR10 */
25062         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 \
25063                 UINT32_C(0x13)
25064         /* 40G_BASECR4 */
25065         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 \
25066                 UINT32_C(0x14)
25067         /* 40G_BASESR4 */
25068         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 \
25069                 UINT32_C(0x15)
25070         /* 40G_BASELR4 */
25071         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 \
25072                 UINT32_C(0x16)
25073         /* 40G_BASEER4 */
25074         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 \
25075                 UINT32_C(0x17)
25076         /* 40G_ACTIVE_CABLE */
25077         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
25078                 UINT32_C(0x18)
25079         /* 1G_baseT */
25080         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET \
25081                 UINT32_C(0x19)
25082         /* 1G_baseSX */
25083         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX \
25084                 UINT32_C(0x1a)
25085         /* 1G_baseCX */
25086         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX \
25087                 UINT32_C(0x1b)
25088         /* 200G_BASECR4 */
25089         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4 \
25090                 UINT32_C(0x1c)
25091         /* 200G_BASESR4 */
25092         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4 \
25093                 UINT32_C(0x1d)
25094         /* 200G_BASELR4 */
25095         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4 \
25096                 UINT32_C(0x1e)
25097         /* 200G_BASEER4 */
25098         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4 \
25099                 UINT32_C(0x1f)
25100         /* 50G_BASECR */
25101         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASECR \
25102                 UINT32_C(0x20)
25103         /* 50G_BASESR */
25104         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASESR \
25105                 UINT32_C(0x21)
25106         /* 50G_BASELR */
25107         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASELR \
25108                 UINT32_C(0x22)
25109         /* 50G_BASEER */
25110         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_50G_BASEER \
25111                 UINT32_C(0x23)
25112         /* 100G_BASECR2 */
25113         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR2 \
25114                 UINT32_C(0x24)
25115         /* 100G_BASESR2 */
25116         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR2 \
25117                 UINT32_C(0x25)
25118         /* 100G_BASELR2 */
25119         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR2 \
25120                 UINT32_C(0x26)
25121         /* 100G_BASEER2 */
25122         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER2 \
25123                 UINT32_C(0x27)
25124         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST \
25125                 HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER2
25126         /* This value represents a media type. */
25127         uint8_t media_type;
25128         /* Unknown */
25129         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
25130         /* Twisted Pair */
25131         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP      UINT32_C(0x1)
25132         /* Direct Attached Copper */
25133         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC     UINT32_C(0x2)
25134         /* Fiber */
25135         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE   UINT32_C(0x3)
25136         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST \
25137                 HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
25138         /* This value represents a transceiver type. */
25139         uint8_t xcvr_pkg_type;
25140         /* PHY and MAC are in the same package */
25141         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
25142                 UINT32_C(0x1)
25143         /* PHY and MAC are in different packages */
25144         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
25145                 UINT32_C(0x2)
25146         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST \
25147                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
25148         uint8_t eee_config_phy_addr;
25149         /* This field represents PHY address. */
25150         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK \
25151                 UINT32_C(0x1f)
25152         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT               0
25153         /*
25154          * This field represents flags related to EEE configuration.
25155          * These EEE configuration flags are valid only when the
25156          * auto_mode is not set to none (in other words autonegotiation
25157          * is enabled).
25158          */
25159         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK \
25160                 UINT32_C(0xe0)
25161         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT             5
25162         /*
25163          * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
25164          * Speeds for autoneg with EEE mode enabled
25165          * are based on eee_link_speed_mask.
25166          */
25167         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED \
25168                 UINT32_C(0x20)
25169         /*
25170          * This flag is valid only when eee_enabled is set to 1.
25171          *
25172          * # If eee_enabled is set to 0, then EEE mode is disabled
25173          * and this flag shall be ignored.
25174          * # If eee_enabled is set to 1 and this flag is set to 1,
25175          * then Energy Efficient Ethernet (EEE) mode is enabled
25176          * and in use.
25177          * # If eee_enabled is set to 1 and this flag is set to 0,
25178          * then Energy Efficient Ethernet (EEE) mode is enabled
25179          * but is currently not in use.
25180          */
25181         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE \
25182                 UINT32_C(0x40)
25183         /*
25184          * This flag is valid only when eee_enabled is set to 1.
25185          *
25186          * # If eee_enabled is set to 0, then EEE mode is disabled
25187          * and this flag shall be ignored.
25188          * # If eee_enabled is set to 1 and this flag is set to 1,
25189          * then Energy Efficient Ethernet (EEE) mode is enabled
25190          * and TX LPI is enabled.
25191          * # If eee_enabled is set to 1 and this flag is set to 0,
25192          * then Energy Efficient Ethernet (EEE) mode is enabled
25193          * but TX LPI is disabled.
25194          */
25195         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI \
25196                 UINT32_C(0x80)
25197         /*
25198          * When set to 1, the parallel detection is used to determine
25199          * the speed of the link partner.
25200          *
25201          * Parallel detection is used when a autonegotiation capable
25202          * device is connected to a link partner that is not capable
25203          * of autonegotiation.
25204          */
25205         uint8_t parallel_detect;
25206         /*
25207          * When set to 1, the parallel detection is used to determine
25208          * the speed of the link partner.
25209          *
25210          * Parallel detection is used when a autonegotiation capable
25211          * device is connected to a link partner that is not capable
25212          * of autonegotiation.
25213          */
25214         #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT     UINT32_C(0x1)
25215         /*
25216          * The advertised speeds for the port by the link partner.
25217          * Each advertised speed will be set to '1'.
25218          */
25219         uint16_t        link_partner_adv_speeds;
25220         /* 100Mb link speed (Half-duplex) */
25221         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
25222                 UINT32_C(0x1)
25223         /* 100Mb link speed (Full-duplex) */
25224         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
25225                 UINT32_C(0x2)
25226         /* 1Gb link speed (Half-duplex) */
25227         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
25228                 UINT32_C(0x4)
25229         /* 1Gb link speed (Full-duplex) */
25230         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
25231                 UINT32_C(0x8)
25232         /* 2Gb link speed */
25233         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
25234                 UINT32_C(0x10)
25235         /* 25Gb link speed */
25236         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
25237                 UINT32_C(0x20)
25238         /* 10Gb link speed */
25239         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
25240                 UINT32_C(0x40)
25241         /* 20Gb link speed */
25242         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
25243                 UINT32_C(0x80)
25244         /* 25Gb link speed */
25245         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
25246                 UINT32_C(0x100)
25247         /* 40Gb link speed */
25248         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
25249                 UINT32_C(0x200)
25250         /* 50Gb link speed */
25251         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
25252                 UINT32_C(0x400)
25253         /* 100Gb link speed */
25254         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
25255                 UINT32_C(0x800)
25256         /* 10Mb link speed (Half-duplex) */
25257         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
25258                 UINT32_C(0x1000)
25259         /* 10Mb link speed (Full-duplex) */
25260         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
25261                 UINT32_C(0x2000)
25262         /*
25263          * The advertised autoneg for the port by the link partner.
25264          * This field is deprecated and should be set to 0.
25265          */
25266         uint8_t link_partner_adv_auto_mode;
25267         /* Disable autoneg or autoneg disabled. No speeds are selected. */
25268         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
25269                 UINT32_C(0x0)
25270         /* Select all possible speeds for autoneg mode. */
25271         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
25272                 UINT32_C(0x1)
25273         /*
25274          * Select only the auto_link_speed speed for autoneg mode. This mode has
25275          * been DEPRECATED. An HWRM client should not use this mode.
25276          */
25277         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
25278                 UINT32_C(0x2)
25279         /*
25280          * Select the auto_link_speed or any speed below that speed for autoneg.
25281          * This mode has been DEPRECATED. An HWRM client should not use this mode.
25282          */
25283         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
25284                 UINT32_C(0x3)
25285         /*
25286          * Select the speeds based on the corresponding link speed mask value
25287          * that is provided.
25288          */
25289         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
25290                 UINT32_C(0x4)
25291         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST \
25292                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
25293         /* The advertised pause settings on the port by the link partner. */
25294         uint8_t link_partner_adv_pause;
25295         /*
25296          * When this bit is '1', Generation of tx pause messages
25297          * is supported. Disabled otherwise.
25298          */
25299         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
25300                 UINT32_C(0x1)
25301         /*
25302          * When this bit is '1', Reception of rx pause messages
25303          * is supported. Disabled otherwise.
25304          */
25305         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
25306                 UINT32_C(0x2)
25307         /*
25308          * Current setting for link speed mask that is used to
25309          * advertise speeds during autonegotiation when EEE is enabled.
25310          * This field is valid only when eee_enabled flags is set to 1.
25311          * The speeds specified in this field shall be a subset of
25312          * speeds specified in auto_link_speed_mask.
25313          */
25314         uint16_t        adv_eee_link_speed_mask;
25315         /* Reserved */
25316         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
25317                 UINT32_C(0x1)
25318         /* 100Mb link speed (Full-duplex) */
25319         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
25320                 UINT32_C(0x2)
25321         /* Reserved */
25322         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
25323                 UINT32_C(0x4)
25324         /* 1Gb link speed (Full-duplex) */
25325         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
25326                 UINT32_C(0x8)
25327         /* Reserved */
25328         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
25329                 UINT32_C(0x10)
25330         /* Reserved */
25331         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
25332                 UINT32_C(0x20)
25333         /* 10Gb link speed */
25334         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
25335                 UINT32_C(0x40)
25336         /*
25337          * Current setting for link speed mask that is advertised by
25338          * the link partner when EEE is enabled.
25339          * This field is valid only when eee_enabled flags is set to 1.
25340          */
25341         uint16_t        link_partner_adv_eee_link_speed_mask;
25342         /* Reserved */
25343         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
25344                 UINT32_C(0x1)
25345         /* 100Mb link speed (Full-duplex) */
25346         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
25347                 UINT32_C(0x2)
25348         /* Reserved */
25349         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
25350                 UINT32_C(0x4)
25351         /* 1Gb link speed (Full-duplex) */
25352         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
25353                 UINT32_C(0x8)
25354         /* Reserved */
25355         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
25356                 UINT32_C(0x10)
25357         /* Reserved */
25358         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
25359                 UINT32_C(0x20)
25360         /* 10Gb link speed */
25361         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
25362                 UINT32_C(0x40)
25363         uint32_t        xcvr_identifier_type_tx_lpi_timer;
25364         /*
25365          * Current setting of TX LPI timer in microseconds.
25366          * This field is valid only when_eee_enabled flag is set to 1
25367          * and tx_lpi_enabled is set to 1.
25368          */
25369         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK \
25370                 UINT32_C(0xffffff)
25371         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT             0
25372         /* This value represents transceiver identifier type. */
25373         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
25374                 UINT32_C(0xff000000)
25375         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT     24
25376         /* Unknown */
25377         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
25378                 (UINT32_C(0x0) << 24)
25379         /* SFP/SFP+/SFP28 */
25380         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
25381                 (UINT32_C(0x3) << 24)
25382         /* QSFP+ */
25383         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
25384                 (UINT32_C(0xc) << 24)
25385         /* QSFP+ */
25386         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
25387                 (UINT32_C(0xd) << 24)
25388         /* QSFP28 */
25389         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
25390                 (UINT32_C(0x11) << 24)
25391         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST \
25392                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28
25393         /*
25394          * This value represents the current configuration of
25395          * Forward Error Correction (FEC) on the port.
25396          */
25397         uint16_t        fec_cfg;
25398         /*
25399          * When set to 1, then FEC is not supported on this port. If this flag
25400          * is set to 1, then all other FEC configuration flags shall be ignored.
25401          * When set to 0, then FEC is supported as indicated by other
25402          * configuration flags.
25403          */
25404         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
25405                 UINT32_C(0x1)
25406         /*
25407          * When set to 1, then FEC autonegotiation is supported on this port.
25408          * When set to 0, then FEC autonegotiation is not supported on this port.
25409          */
25410         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
25411                 UINT32_C(0x2)
25412         /*
25413          * When set to 1, then FEC autonegotiation is enabled on this port.
25414          * When set to 0, then FEC autonegotiation is disabled if supported.
25415          * This flag should be ignored if FEC autonegotiation is not supported on this port.
25416          */
25417         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
25418                 UINT32_C(0x4)
25419         /*
25420          * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port.
25421          * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port.
25422          */
25423         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
25424                 UINT32_C(0x8)
25425         /*
25426          * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this
25427          * port. This means that FEC CLAUSE 74 is either advertised if
25428          * FEC autonegotiation is enabled or FEC CLAUSE 74 is force enabled.
25429          * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported.
25430          * This flag should be ignored if FEC CLAUSE 74 is not supported on this port.
25431          */
25432         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
25433                 UINT32_C(0x10)
25434         /*
25435          * When set to 1, then FEC CLAUSE 91 (Reed Solomon RS(528,514) for
25436          * NRZ) is supported on this port.
25437          * When set to 0, then FEC RS(528,418) is not supported on this port.
25438          */
25439         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
25440                 UINT32_C(0x20)
25441         /*
25442          * When set to 1, then FEC CLAUSE 91 (Reed Solomon RS(528,514) for
25443          * NRZ) is enabled on this port. This means that FEC RS(528,514) is
25444          * either advertised if FEC autonegotiation is enabled or FEC
25445          * RS(528,514) is force enabled.  When set to 0, then FEC RS(528,514)
25446          * is disabled if supported.
25447          * This flag should be ignored if FEC CLAUSE 91 is not supported on this port.
25448          */
25449         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
25450                 UINT32_C(0x40)
25451         /*
25452          * When set to 1, then FEC RS544_1XN is supported on this port.
25453          * When set to 0, then FEC RS544_1XN is not supported on this port.
25454          */
25455         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_SUPPORTED \
25456                 UINT32_C(0x80)
25457         /*
25458          * When set to 1, then RS544_1XN is enabled on this
25459          * port. This means that FEC RS544_1XN is either advertised if
25460          * FEC autonegotiation is enabled or FEC RS544_1XN is force enabled.
25461          * When set to 0, then FEC RS544_1XN is disabled if supported.
25462          * This flag should be ignored if FEC RS544_1XN is not supported on this port.
25463          */
25464         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_ENABLED \
25465                 UINT32_C(0x100)
25466         /*
25467          * When set to 1, then FEC RS(544,514) is supported on this port.
25468          * When set to 0, then FEC RS(544,514) is not supported on this port.
25469          */
25470         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_IEEE_SUPPORTED \
25471                 UINT32_C(0x200)
25472         /*
25473          * When set to 1, then RS(544,514) is enabled on this
25474          * port. This means that FEC RS(544,514) is either advertised if
25475          * FEC autonegotiation is enabled or FEC RS(544,514) is force
25476          * enabled.  When set to 0, then FEC RS(544,514) is disabled if supported.
25477          * This flag should be ignored if FEC RS(544,514) is not supported on this port.
25478          */
25479         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_IEEE_ENABLED \
25480                 UINT32_C(0x400)
25481         /*
25482          * When set to 1, then FEC RS272_1XN is supported on this port.
25483          * When set to 0, then FEC RS272_1XN is not supported on this port.
25484          */
25485         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_1XN_SUPPORTED \
25486                 UINT32_C(0x800)
25487         /*
25488          * When set to 1, then RS272_1XN is enabled on this
25489          * port. This means that FEC RS272_1XN is either advertised if
25490          * FEC autonegotiation is enabled or FEC RS272_1XN is force
25491          * enabled.  When set to 0, then FEC RS272_1XN is disabled if supported.
25492          * This flag should be ignored if FEC RS272_1XN is not supported on this port.
25493          */
25494         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_1XN_ENABLED \
25495                 UINT32_C(0x1000)
25496         /*
25497          * When set to 1, then FEC RS(272,514) is supported on this port.
25498          * When set to 0, then FEC RS(272,514) is not supported on this port.
25499          */
25500         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_IEEE_SUPPORTED \
25501                 UINT32_C(0x2000)
25502         /*
25503          * When set to 1, then RS(272,257) is enabled on this
25504          * port. This means that FEC RS(272,257) is either advertised if
25505          * FEC autonegotiation is enabled or FEC RS(272,257) is force
25506          * enabled.  When set to 0, then FEC RS(272,257) is disabled if supported.
25507          * This flag should be ignored if FEC RS(272,257) is not supported on this port.
25508          */
25509         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_IEEE_ENABLED \
25510                 UINT32_C(0x4000)
25511         /*
25512          * This value is indicates the duplex of the current
25513          * connection state.
25514          */
25515         uint8_t duplex_state;
25516         /* Half Duplex connection. */
25517         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
25518         /* Full duplex connection. */
25519         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
25520         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST \
25521                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
25522         /* Option flags fields. */
25523         uint8_t option_flags;
25524         /* When this bit is '1', Media auto detect is enabled. */
25525         #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT \
25526                 UINT32_C(0x1)
25527         /*
25528          * When this bit is '1', active_fec_signal_mode can be
25529          * trusted.
25530          */
25531         #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_SIGNAL_MODE_KNOWN \
25532                 UINT32_C(0x2)
25533         /*
25534          * Up to 16 bytes of null padded ASCII string representing
25535          * PHY vendor.
25536          * If the string is set to null, then the vendor name is not
25537          * available.
25538          */
25539         char    phy_vendor_name[16];
25540         /*
25541          * Up to 16 bytes of null padded ASCII string that
25542          * identifies vendor specific part number of the PHY.
25543          * If the string is set to null, then the vendor specific
25544          * part number is not available.
25545          */
25546         char    phy_vendor_partnumber[16];
25547         /*
25548          * The supported PAM4 speeds for the port. This is a bit mask.
25549          * For each speed that is supported, the corresponding
25550          * bit will be set to '1'.
25551          */
25552         uint16_t        support_pam4_speeds;
25553         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_50G \
25554                 UINT32_C(0x1)
25555         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_100G \
25556                 UINT32_C(0x2)
25557         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_200G \
25558                 UINT32_C(0x4)
25559         /*
25560          * Current setting of forced PAM4 link speed.
25561          * When the link speed is not being forced, this
25562          * value shall be set to 0.
25563          */
25564         uint16_t        force_pam4_link_speed;
25565         /* 50Gb link speed */
25566         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_50GB \
25567                 UINT32_C(0x1f4)
25568         /* 100Gb link speed */
25569         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_100GB \
25570                 UINT32_C(0x3e8)
25571         /* 200Gb link speed */
25572         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_200GB \
25573                 UINT32_C(0x7d0)
25574         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_LAST \
25575                 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_200GB
25576         /*
25577          * Current setting for auto_pam4_link_speed_mask that is used to
25578          * advertise speeds during autonegotiation.
25579          * This field is only valid when auto_mode is set to "mask".
25580          * The speeds specified in this field shall be a subset of
25581          * supported speeds on this port.
25582          */
25583         uint16_t        auto_pam4_link_speed_mask;
25584         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_50G \
25585                 UINT32_C(0x1)
25586         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_100G \
25587                 UINT32_C(0x2)
25588         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_200G \
25589                 UINT32_C(0x4)
25590         /*
25591          * The advertised PAM4 speeds for the port by the link partner.
25592          * Each advertised speed will be set to '1'.
25593          */
25594         uint8_t link_partner_pam4_adv_speeds;
25595         /* 50Gb link speed */
25596         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_50GB \
25597                 UINT32_C(0x1)
25598         /* 100Gb link speed */
25599         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_100GB \
25600                 UINT32_C(0x2)
25601         /* 200Gb link speed */
25602         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_200GB \
25603                 UINT32_C(0x4)
25604         /*
25605          * This field is used in Output records to indicate that the output
25606          * is completely written to RAM.  This field should be read as '1'
25607          * to indicate that the output has been completely written.
25608          * When writing a command completion or response to an internal processor,
25609          * the order of writes has to be such that this field is written last.
25610          */
25611         uint8_t valid;
25612 } __rte_packed;
25613
25614 /*********************
25615  * hwrm_port_mac_cfg *
25616  *********************/
25617
25618
25619 /* hwrm_port_mac_cfg_input (size:448b/56B) */
25620 struct hwrm_port_mac_cfg_input {
25621         /* The HWRM command request type. */
25622         uint16_t        req_type;
25623         /*
25624          * The completion ring to send the completion event on. This should
25625          * be the NQ ID returned from the `nq_alloc` HWRM command.
25626          */
25627         uint16_t        cmpl_ring;
25628         /*
25629          * The sequence ID is used by the driver for tracking multiple
25630          * commands. This ID is treated as opaque data by the firmware and
25631          * the value is returned in the `hwrm_resp_hdr` upon completion.
25632          */
25633         uint16_t        seq_id;
25634         /*
25635          * The target ID of the command:
25636          * * 0x0-0xFFF8 - The function ID
25637          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25638          * * 0xFFFD - Reserved for user-space HWRM interface
25639          * * 0xFFFF - HWRM
25640          */
25641         uint16_t        target_id;
25642         /*
25643          * A physical address pointer pointing to a host buffer that the
25644          * command's response data will be written. This can be either a host
25645          * physical address (HPA) or a guest physical address (GPA) and must
25646          * point to a physically contiguous block of memory.
25647          */
25648         uint64_t        resp_addr;
25649         /*
25650          * In this field, there are a number of CoS mappings related flags
25651          * that are used to configure CoS mappings and their corresponding
25652          * priorities in the hardware.
25653          * For the priorities of CoS mappings, the HWRM uses the following
25654          * priority order (high to low) by default:
25655          * # vlan pri
25656          * # ip_dscp
25657          * # tunnel_vlan_pri
25658          * # default cos
25659          *
25660          * A subset of CoS mappings can be enabled.
25661          * If a priority is not specified for an enabled CoS mapping, the
25662          * priority will be assigned in the above order for the enabled CoS
25663          * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
25664          * enabled and their priorities are not specified, the following
25665          * priority order (high to low) will be used by the HWRM:
25666          * # vlan_pri
25667          * # ip_dscp
25668          * # default cos
25669          *
25670          * vlan_pri CoS mapping together with default CoS with lower priority
25671          * are enabled by default by the HWRM.
25672          */
25673         uint32_t        flags;
25674         /*
25675          * When this bit is '1', this command will configure
25676          * the MAC to match the current link state of the PHY.
25677          * If the link is not established on the PHY, then this
25678          * bit has no effect.
25679          */
25680         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK \
25681                 UINT32_C(0x1)
25682         /*
25683          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
25684          * is requested to be enabled.
25685          */
25686         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE \
25687                 UINT32_C(0x2)
25688         /*
25689          * When this bit is set to '1', tunnel VLAN PRI field to
25690          * CoS mapping is requested to be enabled.
25691          */
25692         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
25693                 UINT32_C(0x4)
25694         /*
25695          * When this bit is set to '1', the IP DSCP to CoS mapping is
25696          * requested to be enabled.
25697          */
25698         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE \
25699                 UINT32_C(0x8)
25700         /*
25701          * When this bit is '1', the HWRM is requested to
25702          * enable timestamp capture capability on the receive side
25703          * of this port.
25704          */
25705         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
25706                 UINT32_C(0x10)
25707         /*
25708          * When this bit is '1', the HWRM is requested to
25709          * disable timestamp capture capability on the receive side
25710          * of this port.
25711          */
25712         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE \
25713                 UINT32_C(0x20)
25714         /*
25715          * When this bit is '1', the HWRM is requested to
25716          * enable timestamp capture capability on the transmit side
25717          * of this port.
25718          */
25719         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
25720                 UINT32_C(0x40)
25721         /*
25722          * When this bit is '1', the HWRM is requested to
25723          * disable timestamp capture capability on the transmit side
25724          * of this port.
25725          */
25726         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE \
25727                 UINT32_C(0x80)
25728         /*
25729          * When this bit is '1', the Out-Of-Box WoL is requested to
25730          * be enabled on this port.
25731          */
25732         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE \
25733                 UINT32_C(0x100)
25734         /*
25735          * When this bit is '1', the Out-Of-Box WoL is requested to
25736          * be disabled on this port.
25737          */
25738         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE \
25739                 UINT32_C(0x200)
25740         /*
25741          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
25742          * is requested to be disabled.
25743          */
25744         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE \
25745                 UINT32_C(0x400)
25746         /*
25747          * When this bit is set to '1', tunnel VLAN PRI field to
25748          * CoS mapping is requested to be disabled.
25749          */
25750         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE \
25751                 UINT32_C(0x800)
25752         /*
25753          * When this bit is set to '1', the IP DSCP to CoS mapping is
25754          * requested to be disabled.
25755          */
25756         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE \
25757                 UINT32_C(0x1000)
25758         /*
25759          * When this bit is set to '1', and the ptp_tx_ts_capture_enable
25760          * bit is set, then the device uses one step Tx timestamping.
25761          * This bit is temporary and used for experimental purposes.
25762          */
25763         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_ONE_STEP_TX_TS \
25764                 UINT32_C(0x2000)
25765         /*
25766          * When this bit is '1', the controller is requested to enable
25767          * timestamp capture capability on all packets (not just PTP)
25768          * of the receive side of this port.
25769          */
25770         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_ALL_RX_TS_CAPTURE_ENABLE \
25771                 UINT32_C(0x4000)
25772         /*
25773          * When this bit is '1', the controller is requested to disable
25774          * timestamp capture capability on all packets (not just PTP)
25775          * of the receive side of this port.
25776          */
25777         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_ALL_RX_TS_CAPTURE_DISABLE \
25778                 UINT32_C(0x8000)
25779         uint32_t        enables;
25780         /*
25781          * This bit must be '1' for the ipg field to be
25782          * configured.
25783          */
25784         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG \
25785                 UINT32_C(0x1)
25786         /*
25787          * This bit must be '1' for the lpbk field to be
25788          * configured.
25789          */
25790         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK \
25791                 UINT32_C(0x2)
25792         /*
25793          * This bit must be '1' for the vlan_pri2cos_map_pri field to be
25794          * configured.
25795          */
25796         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI \
25797                 UINT32_C(0x4)
25798         /*
25799          * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
25800          * configured.
25801          */
25802         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI \
25803                 UINT32_C(0x10)
25804         /*
25805          * This bit must be '1' for the dscp2cos_map_pri field to be
25806          * configured.
25807          */
25808         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI \
25809                 UINT32_C(0x20)
25810         /*
25811          * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
25812          * configured.
25813          */
25814         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE \
25815                 UINT32_C(0x40)
25816         /*
25817          * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
25818          * configured.
25819          */
25820         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE \
25821                 UINT32_C(0x80)
25822         /*
25823          * This bit must be '1' for the cos_field_cfg field to be
25824          * configured.
25825          */
25826         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG \
25827                 UINT32_C(0x100)
25828         /*
25829          * This bit must be '1' for the ptp_freq_adj_ppb field to be
25830          * configured.
25831          */
25832         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_PPB \
25833                 UINT32_C(0x200)
25834         /*
25835          * This bit must be '1' for the ptp_adj_phase field to be
25836          * configured.
25837          */
25838         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_ADJ_PHASE \
25839                 UINT32_C(0x400)
25840         /* Port ID of port that is to be configured. */
25841         uint16_t        port_id;
25842         /*
25843          * This value is used to configure the minimum IPG that will
25844          * be sent between packets by this port.
25845          */
25846         uint8_t ipg;
25847         /* This value controls the loopback setting for the MAC. */
25848         uint8_t lpbk;
25849         /* No loopback is selected.  Normal operation. */
25850         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE   UINT32_C(0x0)
25851         /*
25852          * The HW will be configured with local loopback such that
25853          * host data is sent back to the host without modification.
25854          */
25855         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL  UINT32_C(0x1)
25856         /*
25857          * The HW will be configured with remote loopback such that
25858          * port logic will send packets back out the transmitter that
25859          * are received.
25860          */
25861         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
25862         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST \
25863                 HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
25864         /*
25865          * This value controls the priority setting of VLAN PRI to CoS
25866          * mapping based on VLAN Tags of inner packet headers of
25867          * tunneled packets or packet headers of non-tunneled packets.
25868          *
25869          * # Each XXX_pri variable shall have a unique priority value
25870          * when it is being specified.
25871          * # When comparing priorities of mappings, higher value
25872          * indicates higher priority.
25873          * For example, a value of 0-3 is returned where 0 is being
25874          * the lowest priority and 3 is being the highest priority.
25875          */
25876         uint8_t vlan_pri2cos_map_pri;
25877         /* Reserved field. */
25878         uint8_t reserved1;
25879         /*
25880          * This value controls the priority setting of VLAN PRI to CoS
25881          * mapping based on VLAN Tags of tunneled header.
25882          * This mapping only applies when tunneled headers
25883          * are present.
25884          *
25885          * # Each XXX_pri variable shall have a unique priority value
25886          * when it is being specified.
25887          * # When comparing priorities of mappings, higher value
25888          * indicates higher priority.
25889          * For example, a value of 0-3 is returned where 0 is being
25890          * the lowest priority and 3 is being the highest priority.
25891          */
25892         uint8_t tunnel_pri2cos_map_pri;
25893         /*
25894          * This value controls the priority setting of IP DSCP to CoS
25895          * mapping based on inner IP header of tunneled packets or
25896          * IP header of non-tunneled packets.
25897          *
25898          * # Each XXX_pri variable shall have a unique priority value
25899          * when it is being specified.
25900          * # When comparing priorities of mappings, higher value
25901          * indicates higher priority.
25902          * For example, a value of 0-3 is returned where 0 is being
25903          * the lowest priority and 3 is being the highest priority.
25904          */
25905         uint8_t dscp2pri_map_pri;
25906         /*
25907          * This is a 16-bit bit mask that is used to request a
25908          * specific configuration of time stamp capture of PTP messages
25909          * on the receive side of this port.
25910          * This field shall be ignored if the ptp_rx_ts_capture_enable
25911          * flag is not set in this command.
25912          * Otherwise, if bit 'i' is set, then the HWRM is being
25913          * requested to configure the receive side of the port to
25914          * capture the time stamp of every received PTP message
25915          * with messageType field value set to i.
25916          */
25917         uint16_t        rx_ts_capture_ptp_msg_type;
25918         /*
25919          * This is a 16-bit bit mask that is used to request a
25920          * specific configuration of time stamp capture of PTP messages
25921          * on the transmit side of this port.
25922          * This field shall be ignored if the ptp_tx_ts_capture_enable
25923          * flag is not set in this command.
25924          * Otherwise, if bit 'i' is set, then the HWRM is being
25925          * requested to configure the transmit side of the port to
25926          * capture the time stamp of every transmitted PTP message
25927          * with messageType field value set to i.
25928          */
25929         uint16_t        tx_ts_capture_ptp_msg_type;
25930         /* Configuration of CoS fields. */
25931         uint8_t cos_field_cfg;
25932         /* Reserved */
25933         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1 \
25934                 UINT32_C(0x1)
25935         /*
25936          * This field is used to specify selection of VLAN PRI value
25937          * based on whether one or two VLAN Tags are present in
25938          * the inner packet headers of tunneled packets or
25939          * non-tunneled packets.
25940          * This field is valid only if inner VLAN PRI to CoS mapping
25941          * is enabled.
25942          * If VLAN PRI to CoS mapping is not enabled, then this
25943          * field shall be ignored.
25944          */
25945         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
25946                 UINT32_C(0x6)
25947         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
25948                 1
25949         /*
25950          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
25951          * present in the inner packet headers
25952          */
25953         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
25954                 (UINT32_C(0x0) << 1)
25955         /*
25956          * Select outer VLAN Tag PRI when 2 VLAN Tags are
25957          * present in the inner packet headers.
25958          * No VLAN PRI shall be selected for this configuration
25959          * if only one VLAN Tag is present in the inner
25960          * packet headers.
25961          */
25962         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
25963                 (UINT32_C(0x1) << 1)
25964         /*
25965          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
25966          * are present in the inner packet headers
25967          */
25968         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
25969                 (UINT32_C(0x2) << 1)
25970         /* Unspecified */
25971         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
25972                 (UINT32_C(0x3) << 1)
25973         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
25974                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
25975         /*
25976          * This field is used to specify selection of tunnel VLAN
25977          * PRI value based on whether one or two VLAN Tags are
25978          * present in tunnel headers.
25979          * This field is valid only if tunnel VLAN PRI to CoS mapping
25980          * is enabled.
25981          * If tunnel VLAN PRI to CoS mapping is not enabled, then this
25982          * field shall be ignored.
25983          */
25984         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
25985                 UINT32_C(0x18)
25986         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
25987                 3
25988         /*
25989          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
25990          * present in the tunnel packet headers
25991          */
25992         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
25993                 (UINT32_C(0x0) << 3)
25994         /*
25995          * Select outer VLAN Tag PRI when 2 VLAN Tags are
25996          * present in the tunnel packet headers.
25997          * No tunnel VLAN PRI shall be selected for this
25998          * configuration if only one VLAN Tag is present in
25999          * the tunnel packet headers.
26000          */
26001         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
26002                 (UINT32_C(0x1) << 3)
26003         /*
26004          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
26005          * are present in the tunnel packet headers
26006          */
26007         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
26008                 (UINT32_C(0x2) << 3)
26009         /* Unspecified */
26010         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
26011                 (UINT32_C(0x3) << 3)
26012         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
26013                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
26014         /*
26015          * This field shall be used to provide default CoS value
26016          * that has been configured on this port.
26017          * This field is valid only if default CoS mapping
26018          * is enabled.
26019          * If default CoS mapping is not enabled, then this
26020          * field shall be ignored.
26021          */
26022         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
26023                 UINT32_C(0xe0)
26024         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
26025                 5
26026         uint8_t unused_0[3];
26027         /*
26028          * This signed field specifies by how much to adjust the frequency
26029          * of sync timer updates (measured in parts per billion).
26030          */
26031         int32_t ptp_freq_adj_ppb;
26032         uint8_t unused_1[4];
26033         /*
26034          * This unsigned field specifies the phase offset to be applied
26035          * to the PHC (PTP Hardware Clock). This field is specified in
26036          * nanoseconds.
26037          */
26038         int64_t ptp_adj_phase;
26039 } __rte_packed;
26040
26041 /* hwrm_port_mac_cfg_output (size:128b/16B) */
26042 struct hwrm_port_mac_cfg_output {
26043         /* The specific error status for the command. */
26044         uint16_t        error_code;
26045         /* The HWRM command request type. */
26046         uint16_t        req_type;
26047         /* The sequence ID from the original command. */
26048         uint16_t        seq_id;
26049         /* The length of the response data in number of bytes. */
26050         uint16_t        resp_len;
26051         /*
26052          * This is the configured maximum length of Ethernet packet
26053          * payload that is allowed to be received on the port.
26054          * This value does not include the number of bytes used by
26055          * Ethernet header and trailer (CRC).
26056          */
26057         uint16_t        mru;
26058         /*
26059          * This is the configured maximum length of Ethernet packet
26060          * payload that is allowed to be transmitted on the port.
26061          * This value does not include the number of bytes used by
26062          * Ethernet header and trailer (CRC).
26063          */
26064         uint16_t        mtu;
26065         /* Current configuration of the IPG value. */
26066         uint8_t ipg;
26067         /* Current value of the loopback value. */
26068         uint8_t lpbk;
26069         /* No loopback is selected.  Normal operation. */
26070         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
26071         /*
26072          * The HW will be configured with local loopback such that
26073          * host data is sent back to the host without modification.
26074          */
26075         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
26076         /*
26077          * The HW will be configured with remote loopback such that
26078          * port logic will send packets back out the transmitter that
26079          * are received.
26080          */
26081         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
26082         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST \
26083                 HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
26084         uint8_t unused_0;
26085         /*
26086          * This field is used in Output records to indicate that the output
26087          * is completely written to RAM.  This field should be read as '1'
26088          * to indicate that the output has been completely written.
26089          * When writing a command completion or response to an internal processor,
26090          * the order of writes has to be such that this field is written last.
26091          */
26092         uint8_t valid;
26093 } __rte_packed;
26094
26095 /**********************
26096  * hwrm_port_mac_qcfg *
26097  **********************/
26098
26099
26100 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
26101 struct hwrm_port_mac_qcfg_input {
26102         /* The HWRM command request type. */
26103         uint16_t        req_type;
26104         /*
26105          * The completion ring to send the completion event on. This should
26106          * be the NQ ID returned from the `nq_alloc` HWRM command.
26107          */
26108         uint16_t        cmpl_ring;
26109         /*
26110          * The sequence ID is used by the driver for tracking multiple
26111          * commands. This ID is treated as opaque data by the firmware and
26112          * the value is returned in the `hwrm_resp_hdr` upon completion.
26113          */
26114         uint16_t        seq_id;
26115         /*
26116          * The target ID of the command:
26117          * * 0x0-0xFFF8 - The function ID
26118          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26119          * * 0xFFFD - Reserved for user-space HWRM interface
26120          * * 0xFFFF - HWRM
26121          */
26122         uint16_t        target_id;
26123         /*
26124          * A physical address pointer pointing to a host buffer that the
26125          * command's response data will be written. This can be either a host
26126          * physical address (HPA) or a guest physical address (GPA) and must
26127          * point to a physically contiguous block of memory.
26128          */
26129         uint64_t        resp_addr;
26130         /* Port ID of port that is to be configured. */
26131         uint16_t        port_id;
26132         uint8_t unused_0[6];
26133 } __rte_packed;
26134
26135 /* hwrm_port_mac_qcfg_output (size:256b/32B) */
26136 struct hwrm_port_mac_qcfg_output {
26137         /* The specific error status for the command. */
26138         uint16_t        error_code;
26139         /* The HWRM command request type. */
26140         uint16_t        req_type;
26141         /* The sequence ID from the original command. */
26142         uint16_t        seq_id;
26143         /* The length of the response data in number of bytes. */
26144         uint16_t        resp_len;
26145         /*
26146          * This is the configured maximum length of Ethernet packet
26147          * payload that is allowed to be received on the port.
26148          * This value does not include the number of bytes used by the
26149          * Ethernet header and trailer (CRC).
26150          */
26151         uint16_t        mru;
26152         /*
26153          * This is the configured maximum length of Ethernet packet
26154          * payload that is allowed to be transmitted on the port.
26155          * This value does not include the number of bytes used by the
26156          * Ethernet header and trailer (CRC).
26157          */
26158         uint16_t        mtu;
26159         /*
26160          * The minimum IPG that will
26161          * be sent between packets by this port.
26162          */
26163         uint8_t ipg;
26164         /* The loopback setting for the MAC. */
26165         uint8_t lpbk;
26166         /* No loopback is selected.  Normal operation. */
26167         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
26168         /*
26169          * The HW will be configured with local loopback such that
26170          * host data is sent back to the host without modification.
26171          */
26172         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
26173         /*
26174          * The HW will be configured with remote loopback such that
26175          * port logic will send packets back out the transmitter that
26176          * are received.
26177          */
26178         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
26179         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST \
26180                 HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
26181         /*
26182          * Priority setting for VLAN PRI to CoS mapping.
26183          * # Each XXX_pri variable shall have a unique priority value
26184          * when it is being used.
26185          * # When comparing priorities of mappings, higher value
26186          * indicates higher priority.
26187          * For example, a value of 0-3 is returned where 0 is being
26188          * the lowest priority and 3 is being the highest priority.
26189          * # If the corresponding CoS mapping is not enabled, then this
26190          * field should be ignored.
26191          * # This value indicates the normalized priority value retained
26192          * in the HWRM.
26193          */
26194         uint8_t vlan_pri2cos_map_pri;
26195         /*
26196          * In this field, a number of CoS mappings related flags
26197          * are used to indicate configured CoS mappings.
26198          */
26199         uint8_t flags;
26200         /*
26201          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
26202          * is enabled.
26203          */
26204         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE \
26205                 UINT32_C(0x1)
26206         /*
26207          * When this bit is set to '1', tunnel VLAN PRI field to
26208          * CoS mapping is enabled.
26209          */
26210         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
26211                 UINT32_C(0x2)
26212         /*
26213          * When this bit is set to '1', the IP DSCP to CoS mapping is
26214          * enabled.
26215          */
26216         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE \
26217                 UINT32_C(0x4)
26218         /*
26219          * When this bit is '1', the Out-Of-Box WoL is enabled on this
26220          * port.
26221          */
26222         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE \
26223                 UINT32_C(0x8)
26224         /* When this bit is '1', PTP is enabled for RX on this port. */
26225         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
26226                 UINT32_C(0x10)
26227         /* When this bit is '1', PTP is enabled for TX on this port. */
26228         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
26229                 UINT32_C(0x20)
26230         /*
26231          * Priority setting for tunnel VLAN PRI to CoS mapping.
26232          * # Each XXX_pri variable shall have a unique priority value
26233          * when it is being used.
26234          * # When comparing priorities of mappings, higher value
26235          * indicates higher priority.
26236          * For example, a value of 0-3 is returned where 0 is being
26237          * the lowest priority and 3 is being the highest priority.
26238          * # If the corresponding CoS mapping is not enabled, then this
26239          * field should be ignored.
26240          * # This value indicates the normalized priority value retained
26241          * in the HWRM.
26242          */
26243         uint8_t tunnel_pri2cos_map_pri;
26244         /*
26245          * Priority setting for DSCP to PRI mapping.
26246          * # Each XXX_pri variable shall have a unique priority value
26247          * when it is being used.
26248          * # When comparing priorities of mappings, higher value
26249          * indicates higher priority.
26250          * For example, a value of 0-3 is returned where 0 is being
26251          * the lowest priority and 3 is being the highest priority.
26252          * # If the corresponding CoS mapping is not enabled, then this
26253          * field should be ignored.
26254          * # This value indicates the normalized priority value retained
26255          * in the HWRM.
26256          */
26257         uint8_t dscp2pri_map_pri;
26258         /*
26259          * This is a 16-bit bit mask that represents the
26260          * current configuration of time stamp capture of PTP messages
26261          * on the receive side of this port.
26262          * If bit 'i' is set, then the receive side of the port
26263          * is configured to capture the time stamp of every
26264          * received PTP message with messageType field value set
26265          * to i.
26266          * If all bits are set to 0 (i.e. field value set 0),
26267          * then the receive side of the port is not configured
26268          * to capture timestamp for PTP messages.
26269          * If all bits are set to 1, then the receive side of the
26270          * port is configured to capture timestamp for all PTP
26271          * messages.
26272          */
26273         uint16_t        rx_ts_capture_ptp_msg_type;
26274         /*
26275          * This is a 16-bit bit mask that represents the
26276          * current configuration of time stamp capture of PTP messages
26277          * on the transmit side of this port.
26278          * If bit 'i' is set, then the transmit side of the port
26279          * is configured to capture the time stamp of every
26280          * received PTP message with messageType field value set
26281          * to i.
26282          * If all bits are set to 0 (i.e. field value set 0),
26283          * then the transmit side of the port is not configured
26284          * to capture timestamp for PTP messages.
26285          * If all bits are set to 1, then the transmit side of the
26286          * port is configured to capture timestamp for all PTP
26287          * messages.
26288          */
26289         uint16_t        tx_ts_capture_ptp_msg_type;
26290         /* Configuration of CoS fields. */
26291         uint8_t cos_field_cfg;
26292         /* Reserved */
26293         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD \
26294                 UINT32_C(0x1)
26295         /*
26296          * This field is used for selecting VLAN PRI value
26297          * based on whether one or two VLAN Tags are present in
26298          * the inner packet headers of tunneled packets or
26299          * non-tunneled packets.
26300          */
26301         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
26302                 UINT32_C(0x6)
26303         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
26304                 1
26305         /*
26306          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
26307          * present in the inner packet headers
26308          */
26309         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
26310                 (UINT32_C(0x0) << 1)
26311         /*
26312          * Select outer VLAN Tag PRI when 2 VLAN Tags are
26313          * present in the inner packet headers.
26314          * No VLAN PRI is selected for this configuration
26315          * if only one VLAN Tag is present in the inner
26316          * packet headers.
26317          */
26318         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
26319                 (UINT32_C(0x1) << 1)
26320         /*
26321          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
26322          * are present in the inner packet headers
26323          */
26324         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
26325                 (UINT32_C(0x2) << 1)
26326         /* Unspecified */
26327         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
26328                 (UINT32_C(0x3) << 1)
26329         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
26330                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
26331         /*
26332          * This field is used for selecting tunnel VLAN PRI value
26333          * based on whether one or two VLAN Tags are present in
26334          * the tunnel headers of tunneled packets. This selection
26335          * does not apply to non-tunneled packets.
26336          */
26337         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
26338                 UINT32_C(0x18)
26339         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
26340                 3
26341         /*
26342          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
26343          * present in the tunnel packet headers
26344          */
26345         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
26346                 (UINT32_C(0x0) << 3)
26347         /*
26348          * Select outer VLAN Tag PRI when 2 VLAN Tags are
26349          * present in the tunnel packet headers.
26350          * No VLAN PRI is selected for this configuration
26351          * if only one VLAN Tag is present in the tunnel
26352          * packet headers.
26353          */
26354         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
26355                 (UINT32_C(0x1) << 3)
26356         /*
26357          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
26358          * are present in the tunnel packet headers
26359          */
26360         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
26361                 (UINT32_C(0x2) << 3)
26362         /* Unspecified */
26363         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
26364                 (UINT32_C(0x3) << 3)
26365         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
26366                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
26367         /*
26368          * This field is used to provide default CoS value that
26369          * has been configured on this port.
26370          */
26371         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
26372                 UINT32_C(0xe0)
26373         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
26374                 5
26375         uint8_t unused_1;
26376         uint16_t        port_svif_info;
26377         /*
26378          * This field specifies the source virtual interface of the port being
26379          * queried. Drivers can use this to program port svif field in the
26380          * L2 context table
26381          */
26382         #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_MASK \
26383                 UINT32_C(0x7fff)
26384         #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_SFT       0
26385         /* This field specifies whether port_svif is valid or not */
26386         #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_VALID \
26387                 UINT32_C(0x8000)
26388         uint8_t unused_2[5];
26389         /*
26390          * This field is used in Output records to indicate that the output
26391          * is completely written to RAM.  This field should be read as '1'
26392          * to indicate that the output has been completely written.
26393          * When writing a command completion or response to an internal processor,
26394          * the order of writes has to be such that this field is written last.
26395          */
26396         uint8_t valid;
26397 } __rte_packed;
26398
26399 /**************************
26400  * hwrm_port_mac_ptp_qcfg *
26401  **************************/
26402
26403
26404 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
26405 struct hwrm_port_mac_ptp_qcfg_input {
26406         /* The HWRM command request type. */
26407         uint16_t        req_type;
26408         /*
26409          * The completion ring to send the completion event on. This should
26410          * be the NQ ID returned from the `nq_alloc` HWRM command.
26411          */
26412         uint16_t        cmpl_ring;
26413         /*
26414          * The sequence ID is used by the driver for tracking multiple
26415          * commands. This ID is treated as opaque data by the firmware and
26416          * the value is returned in the `hwrm_resp_hdr` upon completion.
26417          */
26418         uint16_t        seq_id;
26419         /*
26420          * The target ID of the command:
26421          * * 0x0-0xFFF8 - The function ID
26422          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26423          * * 0xFFFD - Reserved for user-space HWRM interface
26424          * * 0xFFFF - HWRM
26425          */
26426         uint16_t        target_id;
26427         /*
26428          * A physical address pointer pointing to a host buffer that the
26429          * command's response data will be written. This can be either a host
26430          * physical address (HPA) or a guest physical address (GPA) and must
26431          * point to a physically contiguous block of memory.
26432          */
26433         uint64_t        resp_addr;
26434         /* Port ID of port that is being queried. */
26435         uint16_t        port_id;
26436         uint8_t unused_0[6];
26437 } __rte_packed;
26438
26439 /* hwrm_port_mac_ptp_qcfg_output (size:704b/88B) */
26440 struct hwrm_port_mac_ptp_qcfg_output {
26441         /* The specific error status for the command. */
26442         uint16_t        error_code;
26443         /* The HWRM command request type. */
26444         uint16_t        req_type;
26445         /* The sequence ID from the original command. */
26446         uint16_t        seq_id;
26447         /* The length of the response data in number of bytes. */
26448         uint16_t        resp_len;
26449         /*
26450          * In this field, a number of PTP related flags
26451          * are used to indicate configured PTP capabilities.
26452          */
26453         uint8_t flags;
26454         /*
26455          * When this bit is set to '1', the PTP related registers are
26456          * directly accessible by the host.
26457          */
26458         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS \
26459                 UINT32_C(0x1)
26460         /*
26461          * When this bit is set to '1', the device supports one-step
26462          * Tx timestamping.
26463          */
26464         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS \
26465                 UINT32_C(0x4)
26466         /*
26467          * When this bit is set to '1', the PTP information is accessible
26468          * via HWRM commands.
26469          */
26470         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS \
26471                 UINT32_C(0x8)
26472         /*
26473          * When this bit is set to '1', two specific registers for current
26474          * time (ts_ref_clock_reg_lower and ts_ref_clock_reg_upper) are
26475          * directly accessible by the host.
26476          */
26477         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_PARTIAL_DIRECT_ACCESS_REF_CLOCK \
26478                 UINT32_C(0x10)
26479         /*
26480          * When this bit is set to '1', it indicates that driver has
26481          * configured 64bit RTC.
26482          */
26483         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_RTC_CONFIGURED \
26484                 UINT32_C(0x20)
26485         uint8_t unused_0[3];
26486         /*
26487          * Offset of the PTP register for the lower 32 bits of timestamp
26488          * for RX.
26489          */
26490         uint32_t        rx_ts_reg_off_lower;
26491         /*
26492          * Offset of the PTP register for the upper 32 bits of timestamp
26493          * for RX.
26494          */
26495         uint32_t        rx_ts_reg_off_upper;
26496         /* Offset of the PTP register for the sequence ID for RX. */
26497         uint32_t        rx_ts_reg_off_seq_id;
26498         /* Offset of the first PTP source ID for RX. */
26499         uint32_t        rx_ts_reg_off_src_id_0;
26500         /* Offset of the second PTP source ID for RX. */
26501         uint32_t        rx_ts_reg_off_src_id_1;
26502         /* Offset of the third PTP source ID for RX. */
26503         uint32_t        rx_ts_reg_off_src_id_2;
26504         /* Offset of the domain ID for RX. */
26505         uint32_t        rx_ts_reg_off_domain_id;
26506         /* Offset of the PTP FIFO register for RX. */
26507         uint32_t        rx_ts_reg_off_fifo;
26508         /* Offset of the PTP advance FIFO register for RX. */
26509         uint32_t        rx_ts_reg_off_fifo_adv;
26510         /* PTP timestamp granularity for RX. */
26511         uint32_t        rx_ts_reg_off_granularity;
26512         /*
26513          * Offset of the PTP register for the lower 32 bits of timestamp
26514          * for TX.
26515          */
26516         uint32_t        tx_ts_reg_off_lower;
26517         /*
26518          * Offset of the PTP register for the upper 32 bits of timestamp
26519          * for TX.
26520          */
26521         uint32_t        tx_ts_reg_off_upper;
26522         /* Offset of the PTP register for the sequence ID for TX. */
26523         uint32_t        tx_ts_reg_off_seq_id;
26524         /* Offset of the PTP FIFO register for TX. */
26525         uint32_t        tx_ts_reg_off_fifo;
26526         /* PTP timestamp granularity for TX. */
26527         uint32_t        tx_ts_reg_off_granularity;
26528         /* Offset of register to get lower 32 bits of current time. */
26529         uint32_t        ts_ref_clock_reg_lower;
26530         /* Offset of register to get upper 32 bits of current time. */
26531         uint32_t        ts_ref_clock_reg_upper;
26532         uint8_t unused_1[7];
26533         /*
26534          * This field is used in Output records to indicate that the output
26535          * is completely written to RAM.  This field should be read as '1'
26536          * to indicate that the output has been completely written.
26537          * When writing a command completion or response to an internal processor,
26538          * the order of writes has to be such that this field is written last.
26539          */
26540         uint8_t valid;
26541 } __rte_packed;
26542
26543 /* Port Tx Statistics Format */
26544 /* tx_port_stats (size:3264b/408B) */
26545 struct tx_port_stats {
26546         /* Total Number of 64 Bytes frames transmitted */
26547         uint64_t        tx_64b_frames;
26548         /* Total Number of 65-127 Bytes frames transmitted */
26549         uint64_t        tx_65b_127b_frames;
26550         /* Total Number of 128-255 Bytes frames transmitted */
26551         uint64_t        tx_128b_255b_frames;
26552         /* Total Number of 256-511 Bytes frames transmitted */
26553         uint64_t        tx_256b_511b_frames;
26554         /* Total Number of 512-1023 Bytes frames transmitted */
26555         uint64_t        tx_512b_1023b_frames;
26556         /* Total Number of 1024-1518 Bytes frames transmitted */
26557         uint64_t        tx_1024b_1518b_frames;
26558         /*
26559          * Total Number of each good VLAN (excludes FCS errors)
26560          * frame transmitted which is 1519 to 1522 bytes in length
26561          * inclusive (excluding framing bits but including FCS bytes).
26562          */
26563         uint64_t        tx_good_vlan_frames;
26564         /* Total Number of 1519-2047 Bytes frames transmitted */
26565         uint64_t        tx_1519b_2047b_frames;
26566         /* Total Number of 2048-4095 Bytes frames transmitted */
26567         uint64_t        tx_2048b_4095b_frames;
26568         /* Total Number of 4096-9216 Bytes frames transmitted */
26569         uint64_t        tx_4096b_9216b_frames;
26570         /* Total Number of 9217-16383 Bytes frames transmitted */
26571         uint64_t        tx_9217b_16383b_frames;
26572         /* Total Number of good frames transmitted */
26573         uint64_t        tx_good_frames;
26574         /* Total Number of frames transmitted */
26575         uint64_t        tx_total_frames;
26576         /* Total number of unicast frames transmitted */
26577         uint64_t        tx_ucast_frames;
26578         /* Total number of multicast frames transmitted */
26579         uint64_t        tx_mcast_frames;
26580         /* Total number of broadcast frames transmitted */
26581         uint64_t        tx_bcast_frames;
26582         /* Total number of PAUSE control frames transmitted */
26583         uint64_t        tx_pause_frames;
26584         /*
26585          * Total number of PFC/per-priority PAUSE
26586          * control frames transmitted
26587          */
26588         uint64_t        tx_pfc_frames;
26589         /* Total number of jabber frames transmitted */
26590         uint64_t        tx_jabber_frames;
26591         /* Total number of frames transmitted with FCS error */
26592         uint64_t        tx_fcs_err_frames;
26593         /* Total number of control frames transmitted */
26594         uint64_t        tx_control_frames;
26595         /* Total number of over-sized frames transmitted */
26596         uint64_t        tx_oversz_frames;
26597         /* Total number of frames with single deferral */
26598         uint64_t        tx_single_dfrl_frames;
26599         /* Total number of frames with multiple deferrals */
26600         uint64_t        tx_multi_dfrl_frames;
26601         /* Total number of frames with single collision */
26602         uint64_t        tx_single_coll_frames;
26603         /* Total number of frames with multiple collisions */
26604         uint64_t        tx_multi_coll_frames;
26605         /* Total number of frames with late collisions */
26606         uint64_t        tx_late_coll_frames;
26607         /* Total number of frames with excessive collisions */
26608         uint64_t        tx_excessive_coll_frames;
26609         /* Total number of fragmented frames transmitted */
26610         uint64_t        tx_frag_frames;
26611         /* Total number of transmit errors */
26612         uint64_t        tx_err;
26613         /* Total number of single VLAN tagged frames transmitted */
26614         uint64_t        tx_tagged_frames;
26615         /* Total number of double VLAN tagged frames transmitted */
26616         uint64_t        tx_dbl_tagged_frames;
26617         /* Total number of runt frames transmitted */
26618         uint64_t        tx_runt_frames;
26619         /* Total number of TX FIFO under runs */
26620         uint64_t        tx_fifo_underruns;
26621         /*
26622          * Total number of PFC frames with PFC enabled bit for
26623          * Pri 0 transmitted
26624          */
26625         uint64_t        tx_pfc_ena_frames_pri0;
26626         /*
26627          * Total number of PFC frames with PFC enabled bit for
26628          * Pri 1 transmitted
26629          */
26630         uint64_t        tx_pfc_ena_frames_pri1;
26631         /*
26632          * Total number of PFC frames with PFC enabled bit for
26633          * Pri 2 transmitted
26634          */
26635         uint64_t        tx_pfc_ena_frames_pri2;
26636         /*
26637          * Total number of PFC frames with PFC enabled bit for
26638          * Pri 3 transmitted
26639          */
26640         uint64_t        tx_pfc_ena_frames_pri3;
26641         /*
26642          * Total number of PFC frames with PFC enabled bit for
26643          * Pri 4 transmitted
26644          */
26645         uint64_t        tx_pfc_ena_frames_pri4;
26646         /*
26647          * Total number of PFC frames with PFC enabled bit for
26648          * Pri 5 transmitted
26649          */
26650         uint64_t        tx_pfc_ena_frames_pri5;
26651         /*
26652          * Total number of PFC frames with PFC enabled bit for
26653          * Pri 6 transmitted
26654          */
26655         uint64_t        tx_pfc_ena_frames_pri6;
26656         /*
26657          * Total number of PFC frames with PFC enabled bit for
26658          * Pri 7 transmitted
26659          */
26660         uint64_t        tx_pfc_ena_frames_pri7;
26661         /* Total number of EEE LPI Events on TX */
26662         uint64_t        tx_eee_lpi_events;
26663         /* EEE LPI Duration Counter on TX */
26664         uint64_t        tx_eee_lpi_duration;
26665         /*
26666          * Total number of Link Level Flow Control (LLFC) messages
26667          * transmitted
26668          */
26669         uint64_t        tx_llfc_logical_msgs;
26670         /* Total number of HCFC messages transmitted */
26671         uint64_t        tx_hcfc_msgs;
26672         /* Total number of TX collisions */
26673         uint64_t        tx_total_collisions;
26674         /* Total number of transmitted bytes */
26675         uint64_t        tx_bytes;
26676         /* Total number of end-to-end HOL frames */
26677         uint64_t        tx_xthol_frames;
26678         /* Total Tx Drops per Port reported by STATS block */
26679         uint64_t        tx_stat_discard;
26680         /* Total Tx Error Drops per Port reported by STATS block */
26681         uint64_t        tx_stat_error;
26682 } __rte_packed;
26683
26684 /* Port Rx Statistics Format */
26685 /* rx_port_stats (size:4224b/528B) */
26686 struct rx_port_stats {
26687         /* Total Number of 64 Bytes frames received */
26688         uint64_t        rx_64b_frames;
26689         /* Total Number of 65-127 Bytes frames received */
26690         uint64_t        rx_65b_127b_frames;
26691         /* Total Number of 128-255 Bytes frames received */
26692         uint64_t        rx_128b_255b_frames;
26693         /* Total Number of 256-511 Bytes frames received */
26694         uint64_t        rx_256b_511b_frames;
26695         /* Total Number of 512-1023 Bytes frames received */
26696         uint64_t        rx_512b_1023b_frames;
26697         /* Total Number of 1024-1518 Bytes frames received */
26698         uint64_t        rx_1024b_1518b_frames;
26699         /*
26700          * Total Number of each good VLAN (excludes FCS errors)
26701          * frame received which is 1519 to 1522 bytes in length
26702          * inclusive (excluding framing bits but including FCS bytes).
26703          */
26704         uint64_t        rx_good_vlan_frames;
26705         /* Total Number of 1519-2047 Bytes frames received */
26706         uint64_t        rx_1519b_2047b_frames;
26707         /* Total Number of 2048-4095 Bytes frames received */
26708         uint64_t        rx_2048b_4095b_frames;
26709         /* Total Number of 4096-9216 Bytes frames received */
26710         uint64_t        rx_4096b_9216b_frames;
26711         /* Total Number of 9217-16383 Bytes frames received */
26712         uint64_t        rx_9217b_16383b_frames;
26713         /* Total number of frames received */
26714         uint64_t        rx_total_frames;
26715         /* Total number of unicast frames received */
26716         uint64_t        rx_ucast_frames;
26717         /* Total number of multicast frames received */
26718         uint64_t        rx_mcast_frames;
26719         /* Total number of broadcast frames received */
26720         uint64_t        rx_bcast_frames;
26721         /* Total number of received frames with FCS error */
26722         uint64_t        rx_fcs_err_frames;
26723         /* Total number of control frames received */
26724         uint64_t        rx_ctrl_frames;
26725         /* Total number of PAUSE frames received */
26726         uint64_t        rx_pause_frames;
26727         /* Total number of PFC frames received */
26728         uint64_t        rx_pfc_frames;
26729         /*
26730          * Total number of frames received with an unsupported
26731          * opcode
26732          */
26733         uint64_t        rx_unsupported_opcode_frames;
26734         /*
26735          * Total number of frames received with an unsupported
26736          * DA for pause and PFC
26737          */
26738         uint64_t        rx_unsupported_da_pausepfc_frames;
26739         /* Total number of frames received with an unsupported SA */
26740         uint64_t        rx_wrong_sa_frames;
26741         /* Total number of received packets with alignment error */
26742         uint64_t        rx_align_err_frames;
26743         /* Total number of received frames with out-of-range length */
26744         uint64_t        rx_oor_len_frames;
26745         /* Total number of received frames with error termination */
26746         uint64_t        rx_code_err_frames;
26747         /*
26748          * Total number of received frames with a false carrier is
26749          * detected during idle, as defined by RX_ER samples active
26750          * and RXD is 0xE. The event is reported along with the
26751          * statistics generated on the next received frame. Only
26752          * one false carrier condition can be detected and logged
26753          * between frames.
26754          *
26755          * Carrier event, valid for 10M/100M speed modes only.
26756          */
26757         uint64_t        rx_false_carrier_frames;
26758         /* Total number of over-sized frames received */
26759         uint64_t        rx_ovrsz_frames;
26760         /* Total number of jabber packets received */
26761         uint64_t        rx_jbr_frames;
26762         /* Total number of received frames with MTU error */
26763         uint64_t        rx_mtu_err_frames;
26764         /* Total number of received frames with CRC match */
26765         uint64_t        rx_match_crc_frames;
26766         /* Total number of frames received promiscuously */
26767         uint64_t        rx_promiscuous_frames;
26768         /*
26769          * Total number of received frames with one or two VLAN
26770          * tags
26771          */
26772         uint64_t        rx_tagged_frames;
26773         /* Total number of received frames with two VLAN tags */
26774         uint64_t        rx_double_tagged_frames;
26775         /* Total number of truncated frames received */
26776         uint64_t        rx_trunc_frames;
26777         /* Total number of good frames (without errors) received */
26778         uint64_t        rx_good_frames;
26779         /*
26780          * Total number of received PFC frames with transition from
26781          * XON to XOFF on Pri 0
26782          */
26783         uint64_t        rx_pfc_xon2xoff_frames_pri0;
26784         /*
26785          * Total number of received PFC frames with transition from
26786          * XON to XOFF on Pri 1
26787          */
26788         uint64_t        rx_pfc_xon2xoff_frames_pri1;
26789         /*
26790          * Total number of received PFC frames with transition from
26791          * XON to XOFF on Pri 2
26792          */
26793         uint64_t        rx_pfc_xon2xoff_frames_pri2;
26794         /*
26795          * Total number of received PFC frames with transition from
26796          * XON to XOFF on Pri 3
26797          */
26798         uint64_t        rx_pfc_xon2xoff_frames_pri3;
26799         /*
26800          * Total number of received PFC frames with transition from
26801          * XON to XOFF on Pri 4
26802          */
26803         uint64_t        rx_pfc_xon2xoff_frames_pri4;
26804         /*
26805          * Total number of received PFC frames with transition from
26806          * XON to XOFF on Pri 5
26807          */
26808         uint64_t        rx_pfc_xon2xoff_frames_pri5;
26809         /*
26810          * Total number of received PFC frames with transition from
26811          * XON to XOFF on Pri 6
26812          */
26813         uint64_t        rx_pfc_xon2xoff_frames_pri6;
26814         /*
26815          * Total number of received PFC frames with transition from
26816          * XON to XOFF on Pri 7
26817          */
26818         uint64_t        rx_pfc_xon2xoff_frames_pri7;
26819         /*
26820          * Total number of received PFC frames with PFC enabled
26821          * bit for Pri 0
26822          */
26823         uint64_t        rx_pfc_ena_frames_pri0;
26824         /*
26825          * Total number of received PFC frames with PFC enabled
26826          * bit for Pri 1
26827          */
26828         uint64_t        rx_pfc_ena_frames_pri1;
26829         /*
26830          * Total number of received PFC frames with PFC enabled
26831          * bit for Pri 2
26832          */
26833         uint64_t        rx_pfc_ena_frames_pri2;
26834         /*
26835          * Total number of received PFC frames with PFC enabled
26836          * bit for Pri 3
26837          */
26838         uint64_t        rx_pfc_ena_frames_pri3;
26839         /*
26840          * Total number of received PFC frames with PFC enabled
26841          * bit for Pri 4
26842          */
26843         uint64_t        rx_pfc_ena_frames_pri4;
26844         /*
26845          * Total number of received PFC frames with PFC enabled
26846          * bit for Pri 5
26847          */
26848         uint64_t        rx_pfc_ena_frames_pri5;
26849         /*
26850          * Total number of received PFC frames with PFC enabled
26851          * bit for Pri 6
26852          */
26853         uint64_t        rx_pfc_ena_frames_pri6;
26854         /*
26855          * Total number of received PFC frames with PFC enabled
26856          * bit for Pri 7
26857          */
26858         uint64_t        rx_pfc_ena_frames_pri7;
26859         /* Total Number of frames received with SCH CRC error */
26860         uint64_t        rx_sch_crc_err_frames;
26861         /* Total Number of under-sized frames received */
26862         uint64_t        rx_undrsz_frames;
26863         /* Total Number of fragmented frames received */
26864         uint64_t        rx_frag_frames;
26865         /* Total number of RX EEE LPI Events */
26866         uint64_t        rx_eee_lpi_events;
26867         /* EEE LPI Duration Counter on RX */
26868         uint64_t        rx_eee_lpi_duration;
26869         /*
26870          * Total number of physical type Link Level Flow Control
26871          * (LLFC) messages received
26872          */
26873         uint64_t        rx_llfc_physical_msgs;
26874         /*
26875          * Total number of logical type Link Level Flow Control
26876          * (LLFC) messages received
26877          */
26878         uint64_t        rx_llfc_logical_msgs;
26879         /*
26880          * Total number of logical type Link Level Flow Control
26881          * (LLFC) messages received with CRC error
26882          */
26883         uint64_t        rx_llfc_msgs_with_crc_err;
26884         /* Total number of HCFC messages received */
26885         uint64_t        rx_hcfc_msgs;
26886         /* Total number of HCFC messages received with CRC error */
26887         uint64_t        rx_hcfc_msgs_with_crc_err;
26888         /* Total number of received bytes */
26889         uint64_t        rx_bytes;
26890         /* Total number of bytes received in runt frames */
26891         uint64_t        rx_runt_bytes;
26892         /* Total number of runt frames received */
26893         uint64_t        rx_runt_frames;
26894         /* Total Rx Discards per Port reported by STATS block */
26895         uint64_t        rx_stat_discard;
26896         uint64_t        rx_stat_err;
26897 } __rte_packed;
26898
26899 /********************
26900  * hwrm_port_qstats *
26901  ********************/
26902
26903
26904 /* hwrm_port_qstats_input (size:320b/40B) */
26905 struct hwrm_port_qstats_input {
26906         /* The HWRM command request type. */
26907         uint16_t        req_type;
26908         /*
26909          * The completion ring to send the completion event on. This should
26910          * be the NQ ID returned from the `nq_alloc` HWRM command.
26911          */
26912         uint16_t        cmpl_ring;
26913         /*
26914          * The sequence ID is used by the driver for tracking multiple
26915          * commands. This ID is treated as opaque data by the firmware and
26916          * the value is returned in the `hwrm_resp_hdr` upon completion.
26917          */
26918         uint16_t        seq_id;
26919         /*
26920          * The target ID of the command:
26921          * * 0x0-0xFFF8 - The function ID
26922          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26923          * * 0xFFFD - Reserved for user-space HWRM interface
26924          * * 0xFFFF - HWRM
26925          */
26926         uint16_t        target_id;
26927         /*
26928          * A physical address pointer pointing to a host buffer that the
26929          * command's response data will be written. This can be either a host
26930          * physical address (HPA) or a guest physical address (GPA) and must
26931          * point to a physically contiguous block of memory.
26932          */
26933         uint64_t        resp_addr;
26934         /* Port ID of port that is being queried. */
26935         uint16_t        port_id;
26936         uint8_t flags;
26937         /* This value is not used to avoid backward compatibility issues. */
26938         #define HWRM_PORT_QSTATS_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
26939         /*
26940          * This bit is set to 1 when request is for a counter mask,
26941          * representing the width of each of the stats counters, rather
26942          * than counters themselves.
26943          */
26944         #define HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
26945         #define HWRM_PORT_QSTATS_INPUT_FLAGS_LAST \
26946                 HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK
26947         uint8_t unused_0[5];
26948         /*
26949          * This is the host address where
26950          * Tx port statistics will be stored
26951          */
26952         uint64_t        tx_stat_host_addr;
26953         /*
26954          * This is the host address where
26955          * Rx port statistics will be stored
26956          */
26957         uint64_t        rx_stat_host_addr;
26958 } __rte_packed;
26959
26960 /* hwrm_port_qstats_output (size:128b/16B) */
26961 struct hwrm_port_qstats_output {
26962         /* The specific error status for the command. */
26963         uint16_t        error_code;
26964         /* The HWRM command request type. */
26965         uint16_t        req_type;
26966         /* The sequence ID from the original command. */
26967         uint16_t        seq_id;
26968         /* The length of the response data in number of bytes. */
26969         uint16_t        resp_len;
26970         /* The size of TX port statistics block in bytes. */
26971         uint16_t        tx_stat_size;
26972         /* The size of RX port statistics block in bytes. */
26973         uint16_t        rx_stat_size;
26974         uint8_t unused_0[3];
26975         /*
26976          * This field is used in Output records to indicate that the output
26977          * is completely written to RAM.  This field should be read as '1'
26978          * to indicate that the output has been completely written.
26979          * When writing a command completion or response to an internal processor,
26980          * the order of writes has to be such that this field is written last.
26981          */
26982         uint8_t valid;
26983 } __rte_packed;
26984
26985 /* Port Tx Statistics extended Format */
26986 /* tx_port_stats_ext (size:2048b/256B) */
26987 struct tx_port_stats_ext {
26988         /* Total number of tx bytes count on cos queue 0 */
26989         uint64_t        tx_bytes_cos0;
26990         /* Total number of tx bytes count on cos queue 1 */
26991         uint64_t        tx_bytes_cos1;
26992         /* Total number of tx bytes count on cos queue 2 */
26993         uint64_t        tx_bytes_cos2;
26994         /* Total number of tx bytes count on cos queue 3 */
26995         uint64_t        tx_bytes_cos3;
26996         /* Total number of tx bytes count on cos queue 4 */
26997         uint64_t        tx_bytes_cos4;
26998         /* Total number of tx bytes count on cos queue 5 */
26999         uint64_t        tx_bytes_cos5;
27000         /* Total number of tx bytes count on cos queue 6 */
27001         uint64_t        tx_bytes_cos6;
27002         /* Total number of tx bytes count on cos queue 7 */
27003         uint64_t        tx_bytes_cos7;
27004         /* Total number of tx packets count on cos queue 0 */
27005         uint64_t        tx_packets_cos0;
27006         /* Total number of tx packets count on cos queue 1 */
27007         uint64_t        tx_packets_cos1;
27008         /* Total number of tx packets count on cos queue 2 */
27009         uint64_t        tx_packets_cos2;
27010         /* Total number of tx packets count on cos queue 3 */
27011         uint64_t        tx_packets_cos3;
27012         /* Total number of tx packets count on cos queue 4 */
27013         uint64_t        tx_packets_cos4;
27014         /* Total number of tx packets count on cos queue 5 */
27015         uint64_t        tx_packets_cos5;
27016         /* Total number of tx packets count on cos queue 6 */
27017         uint64_t        tx_packets_cos6;
27018         /* Total number of tx packets count on cos queue 7 */
27019         uint64_t        tx_packets_cos7;
27020         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
27021         uint64_t        pfc_pri0_tx_duration_us;
27022         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
27023         uint64_t        pfc_pri0_tx_transitions;
27024         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
27025         uint64_t        pfc_pri1_tx_duration_us;
27026         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
27027         uint64_t        pfc_pri1_tx_transitions;
27028         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
27029         uint64_t        pfc_pri2_tx_duration_us;
27030         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
27031         uint64_t        pfc_pri2_tx_transitions;
27032         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
27033         uint64_t        pfc_pri3_tx_duration_us;
27034         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
27035         uint64_t        pfc_pri3_tx_transitions;
27036         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
27037         uint64_t        pfc_pri4_tx_duration_us;
27038         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
27039         uint64_t        pfc_pri4_tx_transitions;
27040         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
27041         uint64_t        pfc_pri5_tx_duration_us;
27042         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
27043         uint64_t        pfc_pri5_tx_transitions;
27044         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
27045         uint64_t        pfc_pri6_tx_duration_us;
27046         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
27047         uint64_t        pfc_pri6_tx_transitions;
27048         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
27049         uint64_t        pfc_pri7_tx_duration_us;
27050         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
27051         uint64_t        pfc_pri7_tx_transitions;
27052 } __rte_packed;
27053
27054 /* Port Rx Statistics extended Format */
27055 /* rx_port_stats_ext (size:3776b/472B) */
27056 struct rx_port_stats_ext {
27057         /* Number of times link state changed to down */
27058         uint64_t        link_down_events;
27059         /* Number of times the idle rings with pause bit are found */
27060         uint64_t        continuous_pause_events;
27061         /* Number of times the active rings pause bit resumed back */
27062         uint64_t        resume_pause_events;
27063         /* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */
27064         uint64_t        continuous_roce_pause_events;
27065         /* Number of times, the ROCE cos queue PFC is enabled back */
27066         uint64_t        resume_roce_pause_events;
27067         /* Total number of rx bytes count on cos queue 0 */
27068         uint64_t        rx_bytes_cos0;
27069         /* Total number of rx bytes count on cos queue 1 */
27070         uint64_t        rx_bytes_cos1;
27071         /* Total number of rx bytes count on cos queue 2 */
27072         uint64_t        rx_bytes_cos2;
27073         /* Total number of rx bytes count on cos queue 3 */
27074         uint64_t        rx_bytes_cos3;
27075         /* Total number of rx bytes count on cos queue 4 */
27076         uint64_t        rx_bytes_cos4;
27077         /* Total number of rx bytes count on cos queue 5 */
27078         uint64_t        rx_bytes_cos5;
27079         /* Total number of rx bytes count on cos queue 6 */
27080         uint64_t        rx_bytes_cos6;
27081         /* Total number of rx bytes count on cos queue 7 */
27082         uint64_t        rx_bytes_cos7;
27083         /* Total number of rx packets count on cos queue 0 */
27084         uint64_t        rx_packets_cos0;
27085         /* Total number of rx packets count on cos queue 1 */
27086         uint64_t        rx_packets_cos1;
27087         /* Total number of rx packets count on cos queue 2 */
27088         uint64_t        rx_packets_cos2;
27089         /* Total number of rx packets count on cos queue 3 */
27090         uint64_t        rx_packets_cos3;
27091         /* Total number of rx packets count on cos queue 4 */
27092         uint64_t        rx_packets_cos4;
27093         /* Total number of rx packets count on cos queue 5 */
27094         uint64_t        rx_packets_cos5;
27095         /* Total number of rx packets count on cos queue 6 */
27096         uint64_t        rx_packets_cos6;
27097         /* Total number of rx packets count on cos queue 7 */
27098         uint64_t        rx_packets_cos7;
27099         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
27100         uint64_t        pfc_pri0_rx_duration_us;
27101         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
27102         uint64_t        pfc_pri0_rx_transitions;
27103         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
27104         uint64_t        pfc_pri1_rx_duration_us;
27105         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
27106         uint64_t        pfc_pri1_rx_transitions;
27107         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
27108         uint64_t        pfc_pri2_rx_duration_us;
27109         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
27110         uint64_t        pfc_pri2_rx_transitions;
27111         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
27112         uint64_t        pfc_pri3_rx_duration_us;
27113         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
27114         uint64_t        pfc_pri3_rx_transitions;
27115         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
27116         uint64_t        pfc_pri4_rx_duration_us;
27117         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
27118         uint64_t        pfc_pri4_rx_transitions;
27119         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
27120         uint64_t        pfc_pri5_rx_duration_us;
27121         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
27122         uint64_t        pfc_pri5_rx_transitions;
27123         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
27124         uint64_t        pfc_pri6_rx_duration_us;
27125         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
27126         uint64_t        pfc_pri6_rx_transitions;
27127         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
27128         uint64_t        pfc_pri7_rx_duration_us;
27129         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
27130         uint64_t        pfc_pri7_rx_transitions;
27131         /* Total number of received bits */
27132         uint64_t        rx_bits;
27133         /* The number of events where the port receive buffer was over 85% full */
27134         uint64_t        rx_buffer_passed_threshold;
27135         /*
27136          * The number of symbol errors that wasn't corrected by FEC correction
27137          * algorithm
27138          */
27139         uint64_t        rx_pcs_symbol_err;
27140         /* The number of corrected bits on the port according to active FEC */
27141         uint64_t        rx_corrected_bits;
27142         /* Total number of rx discard bytes count on cos queue 0 */
27143         uint64_t        rx_discard_bytes_cos0;
27144         /* Total number of rx discard bytes count on cos queue 1 */
27145         uint64_t        rx_discard_bytes_cos1;
27146         /* Total number of rx discard bytes count on cos queue 2 */
27147         uint64_t        rx_discard_bytes_cos2;
27148         /* Total number of rx discard bytes count on cos queue 3 */
27149         uint64_t        rx_discard_bytes_cos3;
27150         /* Total number of rx discard bytes count on cos queue 4 */
27151         uint64_t        rx_discard_bytes_cos4;
27152         /* Total number of rx discard bytes count on cos queue 5 */
27153         uint64_t        rx_discard_bytes_cos5;
27154         /* Total number of rx discard bytes count on cos queue 6 */
27155         uint64_t        rx_discard_bytes_cos6;
27156         /* Total number of rx discard bytes count on cos queue 7 */
27157         uint64_t        rx_discard_bytes_cos7;
27158         /* Total number of rx discard packets count on cos queue 0 */
27159         uint64_t        rx_discard_packets_cos0;
27160         /* Total number of rx discard packets count on cos queue 1 */
27161         uint64_t        rx_discard_packets_cos1;
27162         /* Total number of rx discard packets count on cos queue 2 */
27163         uint64_t        rx_discard_packets_cos2;
27164         /* Total number of rx discard packets count on cos queue 3 */
27165         uint64_t        rx_discard_packets_cos3;
27166         /* Total number of rx discard packets count on cos queue 4 */
27167         uint64_t        rx_discard_packets_cos4;
27168         /* Total number of rx discard packets count on cos queue 5 */
27169         uint64_t        rx_discard_packets_cos5;
27170         /* Total number of rx discard packets count on cos queue 6 */
27171         uint64_t        rx_discard_packets_cos6;
27172         /* Total number of rx discard packets count on cos queue 7 */
27173         uint64_t        rx_discard_packets_cos7;
27174         /* Total number of FEC blocks corrected by the FEC function in the PHY */
27175         uint64_t        rx_fec_corrected_blocks;
27176         /*
27177          * Total number of FEC blocks determined to be uncorrectable by the
27178          * FEC function in the PHY
27179          */
27180         uint64_t        rx_fec_uncorrectable_blocks;
27181 } __rte_packed;
27182
27183 /*
27184  * Port Rx Statistics extended PFC WatchDog Format.
27185  * StormDetect and StormRevert event determination is based
27186  * on an integration period and a percentage threshold.
27187  * StormDetect event - when percentage of XOFF frames received
27188  * within an integration period exceeds the configured threshold.
27189  * StormRevert event - when percentage of XON frames received
27190  * within an integration period exceeds the configured threshold.
27191  * Actual number of XOFF/XON frames for the events to be triggered
27192  * depends on both configured integration period and sampling rate.
27193  * The statistics in this structure represent counts of specified
27194  * events from the moment the feature (PFC WatchDog) is enabled via
27195  * hwrm_queue_pfc_enable_cfg call.
27196  */
27197 /* rx_port_stats_ext_pfc_wd (size:5120b/640B) */
27198 struct rx_port_stats_ext_pfc_wd {
27199         /*
27200          * Total number of PFC WatchDog StormDetect events detected
27201          * for Pri 0
27202          */
27203         uint64_t        rx_pfc_watchdog_storms_detected_pri0;
27204         /*
27205          * Total number of PFC WatchDog StormDetect events detected
27206          * for Pri 1
27207          */
27208         uint64_t        rx_pfc_watchdog_storms_detected_pri1;
27209         /*
27210          * Total number of PFC WatchDog StormDetect events detected
27211          * for Pri 2
27212          */
27213         uint64_t        rx_pfc_watchdog_storms_detected_pri2;
27214         /*
27215          * Total number of PFC WatchDog StormDetect events detected
27216          * for Pri 3
27217          */
27218         uint64_t        rx_pfc_watchdog_storms_detected_pri3;
27219         /*
27220          * Total number of PFC WatchDog StormDetect events detected
27221          * for Pri 4
27222          */
27223         uint64_t        rx_pfc_watchdog_storms_detected_pri4;
27224         /*
27225          * Total number of PFC WatchDog StormDetect events detected
27226          * for Pri 5
27227          */
27228         uint64_t        rx_pfc_watchdog_storms_detected_pri5;
27229         /*
27230          * Total number of PFC WatchDog StormDetect events detected
27231          * for Pri 6
27232          */
27233         uint64_t        rx_pfc_watchdog_storms_detected_pri6;
27234         /*
27235          * Total number of PFC WatchDog StormDetect events detected
27236          * for Pri 7
27237          */
27238         uint64_t        rx_pfc_watchdog_storms_detected_pri7;
27239         /*
27240          * Total number of PFC WatchDog StormRevert events detected
27241          * for Pri 0
27242          */
27243         uint64_t        rx_pfc_watchdog_storms_reverted_pri0;
27244         /*
27245          * Total number of PFC WatchDog StormRevert events detected
27246          * for Pri 1
27247          */
27248         uint64_t        rx_pfc_watchdog_storms_reverted_pri1;
27249         /*
27250          * Total number of PFC WatchDog StormRevert events detected
27251          * for Pri 2
27252          */
27253         uint64_t        rx_pfc_watchdog_storms_reverted_pri2;
27254         /*
27255          * Total number of PFC WatchDog StormRevert events detected
27256          * for Pri 3
27257          */
27258         uint64_t        rx_pfc_watchdog_storms_reverted_pri3;
27259         /*
27260          * Total number of PFC WatchDog StormRevert events detected
27261          * for Pri 4
27262          */
27263         uint64_t        rx_pfc_watchdog_storms_reverted_pri4;
27264         /*
27265          * Total number of PFC WatchDog StormRevert events detected
27266          * for Pri 5
27267          */
27268         uint64_t        rx_pfc_watchdog_storms_reverted_pri5;
27269         /*
27270          * Total number of PFC WatchDog StormRevert events detected
27271          * for Pri 6
27272          */
27273         uint64_t        rx_pfc_watchdog_storms_reverted_pri6;
27274         /*
27275          * Total number of PFC WatchDog StormRevert events detected
27276          * for Pri 7
27277          */
27278         uint64_t        rx_pfc_watchdog_storms_reverted_pri7;
27279         /*
27280          * Total number of packets received during PFC watchdog storm
27281          * for pri 0
27282          */
27283         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri0;
27284         /*
27285          * Total number of packets received during PFC watchdog storm
27286          * for pri 1
27287          */
27288         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri1;
27289         /*
27290          * Total number of packets received during PFC watchdog storm
27291          *  for pri 2
27292          */
27293         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri2;
27294         /*
27295          * Total number of packets received during PFC watchdog storm
27296          *  for pri 3
27297          */
27298         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri3;
27299         /*
27300          * Total number of packets received during PFC watchdog storm
27301          *  for pri 4
27302          */
27303         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri4;
27304         /*
27305          * Total number of packets received during PFC watchdog storm
27306          *  for pri 5
27307          */
27308         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri5;
27309         /*
27310          * Total number of packets received during PFC watchdog storm
27311          *  for pri 6
27312          */
27313         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri6;
27314         /*
27315          * Total number of packets received during PFC watchdog storm
27316          *  for pri 7
27317          */
27318         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri7;
27319         /*
27320          * Total number of bytes received during PFC watchdog storm
27321          * for pri 0
27322          */
27323         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri0;
27324         /*
27325          * Total number of bytes received during PFC watchdog storm
27326          * for pri 1
27327          */
27328         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri1;
27329         /*
27330          * Total number of bytes received during PFC watchdog storm
27331          *  for pri 2
27332          */
27333         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri2;
27334         /*
27335          * Total number of bytes received during PFC watchdog storm
27336          *  for pri 3
27337          */
27338         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri3;
27339         /*
27340          * Total number of bytes received during PFC watchdog storm
27341          *  for pri 4
27342          */
27343         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri4;
27344         /*
27345          * Total number of bytes received during PFC watchdog storm
27346          *  for pri 5
27347          */
27348         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri5;
27349         /*
27350          * Total number of bytes received during PFC watchdog storm
27351          *  for pri 6
27352          */
27353         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri6;
27354         /*
27355          * Total number of bytes received during PFC watchdog storm
27356          *  for pri 7
27357          */
27358         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri7;
27359         /*
27360          * Total number of packets dropped on rx during PFC watchdog storm
27361          * for pri 0
27362          */
27363         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri0;
27364         /*
27365          * Total number of packets dropped on rx during PFC watchdog storm
27366          * for pri 1
27367          */
27368         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri1;
27369         /*
27370          * Total number of packets dropped on rx during PFC watchdog storm
27371          *  for pri 2
27372          */
27373         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri2;
27374         /*
27375          * Total number of packets dropped on rx during PFC watchdog storm
27376          *  for pri 3
27377          */
27378         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri3;
27379         /*
27380          * Total number of packets dropped on rx during PFC watchdog storm
27381          *  for pri 4
27382          */
27383         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri4;
27384         /*
27385          * Total number of packets dropped on rx during PFC watchdog storm
27386          *  for pri 5
27387          */
27388         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri5;
27389         /*
27390          * Total number of packets dropped on rx during PFC watchdog storm
27391          *  for pri 6
27392          */
27393         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri6;
27394         /*
27395          * Total number of packets dropped on rx during PFC watchdog storm
27396          *  for pri 7
27397          */
27398         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri7;
27399         /*
27400          * Total number of bytes dropped on rx during PFC watchdog storm
27401          * for pri 0
27402          */
27403         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri0;
27404         /*
27405          * Total number of bytes dropped on rx during PFC watchdog storm
27406          * for pri 1
27407          */
27408         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri1;
27409         /*
27410          * Total number of bytes dropped on rx during PFC watchdog storm
27411          *  for pri 2
27412          */
27413         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri2;
27414         /*
27415          * Total number of bytes dropped on rx during PFC watchdog storm
27416          *  for pri 3
27417          */
27418         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri3;
27419         /*
27420          * Total number of bytes dropped on rx during PFC watchdog storm
27421          *  for pri 4
27422          */
27423         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri4;
27424         /*
27425          * Total number of bytes dropped on rx during PFC watchdog storm
27426          *  for pri 5
27427          */
27428         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri5;
27429         /*
27430          * Total number of bytes dropped on rx during PFC watchdog storm
27431          *  for pri 6
27432          */
27433         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri6;
27434         /*
27435          * Total number of bytes dropped on rx during PFC watchdog storm
27436          *  for pri 7
27437          */
27438         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri7;
27439         /*
27440          * Number of packets received during last PFC watchdog storm
27441          * for pri 0
27442          */
27443         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri0;
27444         /*
27445          * Number of packets received during last PFC watchdog storm
27446          * for pri 1
27447          */
27448         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri1;
27449         /*
27450          * Number of packets received during last PFC watchdog storm
27451          *  for pri 2
27452          */
27453         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri2;
27454         /*
27455          * Number of packets received during last PFC watchdog storm
27456          *  for pri 3
27457          */
27458         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri3;
27459         /*
27460          * Number of packets received during last PFC watchdog storm
27461          *  for pri 4
27462          */
27463         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri4;
27464         /*
27465          * Number of packets received during last PFC watchdog storm
27466          *  for pri 5
27467          */
27468         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri5;
27469         /*
27470          * Number of packets received during last PFC watchdog storm
27471          *  for pri 6
27472          */
27473         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri6;
27474         /*
27475          * Number of packets received during last PFC watchdog storm
27476          *  for pri 7
27477          */
27478         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri7;
27479         /*
27480          * Number of bytes received during last PFC watchdog storm
27481          * for pri 0
27482          */
27483         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri0;
27484         /*
27485          * Number of bytes received during last PFC watchdog storm
27486          * for pri 1
27487          */
27488         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri1;
27489         /*
27490          * Number of bytes received during last PFC watchdog storm
27491          *  for pri 2
27492          */
27493         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri2;
27494         /*
27495          * Number of bytes received during last PFC watchdog storm
27496          *  for pri 3
27497          */
27498         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri3;
27499         /*
27500          * Number of bytes received during last PFC watchdog storm
27501          *  for pri 4
27502          */
27503         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri4;
27504         /*
27505          * Number of bytes received during last PFC watchdog storm
27506          *  for pri 5
27507          */
27508         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri5;
27509         /*
27510          * Number of bytes received during last PFC watchdog storm
27511          *  for pri 6
27512          */
27513         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri6;
27514         /*
27515          * Number of bytes received during last PFC watchdog storm
27516          *  for pri 7
27517          */
27518         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri7;
27519         /*
27520          * Number of packets dropped on rx during last PFC watchdog storm
27521          * for pri 0
27522          */
27523         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri0;
27524         /*
27525          * Number of packets dropped on rx during last PFC watchdog storm
27526          * for pri 1
27527          */
27528         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri1;
27529         /*
27530          * Number of packets dropped on rx during last PFC watchdog storm
27531          *  for pri 2
27532          */
27533         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri2;
27534         /*
27535          * Number of packets dropped on rx during last PFC watchdog storm
27536          *  for pri 3
27537          */
27538         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri3;
27539         /*
27540          * Number of packets dropped on rx during last PFC watchdog storm
27541          *  for pri 4
27542          */
27543         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri4;
27544         /*
27545          * Number of packets dropped on rx during last PFC watchdog storm
27546          *  for pri 5
27547          */
27548         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri5;
27549         /*
27550          * Number of packets dropped on rx during last PFC watchdog storm
27551          *  for pri 6
27552          */
27553         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri6;
27554         /*
27555          * Number of packets dropped on rx during last PFC watchdog storm
27556          *  for pri 7
27557          */
27558         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri7;
27559         /*
27560          * Total number of bytes dropped on rx during PFC watchdog storm
27561          * for pri 0
27562          */
27563         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri0;
27564         /*
27565          * Number of bytes dropped on rx during last PFC watchdog storm
27566          * for pri 1
27567          */
27568         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri1;
27569         /*
27570          * Number of bytes dropped on rx during last PFC watchdog storm
27571          *  for pri 2
27572          */
27573         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri2;
27574         /*
27575          * Number of bytes dropped on rx during last PFC watchdog storm
27576          *  for pri 3
27577          */
27578         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri3;
27579         /*
27580          * Number of bytes dropped on rx during last PFC watchdog storm
27581          *  for pri 4
27582          */
27583         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri4;
27584         /*
27585          * Number of bytes dropped on rx during last PFC watchdog storm
27586          *  for pri 5
27587          */
27588         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri5;
27589         /*
27590          * Number of bytes dropped on rx during last PFC watchdog storm
27591          *  for pri 6
27592          */
27593         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri6;
27594         /*
27595          * Number of bytes dropped on rx during last PFC watchdog storm
27596          *  for pri 7
27597          */
27598         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri7;
27599 } __rte_packed;
27600
27601 /************************
27602  * hwrm_port_qstats_ext *
27603  ************************/
27604
27605
27606 /* hwrm_port_qstats_ext_input (size:320b/40B) */
27607 struct hwrm_port_qstats_ext_input {
27608         /* The HWRM command request type. */
27609         uint16_t        req_type;
27610         /*
27611          * The completion ring to send the completion event on. This should
27612          * be the NQ ID returned from the `nq_alloc` HWRM command.
27613          */
27614         uint16_t        cmpl_ring;
27615         /*
27616          * The sequence ID is used by the driver for tracking multiple
27617          * commands. This ID is treated as opaque data by the firmware and
27618          * the value is returned in the `hwrm_resp_hdr` upon completion.
27619          */
27620         uint16_t        seq_id;
27621         /*
27622          * The target ID of the command:
27623          * * 0x0-0xFFF8 - The function ID
27624          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27625          * * 0xFFFD - Reserved for user-space HWRM interface
27626          * * 0xFFFF - HWRM
27627          */
27628         uint16_t        target_id;
27629         /*
27630          * A physical address pointer pointing to a host buffer that the
27631          * command's response data will be written. This can be either a host
27632          * physical address (HPA) or a guest physical address (GPA) and must
27633          * point to a physically contiguous block of memory.
27634          */
27635         uint64_t        resp_addr;
27636         /* Port ID of port that is being queried. */
27637         uint16_t        port_id;
27638         /*
27639          * The size of TX port extended
27640          * statistics block in bytes.
27641          */
27642         uint16_t        tx_stat_size;
27643         /*
27644          * The size of RX port extended
27645          * statistics block in bytes
27646          */
27647         uint16_t        rx_stat_size;
27648         uint8_t flags;
27649         /* This value is not used to avoid backward compatibility issues. */
27650         #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
27651         /*
27652          * This bit is set to 1 when request is for the counter mask,
27653          * representing width of each of the stats counters, rather than
27654          * counters themselves.
27655          */
27656         #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
27657         #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_LAST \
27658                 HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK
27659         uint8_t unused_0;
27660         /*
27661          * This is the host address where
27662          * Tx port statistics will be stored
27663          */
27664         uint64_t        tx_stat_host_addr;
27665         /*
27666          * This is the host address where
27667          * Rx port statistics will be stored
27668          */
27669         uint64_t        rx_stat_host_addr;
27670 } __rte_packed;
27671
27672 /* hwrm_port_qstats_ext_output (size:128b/16B) */
27673 struct hwrm_port_qstats_ext_output {
27674         /* The specific error status for the command. */
27675         uint16_t        error_code;
27676         /* The HWRM command request type. */
27677         uint16_t        req_type;
27678         /* The sequence ID from the original command. */
27679         uint16_t        seq_id;
27680         /* The length of the response data in number of bytes. */
27681         uint16_t        resp_len;
27682         /* The size of TX port statistics block in bytes. */
27683         uint16_t        tx_stat_size;
27684         /* The size of RX port statistics block in bytes. */
27685         uint16_t        rx_stat_size;
27686         /* Total number of active cos queues available. */
27687         uint16_t        total_active_cos_queues;
27688         uint8_t flags;
27689         /*
27690          * If set to 1, then this field indicates that clear
27691          * roce specific counters is supported.
27692          */
27693         #define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED \
27694                 UINT32_C(0x1)
27695         /*
27696          * This field is used in Output records to indicate that the output
27697          * is completely written to RAM.  This field should be read as '1'
27698          * to indicate that the output has been completely written.
27699          * When writing a command completion or response to an internal processor,
27700          * the order of writes has to be such that this field is written last.
27701          */
27702         uint8_t valid;
27703 } __rte_packed;
27704
27705 /*******************************
27706  * hwrm_port_qstats_ext_pfc_wd *
27707  *******************************/
27708
27709
27710 /* hwrm_port_qstats_ext_pfc_wd_input (size:256b/32B) */
27711 struct hwrm_port_qstats_ext_pfc_wd_input {
27712         /* The HWRM command request type. */
27713         uint16_t        req_type;
27714         /*
27715          * The completion ring to send the completion event on. This should
27716          * be the NQ ID returned from the `nq_alloc` HWRM command.
27717          */
27718         uint16_t        cmpl_ring;
27719         /*
27720          * The sequence ID is used by the driver for tracking multiple
27721          * commands. This ID is treated as opaque data by the firmware and
27722          * the value is returned in the `hwrm_resp_hdr` upon completion.
27723          */
27724         uint16_t        seq_id;
27725         /*
27726          * The target ID of the command:
27727          * * 0x0-0xFFF8 - The function ID
27728          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27729          * * 0xFFFD - Reserved for user-space HWRM interface
27730          * * 0xFFFF - HWRM
27731          */
27732         uint16_t        target_id;
27733         /*
27734          * A physical address pointer pointing to a host buffer that the
27735          * command's response data will be written. This can be either a host
27736          * physical address (HPA) or a guest physical address (GPA) and must
27737          * point to a physically contiguous block of memory.
27738          */
27739         uint64_t        resp_addr;
27740         /* Port ID of port that is being queried. */
27741         uint16_t        port_id;
27742         /*
27743          * The size of rx_port_stats_ext_pfc_wd
27744          * block in bytes
27745          */
27746         uint16_t        pfc_wd_stat_size;
27747         uint8_t unused_0[4];
27748         /*
27749          * This is the host address where
27750          * rx_port_stats_ext_pfc_wd will be stored
27751          */
27752         uint64_t        pfc_wd_stat_host_addr;
27753 } __rte_packed;
27754
27755 /* hwrm_port_qstats_ext_pfc_wd_output (size:128b/16B) */
27756 struct hwrm_port_qstats_ext_pfc_wd_output {
27757         /* The specific error status for the command. */
27758         uint16_t        error_code;
27759         /* The HWRM command request type. */
27760         uint16_t        req_type;
27761         /* The sequence ID from the original command. */
27762         uint16_t        seq_id;
27763         /* The length of the response data in number of bytes. */
27764         uint16_t        resp_len;
27765         /*
27766          * The size of rx_port_stats_ext_pfc_wd
27767          * statistics block in bytes.
27768          */
27769         uint16_t        pfc_wd_stat_size;
27770         uint8_t flags;
27771         /*
27772          * This field is used in Output records to indicate that the output
27773          * is completely written to RAM.  This field should be read as '1'
27774          * to indicate that the output has been completely written.
27775          * When writing a command completion or response to an internal processor,
27776          * the order of writes has to be such that this field is written last.
27777          */
27778         uint8_t valid;
27779         uint8_t unused_0[4];
27780 } __rte_packed;
27781
27782 /*************************
27783  * hwrm_port_lpbk_qstats *
27784  *************************/
27785
27786
27787 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */
27788 struct hwrm_port_lpbk_qstats_input {
27789         /* The HWRM command request type. */
27790         uint16_t        req_type;
27791         /*
27792          * The completion ring to send the completion event on. This should
27793          * be the NQ ID returned from the `nq_alloc` HWRM command.
27794          */
27795         uint16_t        cmpl_ring;
27796         /*
27797          * The sequence ID is used by the driver for tracking multiple
27798          * commands. This ID is treated as opaque data by the firmware and
27799          * the value is returned in the `hwrm_resp_hdr` upon completion.
27800          */
27801         uint16_t        seq_id;
27802         /*
27803          * The target ID of the command:
27804          * * 0x0-0xFFF8 - The function ID
27805          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27806          * * 0xFFFD - Reserved for user-space HWRM interface
27807          * * 0xFFFF - HWRM
27808          */
27809         uint16_t        target_id;
27810         /*
27811          * A physical address pointer pointing to a host buffer that the
27812          * command's response data will be written. This can be either a host
27813          * physical address (HPA) or a guest physical address (GPA) and must
27814          * point to a physically contiguous block of memory.
27815          */
27816         uint64_t        resp_addr;
27817 } __rte_packed;
27818
27819 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
27820 struct hwrm_port_lpbk_qstats_output {
27821         /* The specific error status for the command. */
27822         uint16_t        error_code;
27823         /* The HWRM command request type. */
27824         uint16_t        req_type;
27825         /* The sequence ID from the original command. */
27826         uint16_t        seq_id;
27827         /* The length of the response data in number of bytes. */
27828         uint16_t        resp_len;
27829         /* Number of transmitted unicast frames */
27830         uint64_t        lpbk_ucast_frames;
27831         /* Number of transmitted multicast frames */
27832         uint64_t        lpbk_mcast_frames;
27833         /* Number of transmitted broadcast frames */
27834         uint64_t        lpbk_bcast_frames;
27835         /* Number of transmitted bytes for unicast traffic */
27836         uint64_t        lpbk_ucast_bytes;
27837         /* Number of transmitted bytes for multicast traffic */
27838         uint64_t        lpbk_mcast_bytes;
27839         /* Number of transmitted bytes for broadcast traffic */
27840         uint64_t        lpbk_bcast_bytes;
27841         /* Total Tx Drops for loopback traffic reported by STATS block */
27842         uint64_t        tx_stat_discard;
27843         /* Total Tx Error Drops for loopback traffic reported by STATS block */
27844         uint64_t        tx_stat_error;
27845         /* Total Rx Drops for loopback traffic reported by STATS block */
27846         uint64_t        rx_stat_discard;
27847         /* Total Rx Error Drops for loopback traffic reported by STATS block */
27848         uint64_t        rx_stat_error;
27849         uint8_t unused_0[7];
27850         /*
27851          * This field is used in Output records to indicate that the output
27852          * is completely written to RAM.  This field should be read as '1'
27853          * to indicate that the output has been completely written.
27854          * When writing a command completion or response to an internal processor,
27855          * the order of writes has to be such that this field is written last.
27856          */
27857         uint8_t valid;
27858 } __rte_packed;
27859
27860 /************************
27861  * hwrm_port_ecn_qstats *
27862  ************************/
27863
27864
27865 /* hwrm_port_ecn_qstats_input (size:256b/32B) */
27866 struct hwrm_port_ecn_qstats_input {
27867         /* The HWRM command request type. */
27868         uint16_t        req_type;
27869         /*
27870          * The completion ring to send the completion event on. This should
27871          * be the NQ ID returned from the `nq_alloc` HWRM command.
27872          */
27873         uint16_t        cmpl_ring;
27874         /*
27875          * The sequence ID is used by the driver for tracking multiple
27876          * commands. This ID is treated as opaque data by the firmware and
27877          * the value is returned in the `hwrm_resp_hdr` upon completion.
27878          */
27879         uint16_t        seq_id;
27880         /*
27881          * The target ID of the command:
27882          * * 0x0-0xFFF8 - The function ID
27883          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27884          * * 0xFFFD - Reserved for user-space HWRM interface
27885          * * 0xFFFF - HWRM
27886          */
27887         uint16_t        target_id;
27888         /*
27889          * A physical address pointer pointing to a host buffer that the
27890          * command's response data will be written. This can be either a host
27891          * physical address (HPA) or a guest physical address (GPA) and must
27892          * point to a physically contiguous block of memory.
27893          */
27894         uint64_t        resp_addr;
27895         /*
27896          * Port ID of port that is being queried. Unused if NIC is in
27897          * multi-host mode.
27898          */
27899         uint16_t        port_id;
27900         /*
27901          * Size of the DMA buffer the caller has allocated for the firmware to
27902          * write into.
27903          */
27904         uint16_t        ecn_stat_buf_size;
27905         uint8_t flags;
27906         /* This value is not used to avoid backward compatibility issues. */
27907         #define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
27908         /*
27909          * This bit is set to 1 when request is for a counter mask,
27910          * representing the width of each of the stats counters, rather
27911          * than counters themselves.
27912          */
27913         #define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
27914         #define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_LAST \
27915                 HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_COUNTER_MASK
27916         uint8_t unused_0[3];
27917         /*
27918          * This is the host address where
27919          * ECN port statistics will be stored
27920          */
27921         uint64_t        ecn_stat_host_addr;
27922 } __rte_packed;
27923
27924 /* hwrm_port_ecn_qstats_output (size:128b/16B) */
27925 struct hwrm_port_ecn_qstats_output {
27926         /* The specific error status for the command. */
27927         uint16_t        error_code;
27928         /* The HWRM command request type. */
27929         uint16_t        req_type;
27930         /* The sequence ID from the original command. */
27931         uint16_t        seq_id;
27932         /* The length of the response data in number of bytes. */
27933         uint16_t        resp_len;
27934         /* Number of bytes of stats the firmware wrote to the DMA buffer. */
27935         uint16_t        ecn_stat_buf_size;
27936         /*
27937          * Bitmask that indicates which CoS queues have ECN marking enabled.
27938          * Bit i corresponds to CoS queue i.
27939          */
27940         uint8_t mark_en;
27941         uint8_t unused_0[4];
27942         /*
27943          * This field is used in Output records to indicate that the output
27944          * is completely written to RAM.  This field should be read as '1'
27945          * to indicate that the output has been completely written.
27946          * When writing a command completion or response to an internal processor,
27947          * the order of writes has to be such that this field is written last.
27948          */
27949         uint8_t valid;
27950 } __rte_packed;
27951
27952 /* ECN mark statistics format */
27953 /* port_stats_ecn (size:512b/64B) */
27954 struct port_stats_ecn {
27955         /*
27956          * Number of packets marked in CoS queue 0.
27957          * Or, if the driver requested counter masks, a mask to indicate the size
27958          * of the counter.
27959          */
27960         uint64_t        mark_cnt_cos0;
27961         /*
27962          * Number of packets marked in CoS queue 1.
27963          * Or, if the driver requested counter masks, a mask to indicate the size
27964          * of the counter.
27965          */
27966         uint64_t        mark_cnt_cos1;
27967         /*
27968          * Number of packets marked in CoS queue 2.
27969          * Or, if the driver requested counter masks, a mask to indicate the size
27970          * of the counter.
27971          */
27972         uint64_t        mark_cnt_cos2;
27973         /*
27974          * Number of packets marked in CoS queue 3.
27975          * Or, if the driver requested counter masks, a mask to indicate the size
27976          * of the counter.
27977          */
27978         uint64_t        mark_cnt_cos3;
27979         /*
27980          * Number of packets marked in CoS queue 4.
27981          * Or, if the driver requested counter masks, a mask to indicate the size
27982          * of the counter.
27983          */
27984         uint64_t        mark_cnt_cos4;
27985         /*
27986          * Number of packets marked in CoS queue 5.
27987          * Or, if the driver requested counter masks, a mask to indicate the size
27988          * of the counter.
27989          */
27990         uint64_t        mark_cnt_cos5;
27991         /*
27992          * Number of packets marked in CoS queue 6.
27993          * Or, if the driver requested counter masks, a mask to indicate the size
27994          * of the counter.
27995          */
27996         uint64_t        mark_cnt_cos6;
27997         /*
27998          * Number of packets marked in CoS queue 7.
27999          * Or, if the driver requested counter masks, a mask to indicate the size
28000          * of the counter.
28001          */
28002         uint64_t        mark_cnt_cos7;
28003 } __rte_packed;
28004
28005 /***********************
28006  * hwrm_port_clr_stats *
28007  ***********************/
28008
28009
28010 /* hwrm_port_clr_stats_input (size:192b/24B) */
28011 struct hwrm_port_clr_stats_input {
28012         /* The HWRM command request type. */
28013         uint16_t        req_type;
28014         /*
28015          * The completion ring to send the completion event on. This should
28016          * be the NQ ID returned from the `nq_alloc` HWRM command.
28017          */
28018         uint16_t        cmpl_ring;
28019         /*
28020          * The sequence ID is used by the driver for tracking multiple
28021          * commands. This ID is treated as opaque data by the firmware and
28022          * the value is returned in the `hwrm_resp_hdr` upon completion.
28023          */
28024         uint16_t        seq_id;
28025         /*
28026          * The target ID of the command:
28027          * * 0x0-0xFFF8 - The function ID
28028          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28029          * * 0xFFFD - Reserved for user-space HWRM interface
28030          * * 0xFFFF - HWRM
28031          */
28032         uint16_t        target_id;
28033         /*
28034          * A physical address pointer pointing to a host buffer that the
28035          * command's response data will be written. This can be either a host
28036          * physical address (HPA) or a guest physical address (GPA) and must
28037          * point to a physically contiguous block of memory.
28038          */
28039         uint64_t        resp_addr;
28040         /* Port ID of port that is being queried. */
28041         uint16_t        port_id;
28042         uint8_t flags;
28043         /*
28044          * If set to 1, then this field indicates clear the following RoCE
28045          * specific counters.
28046          * RoCE associated TX/RX cos counters
28047          * CNP associated TX/RX cos counters
28048          * RoCE/CNP specific TX/RX flow counters
28049          * Firmware will determine the RoCE/CNP cos queue based on qos profile.
28050          * This flag is honored only when RoCE is enabled on that port.
28051          */
28052         #define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS     UINT32_C(0x1)
28053         uint8_t unused_0[5];
28054 } __rte_packed;
28055
28056 /* hwrm_port_clr_stats_output (size:128b/16B) */
28057 struct hwrm_port_clr_stats_output {
28058         /* The specific error status for the command. */
28059         uint16_t        error_code;
28060         /* The HWRM command request type. */
28061         uint16_t        req_type;
28062         /* The sequence ID from the original command. */
28063         uint16_t        seq_id;
28064         /* The length of the response data in number of bytes. */
28065         uint16_t        resp_len;
28066         uint8_t unused_0[7];
28067         /*
28068          * This field is used in Output records to indicate that the output
28069          * is completely written to RAM.  This field should be read as '1'
28070          * to indicate that the output has been completely written.
28071          * When writing a command completion or response to an internal processor,
28072          * the order of writes has to be such that this field is written last.
28073          */
28074         uint8_t valid;
28075 } __rte_packed;
28076
28077 /***********************
28078  * hwrm_port_phy_qcaps *
28079  ***********************/
28080
28081
28082 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
28083 struct hwrm_port_phy_qcaps_input {
28084         /* The HWRM command request type. */
28085         uint16_t        req_type;
28086         /*
28087          * The completion ring to send the completion event on. This should
28088          * be the NQ ID returned from the `nq_alloc` HWRM command.
28089          */
28090         uint16_t        cmpl_ring;
28091         /*
28092          * The sequence ID is used by the driver for tracking multiple
28093          * commands. This ID is treated as opaque data by the firmware and
28094          * the value is returned in the `hwrm_resp_hdr` upon completion.
28095          */
28096         uint16_t        seq_id;
28097         /*
28098          * The target ID of the command:
28099          * * 0x0-0xFFF8 - The function ID
28100          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28101          * * 0xFFFD - Reserved for user-space HWRM interface
28102          * * 0xFFFF - HWRM
28103          */
28104         uint16_t        target_id;
28105         /*
28106          * A physical address pointer pointing to a host buffer that the
28107          * command's response data will be written. This can be either a host
28108          * physical address (HPA) or a guest physical address (GPA) and must
28109          * point to a physically contiguous block of memory.
28110          */
28111         uint64_t        resp_addr;
28112         /* Port ID of port that is being queried. */
28113         uint16_t        port_id;
28114         uint8_t unused_0[6];
28115 } __rte_packed;
28116
28117 /* hwrm_port_phy_qcaps_output (size:256b/32B) */
28118 struct hwrm_port_phy_qcaps_output {
28119         /* The specific error status for the command. */
28120         uint16_t        error_code;
28121         /* The HWRM command request type. */
28122         uint16_t        req_type;
28123         /* The sequence ID from the original command. */
28124         uint16_t        seq_id;
28125         /* The length of the response data in number of bytes. */
28126         uint16_t        resp_len;
28127         /* PHY capability flags */
28128         uint8_t flags;
28129         /*
28130          * If set to 1, then this field indicates that the
28131          * link is capable of supporting EEE.
28132          */
28133         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED \
28134                 UINT32_C(0x1)
28135         /*
28136          * If set to 1, then this field indicates that the
28137          * PHY is capable of supporting external loopback.
28138          */
28139         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED \
28140                 UINT32_C(0x2)
28141         /*
28142          * If set to 1, then this field indicates that the
28143          * PHY is capable of supporting loopback in autoneg mode.
28144          */
28145         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_AUTONEG_LPBK_SUPPORTED \
28146                 UINT32_C(0x4)
28147         /*
28148          * Indicates if the configuration of shared PHY settings is supported.
28149          * In cases where a physical port is shared by multiple functions
28150          * (e.g. NPAR, multihost, etc), the configuration of PHY
28151          * settings may not be allowed. Callers to HWRM_PORT_PHY_CFG will
28152          * get an HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED error in this case.
28153          */
28154         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_SHARED_PHY_CFG_SUPPORTED \
28155                 UINT32_C(0x8)
28156         /*
28157          * If set to 1, it indicates that the port counters and extended
28158          * port counters will not reset when the firmware shuts down or
28159          * resets the PHY.  These counters will only be reset during power
28160          * cycle or by calling HWRM_PORT_CLR_STATS.
28161          * If set to 0, the state of the counters is unspecified when
28162          * firmware shuts down or resets the PHY.
28163          */
28164         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_CUMULATIVE_COUNTERS_ON_RESET \
28165                 UINT32_C(0x10)
28166         /*
28167          * If set to 1, then this field indicates that the
28168          * local loopback is not supported on this controller.
28169          */
28170         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_LOCAL_LPBK_NOT_SUPPORTED \
28171                 UINT32_C(0x20)
28172         /*
28173          * If set to 1, then this field indicates that the
28174          * PHY/Link down policy during PF shutdown is totally
28175          * controlled by the firmware. It can shutdown the link
28176          * even when there are active VFs associated with the PF.
28177          * Host PF driver can send HWRM_PHY_CFG command to bring
28178          * down the PHY even when the port is shared between VFs
28179          * and PFs.
28180          */
28181         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_FW_MANAGED_LINK_DOWN \
28182                 UINT32_C(0x40)
28183         /*
28184          * If set to 1, this field indicates that the FCS may
28185          * be disabled for a given packet via the transmit
28186          * buffer descriptor.
28187          */
28188         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_NO_FCS \
28189                 UINT32_C(0x80)
28190         /* Number of front panel ports for this device. */
28191         uint8_t port_cnt;
28192         /* Not supported or unknown */
28193         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
28194         /* single port device */
28195         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1       UINT32_C(0x1)
28196         /* 2-port device */
28197         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2       UINT32_C(0x2)
28198         /* 3-port device */
28199         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3       UINT32_C(0x3)
28200         /* 4-port device */
28201         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4       UINT32_C(0x4)
28202         /* 12-port device */
28203         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_12      UINT32_C(0xc)
28204         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST \
28205                 HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_12
28206         /*
28207          * This is a bit mask to indicate what speeds are supported
28208          * as forced speeds on this link.
28209          * For each speed that can be forced on this link, the
28210          * corresponding mask bit shall be set to '1'.
28211          */
28212         uint16_t        supported_speeds_force_mode;
28213         /* 100Mb link speed (Half-duplex) */
28214         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD \
28215                 UINT32_C(0x1)
28216         /* 100Mb link speed (Full-duplex) */
28217         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB \
28218                 UINT32_C(0x2)
28219         /* 1Gb link speed (Half-duplex) */
28220         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD \
28221                 UINT32_C(0x4)
28222         /* 1Gb link speed (Full-duplex) */
28223         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB \
28224                 UINT32_C(0x8)
28225         /* 2Gb link speed */
28226         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB \
28227                 UINT32_C(0x10)
28228         /* 25Gb link speed */
28229         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB \
28230                 UINT32_C(0x20)
28231         /* 10Gb link speed */
28232         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB \
28233                 UINT32_C(0x40)
28234         /* 20Gb link speed */
28235         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB \
28236                 UINT32_C(0x80)
28237         /* 25Gb link speed */
28238         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB \
28239                 UINT32_C(0x100)
28240         /* 40Gb link speed */
28241         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB \
28242                 UINT32_C(0x200)
28243         /* 50Gb link speed */
28244         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB \
28245                 UINT32_C(0x400)
28246         /* 100Gb link speed */
28247         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB \
28248                 UINT32_C(0x800)
28249         /* 10Mb link speed (Half-duplex) */
28250         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD \
28251                 UINT32_C(0x1000)
28252         /* 10Mb link speed (Full-duplex) */
28253         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB \
28254                 UINT32_C(0x2000)
28255         /*
28256          * This is a bit mask to indicate what speeds are supported
28257          * for autonegotiation on this link.
28258          * For each speed that can be autonegotiated on this link, the
28259          * corresponding mask bit shall be set to '1'.
28260          */
28261         uint16_t        supported_speeds_auto_mode;
28262         /* 100Mb link speed (Half-duplex) */
28263         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD \
28264                 UINT32_C(0x1)
28265         /* 100Mb link speed (Full-duplex) */
28266         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB \
28267                 UINT32_C(0x2)
28268         /* 1Gb link speed (Half-duplex) */
28269         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD \
28270                 UINT32_C(0x4)
28271         /* 1Gb link speed (Full-duplex) */
28272         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB \
28273                 UINT32_C(0x8)
28274         /* 2Gb link speed */
28275         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB \
28276                 UINT32_C(0x10)
28277         /* 25Gb link speed */
28278         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB \
28279                 UINT32_C(0x20)
28280         /* 10Gb link speed */
28281         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB \
28282                 UINT32_C(0x40)
28283         /* 20Gb link speed */
28284         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB \
28285                 UINT32_C(0x80)
28286         /* 25Gb link speed */
28287         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB \
28288                 UINT32_C(0x100)
28289         /* 40Gb link speed */
28290         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB \
28291                 UINT32_C(0x200)
28292         /* 50Gb link speed */
28293         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB \
28294                 UINT32_C(0x400)
28295         /* 100Gb link speed */
28296         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB \
28297                 UINT32_C(0x800)
28298         /* 10Mb link speed (Half-duplex) */
28299         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD \
28300                 UINT32_C(0x1000)
28301         /* 10Mb link speed (Full-duplex) */
28302         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB \
28303                 UINT32_C(0x2000)
28304         /*
28305          * This is a bit mask to indicate what speeds are supported
28306          * for EEE on this link.
28307          * For each speed that can be autonegotiated when EEE is enabled
28308          * on this link, the corresponding mask bit shall be set to '1'.
28309          * This field is only valid when the eee_supported is set to '1'.
28310          */
28311         uint16_t        supported_speeds_eee_mode;
28312         /* Reserved */
28313         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 \
28314                 UINT32_C(0x1)
28315         /* 100Mb link speed (Full-duplex) */
28316         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB \
28317                 UINT32_C(0x2)
28318         /* Reserved */
28319         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 \
28320                 UINT32_C(0x4)
28321         /* 1Gb link speed (Full-duplex) */
28322         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB \
28323                 UINT32_C(0x8)
28324         /* Reserved */
28325         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 \
28326                 UINT32_C(0x10)
28327         /* Reserved */
28328         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 \
28329                 UINT32_C(0x20)
28330         /* 10Gb link speed */
28331         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB \
28332                 UINT32_C(0x40)
28333         uint32_t        tx_lpi_timer_low;
28334         /*
28335          * The lowest value of TX LPI timer that can be set on this link
28336          * when EEE is enabled. This value is in microseconds.
28337          * This field is valid only when_eee_supported is set to '1'.
28338          */
28339         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK \
28340                 UINT32_C(0xffffff)
28341         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
28342         /*
28343          * Reserved field. The HWRM shall set this field to 0.
28344          * An HWRM client shall ignore this field.
28345          */
28346         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK \
28347                 UINT32_C(0xff000000)
28348         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT            24
28349         uint32_t        valid_tx_lpi_timer_high;
28350         /*
28351          * The highest value of TX LPI timer that can be set on this link
28352          * when EEE is enabled. This value is in microseconds.
28353          * This field is valid only when_eee_supported is set to '1'.
28354          */
28355         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK \
28356                 UINT32_C(0xffffff)
28357         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
28358         /*
28359          * Reserved field. The HWRM shall set this field to 0.
28360          * An HWRM client shall ignore this field.
28361          */
28362         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD_MASK \
28363                 UINT32_C(0xff000000)
28364         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD_SFT              24
28365         /*
28366          * This field is used to advertise which PAM4 speeds are supported
28367          * in auto mode.
28368          */
28369         uint16_t        supported_pam4_speeds_auto_mode;
28370         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_50G \
28371                 UINT32_C(0x1)
28372         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_100G \
28373                 UINT32_C(0x2)
28374         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_200G \
28375                 UINT32_C(0x4)
28376         /*
28377          * This field is used to advertise which PAM4 speeds are supported
28378          * in forced mode.
28379          */
28380         uint16_t        supported_pam4_speeds_force_mode;
28381         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_50G \
28382                 UINT32_C(0x1)
28383         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_100G \
28384                 UINT32_C(0x2)
28385         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_200G \
28386                 UINT32_C(0x4)
28387         /* More PHY capability flags */
28388         uint16_t        flags2;
28389         /*
28390          * If set to 1, then this field indicates that
28391          * 802.3x flow control is not supported.
28392          */
28393         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_PAUSE_UNSUPPORTED \
28394                 UINT32_C(0x1)
28395         /*
28396          * If set to 1, then this field indicates that
28397          * priority-based flow control is not supported.
28398          */
28399         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS2_PFC_UNSUPPORTED \
28400                 UINT32_C(0x2)
28401         /*
28402          * Number of internal ports for this device. This field allows the FW
28403          * to advertise how many internal ports are present. Manufacturing
28404          * tools uses this to determine how many internal ports should have
28405          * the PRBS test run on them. This field always return 0 unless NVM
28406          * option "HPTN_MODE" is set to 1.
28407          */
28408         uint8_t internal_port_cnt;
28409         /*
28410          * This field is used in Output records to indicate that the output
28411          * is completely written to RAM.  This field should be read as '1'
28412          * to indicate that the output has been completely written.
28413          * When writing a command completion or response to an internal processor,
28414          * the order of writes has to be such that this field is written last.
28415          */
28416         uint8_t valid;
28417 } __rte_packed;
28418
28419 /****************************
28420  * hwrm_port_phy_mdio_write *
28421  ****************************/
28422
28423
28424 /* hwrm_port_phy_mdio_write_input (size:320b/40B) */
28425 struct hwrm_port_phy_mdio_write_input {
28426         /* The HWRM command request type. */
28427         uint16_t        req_type;
28428         /*
28429          * The completion ring to send the completion event on. This should
28430          * be the NQ ID returned from the `nq_alloc` HWRM command.
28431          */
28432         uint16_t        cmpl_ring;
28433         /*
28434          * The sequence ID is used by the driver for tracking multiple
28435          * commands. This ID is treated as opaque data by the firmware and
28436          * the value is returned in the `hwrm_resp_hdr` upon completion.
28437          */
28438         uint16_t        seq_id;
28439         /*
28440          * The target ID of the command:
28441          * * 0x0-0xFFF8 - The function ID
28442          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28443          * * 0xFFFD - Reserved for user-space HWRM interface
28444          * * 0xFFFF - HWRM
28445          */
28446         uint16_t        target_id;
28447         /*
28448          * A physical address pointer pointing to a host buffer that the
28449          * command's response data will be written. This can be either a host
28450          * physical address (HPA) or a guest physical address (GPA) and must
28451          * point to a physically contiguous block of memory.
28452          */
28453         uint64_t        resp_addr;
28454         /* Reserved for future use. */
28455         uint32_t        unused_0[2];
28456         /* Port ID of port. */
28457         uint16_t        port_id;
28458         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
28459         uint8_t phy_addr;
28460         /* 8-bit device address. */
28461         uint8_t dev_addr;
28462         /* 16-bit register address. */
28463         uint16_t        reg_addr;
28464         /* 16-bit register data. */
28465         uint16_t        reg_data;
28466         /*
28467          * When this bit is set to 1 a Clause 45 mdio access is done.
28468          * when this bit is set to 0 a Clause 22 mdio access is done.
28469          */
28470         uint8_t cl45_mdio;
28471         /*  */
28472         uint8_t unused_1[7];
28473 } __rte_packed;
28474
28475 /* hwrm_port_phy_mdio_write_output (size:128b/16B) */
28476 struct hwrm_port_phy_mdio_write_output {
28477         /* The specific error status for the command. */
28478         uint16_t        error_code;
28479         /* The HWRM command request type. */
28480         uint16_t        req_type;
28481         /* The sequence ID from the original command. */
28482         uint16_t        seq_id;
28483         /* The length of the response data in number of bytes. */
28484         uint16_t        resp_len;
28485         uint8_t unused_0[7];
28486         /*
28487          * This field is used in Output records to indicate that the output
28488          * is completely written to RAM.  This field should be read as '1'
28489          * to indicate that the output has been completely written.
28490          * When writing a command completion or response to an internal processor,
28491          * the order of writes has to be such that this field is written last.
28492          */
28493         uint8_t valid;
28494 } __rte_packed;
28495
28496 /***************************
28497  * hwrm_port_phy_mdio_read *
28498  ***************************/
28499
28500
28501 /* hwrm_port_phy_mdio_read_input (size:256b/32B) */
28502 struct hwrm_port_phy_mdio_read_input {
28503         /* The HWRM command request type. */
28504         uint16_t        req_type;
28505         /*
28506          * The completion ring to send the completion event on. This should
28507          * be the NQ ID returned from the `nq_alloc` HWRM command.
28508          */
28509         uint16_t        cmpl_ring;
28510         /*
28511          * The sequence ID is used by the driver for tracking multiple
28512          * commands. This ID is treated as opaque data by the firmware and
28513          * the value is returned in the `hwrm_resp_hdr` upon completion.
28514          */
28515         uint16_t        seq_id;
28516         /*
28517          * The target ID of the command:
28518          * * 0x0-0xFFF8 - The function ID
28519          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28520          * * 0xFFFD - Reserved for user-space HWRM interface
28521          * * 0xFFFF - HWRM
28522          */
28523         uint16_t        target_id;
28524         /*
28525          * A physical address pointer pointing to a host buffer that the
28526          * command's response data will be written. This can be either a host
28527          * physical address (HPA) or a guest physical address (GPA) and must
28528          * point to a physically contiguous block of memory.
28529          */
28530         uint64_t        resp_addr;
28531         /* Reserved for future use. */
28532         uint32_t        unused_0[2];
28533         /* Port ID of port. */
28534         uint16_t        port_id;
28535         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
28536         uint8_t phy_addr;
28537         /* 8-bit device address. */
28538         uint8_t dev_addr;
28539         /* 16-bit register address. */
28540         uint16_t        reg_addr;
28541         /*
28542          * When this bit is set to 1 a Clause 45 mdio access is done.
28543          * when this bit is set to 0 a Clause 22 mdio access is done.
28544          */
28545         uint8_t cl45_mdio;
28546         /*  */
28547         uint8_t unused_1;
28548 } __rte_packed;
28549
28550 /* hwrm_port_phy_mdio_read_output (size:128b/16B) */
28551 struct hwrm_port_phy_mdio_read_output {
28552         /* The specific error status for the command. */
28553         uint16_t        error_code;
28554         /* The HWRM command request type. */
28555         uint16_t        req_type;
28556         /* The sequence ID from the original command. */
28557         uint16_t        seq_id;
28558         /* The length of the response data in number of bytes. */
28559         uint16_t        resp_len;
28560         /* 16-bit register data. */
28561         uint16_t        reg_data;
28562         uint8_t unused_0[5];
28563         /*
28564          * This field is used in Output records to indicate that the output
28565          * is completely written to RAM.  This field should be read as '1'
28566          * to indicate that the output has been completely written.
28567          * When writing a command completion or response to an internal processor,
28568          * the order of writes has to be such that this field is written last.
28569          */
28570         uint8_t valid;
28571 } __rte_packed;
28572
28573 /*********************
28574  * hwrm_port_led_cfg *
28575  *********************/
28576
28577
28578 /* hwrm_port_led_cfg_input (size:512b/64B) */
28579 struct hwrm_port_led_cfg_input {
28580         /* The HWRM command request type. */
28581         uint16_t        req_type;
28582         /*
28583          * The completion ring to send the completion event on. This should
28584          * be the NQ ID returned from the `nq_alloc` HWRM command.
28585          */
28586         uint16_t        cmpl_ring;
28587         /*
28588          * The sequence ID is used by the driver for tracking multiple
28589          * commands. This ID is treated as opaque data by the firmware and
28590          * the value is returned in the `hwrm_resp_hdr` upon completion.
28591          */
28592         uint16_t        seq_id;
28593         /*
28594          * The target ID of the command:
28595          * * 0x0-0xFFF8 - The function ID
28596          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28597          * * 0xFFFD - Reserved for user-space HWRM interface
28598          * * 0xFFFF - HWRM
28599          */
28600         uint16_t        target_id;
28601         /*
28602          * A physical address pointer pointing to a host buffer that the
28603          * command's response data will be written. This can be either a host
28604          * physical address (HPA) or a guest physical address (GPA) and must
28605          * point to a physically contiguous block of memory.
28606          */
28607         uint64_t        resp_addr;
28608         uint32_t        enables;
28609         /*
28610          * This bit must be '1' for the led0_id field to be
28611          * configured.
28612          */
28613         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID \
28614                 UINT32_C(0x1)
28615         /*
28616          * This bit must be '1' for the led0_state field to be
28617          * configured.
28618          */
28619         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE \
28620                 UINT32_C(0x2)
28621         /*
28622          * This bit must be '1' for the led0_color field to be
28623          * configured.
28624          */
28625         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR \
28626                 UINT32_C(0x4)
28627         /*
28628          * This bit must be '1' for the led0_blink_on field to be
28629          * configured.
28630          */
28631         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON \
28632                 UINT32_C(0x8)
28633         /*
28634          * This bit must be '1' for the led0_blink_off field to be
28635          * configured.
28636          */
28637         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF \
28638                 UINT32_C(0x10)
28639         /*
28640          * This bit must be '1' for the led0_group_id field to be
28641          * configured.
28642          */
28643         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID \
28644                 UINT32_C(0x20)
28645         /*
28646          * This bit must be '1' for the led1_id field to be
28647          * configured.
28648          */
28649         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID \
28650                 UINT32_C(0x40)
28651         /*
28652          * This bit must be '1' for the led1_state field to be
28653          * configured.
28654          */
28655         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE \
28656                 UINT32_C(0x80)
28657         /*
28658          * This bit must be '1' for the led1_color field to be
28659          * configured.
28660          */
28661         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR \
28662                 UINT32_C(0x100)
28663         /*
28664          * This bit must be '1' for the led1_blink_on field to be
28665          * configured.
28666          */
28667         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON \
28668                 UINT32_C(0x200)
28669         /*
28670          * This bit must be '1' for the led1_blink_off field to be
28671          * configured.
28672          */
28673         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF \
28674                 UINT32_C(0x400)
28675         /*
28676          * This bit must be '1' for the led1_group_id field to be
28677          * configured.
28678          */
28679         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID \
28680                 UINT32_C(0x800)
28681         /*
28682          * This bit must be '1' for the led2_id field to be
28683          * configured.
28684          */
28685         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID \
28686                 UINT32_C(0x1000)
28687         /*
28688          * This bit must be '1' for the led2_state field to be
28689          * configured.
28690          */
28691         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE \
28692                 UINT32_C(0x2000)
28693         /*
28694          * This bit must be '1' for the led2_color field to be
28695          * configured.
28696          */
28697         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR \
28698                 UINT32_C(0x4000)
28699         /*
28700          * This bit must be '1' for the led2_blink_on field to be
28701          * configured.
28702          */
28703         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON \
28704                 UINT32_C(0x8000)
28705         /*
28706          * This bit must be '1' for the led2_blink_off field to be
28707          * configured.
28708          */
28709         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF \
28710                 UINT32_C(0x10000)
28711         /*
28712          * This bit must be '1' for the led2_group_id field to be
28713          * configured.
28714          */
28715         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID \
28716                 UINT32_C(0x20000)
28717         /*
28718          * This bit must be '1' for the led3_id field to be
28719          * configured.
28720          */
28721         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID \
28722                 UINT32_C(0x40000)
28723         /*
28724          * This bit must be '1' for the led3_state field to be
28725          * configured.
28726          */
28727         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE \
28728                 UINT32_C(0x80000)
28729         /*
28730          * This bit must be '1' for the led3_color field to be
28731          * configured.
28732          */
28733         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR \
28734                 UINT32_C(0x100000)
28735         /*
28736          * This bit must be '1' for the led3_blink_on field to be
28737          * configured.
28738          */
28739         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON \
28740                 UINT32_C(0x200000)
28741         /*
28742          * This bit must be '1' for the led3_blink_off field to be
28743          * configured.
28744          */
28745         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \
28746                 UINT32_C(0x400000)
28747         /*
28748          * This bit must be '1' for the led3_group_id field to be
28749          * configured.
28750          */
28751         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID \
28752                 UINT32_C(0x800000)
28753         /* Port ID of port whose LEDs are configured. */
28754         uint16_t        port_id;
28755         /*
28756          * The number of LEDs that are being configured.
28757          * Up to 4 LEDs can be configured with this command.
28758          */
28759         uint8_t num_leds;
28760         /* Reserved field. */
28761         uint8_t rsvd;
28762         /* An identifier for the LED #0. */
28763         uint8_t led0_id;
28764         /* The requested state of the LED #0. */
28765         uint8_t led0_state;
28766         /* Default state of the LED */
28767         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
28768         /* Off */
28769         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF      UINT32_C(0x1)
28770         /* On */
28771         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON       UINT32_C(0x2)
28772         /* Blink */
28773         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK    UINT32_C(0x3)
28774         /* Blink Alternately */
28775         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
28776         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST \
28777                 HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
28778         /* The requested color of LED #0. */
28779         uint8_t led0_color;
28780         /* Default */
28781         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
28782         /* Amber */
28783         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
28784         /* Green */
28785         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
28786         /* Green or Amber */
28787         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
28788         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST \
28789                 HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
28790         uint8_t unused_0;
28791         /*
28792          * If the LED #0 state is "blink" or "blinkalt", then
28793          * this field represents the requested time in milliseconds
28794          * to keep LED on between cycles.
28795          */
28796         uint16_t        led0_blink_on;
28797         /*
28798          * If the LED #0 state is "blink" or "blinkalt", then
28799          * this field represents the requested time in milliseconds
28800          * to keep LED off between cycles.
28801          */
28802         uint16_t        led0_blink_off;
28803         /*
28804          * An identifier for the group of LEDs that LED #0 belongs
28805          * to.
28806          * If set to 0, then the LED #0 shall not be grouped and
28807          * shall be treated as an individual resource.
28808          * For all other non-zero values of this field, LED #0 shall
28809          * be grouped together with the LEDs with the same group ID
28810          * value.
28811          */
28812         uint8_t led0_group_id;
28813         /* Reserved field. */
28814         uint8_t rsvd0;
28815         /* An identifier for the LED #1. */
28816         uint8_t led1_id;
28817         /* The requested state of the LED #1. */
28818         uint8_t led1_state;
28819         /* Default state of the LED */
28820         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
28821         /* Off */
28822         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF      UINT32_C(0x1)
28823         /* On */
28824         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON       UINT32_C(0x2)
28825         /* Blink */
28826         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK    UINT32_C(0x3)
28827         /* Blink Alternately */
28828         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
28829         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST \
28830                 HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
28831         /* The requested color of LED #1. */
28832         uint8_t led1_color;
28833         /* Default */
28834         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
28835         /* Amber */
28836         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
28837         /* Green */
28838         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
28839         /* Green or Amber */
28840         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
28841         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST \
28842                 HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
28843         uint8_t unused_1;
28844         /*
28845          * If the LED #1 state is "blink" or "blinkalt", then
28846          * this field represents the requested time in milliseconds
28847          * to keep LED on between cycles.
28848          */
28849         uint16_t        led1_blink_on;
28850         /*
28851          * If the LED #1 state is "blink" or "blinkalt", then
28852          * this field represents the requested time in milliseconds
28853          * to keep LED off between cycles.
28854          */
28855         uint16_t        led1_blink_off;
28856         /*
28857          * An identifier for the group of LEDs that LED #1 belongs
28858          * to.
28859          * If set to 0, then the LED #1 shall not be grouped and
28860          * shall be treated as an individual resource.
28861          * For all other non-zero values of this field, LED #1 shall
28862          * be grouped together with the LEDs with the same group ID
28863          * value.
28864          */
28865         uint8_t led1_group_id;
28866         /* Reserved field. */
28867         uint8_t rsvd1;
28868         /* An identifier for the LED #2. */
28869         uint8_t led2_id;
28870         /* The requested state of the LED #2. */
28871         uint8_t led2_state;
28872         /* Default state of the LED */
28873         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
28874         /* Off */
28875         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF      UINT32_C(0x1)
28876         /* On */
28877         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON       UINT32_C(0x2)
28878         /* Blink */
28879         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK    UINT32_C(0x3)
28880         /* Blink Alternately */
28881         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
28882         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST \
28883                 HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
28884         /* The requested color of LED #2. */
28885         uint8_t led2_color;
28886         /* Default */
28887         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
28888         /* Amber */
28889         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
28890         /* Green */
28891         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
28892         /* Green or Amber */
28893         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
28894         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST \
28895                 HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
28896         uint8_t unused_2;
28897         /*
28898          * If the LED #2 state is "blink" or "blinkalt", then
28899          * this field represents the requested time in milliseconds
28900          * to keep LED on between cycles.
28901          */
28902         uint16_t        led2_blink_on;
28903         /*
28904          * If the LED #2 state is "blink" or "blinkalt", then
28905          * this field represents the requested time in milliseconds
28906          * to keep LED off between cycles.
28907          */
28908         uint16_t        led2_blink_off;
28909         /*
28910          * An identifier for the group of LEDs that LED #2 belongs
28911          * to.
28912          * If set to 0, then the LED #2 shall not be grouped and
28913          * shall be treated as an individual resource.
28914          * For all other non-zero values of this field, LED #2 shall
28915          * be grouped together with the LEDs with the same group ID
28916          * value.
28917          */
28918         uint8_t led2_group_id;
28919         /* Reserved field. */
28920         uint8_t rsvd2;
28921         /* An identifier for the LED #3. */
28922         uint8_t led3_id;
28923         /* The requested state of the LED #3. */
28924         uint8_t led3_state;
28925         /* Default state of the LED */
28926         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
28927         /* Off */
28928         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF      UINT32_C(0x1)
28929         /* On */
28930         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON       UINT32_C(0x2)
28931         /* Blink */
28932         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK    UINT32_C(0x3)
28933         /* Blink Alternately */
28934         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
28935         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST \
28936                 HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
28937         /* The requested color of LED #3. */
28938         uint8_t led3_color;
28939         /* Default */
28940         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
28941         /* Amber */
28942         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
28943         /* Green */
28944         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
28945         /* Green or Amber */
28946         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
28947         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST \
28948                 HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
28949         uint8_t unused_3;
28950         /*
28951          * If the LED #3 state is "blink" or "blinkalt", then
28952          * this field represents the requested time in milliseconds
28953          * to keep LED on between cycles.
28954          */
28955         uint16_t        led3_blink_on;
28956         /*
28957          * If the LED #3 state is "blink" or "blinkalt", then
28958          * this field represents the requested time in milliseconds
28959          * to keep LED off between cycles.
28960          */
28961         uint16_t        led3_blink_off;
28962         /*
28963          * An identifier for the group of LEDs that LED #3 belongs
28964          * to.
28965          * If set to 0, then the LED #3 shall not be grouped and
28966          * shall be treated as an individual resource.
28967          * For all other non-zero values of this field, LED #3 shall
28968          * be grouped together with the LEDs with the same group ID
28969          * value.
28970          */
28971         uint8_t led3_group_id;
28972         /* Reserved field. */
28973         uint8_t rsvd3;
28974 } __rte_packed;
28975
28976 /* hwrm_port_led_cfg_output (size:128b/16B) */
28977 struct hwrm_port_led_cfg_output {
28978         /* The specific error status for the command. */
28979         uint16_t        error_code;
28980         /* The HWRM command request type. */
28981         uint16_t        req_type;
28982         /* The sequence ID from the original command. */
28983         uint16_t        seq_id;
28984         /* The length of the response data in number of bytes. */
28985         uint16_t        resp_len;
28986         uint8_t unused_0[7];
28987         /*
28988          * This field is used in Output records to indicate that the output
28989          * is completely written to RAM.  This field should be read as '1'
28990          * to indicate that the output has been completely written.
28991          * When writing a command completion or response to an internal processor,
28992          * the order of writes has to be such that this field is written last.
28993          */
28994         uint8_t valid;
28995 } __rte_packed;
28996
28997 /**********************
28998  * hwrm_port_led_qcfg *
28999  **********************/
29000
29001
29002 /* hwrm_port_led_qcfg_input (size:192b/24B) */
29003 struct hwrm_port_led_qcfg_input {
29004         /* The HWRM command request type. */
29005         uint16_t        req_type;
29006         /*
29007          * The completion ring to send the completion event on. This should
29008          * be the NQ ID returned from the `nq_alloc` HWRM command.
29009          */
29010         uint16_t        cmpl_ring;
29011         /*
29012          * The sequence ID is used by the driver for tracking multiple
29013          * commands. This ID is treated as opaque data by the firmware and
29014          * the value is returned in the `hwrm_resp_hdr` upon completion.
29015          */
29016         uint16_t        seq_id;
29017         /*
29018          * The target ID of the command:
29019          * * 0x0-0xFFF8 - The function ID
29020          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29021          * * 0xFFFD - Reserved for user-space HWRM interface
29022          * * 0xFFFF - HWRM
29023          */
29024         uint16_t        target_id;
29025         /*
29026          * A physical address pointer pointing to a host buffer that the
29027          * command's response data will be written. This can be either a host
29028          * physical address (HPA) or a guest physical address (GPA) and must
29029          * point to a physically contiguous block of memory.
29030          */
29031         uint64_t        resp_addr;
29032         /* Port ID of port whose LED configuration is being queried. */
29033         uint16_t        port_id;
29034         uint8_t unused_0[6];
29035 } __rte_packed;
29036
29037 /* hwrm_port_led_qcfg_output (size:448b/56B) */
29038 struct hwrm_port_led_qcfg_output {
29039         /* The specific error status for the command. */
29040         uint16_t        error_code;
29041         /* The HWRM command request type. */
29042         uint16_t        req_type;
29043         /* The sequence ID from the original command. */
29044         uint16_t        seq_id;
29045         /* The length of the response data in number of bytes. */
29046         uint16_t        resp_len;
29047         /*
29048          * The number of LEDs that are configured on this port.
29049          * Up to 4 LEDs can be returned in the response.
29050          */
29051         uint8_t num_leds;
29052         /* An identifier for the LED #0. */
29053         uint8_t led0_id;
29054         /* The type of LED #0. */
29055         uint8_t led0_type;
29056         /* Speed LED */
29057         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
29058         /* Activity LED */
29059         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
29060         /* Invalid */
29061         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
29062         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST \
29063                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
29064         /* The current state of the LED #0. */
29065         uint8_t led0_state;
29066         /* Default state of the LED */
29067         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
29068         /* Off */
29069         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF      UINT32_C(0x1)
29070         /* On */
29071         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON       UINT32_C(0x2)
29072         /* Blink */
29073         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK    UINT32_C(0x3)
29074         /* Blink Alternately */
29075         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
29076         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST \
29077                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
29078         /* The color of LED #0. */
29079         uint8_t led0_color;
29080         /* Default */
29081         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
29082         /* Amber */
29083         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
29084         /* Green */
29085         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
29086         /* Green or Amber */
29087         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
29088         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST \
29089                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
29090         uint8_t unused_0;
29091         /*
29092          * If the LED #0 state is "blink" or "blinkalt", then
29093          * this field represents the requested time in milliseconds
29094          * to keep LED on between cycles.
29095          */
29096         uint16_t        led0_blink_on;
29097         /*
29098          * If the LED #0 state is "blink" or "blinkalt", then
29099          * this field represents the requested time in milliseconds
29100          * to keep LED off between cycles.
29101          */
29102         uint16_t        led0_blink_off;
29103         /*
29104          * An identifier for the group of LEDs that LED #0 belongs
29105          * to.
29106          * If set to 0, then the LED #0 is not grouped.
29107          * For all other non-zero values of this field, LED #0 is
29108          * grouped together with the LEDs with the same group ID
29109          * value.
29110          */
29111         uint8_t led0_group_id;
29112         /* An identifier for the LED #1. */
29113         uint8_t led1_id;
29114         /* The type of LED #1. */
29115         uint8_t led1_type;
29116         /* Speed LED */
29117         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
29118         /* Activity LED */
29119         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
29120         /* Invalid */
29121         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
29122         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST \
29123                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
29124         /* The current state of the LED #1. */
29125         uint8_t led1_state;
29126         /* Default state of the LED */
29127         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
29128         /* Off */
29129         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF      UINT32_C(0x1)
29130         /* On */
29131         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON       UINT32_C(0x2)
29132         /* Blink */
29133         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK    UINT32_C(0x3)
29134         /* Blink Alternately */
29135         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
29136         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST \
29137                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
29138         /* The color of LED #1. */
29139         uint8_t led1_color;
29140         /* Default */
29141         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
29142         /* Amber */
29143         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
29144         /* Green */
29145         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
29146         /* Green or Amber */
29147         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
29148         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST \
29149                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
29150         uint8_t unused_1;
29151         /*
29152          * If the LED #1 state is "blink" or "blinkalt", then
29153          * this field represents the requested time in milliseconds
29154          * to keep LED on between cycles.
29155          */
29156         uint16_t        led1_blink_on;
29157         /*
29158          * If the LED #1 state is "blink" or "blinkalt", then
29159          * this field represents the requested time in milliseconds
29160          * to keep LED off between cycles.
29161          */
29162         uint16_t        led1_blink_off;
29163         /*
29164          * An identifier for the group of LEDs that LED #1 belongs
29165          * to.
29166          * If set to 0, then the LED #1 is not grouped.
29167          * For all other non-zero values of this field, LED #1 is
29168          * grouped together with the LEDs with the same group ID
29169          * value.
29170          */
29171         uint8_t led1_group_id;
29172         /* An identifier for the LED #2. */
29173         uint8_t led2_id;
29174         /* The type of LED #2. */
29175         uint8_t led2_type;
29176         /* Speed LED */
29177         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
29178         /* Activity LED */
29179         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
29180         /* Invalid */
29181         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
29182         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST \
29183                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
29184         /* The current state of the LED #2. */
29185         uint8_t led2_state;
29186         /* Default state of the LED */
29187         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
29188         /* Off */
29189         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF      UINT32_C(0x1)
29190         /* On */
29191         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON       UINT32_C(0x2)
29192         /* Blink */
29193         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK    UINT32_C(0x3)
29194         /* Blink Alternately */
29195         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
29196         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST \
29197                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
29198         /* The color of LED #2. */
29199         uint8_t led2_color;
29200         /* Default */
29201         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
29202         /* Amber */
29203         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
29204         /* Green */
29205         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
29206         /* Green or Amber */
29207         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
29208         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST \
29209                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
29210         uint8_t unused_2;
29211         /*
29212          * If the LED #2 state is "blink" or "blinkalt", then
29213          * this field represents the requested time in milliseconds
29214          * to keep LED on between cycles.
29215          */
29216         uint16_t        led2_blink_on;
29217         /*
29218          * If the LED #2 state is "blink" or "blinkalt", then
29219          * this field represents the requested time in milliseconds
29220          * to keep LED off between cycles.
29221          */
29222         uint16_t        led2_blink_off;
29223         /*
29224          * An identifier for the group of LEDs that LED #2 belongs
29225          * to.
29226          * If set to 0, then the LED #2 is not grouped.
29227          * For all other non-zero values of this field, LED #2 is
29228          * grouped together with the LEDs with the same group ID
29229          * value.
29230          */
29231         uint8_t led2_group_id;
29232         /* An identifier for the LED #3. */
29233         uint8_t led3_id;
29234         /* The type of LED #3. */
29235         uint8_t led3_type;
29236         /* Speed LED */
29237         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
29238         /* Activity LED */
29239         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
29240         /* Invalid */
29241         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
29242         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST \
29243                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
29244         /* The current state of the LED #3. */
29245         uint8_t led3_state;
29246         /* Default state of the LED */
29247         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
29248         /* Off */
29249         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF      UINT32_C(0x1)
29250         /* On */
29251         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON       UINT32_C(0x2)
29252         /* Blink */
29253         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK    UINT32_C(0x3)
29254         /* Blink Alternately */
29255         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
29256         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST \
29257                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
29258         /* The color of LED #3. */
29259         uint8_t led3_color;
29260         /* Default */
29261         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
29262         /* Amber */
29263         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
29264         /* Green */
29265         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
29266         /* Green or Amber */
29267         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
29268         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST \
29269                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
29270         uint8_t unused_3;
29271         /*
29272          * If the LED #3 state is "blink" or "blinkalt", then
29273          * this field represents the requested time in milliseconds
29274          * to keep LED on between cycles.
29275          */
29276         uint16_t        led3_blink_on;
29277         /*
29278          * If the LED #3 state is "blink" or "blinkalt", then
29279          * this field represents the requested time in milliseconds
29280          * to keep LED off between cycles.
29281          */
29282         uint16_t        led3_blink_off;
29283         /*
29284          * An identifier for the group of LEDs that LED #3 belongs
29285          * to.
29286          * If set to 0, then the LED #3 is not grouped.
29287          * For all other non-zero values of this field, LED #3 is
29288          * grouped together with the LEDs with the same group ID
29289          * value.
29290          */
29291         uint8_t led3_group_id;
29292         uint8_t unused_4[6];
29293         /*
29294          * This field is used in Output records to indicate that the output
29295          * is completely written to RAM.  This field should be read as '1'
29296          * to indicate that the output has been completely written.
29297          * When writing a command completion or response to an internal processor,
29298          * the order of writes has to be such that this field is written last.
29299          */
29300         uint8_t valid;
29301 } __rte_packed;
29302
29303 /***********************
29304  * hwrm_port_led_qcaps *
29305  ***********************/
29306
29307
29308 /* hwrm_port_led_qcaps_input (size:192b/24B) */
29309 struct hwrm_port_led_qcaps_input {
29310         /* The HWRM command request type. */
29311         uint16_t        req_type;
29312         /*
29313          * The completion ring to send the completion event on. This should
29314          * be the NQ ID returned from the `nq_alloc` HWRM command.
29315          */
29316         uint16_t        cmpl_ring;
29317         /*
29318          * The sequence ID is used by the driver for tracking multiple
29319          * commands. This ID is treated as opaque data by the firmware and
29320          * the value is returned in the `hwrm_resp_hdr` upon completion.
29321          */
29322         uint16_t        seq_id;
29323         /*
29324          * The target ID of the command:
29325          * * 0x0-0xFFF8 - The function ID
29326          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29327          * * 0xFFFD - Reserved for user-space HWRM interface
29328          * * 0xFFFF - HWRM
29329          */
29330         uint16_t        target_id;
29331         /*
29332          * A physical address pointer pointing to a host buffer that the
29333          * command's response data will be written. This can be either a host
29334          * physical address (HPA) or a guest physical address (GPA) and must
29335          * point to a physically contiguous block of memory.
29336          */
29337         uint64_t        resp_addr;
29338         /* Port ID of port whose LED configuration is being queried. */
29339         uint16_t        port_id;
29340         uint8_t unused_0[6];
29341 } __rte_packed;
29342
29343 /* hwrm_port_led_qcaps_output (size:384b/48B) */
29344 struct hwrm_port_led_qcaps_output {
29345         /* The specific error status for the command. */
29346         uint16_t        error_code;
29347         /* The HWRM command request type. */
29348         uint16_t        req_type;
29349         /* The sequence ID from the original command. */
29350         uint16_t        seq_id;
29351         /* The length of the response data in number of bytes. */
29352         uint16_t        resp_len;
29353         /*
29354          * The number of LEDs that are configured on this port.
29355          * Up to 4 LEDs can be returned in the response.
29356          */
29357         uint8_t num_leds;
29358         /* Reserved for future use. */
29359         uint8_t unused[3];
29360         /* An identifier for the LED #0. */
29361         uint8_t led0_id;
29362         /* The type of LED #0. */
29363         uint8_t led0_type;
29364         /* Speed LED */
29365         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
29366         /* Activity LED */
29367         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
29368         /* Invalid */
29369         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
29370         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST \
29371                 HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
29372         /*
29373          * An identifier for the group of LEDs that LED #0 belongs
29374          * to.
29375          * If set to 0, then the LED #0 cannot be grouped.
29376          * For all other non-zero values of this field, LED #0 is
29377          * grouped together with the LEDs with the same group ID
29378          * value.
29379          */
29380         uint8_t led0_group_id;
29381         uint8_t unused_0;
29382         /* The states supported by LED #0. */
29383         uint16_t        led0_state_caps;
29384         /*
29385          * If set to 1, this LED is enabled.
29386          * If set to 0, this LED is disabled.
29387          */
29388         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED \
29389                 UINT32_C(0x1)
29390         /*
29391          * If set to 1, off state is supported on this LED.
29392          * If set to 0, off state is not supported on this LED.
29393          */
29394         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \
29395                 UINT32_C(0x2)
29396         /*
29397          * If set to 1, on state is supported on this LED.
29398          * If set to 0, on state is not supported on this LED.
29399          */
29400         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \
29401                 UINT32_C(0x4)
29402         /*
29403          * If set to 1, blink state is supported on this LED.
29404          * If set to 0, blink state is not supported on this LED.
29405          */
29406         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \
29407                 UINT32_C(0x8)
29408         /*
29409          * If set to 1, blink_alt state is supported on this LED.
29410          * If set to 0, blink_alt state is not supported on this LED.
29411          */
29412         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \
29413                 UINT32_C(0x10)
29414         /* The colors supported by LED #0. */
29415         uint16_t        led0_color_caps;
29416         /* reserved. */
29417         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD \
29418                 UINT32_C(0x1)
29419         /*
29420          * If set to 1, Amber color is supported on this LED.
29421          * If set to 0, Amber color is not supported on this LED.
29422          */
29423         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \
29424                 UINT32_C(0x2)
29425         /*
29426          * If set to 1, Green color is supported on this LED.
29427          * If set to 0, Green color is not supported on this LED.
29428          */
29429         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \
29430                 UINT32_C(0x4)
29431         /* An identifier for the LED #1. */
29432         uint8_t led1_id;
29433         /* The type of LED #1. */
29434         uint8_t led1_type;
29435         /* Speed LED */
29436         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
29437         /* Activity LED */
29438         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
29439         /* Invalid */
29440         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
29441         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST \
29442                 HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
29443         /*
29444          * An identifier for the group of LEDs that LED #1 belongs
29445          * to.
29446          * If set to 0, then the LED #0 cannot be grouped.
29447          * For all other non-zero values of this field, LED #0 is
29448          * grouped together with the LEDs with the same group ID
29449          * value.
29450          */
29451         uint8_t led1_group_id;
29452         uint8_t unused_1;
29453         /* The states supported by LED #1. */
29454         uint16_t        led1_state_caps;
29455         /*
29456          * If set to 1, this LED is enabled.
29457          * If set to 0, this LED is disabled.
29458          */
29459         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED \
29460                 UINT32_C(0x1)
29461         /*
29462          * If set to 1, off state is supported on this LED.
29463          * If set to 0, off state is not supported on this LED.
29464          */
29465         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \
29466                 UINT32_C(0x2)
29467         /*
29468          * If set to 1, on state is supported on this LED.
29469          * If set to 0, on state is not supported on this LED.
29470          */
29471         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \
29472                 UINT32_C(0x4)
29473         /*
29474          * If set to 1, blink state is supported on this LED.
29475          * If set to 0, blink state is not supported on this LED.
29476          */
29477         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \
29478                 UINT32_C(0x8)
29479         /*
29480          * If set to 1, blink_alt state is supported on this LED.
29481          * If set to 0, blink_alt state is not supported on this LED.
29482          */
29483         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \
29484                 UINT32_C(0x10)
29485         /* The colors supported by LED #1. */
29486         uint16_t        led1_color_caps;
29487         /* reserved. */
29488         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD \
29489                 UINT32_C(0x1)
29490         /*
29491          * If set to 1, Amber color is supported on this LED.
29492          * If set to 0, Amber color is not supported on this LED.
29493          */
29494         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \
29495                 UINT32_C(0x2)
29496         /*
29497          * If set to 1, Green color is supported on this LED.
29498          * If set to 0, Green color is not supported on this LED.
29499          */
29500         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \
29501                 UINT32_C(0x4)
29502         /* An identifier for the LED #2. */
29503         uint8_t led2_id;
29504         /* The type of LED #2. */
29505         uint8_t led2_type;
29506         /* Speed LED */
29507         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
29508         /* Activity LED */
29509         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
29510         /* Invalid */
29511         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
29512         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST \
29513                 HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
29514         /*
29515          * An identifier for the group of LEDs that LED #0 belongs
29516          * to.
29517          * If set to 0, then the LED #0 cannot be grouped.
29518          * For all other non-zero values of this field, LED #0 is
29519          * grouped together with the LEDs with the same group ID
29520          * value.
29521          */
29522         uint8_t led2_group_id;
29523         uint8_t unused_2;
29524         /* The states supported by LED #2. */
29525         uint16_t        led2_state_caps;
29526         /*
29527          * If set to 1, this LED is enabled.
29528          * If set to 0, this LED is disabled.
29529          */
29530         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED \
29531                 UINT32_C(0x1)
29532         /*
29533          * If set to 1, off state is supported on this LED.
29534          * If set to 0, off state is not supported on this LED.
29535          */
29536         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \
29537                 UINT32_C(0x2)
29538         /*
29539          * If set to 1, on state is supported on this LED.
29540          * If set to 0, on state is not supported on this LED.
29541          */
29542         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \
29543                 UINT32_C(0x4)
29544         /*
29545          * If set to 1, blink state is supported on this LED.
29546          * If set to 0, blink state is not supported on this LED.
29547          */
29548         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \
29549                 UINT32_C(0x8)
29550         /*
29551          * If set to 1, blink_alt state is supported on this LED.
29552          * If set to 0, blink_alt state is not supported on this LED.
29553          */
29554         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \
29555                 UINT32_C(0x10)
29556         /* The colors supported by LED #2. */
29557         uint16_t        led2_color_caps;
29558         /* reserved. */
29559         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD \
29560                 UINT32_C(0x1)
29561         /*
29562          * If set to 1, Amber color is supported on this LED.
29563          * If set to 0, Amber color is not supported on this LED.
29564          */
29565         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \
29566                 UINT32_C(0x2)
29567         /*
29568          * If set to 1, Green color is supported on this LED.
29569          * If set to 0, Green color is not supported on this LED.
29570          */
29571         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \
29572                 UINT32_C(0x4)
29573         /* An identifier for the LED #3. */
29574         uint8_t led3_id;
29575         /* The type of LED #3. */
29576         uint8_t led3_type;
29577         /* Speed LED */
29578         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
29579         /* Activity LED */
29580         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
29581         /* Invalid */
29582         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
29583         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST \
29584                 HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
29585         /*
29586          * An identifier for the group of LEDs that LED #3 belongs
29587          * to.
29588          * If set to 0, then the LED #0 cannot be grouped.
29589          * For all other non-zero values of this field, LED #0 is
29590          * grouped together with the LEDs with the same group ID
29591          * value.
29592          */
29593         uint8_t led3_group_id;
29594         uint8_t unused_3;
29595         /* The states supported by LED #3. */
29596         uint16_t        led3_state_caps;
29597         /*
29598          * If set to 1, this LED is enabled.
29599          * If set to 0, this LED is disabled.
29600          */
29601         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED \
29602                 UINT32_C(0x1)
29603         /*
29604          * If set to 1, off state is supported on this LED.
29605          * If set to 0, off state is not supported on this LED.
29606          */
29607         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \
29608                 UINT32_C(0x2)
29609         /*
29610          * If set to 1, on state is supported on this LED.
29611          * If set to 0, on state is not supported on this LED.
29612          */
29613         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \
29614                 UINT32_C(0x4)
29615         /*
29616          * If set to 1, blink state is supported on this LED.
29617          * If set to 0, blink state is not supported on this LED.
29618          */
29619         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \
29620                 UINT32_C(0x8)
29621         /*
29622          * If set to 1, blink_alt state is supported on this LED.
29623          * If set to 0, blink_alt state is not supported on this LED.
29624          */
29625         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \
29626                 UINT32_C(0x10)
29627         /* The colors supported by LED #3. */
29628         uint16_t        led3_color_caps;
29629         /* reserved. */
29630         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD \
29631                 UINT32_C(0x1)
29632         /*
29633          * If set to 1, Amber color is supported on this LED.
29634          * If set to 0, Amber color is not supported on this LED.
29635          */
29636         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \
29637                 UINT32_C(0x2)
29638         /*
29639          * If set to 1, Green color is supported on this LED.
29640          * If set to 0, Green color is not supported on this LED.
29641          */
29642         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \
29643                 UINT32_C(0x4)
29644         uint8_t unused_4[3];
29645         /*
29646          * This field is used in Output records to indicate that the output
29647          * is completely written to RAM.  This field should be read as '1'
29648          * to indicate that the output has been completely written.
29649          * When writing a command completion or response to an internal processor,
29650          * the order of writes has to be such that this field is written last.
29651          */
29652         uint8_t valid;
29653 } __rte_packed;
29654
29655 /***********************
29656  * hwrm_port_prbs_test *
29657  ***********************/
29658
29659
29660 /* hwrm_port_prbs_test_input (size:384b/48B) */
29661 struct hwrm_port_prbs_test_input {
29662         /* The HWRM command request type. */
29663         uint16_t        req_type;
29664         /*
29665          * The completion ring to send the completion event on. This should
29666          * be the NQ ID returned from the `nq_alloc` HWRM command.
29667          */
29668         uint16_t        cmpl_ring;
29669         /*
29670          * The sequence ID is used by the driver for tracking multiple
29671          * commands. This ID is treated as opaque data by the firmware and
29672          * the value is returned in the `hwrm_resp_hdr` upon completion.
29673          */
29674         uint16_t        seq_id;
29675         /*
29676          * The target ID of the command:
29677          * * 0x0-0xFFF8 - The function ID
29678          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29679          * * 0xFFFD - Reserved for user-space HWRM interface
29680          * * 0xFFFF - HWRM
29681          */
29682         uint16_t        target_id;
29683         /*
29684          * A physical address pointer pointing to a host buffer that the
29685          * command's response data will be written. This can be either a host
29686          * physical address (HPA) or a guest physical address (GPA) and must
29687          * point to a physically contiguous block of memory.
29688          */
29689         uint64_t        resp_addr;
29690         /* Host address data is to DMA'd to. */
29691         uint64_t        resp_data_addr;
29692         /*
29693          * Size of the buffer pointed to by resp_data_addr. The firmware may
29694          * use this entire buffer or less than the entire buffer, but never more.
29695          */
29696         uint16_t        data_len;
29697         uint16_t        flags;
29698         /*
29699          * If set, the port_id field should be interpreted as an internal
29700          * port. The internal port id range is returned in port_phy_qcaps
29701          * response internal_port_cnt field.
29702          */
29703         #define HWRM_PORT_PRBS_TEST_INPUT_FLAGS_INTERNAL     UINT32_C(0x1)
29704         uint32_t        unused_1;
29705         /* Port ID of port where PRBS test to be run. */
29706         uint16_t        port_id;
29707         /* Polynomial selection for PRBS test. */
29708         uint16_t        poly;
29709         /* PRBS7 */
29710         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS7   UINT32_C(0x0)
29711         /* PRBS9 */
29712         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS9   UINT32_C(0x1)
29713         /* PRBS11 */
29714         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS11  UINT32_C(0x2)
29715         /* PRBS15 */
29716         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS15  UINT32_C(0x3)
29717         /* PRBS23 */
29718         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS23  UINT32_C(0x4)
29719         /* PRBS31 */
29720         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS31  UINT32_C(0x5)
29721         /* PRBS58 */
29722         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS58  UINT32_C(0x6)
29723         /* Invalid */
29724         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID UINT32_C(0xff)
29725         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_LAST \
29726                 HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID
29727         /*
29728          * Configuration bits for PRBS test.
29729          * Use enable bit to start/stop test.
29730          * Use tx/rx lane map bits to run test on specific lanes,
29731          * if set to 0 test will be run on all lanes.
29732          */
29733         uint16_t        prbs_config;
29734         /*
29735          * Set 0 to stop test currently in progress
29736          * Set 1 to start test with configuration provided.
29737          */
29738         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_START_STOP \
29739                 UINT32_C(0x1)
29740         /*
29741          * If set to 1, tx_lane_map bitmap should have lane bits set.
29742          * If set to 0, test will be run on all lanes for this port.
29743          */
29744         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_TX_LANE_MAP_VALID \
29745                 UINT32_C(0x2)
29746         /*
29747          * If set to 1, rx_lane_map bitmap should have lane bits set.
29748          * If set to 0, test will be run on all lanes for this port.
29749          */
29750         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_RX_LANE_MAP_VALID \
29751                 UINT32_C(0x4)
29752         /* Duration in seconds to run the PRBS test. */
29753         uint16_t        timeout;
29754         /*
29755          * If tx_lane_map_valid is set to 1, this field is a bitmap
29756          * of tx lanes to run PRBS test. bit0 = lane0,
29757          * bit1 = lane1 ..bit31 = lane31
29758          */
29759         uint32_t        tx_lane_map;
29760         /*
29761          * If rx_lane_map_valid is set to 1, this field is a bitmap
29762          * of rx lanes to run PRBS test. bit0 = lane0,
29763          * bit1 = lane1 ..bit31 = lane31
29764          */
29765         uint32_t        rx_lane_map;
29766 } __rte_packed;
29767
29768 /* hwrm_port_prbs_test_output (size:128b/16B) */
29769 struct hwrm_port_prbs_test_output {
29770         /* The specific error status for the command. */
29771         uint16_t        error_code;
29772         /* The HWRM command request type. */
29773         uint16_t        req_type;
29774         /* The sequence ID from the original command. */
29775         uint16_t        seq_id;
29776         /* The length of the response data in number of bytes. */
29777         uint16_t        resp_len;
29778         /* Total length of stored data. */
29779         uint16_t        total_data_len;
29780         uint16_t        unused_0;
29781         uint8_t unused_1[3];
29782         /*
29783          * This field is used in Output records to indicate that the output
29784          * is completely written to RAM.  This field should be read as '1'
29785          * to indicate that the output has been completely written.
29786          * When writing a command completion or response to an internal processor,
29787          * the order of writes has to be such that this field is written last.
29788          */
29789         uint8_t valid;
29790 } __rte_packed;
29791
29792 /**********************
29793  * hwrm_port_dsc_dump *
29794  **********************/
29795
29796
29797 /* hwrm_port_dsc_dump_input (size:320b/40B) */
29798 struct hwrm_port_dsc_dump_input {
29799         /* The HWRM command request type. */
29800         uint16_t        req_type;
29801         /*
29802          * The completion ring to send the completion event on. This should
29803          * be the NQ ID returned from the `nq_alloc` HWRM command.
29804          */
29805         uint16_t        cmpl_ring;
29806         /*
29807          * The sequence ID is used by the driver for tracking multiple
29808          * commands. This ID is treated as opaque data by the firmware and
29809          * the value is returned in the `hwrm_resp_hdr` upon completion.
29810          */
29811         uint16_t        seq_id;
29812         /*
29813          * The target ID of the command:
29814          * * 0x0-0xFFF8 - The function ID
29815          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29816          * * 0xFFFD - Reserved for user-space HWRM interface
29817          * * 0xFFFF - HWRM
29818          */
29819         uint16_t        target_id;
29820         /*
29821          * A physical address pointer pointing to a host buffer that the
29822          * command's response data will be written. This can be either a host
29823          * physical address (HPA) or a guest physical address (GPA) and must
29824          * point to a physically contiguous block of memory.
29825          */
29826         uint64_t        resp_addr;
29827         /* Host address where response diagnostic data is returned. */
29828         uint64_t        resp_data_addr;
29829         /*
29830          * Size of the buffer pointed to by resp_data_addr. The firmware
29831          * may use this entire buffer or less than the entire buffer, but
29832          * never more.
29833          */
29834         uint16_t        data_len;
29835         uint16_t        unused_0;
29836         uint32_t        unused_1;
29837         /* Port ID of port where dsc dump to be collected. */
29838         uint16_t        port_id;
29839         /* Diag level specified by the user */
29840         uint16_t        diag_level;
29841         /* SRDS_DIAG_LANE */
29842         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE \
29843                 UINT32_C(0x0)
29844         /* SRDS_DIAG_CORE */
29845         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_CORE \
29846                 UINT32_C(0x1)
29847         /* SRDS_DIAG_EVENT */
29848         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT \
29849                 UINT32_C(0x2)
29850         /* SRDS_DIAG_EYE */
29851         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EYE \
29852                 UINT32_C(0x3)
29853         /* SRDS_DIAG_REG_CORE */
29854         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_CORE \
29855                 UINT32_C(0x4)
29856         /* SRDS_DIAG_REG_LANE */
29857         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_LANE \
29858                 UINT32_C(0x5)
29859         /* SRDS_DIAG_UC_CORE */
29860         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_CORE \
29861                 UINT32_C(0x6)
29862         /* SRDS_DIAG_UC_LANE */
29863         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_LANE \
29864                 UINT32_C(0x7)
29865         /* SRDS_DIAG_LANE_DEBUG */
29866         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE_DEBUG \
29867                 UINT32_C(0x8)
29868         /* SRDS_DIAG_BER_VERT */
29869         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_VERT \
29870                 UINT32_C(0x9)
29871         /* SRDS_DIAG_BER_HORZ */
29872         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_HORZ \
29873                 UINT32_C(0xa)
29874         /* SRDS_DIAG_EVENT_SAFE */
29875         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT_SAFE \
29876                 UINT32_C(0xb)
29877         /* SRDS_DIAG_TIMESTAMP */
29878         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP \
29879                 UINT32_C(0xc)
29880         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_LAST \
29881                 HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP
29882         /*
29883          * This field is a lane number
29884          * on which to collect the dsc dump
29885          */
29886         uint16_t        lane_number;
29887         /*
29888          * Configuration bits.
29889          * Use enable bit to start dsc dump or retrieve dump
29890          */
29891         uint16_t        dsc_dump_config;
29892         /*
29893          * Set 0 to retrieve the dsc dump
29894          * Set 1 to start the dsc dump
29895          */
29896         #define HWRM_PORT_DSC_DUMP_INPUT_DSC_DUMP_CONFIG_START_RETRIEVE \
29897                 UINT32_C(0x1)
29898 } __rte_packed;
29899
29900 /* hwrm_port_dsc_dump_output (size:128b/16B) */
29901 struct hwrm_port_dsc_dump_output {
29902         /* The specific error status for the command. */
29903         uint16_t        error_code;
29904         /* The HWRM command request type. */
29905         uint16_t        req_type;
29906         /* The sequence ID from the original command. */
29907         uint16_t        seq_id;
29908         /* The length of the response data in number of bytes. */
29909         uint16_t        resp_len;
29910         /* Total length of stored data. */
29911         uint16_t        total_data_len;
29912         uint16_t        unused_0;
29913         uint8_t unused_1[3];
29914         /*
29915          * This field is used in Output records to indicate that the output
29916          * is completely written to RAM.  This field should be read as '1'
29917          * to indicate that the output has been completely written.
29918          * When writing a command completion or response to an internal processor,
29919          * the order of writes has to be such that this field is written last.
29920          */
29921         uint8_t valid;
29922 } __rte_packed;
29923
29924 /******************************
29925  * hwrm_port_sfp_sideband_cfg *
29926  ******************************/
29927
29928
29929 /* hwrm_port_sfp_sideband_cfg_input (size:256b/32B) */
29930 struct hwrm_port_sfp_sideband_cfg_input {
29931         /* The HWRM command request type. */
29932         uint16_t        req_type;
29933         /*
29934          * The completion ring to send the completion event on. This should
29935          * be the NQ ID returned from the `nq_alloc` HWRM command.
29936          */
29937         uint16_t        cmpl_ring;
29938         /*
29939          * The sequence ID is used by the driver for tracking multiple
29940          * commands. This ID is treated as opaque data by the firmware and
29941          * the value is returned in the `hwrm_resp_hdr` upon completion.
29942          */
29943         uint16_t        seq_id;
29944         /*
29945          * The target ID of the command:
29946          * * 0x0-0xFFF8 - The function ID
29947          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29948          * * 0xFFFD - Reserved for user-space HWRM interface
29949          * * 0xFFFF - HWRM
29950          */
29951         uint16_t        target_id;
29952         /*
29953          * A physical address pointer pointing to a host buffer that the
29954          * command's response data will be written. This can be either a host
29955          * physical address (HPA) or a guest physical address (GPA) and must
29956          * point to a physically contiguous block of memory.
29957          */
29958         uint64_t        resp_addr;
29959         /* Port ID of port that is to be queried. */
29960         uint16_t        port_id;
29961         uint8_t unused_0[6];
29962         /*
29963          * This bitfield is used to specify which bits from the 'flags'
29964          * fields are being configured by the caller.
29965          */
29966         uint32_t        enables;
29967         /* This bit must be '1' for rs0 to be configured. */
29968         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS0 \
29969                 UINT32_C(0x1)
29970         /* This bit must be '1' for rs1 to be configured. */
29971         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS1 \
29972                 UINT32_C(0x2)
29973         /* This bit must be '1' for tx_disable to be configured. */
29974         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_TX_DIS \
29975                 UINT32_C(0x4)
29976         /*
29977          * This bit must be '1' for mod_sel to be configured.
29978          * Valid only on QSFP modules
29979          */
29980         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_MOD_SEL \
29981                 UINT32_C(0x8)
29982         /* This bit must be '1' for reset_l to be configured. */
29983         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RESET_L \
29984                 UINT32_C(0x10)
29985         /* This bit must be '1' for lp_mode to be configured. */
29986         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_LP_MODE \
29987                 UINT32_C(0x20)
29988         /* This bit must be '1' for pwr_disable to be configured. */
29989         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_PWR_DIS \
29990                 UINT32_C(0x40)
29991         /*
29992          * Only bits that have corresponding bits in the 'enables'
29993          * bitfield are processed by the firmware, all other bits
29994          * of 'flags' are ignored.
29995          */
29996         uint32_t        flags;
29997         /*
29998          * This bit along with rs1 configures the current speed of the dual
29999          * rate module. If these pins are GNDed then the speed can be changed
30000          * by directly writing to EEPROM.
30001          */
30002         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS0 \
30003                 UINT32_C(0x1)
30004         /*
30005          * This bit along with rs0 configures the current speed of the dual
30006          * rate module. If these pins are GNDed then the speed can be changed
30007          * by directly writing to EEPROM.
30008          */
30009         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS1 \
30010                 UINT32_C(0x2)
30011         /*
30012          * When this bit is set to '1', tx_disable is set.
30013          * On a 1G BASE-T module, if this bit is set,
30014          * module PHY registers will not be accessible.
30015          */
30016         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_TX_DIS \
30017                 UINT32_C(0x4)
30018         /*
30019          * When this bit is set to '1', this module is selected.
30020          * Valid only on QSFP modules
30021          */
30022         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_MOD_SEL \
30023                 UINT32_C(0x8)
30024         /*
30025          * If reset_l is set to 0, Module will be taken out of reset
30026          * and other signals will be set to their requested state once
30027          * the module is out of reset.
30028          * Valid only on QSFP modules
30029          */
30030         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RESET_L \
30031                 UINT32_C(0x10)
30032         /*
30033          * When this bit is set to '1', the module will be configured
30034          * in low power mode.
30035          * Valid only on QSFP modules
30036          */
30037         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_LP_MODE \
30038                 UINT32_C(0x20)
30039         /* When this bit is set to '1', the module will be powered down. */
30040         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_PWR_DIS \
30041                 UINT32_C(0x40)
30042 } __rte_packed;
30043
30044 /* hwrm_port_sfp_sideband_cfg_output (size:128b/16B) */
30045 struct hwrm_port_sfp_sideband_cfg_output {
30046         /* The specific error status for the command. */
30047         uint16_t        error_code;
30048         /* The HWRM command request type. */
30049         uint16_t        req_type;
30050         /* The sequence ID from the original command. */
30051         uint16_t        seq_id;
30052         /* The length of the response data in number of bytes. */
30053         uint16_t        resp_len;
30054         uint8_t unused[7];
30055         /*
30056          * This field is used in Output records to indicate that the output
30057          * is completely written to RAM.  This field should be read as '1'
30058          * to indicate that the output has been completely written. When
30059          * writing a command completion or response to an internal processor,
30060          * the order of writes has to be such that this field is written last.
30061          */
30062         uint8_t valid;
30063 } __rte_packed;
30064
30065 /*******************************
30066  * hwrm_port_sfp_sideband_qcfg *
30067  *******************************/
30068
30069
30070 /* hwrm_port_sfp_sideband_qcfg_input (size:192b/24B) */
30071 struct hwrm_port_sfp_sideband_qcfg_input {
30072         /* The HWRM command request type. */
30073         uint16_t        req_type;
30074         /*
30075          * The completion ring to send the completion event on. This should
30076          * be the NQ ID returned from the `nq_alloc` HWRM command.
30077          */
30078         uint16_t        cmpl_ring;
30079         /*
30080          * The sequence ID is used by the driver for tracking multiple
30081          * commands. This ID is treated as opaque data by the firmware and
30082          * the value is returned in the `hwrm_resp_hdr` upon completion.
30083          */
30084         uint16_t        seq_id;
30085         /*
30086          * The target ID of the command:
30087          * * 0x0-0xFFF8 - The function ID
30088          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30089          * * 0xFFFD - Reserved for user-space HWRM interface
30090          * * 0xFFFF - HWRM
30091          */
30092         uint16_t        target_id;
30093         /*
30094          * A physical address pointer pointing to a host buffer that the
30095          * command's response data will be written. This can be either a host
30096          * physical address (HPA) or a guest physical address (GPA) and must
30097          * point to a physically contiguous block of memory.
30098          */
30099         uint64_t        resp_addr;
30100         /* Port ID of port that is to be queried. */
30101         uint16_t        port_id;
30102         uint8_t unused_0[6];
30103 } __rte_packed;
30104
30105 /* hwrm_port_sfp_sideband_qcfg_output (size:192b/24B) */
30106 struct hwrm_port_sfp_sideband_qcfg_output {
30107         /* The specific error status for the command. */
30108         uint16_t        error_code;
30109         /* The HWRM command request type. */
30110         uint16_t        req_type;
30111         /* The sequence ID from the original command. */
30112         uint16_t        seq_id;
30113         /* The length of the response data in number of bytes. */
30114         uint16_t        resp_len;
30115         /*
30116          * Bitmask indicating which sideband signals are valid.
30117          * This is based on the board and nvm cfg that is present on the board.
30118          */
30119         uint32_t        supported_mask;
30120         uint32_t        sideband_signals;
30121         /* When this bit is set to '1', the Module is absent. */
30122         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_ABS \
30123                 UINT32_C(0x1)
30124         /*
30125          * When this bit is set to '1', there is no valid signal on RX.
30126          * This signal is a filtered version of Signal Detect.
30127          */
30128         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RX_LOS \
30129                 UINT32_C(0x2)
30130         /*
30131          * This bit along with rs1 indicates the current speed of the dual
30132          * rate module.If these pins are grounded then the speed can be
30133          * changed by directly writing to EEPROM.
30134          */
30135         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS0 \
30136                 UINT32_C(0x4)
30137         /*
30138          * This bit along with rs0 indicates the current speed of the dual
30139          * rate module.If these pins are grounded then the speed can be
30140          * changed by directly writing to EEPROM.
30141          */
30142         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS1 \
30143                 UINT32_C(0x8)
30144         /*
30145          * When this bit is set to '1', tx_disable is set.
30146          * On a 1G BASE-T module, if this bit is set, module PHY
30147          * registers will not be accessible.
30148          */
30149         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_DIS \
30150                 UINT32_C(0x10)
30151         /* When this bit is set to '1', tx_fault is set. */
30152         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_FAULT \
30153                 UINT32_C(0x20)
30154         /*
30155          * When this bit is set to '1', module is selected.
30156          * Valid only on QSFP modules
30157          */
30158         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_SEL \
30159                 UINT32_C(0x40)
30160         /*
30161          * When this bit is set to '0', the module is held in reset.
30162          * if reset_l is set to 1,first module is taken out of reset
30163          * and other signals will be set to their requested state.
30164          * Valid only on QSFP modules.
30165          */
30166         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RESET_L \
30167                 UINT32_C(0x80)
30168         /*
30169          * When this bit is set to '1', the module is in low power mode.
30170          * Valid only on QSFP modules
30171          */
30172         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_LP_MODE \
30173                 UINT32_C(0x100)
30174         /* When this bit is set to '1', module is in power down state. */
30175         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_PWR_DIS \
30176                 UINT32_C(0x200)
30177         uint8_t unused[7];
30178         /*
30179          * This field is used in Output records to indicate that the output
30180          * is completely written to RAM.  This field should be read as '1'
30181          * to indicate that the output has been completely written. When
30182          * writing a command completion or response to an internal processor,
30183          * the order of writes has to be such that this field is written last.
30184          */
30185         uint8_t valid;
30186 } __rte_packed;
30187
30188 /**********************************
30189  * hwrm_port_phy_mdio_bus_acquire *
30190  **********************************/
30191
30192
30193 /* hwrm_port_phy_mdio_bus_acquire_input (size:192b/24B) */
30194 struct hwrm_port_phy_mdio_bus_acquire_input {
30195         /* The HWRM command request type. */
30196         uint16_t        req_type;
30197         /*
30198          * The completion ring to send the completion event on. This should
30199          * be the NQ ID returned from the `nq_alloc` HWRM command.
30200          */
30201         uint16_t        cmpl_ring;
30202         /*
30203          * The sequence ID is used by the driver for tracking multiple
30204          * commands. This ID is treated as opaque data by the firmware and
30205          * the value is returned in the `hwrm_resp_hdr` upon completion.
30206          */
30207         uint16_t        seq_id;
30208         /*
30209          * The target ID of the command:
30210          * * 0x0-0xFFF8 - The function ID
30211          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30212          * * 0xFFFD - Reserved for user-space HWRM interface
30213          * * 0xFFFF - HWRM
30214          */
30215         uint16_t        target_id;
30216         /*
30217          * A physical address pointer pointing to a host buffer that the
30218          * command's response data will be written. This can be either a host
30219          * physical address (HPA) or a guest physical address (GPA) and must
30220          * point to a physically contiguous block of memory.
30221          */
30222         uint64_t        resp_addr;
30223         /* Port ID of the port. */
30224         uint16_t        port_id;
30225         /*
30226          * client_id of the client requesting BUS access.
30227          * Any value from 0x10 to 0xFFFF can be used.
30228          * Client should make sure that the returned client_id
30229          * in response matches the client_id in request.
30230          * 0-0xF are reserved for internal use.
30231          */
30232         uint16_t        client_id;
30233         /*
30234          * Timeout in milli seconds, MDIO BUS will be released automatically
30235          * after this time, if another mdio acquire command is not received
30236          * within the timeout window from the same client.
30237          * A 0xFFFF will hold the bus until this bus is released.
30238          */
30239         uint16_t        mdio_bus_timeout;
30240         uint8_t unused_0[2];
30241 } __rte_packed;
30242
30243 /* hwrm_port_phy_mdio_bus_acquire_output (size:128b/16B) */
30244 struct hwrm_port_phy_mdio_bus_acquire_output {
30245         /* The specific error status for the command. */
30246         uint16_t        error_code;
30247         /* The HWRM command request type. */
30248         uint16_t        req_type;
30249         /* The sequence ID from the original command. */
30250         uint16_t        seq_id;
30251         /* The length of the response data in number of bytes. */
30252         uint16_t        resp_len;
30253         uint16_t        unused_0;
30254         /*
30255          * client_id of the module holding the BUS.
30256          * 0-0xF are reserved for internal use.
30257          */
30258         uint16_t        client_id;
30259         uint8_t unused_1[3];
30260         /*
30261          * This field is used in Output records to indicate that the output
30262          * is completely written to RAM.  This field should be read as '1'
30263          * to indicate that the output has been completely written.
30264          * When writing a command completion or response to an internal processor,
30265          * the order of writes has to be such that this field is written last.
30266          */
30267         uint8_t valid;
30268 } __rte_packed;
30269
30270 /**********************************
30271  * hwrm_port_phy_mdio_bus_release *
30272  **********************************/
30273
30274
30275 /* hwrm_port_phy_mdio_bus_release_input (size:192b/24B) */
30276 struct hwrm_port_phy_mdio_bus_release_input {
30277         /* The HWRM command request type. */
30278         uint16_t        req_type;
30279         /*
30280          * The completion ring to send the completion event on. This should
30281          * be the NQ ID returned from the `nq_alloc` HWRM command.
30282          */
30283         uint16_t        cmpl_ring;
30284         /*
30285          * The sequence ID is used by the driver for tracking multiple
30286          * commands. This ID is treated as opaque data by the firmware and
30287          * the value is returned in the `hwrm_resp_hdr` upon completion.
30288          */
30289         uint16_t        seq_id;
30290         /*
30291          * The target ID of the command:
30292          * * 0x0-0xFFF8 - The function ID
30293          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30294          * * 0xFFFD - Reserved for user-space HWRM interface
30295          * * 0xFFFF - HWRM
30296          */
30297         uint16_t        target_id;
30298         /*
30299          * A physical address pointer pointing to a host buffer that the
30300          * command's response data will be written. This can be either a host
30301          * physical address (HPA) or a guest physical address (GPA) and must
30302          * point to a physically contiguous block of memory.
30303          */
30304         uint64_t        resp_addr;
30305         /* Port ID of the port. */
30306         uint16_t        port_id;
30307         /*
30308          * client_id of the client requesting BUS release.
30309          * A client should not release any other clients BUS.
30310          */
30311         uint16_t        client_id;
30312         uint8_t unused_0[4];
30313 } __rte_packed;
30314
30315 /* hwrm_port_phy_mdio_bus_release_output (size:128b/16B) */
30316 struct hwrm_port_phy_mdio_bus_release_output {
30317         /* The specific error status for the command. */
30318         uint16_t        error_code;
30319         /* The HWRM command request type. */
30320         uint16_t        req_type;
30321         /* The sequence ID from the original command. */
30322         uint16_t        seq_id;
30323         /* The length of the response data in number of bytes. */
30324         uint16_t        resp_len;
30325         uint16_t        unused_0;
30326         /* The BUS is released if client_id matches the client_id in request. */
30327         uint16_t        clients_id;
30328         uint8_t unused_1[3];
30329         /*
30330          * This field is used in Output records to indicate that the output
30331          * is completely written to RAM.  This field should be read as '1'
30332          * to indicate that the output has been completely written.
30333          * When writing a command completion or response to an internal processor,
30334          * the order of writes has to be such that this field is written last.
30335          */
30336         uint8_t valid;
30337 } __rte_packed;
30338
30339 /************************
30340  * hwrm_port_tx_fir_cfg *
30341  ************************/
30342
30343
30344 /* hwrm_port_tx_fir_cfg_input (size:320b/40B) */
30345 struct hwrm_port_tx_fir_cfg_input {
30346         /* The HWRM command request type. */
30347         uint16_t        req_type;
30348         /*
30349          * The completion ring to send the completion event on. This should
30350          * be the NQ ID returned from the `nq_alloc` HWRM command.
30351          */
30352         uint16_t        cmpl_ring;
30353         /*
30354          * The sequence ID is used by the driver for tracking multiple
30355          * commands. This ID is treated as opaque data by the firmware and
30356          * the value is returned in the `hwrm_resp_hdr` upon completion.
30357          */
30358         uint16_t        seq_id;
30359         /*
30360          * The target ID of the command:
30361          * * 0x0-0xFFF8 - The function ID
30362          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30363          * * 0xFFFD - Reserved for user-space HWRM interface
30364          * * 0xFFFF - HWRM
30365          */
30366         uint16_t        target_id;
30367         /*
30368          * A physical address pointer pointing to a host buffer that the
30369          * command's response data will be written. This can be either a host
30370          * physical address (HPA) or a guest physical address (GPA) and must
30371          * point to a physically contiguous block of memory.
30372          */
30373         uint64_t        resp_addr;
30374         /* Modulation types of TX FIR: NRZ, PAM4. */
30375         uint8_t mod_type;
30376         /* For NRZ */
30377         #define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_NRZ  UINT32_C(0x0)
30378         /* For PAM4 */
30379         #define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_PAM4 UINT32_C(0x1)
30380         #define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_LAST \
30381                 HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_PAM4
30382         /* The lane mask of the lane TX FIR will be configured. */
30383         uint8_t lane_mask;
30384         uint8_t unused_0[2];
30385         /* Value1 of TX FIR, required for NRZ or PAM4. */
30386         uint32_t        txfir_val_1;
30387         /* Value2 of TX FIR, required for NRZ or PAM4. */
30388         uint32_t        txfir_val_2;
30389         /* Value3 of TX FIR, required for PAM4. */
30390         uint32_t        txfir_val_3;
30391         /* Value4 of TX FIR, required for PAM4. */
30392         uint32_t        txfir_val_4;
30393         uint8_t unused_1[4];
30394 } __rte_packed;
30395
30396 /* hwrm_port_tx_fir_cfg_output (size:128b/16B) */
30397 struct hwrm_port_tx_fir_cfg_output {
30398         /* The specific error status for the command. */
30399         uint16_t        error_code;
30400         /* The HWRM command request type. */
30401         uint16_t        req_type;
30402         /* The sequence ID from the original command. */
30403         uint16_t        seq_id;
30404         /* The length of the response data in number of bytes. */
30405         uint16_t        resp_len;
30406         uint8_t unused[7];
30407         /*
30408          * This field is used in Output records to indicate that the output
30409          * is completely written to RAM.  This field should be read as '1'
30410          * to indicate that the output has been completely written.
30411          * When writing a command completion or response to an internal processor,
30412          * the order of writes has to be such that this field is written last.
30413          */
30414         uint8_t valid;
30415 } __rte_packed;
30416
30417 /*************************
30418  * hwrm_port_tx_fir_qcfg *
30419  *************************/
30420
30421
30422 /* hwrm_port_tx_fir_qcfg_input (size:192b/24B) */
30423 struct hwrm_port_tx_fir_qcfg_input {
30424         /* The HWRM command request type. */
30425         uint16_t        req_type;
30426         /*
30427          * The completion ring to send the completion event on. This should
30428          * be the NQ ID returned from the `nq_alloc` HWRM command.
30429          */
30430         uint16_t        cmpl_ring;
30431         /*
30432          * The sequence ID is used by the driver for tracking multiple
30433          * commands. This ID is treated as opaque data by the firmware and
30434          * the value is returned in the `hwrm_resp_hdr` upon completion.
30435          */
30436         uint16_t        seq_id;
30437         /*
30438          * The target ID of the command:
30439          * * 0x0-0xFFF8 - The function ID
30440          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30441          * * 0xFFFD - Reserved for user-space HWRM interface
30442          * * 0xFFFF - HWRM
30443          */
30444         uint16_t        target_id;
30445         /*
30446          * A physical address pointer pointing to a host buffer that the
30447          * command's response data will be written. This can be either a host
30448          * physical address (HPA) or a guest physical address (GPA) and must
30449          * point to a physically contiguous block of memory.
30450          */
30451         uint64_t        resp_addr;
30452         /* Modulation types of TX FIR: NRZ, PAM4. */
30453         uint8_t mod_type;
30454         /* For NRZ */
30455         #define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_NRZ  UINT32_C(0x0)
30456         /* For PAM4 */
30457         #define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_PAM4 UINT32_C(0x1)
30458         #define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_LAST \
30459                 HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_PAM4
30460         /* The ID of the lane TX FIR will be queried. */
30461         uint8_t lane_id;
30462         uint8_t unused[6];
30463 } __rte_packed;
30464
30465 /* hwrm_port_tx_fir_qcfg_output (size:256b/32B) */
30466 struct hwrm_port_tx_fir_qcfg_output {
30467         /* The specific error status for the command. */
30468         uint16_t        error_code;
30469         /* The HWRM command request type. */
30470         uint16_t        req_type;
30471         /* The sequence ID from the original command. */
30472         uint16_t        seq_id;
30473         /* The length of the response data in number of bytes. */
30474         uint16_t        resp_len;
30475         /* Value1 of TX FIR, required for NRZ or PAM4. */
30476         uint32_t        txfir_val_1;
30477         /* Value2 of TX FIR, required for NRZ or PAM4. */
30478         uint32_t        txfir_val_2;
30479         /* Value3 of TX FIR, required for PAM4. */
30480         uint32_t        txfir_val_3;
30481         /* Value4 of TX FIR, required for PAM4. */
30482         uint32_t        txfir_val_4;
30483         uint8_t unused[7];
30484         /*
30485          * This field is used in Output records to indicate that the output
30486          * is completely written to RAM.  This field should be read as '1'
30487          * to indicate that the output has been completely written.
30488          * When writing a command completion or response to an internal processor,
30489          * the order of writes has to be such that this field is written last.
30490          */
30491         uint8_t valid;
30492 } __rte_packed;
30493
30494 /***********************
30495  * hwrm_port_ep_tx_cfg *
30496  ***********************/
30497
30498
30499 /* hwrm_port_ep_tx_cfg_input (size:256b/32B) */
30500 struct hwrm_port_ep_tx_cfg_input {
30501         /* The HWRM command request type. */
30502         uint16_t        req_type;
30503         /*
30504          * The completion ring to send the completion event on. This should
30505          * be the NQ ID returned from the `nq_alloc` HWRM command.
30506          */
30507         uint16_t        cmpl_ring;
30508         /*
30509          * The sequence ID is used by the driver for tracking multiple
30510          * commands. This ID is treated as opaque data by the firmware and
30511          * the value is returned in the `hwrm_resp_hdr` upon completion.
30512          */
30513         uint16_t        seq_id;
30514         /*
30515          * The target ID of the command:
30516          * * 0x0-0xFFF8 - The function ID
30517          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30518          * * 0xFFFD - Reserved for user-space HWRM interface
30519          * * 0xFFFF - HWRM
30520          */
30521         uint16_t        target_id;
30522         /*
30523          * A physical address pointer pointing to a host buffer that the
30524          * command's response data will be written. This can be either a host
30525          * physical address (HPA) or a guest physical address (GPA) and must
30526          * point to a physically contiguous block of memory.
30527          */
30528         uint64_t        resp_addr;
30529         uint16_t        enables;
30530         /* When this bit is '1', the value in the ep0_min_bw field is valid. */
30531         #define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP0_MIN_BW     UINT32_C(0x1)
30532         /* When this bit is '1', the value in the ep0_max_bw field is valid. */
30533         #define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP0_MAX_BW     UINT32_C(0x2)
30534         /* When this bit is '1', the value in the ep1_min_bw field is valid. */
30535         #define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP1_MIN_BW     UINT32_C(0x4)
30536         /* When this bit is '1', the value in the ep1_max_bw field is valid. */
30537         #define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP1_MAX_BW     UINT32_C(0x8)
30538         /* When this bit is '1', the value in the ep2_min_bw field is valid. */
30539         #define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP2_MIN_BW     UINT32_C(0x10)
30540         /* When this bit is '1', the value in the ep2_max_bw field is valid. */
30541         #define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP2_MAX_BW     UINT32_C(0x20)
30542         /* When this bit is '1', the value in the ep3_min_bw field is valid. */
30543         #define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP3_MIN_BW     UINT32_C(0x40)
30544         /* When this bit is '1', the value in the ep3_max_bw field is valid. */
30545         #define HWRM_PORT_EP_TX_CFG_INPUT_ENABLES_EP3_MAX_BW     UINT32_C(0x80)
30546         /* A port index, from 0 to the number of front panel ports, minus 1. */
30547         uint8_t port_id;
30548         uint8_t unused;
30549         /*
30550          * Specifies a minimum guaranteed bandwidth, as a percentage of the
30551          * port bandwidth, for the set of PFs and VFs on PCIe endpoint 0 for
30552          * the specified port. The range is 0 to 100. A value of 0 indicates no
30553          * minimum rate. The endpoint's min_bw must be less than or equal to
30554          * max_bw. The sum of all configured minimum bandwidths for a port must
30555          * be less than or equal to 100.
30556          */
30557         uint8_t ep0_min_bw;
30558         /*
30559          * Specifies the maximum portion of the port's bandwidth that the set
30560          * of PFs and VFs on PCIe endpoint 0 may use. The value is a percentage
30561          * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30562          * maximum rate.
30563          */
30564         uint8_t ep0_max_bw;
30565         /*
30566          * Specifies a minimum guaranteed bandwidth, as a percentage of the
30567          * port bandwidth, for the set of PFs and VFs on PCIe endpoint 1 for
30568          * the specified port. The range is 0 to 100. A value of 0 indicates no
30569          * minimum rate. The endpoint's min_bw must be less than or equal to
30570          * max_bw. The sum of all configured minimum bandwidths for a port must
30571          * be less than or equal to 100.
30572          */
30573         uint8_t ep1_min_bw;
30574         /*
30575          * Specifies the maximum portion of the port's bandwidth that the set
30576          * of PFs and VFs on PCIe endpoint 1 may use. The value is a percentage
30577          * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30578          * maximum rate.
30579          */
30580         uint8_t ep1_max_bw;
30581         /*
30582          * Specifies a minimum guaranteed bandwidth, as a percentage of the
30583          * port bandwidth, for the set of PFs and VFs on PCIe endpoint 2 for
30584          * the specified port. The range is 0 to 100. A value of 0 indicates no
30585          * minimum rate. The endpoint's min_bw must be less than or equal to
30586          * max_bw. The sum of all configured minimum bandwidths for a port must
30587          * be less than or equal to 100.
30588          */
30589         uint8_t ep2_min_bw;
30590         /*
30591          * Specifies the maximum portion of the port's bandwidth that the set of
30592          * PFs and VFs on PCIe endpoint 2 may use. The value is a percentage of
30593          * the link bandwidth, from 0 to 100. A value of 0 indicates no
30594          * maximum rate.
30595          */
30596         uint8_t ep2_max_bw;
30597         /*
30598          * Specifies a minimum guaranteed bandwidth, as a percentage of the
30599          * port bandwidth, for the set of PFs and VFs on PCIe endpoint 3 for
30600          * the specified port. The range is 0 to 100. A value of 0 indicates no
30601          * minimum rate. The endpoint's min_bw must be less than or equal to
30602          * max_bw. The sum of all configured minimum bandwidths for a port must
30603          * be less than or equal to 100.
30604          */
30605         uint8_t ep3_min_bw;
30606         /*
30607          * Specifies the maximum portion of the port's bandwidth that the set
30608          * of PFs and VFs on PCIe endpoint 3 may use. The value is a percentage
30609          * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30610          * maximum rate.
30611          */
30612         uint8_t ep3_max_bw;
30613         uint8_t unused_1[4];
30614 } __rte_packed;
30615
30616 /* hwrm_port_ep_tx_cfg_output (size:128b/16B) */
30617 struct hwrm_port_ep_tx_cfg_output {
30618         /* The specific error status for the command. */
30619         uint16_t        error_code;
30620         /* The HWRM command request type. */
30621         uint16_t        req_type;
30622         /* The sequence ID from the original command. */
30623         uint16_t        seq_id;
30624         /* The length of the response data in number of bytes. */
30625         uint16_t        resp_len;
30626         uint8_t unused_0[7];
30627         /*
30628          * This field is used in output records to indicate that the output
30629          * is completely written to RAM. This field should be read as '1'
30630          * to indicate that the output has been completely written.
30631          * When writing a command completion or response to an internal
30632          * processor, the order of writes has to be such that this field
30633          * is written last.
30634          */
30635         uint8_t valid;
30636 } __rte_packed;
30637
30638 /* hwrm_port_ep_tx_cfg_cmd_err (size:64b/8B) */
30639 struct hwrm_port_ep_tx_cfg_cmd_err {
30640         /*
30641          * command specific error codes for the cmd_err field in
30642          * hwrm_err_output
30643          */
30644         uint8_t code;
30645         /* Unknown error. */
30646         #define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_UNKNOWN \
30647                 UINT32_C(0x0)
30648         /* The port ID is invalid */
30649         #define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_PORT_ID_INVALID \
30650                 UINT32_C(0x1)
30651         /* One of the PCIe endpoints configured is not active. */
30652         #define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_EP_INACTIVE \
30653                 UINT32_C(0x2)
30654         /* A minimum bandwidth is out of range. */
30655         #define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_RANGE \
30656                 UINT32_C(0x3)
30657         /*
30658          * One endpoint's minimum bandwidth is more than its maximum
30659          * bandwidth.
30660          */
30661         #define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_MORE_THAN_MAX \
30662                 UINT32_C(0x4)
30663         /* The sum of the minimum bandwidths on the port is more than 100%. */
30664         #define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_SUM \
30665                 UINT32_C(0x5)
30666         /*
30667          * The NIC does not support enforcement of a minimum guaranteed
30668          * bandwidth for an endpoint.
30669          */
30670         #define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_UNSUPPORTED \
30671                 UINT32_C(0x6)
30672         #define HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_LAST \
30673                 HWRM_PORT_EP_TX_CFG_CMD_ERR_CODE_MIN_BW_UNSUPPORTED
30674         uint8_t unused_0[7];
30675 } __rte_packed;
30676
30677 /************************
30678  * hwrm_port_ep_tx_qcfg *
30679  ************************/
30680
30681
30682 /* hwrm_port_ep_tx_qcfg_input (size:192b/24B) */
30683 struct hwrm_port_ep_tx_qcfg_input {
30684         /* The HWRM command request type. */
30685         uint16_t        req_type;
30686         /*
30687          * The completion ring to send the completion event on. This should
30688          * be the NQ ID returned from the `nq_alloc` HWRM command.
30689          */
30690         uint16_t        cmpl_ring;
30691         /*
30692          * The sequence ID is used by the driver for tracking multiple
30693          * commands. This ID is treated as opaque data by the firmware and
30694          * the value is returned in the `hwrm_resp_hdr` upon completion.
30695          */
30696         uint16_t        seq_id;
30697         /*
30698          * The target ID of the command:
30699          * * 0x0-0xFFF8 - The function ID
30700          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30701          * * 0xFFFD - Reserved for user-space HWRM interface
30702          * * 0xFFFF - HWRM
30703          */
30704         uint16_t        target_id;
30705         /*
30706          * A physical address pointer pointing to a host buffer that the
30707          * command's response data will be written. This can be either a host
30708          * physical address (HPA) or a guest physical address (GPA) and must
30709          * point to a physically contiguous block of memory.
30710          */
30711         uint64_t        resp_addr;
30712         /* The port whose endpoint rate limits are queried. */
30713         uint8_t port_id;
30714         uint8_t unused[7];
30715 } __rte_packed;
30716
30717 /* hwrm_port_ep_tx_qcfg_output (size:192b/24B) */
30718 struct hwrm_port_ep_tx_qcfg_output {
30719         /* The specific error status for the command. */
30720         uint16_t        error_code;
30721         /* The HWRM command request type. */
30722         uint16_t        req_type;
30723         /* The sequence ID from the original command. */
30724         uint16_t        seq_id;
30725         /* The length of the response data in number of bytes. */
30726         uint16_t        resp_len;
30727         /*
30728          * Specifies a minimum guaranteed bandwidth, as a percentage of the
30729          * port bandwidth, for the set of PFs and VFs on PCIe endpoint 0 for
30730          * the specified port. The range is 0 to 100. A value of 0 indicates no
30731          * minimum rate. The endpoint's min_bw must be less than or equal to
30732          * max_bw. The sum of all configured minimum bandwidths for a port must
30733          * be less than or equal to 100.
30734          */
30735         uint8_t ep0_min_bw;
30736         /*
30737          * Specifies the maximum portion of the port's bandwidth that the set
30738          * of PFs and VFs on PCIe endpoint 0 may use. The value is a percentage
30739          * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30740          * maximum rate.
30741          */
30742         uint8_t ep0_max_bw;
30743         /*
30744          * Specifies a minimum guaranteed bandwidth, as a percentage of the
30745          * port bandwidth, for the set of PFs and VFs on PCIe endpoint 1 for
30746          * the specified port. The range is 0 to 100. A value of 0 indicates no
30747          * minimum rate. The endpoint's min_bw must be less than or equal to
30748          * max_bw. The sum of all configured minimum bandwidths for a port must
30749          * be less than or equal to 100.
30750          */
30751         uint8_t ep1_min_bw;
30752         /*
30753          * Specifies the maximum portion of the port's bandwidth that the set
30754          * of PFs and VFs on PCIe endpoint 1 may use. The value is a percentage
30755          * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30756          * maximum rate.
30757          */
30758         uint8_t ep1_max_bw;
30759         /*
30760          * Specifies a minimum guaranteed bandwidth, as a percentage of the
30761          * port bandwidth, for the set of PFs and VFs on PCIe endpoint 2 for
30762          * the specified port. The range is 0 to 100. A value of 0 indicates no
30763          * minimum rate. The endpoint's min_bw must be less than or equal to
30764          * max_bw. The sum of all configured minimum bandwidths for a port must
30765          * be less than or equal to 100.
30766          */
30767         uint8_t ep2_min_bw;
30768         /*
30769          * Specifies the maximum portion of the port's bandwidth that the set
30770          * of PFs and VFs on PCIe endpoint 2 may use. The value is a percentage
30771          * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30772          * maximum rate.
30773          */
30774         uint8_t ep2_max_bw;
30775         /*
30776          * Specifies a minimum guaranteed bandwidth, as a percentage of the
30777          * port bandwidth, for the set of PFs and VFs on PCIe endpoint 3 for
30778          * the specified port. The range is 0 to 100. A value of 0 indicates no
30779          * minimum rate. The endpoint's min_bw must be less than or equal to
30780          * max_bw. The sum of all configured minimum bandwidths for a port must
30781          * be less than or equal to 100.
30782          */
30783         uint8_t ep3_min_bw;
30784         /*
30785          * Specifies the maximum portion of the port's bandwidth that the set
30786          * of PFs and VFs on PCIe endpoint 3 may use. The value is a percentage
30787          * of the link bandwidth, from 0 to 100. A value of 0 indicates no
30788          * maximum rate.
30789          */
30790         uint8_t ep3_max_bw;
30791         uint8_t unused_0[7];
30792         /*
30793          * This field is used in output records to indicate that the output
30794          * is completely written to RAM. This field should be read as '1'
30795          * to indicate that the output has been completely written.
30796          * When writing a command completion or response to an internal
30797          * processor, the order of writes has to be such that this field is
30798          * written last.
30799          */
30800         uint8_t valid;
30801 } __rte_packed;
30802
30803 /***********************
30804  * hwrm_queue_qportcfg *
30805  ***********************/
30806
30807
30808 /* hwrm_queue_qportcfg_input (size:192b/24B) */
30809 struct hwrm_queue_qportcfg_input {
30810         /* The HWRM command request type. */
30811         uint16_t        req_type;
30812         /*
30813          * The completion ring to send the completion event on. This should
30814          * be the NQ ID returned from the `nq_alloc` HWRM command.
30815          */
30816         uint16_t        cmpl_ring;
30817         /*
30818          * The sequence ID is used by the driver for tracking multiple
30819          * commands. This ID is treated as opaque data by the firmware and
30820          * the value is returned in the `hwrm_resp_hdr` upon completion.
30821          */
30822         uint16_t        seq_id;
30823         /*
30824          * The target ID of the command:
30825          * * 0x0-0xFFF8 - The function ID
30826          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30827          * * 0xFFFD - Reserved for user-space HWRM interface
30828          * * 0xFFFF - HWRM
30829          */
30830         uint16_t        target_id;
30831         /*
30832          * A physical address pointer pointing to a host buffer that the
30833          * command's response data will be written. This can be either a host
30834          * physical address (HPA) or a guest physical address (GPA) and must
30835          * point to a physically contiguous block of memory.
30836          */
30837         uint64_t        resp_addr;
30838         uint32_t        flags;
30839         /*
30840          * Enumeration denoting the RX, TX type of the resource.
30841          * This enumeration is used for resources that are similar for both
30842          * TX and RX paths of the chip.
30843          */
30844         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
30845         /* tx path */
30846         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
30847         /* rx path */
30848         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
30849         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
30850                 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
30851         /*
30852          * Port ID of port for which the queue configuration is being
30853          * queried. This field is only required when sent by IPC.
30854          */
30855         uint16_t        port_id;
30856         /*
30857          * Drivers will set this capability when it can use
30858          * queue_idx_service_profile to map the queues to application.
30859          */
30860         uint8_t drv_qmap_cap;
30861         /* disabled */
30862         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
30863         /* enabled */
30864         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
30865         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
30866                 HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
30867         uint8_t unused_0;
30868 } __rte_packed;
30869
30870 /* hwrm_queue_qportcfg_output (size:1344b/168B) */
30871 struct hwrm_queue_qportcfg_output {
30872         /* The specific error status for the command. */
30873         uint16_t        error_code;
30874         /* The HWRM command request type. */
30875         uint16_t        req_type;
30876         /* The sequence ID from the original command. */
30877         uint16_t        seq_id;
30878         /* The length of the response data in number of bytes. */
30879         uint16_t        resp_len;
30880         /*
30881          * The maximum number of queues that can be configured on this
30882          * port.
30883          * Valid values range from 1 through 8.
30884          */
30885         uint8_t max_configurable_queues;
30886         /*
30887          * The maximum number of lossless queues that can be configured
30888          * on this port.
30889          * Valid values range from 0 through 8.
30890          */
30891         uint8_t max_configurable_lossless_queues;
30892         /*
30893          * Bitmask indicating which queues can be configured by the
30894          * hwrm_queue_cfg command.
30895          *
30896          * Each bit represents a specific queue where bit 0 represents
30897          * queue 0 and bit 7 represents queue 7.
30898          * # A value of 0 indicates that the queue is not configurable
30899          * by the hwrm_queue_cfg command.
30900          * # A value of 1 indicates that the queue is configurable.
30901          * # A hwrm_queue_cfg command shall return error when trying to
30902          * configure a queue not configurable.
30903          */
30904         uint8_t queue_cfg_allowed;
30905         /* Information about queue configuration. */
30906         uint8_t queue_cfg_info;
30907         /*
30908          * If this flag is set to '1', then the queues are
30909          * configured asymmetrically on TX and RX sides.
30910          * If this flag is set to '0', then the queues are
30911          * configured symmetrically on TX and RX sides. For
30912          * symmetric configuration, the queue configuration
30913          * including queue ids and service profiles on the
30914          * TX side is the same as the corresponding queue
30915          * configuration on the RX side.
30916          */
30917         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
30918                 UINT32_C(0x1)
30919         /*
30920          * If this flag is set to '1', then service_profile will carry
30921          * either lossy/lossless type and the new service_profile_type
30922          * field will be used to determine if the queue is for L2/ROCE/CNP.
30923          */
30924         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_USE_PROFILE_TYPE \
30925                 UINT32_C(0x2)
30926         /*
30927          * Bitmask indicating which queues can be configured by the
30928          * hwrm_queue_pfcenable_cfg command.
30929          *
30930          * Each bit represents a specific priority where bit 0 represents
30931          * priority 0 and bit 7 represents priority 7.
30932          * # A value of 0 indicates that the priority is not configurable by
30933          * the hwrm_queue_pfcenable_cfg command.
30934          * # A value of 1 indicates that the priority is configurable.
30935          * # A hwrm_queue_pfcenable_cfg command shall return error when
30936          * trying to configure a priority that is not configurable.
30937          */
30938         uint8_t queue_pfcenable_cfg_allowed;
30939         /*
30940          * Bitmask indicating which queues can be configured by the
30941          * hwrm_queue_pri2cos_cfg command.
30942          *
30943          * Each bit represents a specific queue where bit 0 represents
30944          * queue 0 and bit 7 represents queue 7.
30945          * # A value of 0 indicates that the queue is not configurable
30946          * by the hwrm_queue_pri2cos_cfg command.
30947          * # A value of 1 indicates that the queue is configurable.
30948          * # A hwrm_queue_pri2cos_cfg command shall return error when
30949          * trying to configure a queue that is not configurable.
30950          */
30951         uint8_t queue_pri2cos_cfg_allowed;
30952         /*
30953          * Bitmask indicating which queues can be configured by the
30954          * hwrm_queue_pri2cos_cfg command.
30955          *
30956          * Each bit represents a specific queue where bit 0 represents
30957          * queue 0 and bit 7 represents queue 7.
30958          * # A value of 0 indicates that the queue is not configurable
30959          * by the hwrm_queue_pri2cos_cfg command.
30960          * # A value of 1 indicates that the queue is configurable.
30961          * # A hwrm_queue_pri2cos_cfg command shall return error when
30962          * trying to configure a queue not configurable.
30963          */
30964         uint8_t queue_cos2bw_cfg_allowed;
30965         /*
30966          * ID of CoS Queue 0.
30967          * FF - Invalid id
30968          *
30969          * # This ID can be used on any subsequent call to an hwrm command
30970          * that takes a queue id.
30971          * # IDs must always be queried by this command before any use
30972          * by the driver or software.
30973          * # The CoS queue index is obtained by applying modulo 10 to the
30974          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
30975          * The CoS queue index is used to reference port statistics for the
30976          * CoS queue.
30977          * # A value of 0xff indicates that the queue is not available.
30978          * # Available queues may not be in sequential order.
30979          */
30980         uint8_t queue_id0;
30981         /* This value specifies service profile kind for CoS queue */
30982         uint8_t queue_id0_service_profile;
30983         /* Lossy (best-effort) */
30984         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
30985                 UINT32_C(0x0)
30986         /* Lossless */
30987         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
30988                 UINT32_C(0x1)
30989         /* Lossless RoCE (deprecated) */
30990         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \
30991                 UINT32_C(0x1)
30992         /* Lossy RoCE CNP (deprecated) */
30993         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \
30994                 UINT32_C(0x2)
30995         /* Lossless NIC (deprecated) */
30996         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \
30997                 UINT32_C(0x3)
30998         /* Set to 0xFF... (All Fs) if there is no service profile specified */
30999         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
31000                 UINT32_C(0xff)
31001         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \
31002                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
31003         /*
31004          * ID of CoS Queue 1.
31005          * FF - Invalid id
31006          *
31007          * # This ID can be used on any subsequent call to an hwrm command
31008          * that takes a queue id.
31009          * # IDs must always be queried by this command before any use
31010          * by the driver or software.
31011          * # The CoS queue index is obtained by applying modulo 10 to the
31012          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31013          * The CoS queue index is used to reference port statistics for the
31014          * CoS queue.
31015          * # A value of 0xff indicates that the queue is not available.
31016          * # Available queues may not be in sequential order.
31017          */
31018         uint8_t queue_id1;
31019         /* This value specifies service profile kind for CoS queue */
31020         uint8_t queue_id1_service_profile;
31021         /* Lossy (best-effort) */
31022         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
31023                 UINT32_C(0x0)
31024         /* Lossless */
31025         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
31026                 UINT32_C(0x1)
31027         /* Lossless RoCE (deprecated) */
31028         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \
31029                 UINT32_C(0x1)
31030         /* Lossy RoCE CNP (deprecated) */
31031         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \
31032                 UINT32_C(0x2)
31033         /* Lossless NIC (deprecated) */
31034         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \
31035                 UINT32_C(0x3)
31036         /* Set to 0xFF... (All Fs) if there is no service profile specified */
31037         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
31038                 UINT32_C(0xff)
31039         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \
31040                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
31041         /*
31042          * ID of CoS Queue 2.
31043          * FF - Invalid id
31044          *
31045          * # This ID can be used on any subsequent call to an hwrm command
31046          * that takes a queue id.
31047          * # IDs must always be queried by this command before any use
31048          * by the driver or software.
31049          * # The CoS queue index is obtained by applying modulo 10 to the
31050          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31051          * The CoS queue index is used to reference port statistics for the
31052          * CoS queue.
31053          * # A value of 0xff indicates that the queue is not available.
31054          * # Available queues may not be in sequential order.
31055          */
31056         uint8_t queue_id2;
31057         /* This value specifies service profile kind for CoS queue */
31058         uint8_t queue_id2_service_profile;
31059         /* Lossy (best-effort) */
31060         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
31061                 UINT32_C(0x0)
31062         /* Lossless */
31063         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
31064                 UINT32_C(0x1)
31065         /* Lossless RoCE (deprecated) */
31066         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \
31067                 UINT32_C(0x1)
31068         /* Lossy RoCE CNP (deprecated) */
31069         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \
31070                 UINT32_C(0x2)
31071         /* Lossless NIC (deprecated) */
31072         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \
31073                 UINT32_C(0x3)
31074         /* Set to 0xFF... (All Fs) if there is no service profile specified */
31075         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
31076                 UINT32_C(0xff)
31077         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \
31078                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
31079         /*
31080          * ID of CoS Queue 3.
31081          * FF - Invalid id
31082          *
31083          * # This ID can be used on any subsequent call to an hwrm command
31084          * that takes a queue id.
31085          * # IDs must always be queried by this command before any use
31086          * by the driver or software.
31087          * # The CoS queue index is obtained by applying modulo 10 to the
31088          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31089          * The CoS queue index is used to reference port statistics for the
31090          * CoS queue.
31091          * # A value of 0xff indicates that the queue is not available.
31092          * # Available queues may not be in sequential order.
31093          */
31094         uint8_t queue_id3;
31095         /* This value specifies service profile kind for CoS queue */
31096         uint8_t queue_id3_service_profile;
31097         /* Lossy (best-effort) */
31098         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
31099                 UINT32_C(0x0)
31100         /* Lossless */
31101         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
31102                 UINT32_C(0x1)
31103         /* Lossless RoCE (deprecated) */
31104         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \
31105                 UINT32_C(0x1)
31106         /* Lossy RoCE CNP (deprecated) */
31107         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \
31108                 UINT32_C(0x2)
31109         /* Lossless NIC (deprecated) */
31110         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \
31111                 UINT32_C(0x3)
31112         /* Set to 0xFF... (All Fs) if there is no service profile specified */
31113         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
31114                 UINT32_C(0xff)
31115         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \
31116                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
31117         /*
31118          * ID of CoS Queue 4.
31119          * FF - Invalid id
31120          *
31121          * # This ID can be used on any subsequent call to an hwrm command
31122          * that takes a queue id.
31123          * # IDs must always be queried by this command before any use
31124          * by the driver or software.
31125          * # The CoS queue index is obtained by applying modulo 10 to the
31126          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31127          * The CoS queue index is used to reference port statistics for the
31128          * CoS queue.
31129          * # A value of 0xff indicates that the queue is not available.
31130          * # Available queues may not be in sequential order.
31131          */
31132         uint8_t queue_id4;
31133         /* This value specifies service profile kind for CoS queue */
31134         uint8_t queue_id4_service_profile;
31135         /* Lossy (best-effort) */
31136         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
31137                 UINT32_C(0x0)
31138         /* Lossless */
31139         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
31140                 UINT32_C(0x1)
31141         /* Lossless RoCE (deprecated) */
31142         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \
31143                 UINT32_C(0x1)
31144         /* Lossy RoCE CNP (deprecated) */
31145         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \
31146                 UINT32_C(0x2)
31147         /* Lossless NIC (deprecated) */
31148         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \
31149                 UINT32_C(0x3)
31150         /* Set to 0xFF... (All Fs) if there is no service profile specified */
31151         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
31152                 UINT32_C(0xff)
31153         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \
31154                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
31155         /*
31156          * ID of CoS Queue 5.
31157          * FF - Invalid id
31158          *
31159          * # This ID can be used on any subsequent call to an hwrm command
31160          * that takes a queue id.
31161          * # IDs must always be queried by this command before any use
31162          * by the driver or software.
31163          * # The CoS queue index is obtained by applying modulo 10 to the
31164          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31165          * The CoS queue index is used to reference port statistics for the
31166          * CoS queue.
31167          * # A value of 0xff indicates that the queue is not available.
31168          * # Available queues may not be in sequential order.
31169          */
31170         uint8_t queue_id5;
31171         /* This value specifies service profile kind for CoS queue */
31172         uint8_t queue_id5_service_profile;
31173         /* Lossy (best-effort) */
31174         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
31175                 UINT32_C(0x0)
31176         /* Lossless */
31177         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
31178                 UINT32_C(0x1)
31179         /* Lossless RoCE (deprecated) */
31180         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \
31181                 UINT32_C(0x1)
31182         /* Lossy RoCE CNP (deprecated) */
31183         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \
31184                 UINT32_C(0x2)
31185         /* Lossless NIC (deprecated) */
31186         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \
31187                 UINT32_C(0x3)
31188         /* Set to 0xFF... (All Fs) if there is no service profile specified */
31189         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
31190                 UINT32_C(0xff)
31191         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \
31192                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
31193         /*
31194          * ID of CoS Queue 6.
31195          * FF - Invalid id
31196          *
31197          * # This ID can be used on any subsequent call to an hwrm command
31198          * that takes a queue id.
31199          * # IDs must always be queried by this command before any use
31200          * by the driver or software.
31201          * # The CoS queue index is obtained by applying modulo 10 to the
31202          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31203          * The CoS queue index is used to reference port statistics for the
31204          * CoS queue.
31205          * # A value of 0xff indicates that the queue is not available.
31206          * # Available queues may not be in sequential order.
31207          */
31208         uint8_t queue_id6;
31209         /* This value specifies service profile kind for CoS queue */
31210         uint8_t queue_id6_service_profile;
31211         /* Lossy (best-effort) */
31212         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
31213                 UINT32_C(0x0)
31214         /* Lossless */
31215         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
31216                 UINT32_C(0x1)
31217         /* Lossless RoCE (deprecated) */
31218         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \
31219                 UINT32_C(0x1)
31220         /* Lossy RoCE CNP (deprecated) */
31221         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \
31222                 UINT32_C(0x2)
31223         /* Lossless NIC (deprecated) */
31224         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \
31225                 UINT32_C(0x3)
31226         /* Set to 0xFF... (All Fs) if there is no service profile specified */
31227         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
31228                 UINT32_C(0xff)
31229         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \
31230                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
31231         /*
31232          * ID of CoS Queue 7.
31233          * FF - Invalid id
31234          *
31235          * # This ID can be used on any subsequent call to an hwrm command
31236          * that takes a queue id.
31237          * # IDs must always be queried by this command before any use
31238          * by the driver or software.
31239          * # The CoS queue index is obtained by applying modulo 10 to the
31240          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
31241          * The CoS queue index is used to reference port statistics for the
31242          * CoS queue.
31243          * # A value of 0xff indicates that the queue is not available.
31244          * # Available queues may not be in sequential order.
31245          */
31246         uint8_t queue_id7;
31247         /* This value specifies service profile kind for CoS queue */
31248         uint8_t queue_id7_service_profile;
31249         /* Lossy (best-effort) */
31250         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
31251                 UINT32_C(0x0)
31252         /* Lossless */
31253         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
31254                 UINT32_C(0x1)
31255         /* Lossless RoCE (deprecated) */
31256         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \
31257                 UINT32_C(0x1)
31258         /* Lossy RoCE CNP (deprecated) */
31259         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \
31260                 UINT32_C(0x2)
31261         /* Lossless NIC (deprecated) */
31262         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \
31263                 UINT32_C(0x3)
31264         /* Set to 0xFF... (All Fs) if there is no service profile specified */
31265         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
31266                 UINT32_C(0xff)
31267         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \
31268                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
31269         /*
31270          * This value specifies traffic type for the service profile. We can
31271          * have a TC mapped to multiple traffic types. For example shared
31272          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31273          * A value of zero is considered as invalid.
31274          */
31275         uint8_t queue_id0_service_profile_type;
31276         /* Recommended to be used for RoCE traffic only. */
31277         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_ROCE \
31278                 UINT32_C(0x1)
31279         /* Recommended to be used for NIC/L2 traffic only. */
31280         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_NIC \
31281                 UINT32_C(0x2)
31282         /* Recommended to be used for CNP traffic only. */
31283         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_CNP \
31284                 UINT32_C(0x4)
31285         /*
31286          * Up to 16 bytes of null padded ASCII string describing this queue.
31287          * The queue name includes a CoS queue index and, in some cases, text
31288          * that distinguishes the queue from other queues in the group.
31289          */
31290         char    qid0_name[16];
31291         /* Up to 16 bytes of null padded ASCII string describing this queue. */
31292         char    qid1_name[16];
31293         /* Up to 16 bytes of null padded ASCII string describing this queue. */
31294         char    qid2_name[16];
31295         /* Up to 16 bytes of null padded ASCII string describing this queue. */
31296         char    qid3_name[16];
31297         /* Up to 16 bytes of null padded ASCII string describing this queue. */
31298         char    qid4_name[16];
31299         /* Up to 16 bytes of null padded ASCII string describing this queue. */
31300         char    qid5_name[16];
31301         /* Up to 16 bytes of null padded ASCII string describing this queue. */
31302         char    qid6_name[16];
31303         /* Up to 16 bytes of null padded ASCII string describing this queue. */
31304         char    qid7_name[16];
31305         /*
31306          * This value specifies traffic type for the service profile. We can
31307          * have a TC mapped to multiple traffic types. For example shared
31308          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31309          * A value of zero is considered as invalid.
31310          */
31311         uint8_t queue_id1_service_profile_type;
31312         /* Recommended to be used for RoCE traffic only. */
31313         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_ROCE \
31314                 UINT32_C(0x1)
31315         /* Recommended to be used for NIC/L2 traffic only. */
31316         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_NIC \
31317                 UINT32_C(0x2)
31318         /* Recommended to be used for CNP traffic only. */
31319         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_CNP \
31320                 UINT32_C(0x4)
31321         /*
31322          * This value specifies traffic type for the service profile. We can
31323          * have a TC mapped to multiple traffic types. For example shared
31324          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31325          * A value of zero is considered as invalid.
31326          */
31327         uint8_t queue_id2_service_profile_type;
31328         /* Recommended to be used for RoCE traffic only. */
31329         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_ROCE \
31330                 UINT32_C(0x1)
31331         /* Recommended to be used for NIC/L2 traffic only. */
31332         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_NIC \
31333                 UINT32_C(0x2)
31334         /* Recommended to be used for CNP traffic only. */
31335         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_CNP \
31336                 UINT32_C(0x4)
31337         /*
31338          * This value specifies traffic type for the service profile. We can
31339          * have a TC mapped to multiple traffic types. For example shared
31340          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31341          * A value of zero is considered as invalid.
31342          */
31343         uint8_t queue_id3_service_profile_type;
31344         /* Recommended to be used for RoCE traffic only. */
31345         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_ROCE \
31346                 UINT32_C(0x1)
31347         /* Recommended to be used for NIC/L2 traffic only. */
31348         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_NIC \
31349                 UINT32_C(0x2)
31350         /* Recommended to be used for CNP traffic only. */
31351         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_CNP \
31352                 UINT32_C(0x4)
31353         /*
31354          * This value specifies traffic type for the service profile. We can
31355          * have a TC mapped to multiple traffic types. For example shared
31356          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31357          * A value of zero is considered as invalid.
31358          */
31359         uint8_t queue_id4_service_profile_type;
31360         /* Recommended to be used for RoCE traffic only. */
31361         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_ROCE \
31362                 UINT32_C(0x1)
31363         /* Recommended to be used for NIC/L2 traffic only. */
31364         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_NIC \
31365                 UINT32_C(0x2)
31366         /* Recommended to be used for CNP traffic only. */
31367         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_CNP \
31368                 UINT32_C(0x4)
31369         /*
31370          * This value specifies traffic type for the service profile. We can
31371          * have a TC mapped to multiple traffic types. For example shared
31372          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31373          * A value of zero is considered as invalid.
31374          */
31375         uint8_t queue_id5_service_profile_type;
31376         /* Recommended to be used for RoCE traffic only. */
31377         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_ROCE \
31378                 UINT32_C(0x1)
31379         /* Recommended to be used for NIC/L2 traffic only. */
31380         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_NIC \
31381                 UINT32_C(0x2)
31382         /* Recommended to be used for CNP traffic only. */
31383         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_CNP \
31384                 UINT32_C(0x4)
31385         /*
31386          * This value specifies traffic type for the service profile. We can
31387          * have a TC mapped to multiple traffic types. For example shared
31388          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31389          * A value of zero is considered as invalid.
31390          */
31391         uint8_t queue_id6_service_profile_type;
31392         /* Recommended to be used for RoCE traffic only. */
31393         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_ROCE \
31394                 UINT32_C(0x1)
31395         /* Recommended to be used for NIC/L2 traffic only. */
31396         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_NIC \
31397                 UINT32_C(0x2)
31398         /* Recommended to be used for CNP traffic only. */
31399         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_CNP \
31400                 UINT32_C(0x4)
31401         /*
31402          * This value specifies traffic type for the service profile. We can
31403          * have a TC mapped to multiple traffic types. For example shared
31404          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
31405          * A value of zero is considered as invalid.
31406          */
31407         uint8_t queue_id7_service_profile_type;
31408         /* Recommended to be used for RoCE traffic only. */
31409         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_ROCE \
31410                 UINT32_C(0x1)
31411         /* Recommended to be used for NIC/L2 traffic only. */
31412         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_NIC \
31413                 UINT32_C(0x2)
31414         /* Recommended to be used for CNP traffic only. */
31415         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_CNP \
31416                 UINT32_C(0x4)
31417         /*
31418          * This field is used in Output records to indicate that the output
31419          * is completely written to RAM. This field should be read as '1'
31420          * to indicate that the output has been completely written.
31421          * When writing a command completion or response to an internal processor,
31422          * the order of writes has to be such that this field is written last.
31423          */
31424         uint8_t valid;
31425 } __rte_packed;
31426
31427 /*******************
31428  * hwrm_queue_qcfg *
31429  *******************/
31430
31431
31432 /* hwrm_queue_qcfg_input (size:192b/24B) */
31433 struct hwrm_queue_qcfg_input {
31434         /* The HWRM command request type. */
31435         uint16_t        req_type;
31436         /*
31437          * The completion ring to send the completion event on. This should
31438          * be the NQ ID returned from the `nq_alloc` HWRM command.
31439          */
31440         uint16_t        cmpl_ring;
31441         /*
31442          * The sequence ID is used by the driver for tracking multiple
31443          * commands. This ID is treated as opaque data by the firmware and
31444          * the value is returned in the `hwrm_resp_hdr` upon completion.
31445          */
31446         uint16_t        seq_id;
31447         /*
31448          * The target ID of the command:
31449          * * 0x0-0xFFF8 - The function ID
31450          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31451          * * 0xFFFD - Reserved for user-space HWRM interface
31452          * * 0xFFFF - HWRM
31453          */
31454         uint16_t        target_id;
31455         /*
31456          * A physical address pointer pointing to a host buffer that the
31457          * command's response data will be written. This can be either a host
31458          * physical address (HPA) or a guest physical address (GPA) and must
31459          * point to a physically contiguous block of memory.
31460          */
31461         uint64_t        resp_addr;
31462         uint32_t        flags;
31463         /*
31464          * Enumeration denoting the RX, TX type of the resource.
31465          * This enumeration is used for resources that are similar for both
31466          * TX and RX paths of the chip.
31467          */
31468         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
31469         /* tx path */
31470         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
31471         /* rx path */
31472         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
31473         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST \
31474                 HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
31475         /* Queue ID of the queue. */
31476         uint32_t        queue_id;
31477 } __rte_packed;
31478
31479 /* hwrm_queue_qcfg_output (size:128b/16B) */
31480 struct hwrm_queue_qcfg_output {
31481         /* The specific error status for the command. */
31482         uint16_t        error_code;
31483         /* The HWRM command request type. */
31484         uint16_t        req_type;
31485         /* The sequence ID from the original command. */
31486         uint16_t        seq_id;
31487         /* The length of the response data in number of bytes. */
31488         uint16_t        resp_len;
31489         /*
31490          * This value is the estimate packet length used in the
31491          * TX arbiter.
31492          */
31493         uint32_t        queue_len;
31494         /* This value is applicable to CoS queues only. */
31495         uint8_t service_profile;
31496         /* Lossy (best-effort) */
31497         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
31498         /* Lossless */
31499         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
31500         /* Set to 0xFF... (All Fs) if there is no service profile specified */
31501         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
31502         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST \
31503                 HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
31504         /* Information about queue configuration. */
31505         uint8_t queue_cfg_info;
31506         /*
31507          * If this flag is set to '1', then the queue is
31508          * configured asymmetrically on TX and RX sides.
31509          * If this flag is set to '0', then this queue is
31510          * configured symmetrically on TX and RX sides.
31511          */
31512         #define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
31513                 UINT32_C(0x1)
31514         uint8_t unused_0;
31515         /*
31516          * This field is used in Output records to indicate that the output
31517          * is completely written to RAM. This field should be read as '1'
31518          * to indicate that the output has been completely written.
31519          * When writing a command completion or response to an internal processor,
31520          * the order of writes has to be such that this field is written last.
31521          */
31522         uint8_t valid;
31523 } __rte_packed;
31524
31525 /******************
31526  * hwrm_queue_cfg *
31527  ******************/
31528
31529
31530 /* hwrm_queue_cfg_input (size:320b/40B) */
31531 struct hwrm_queue_cfg_input {
31532         /* The HWRM command request type. */
31533         uint16_t        req_type;
31534         /*
31535          * The completion ring to send the completion event on. This should
31536          * be the NQ ID returned from the `nq_alloc` HWRM command.
31537          */
31538         uint16_t        cmpl_ring;
31539         /*
31540          * The sequence ID is used by the driver for tracking multiple
31541          * commands. This ID is treated as opaque data by the firmware and
31542          * the value is returned in the `hwrm_resp_hdr` upon completion.
31543          */
31544         uint16_t        seq_id;
31545         /*
31546          * The target ID of the command:
31547          * * 0x0-0xFFF8 - The function ID
31548          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31549          * * 0xFFFD - Reserved for user-space HWRM interface
31550          * * 0xFFFF - HWRM
31551          */
31552         uint16_t        target_id;
31553         /*
31554          * A physical address pointer pointing to a host buffer that the
31555          * command's response data will be written. This can be either a host
31556          * physical address (HPA) or a guest physical address (GPA) and must
31557          * point to a physically contiguous block of memory.
31558          */
31559         uint64_t        resp_addr;
31560         uint32_t        flags;
31561         /*
31562          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
31563          * This enumeration is used for resources that are similar for both
31564          * TX and RX paths of the chip.
31565          */
31566         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
31567         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT  0
31568         /* tx path */
31569         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
31570         /* rx path */
31571         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
31572         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
31573         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
31574         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST \
31575                 HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
31576         uint32_t        enables;
31577         /*
31578          * This bit must be '1' for the dflt_len field to be
31579          * configured.
31580          */
31581         #define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN            UINT32_C(0x1)
31582         /*
31583          * This bit must be '1' for the service_profile field to be
31584          * configured.
31585          */
31586         #define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE     UINT32_C(0x2)
31587         /* Queue ID of queue that is to be configured by this function. */
31588         uint32_t        queue_id;
31589         /*
31590          * This value is a the estimate packet length used in the
31591          * TX arbiter.
31592          * Set to 0xFF... (All Fs) to not adjust this value.
31593          */
31594         uint32_t        dflt_len;
31595         /* This value is applicable to CoS queues only. */
31596         uint8_t service_profile;
31597         /* Lossy (best-effort) */
31598         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
31599         /* Lossless */
31600         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
31601         /* Set to 0xFF... (All Fs) if there is no service profile specified */
31602         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
31603         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST \
31604                 HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
31605         uint8_t unused_0[7];
31606 } __rte_packed;
31607
31608 /* hwrm_queue_cfg_output (size:128b/16B) */
31609 struct hwrm_queue_cfg_output {
31610         /* The specific error status for the command. */
31611         uint16_t        error_code;
31612         /* The HWRM command request type. */
31613         uint16_t        req_type;
31614         /* The sequence ID from the original command. */
31615         uint16_t        seq_id;
31616         /* The length of the response data in number of bytes. */
31617         uint16_t        resp_len;
31618         uint8_t unused_0[7];
31619         /*
31620          * This field is used in Output records to indicate that the output
31621          * is completely written to RAM. This field should be read as '1'
31622          * to indicate that the output has been completely written.
31623          * When writing a command completion or response to an internal processor,
31624          * the order of writes has to be such that this field is written last.
31625          */
31626         uint8_t valid;
31627 } __rte_packed;
31628
31629 /*****************************
31630  * hwrm_queue_pfcenable_qcfg *
31631  *****************************/
31632
31633
31634 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
31635 struct hwrm_queue_pfcenable_qcfg_input {
31636         /* The HWRM command request type. */
31637         uint16_t        req_type;
31638         /*
31639          * The completion ring to send the completion event on. This should
31640          * be the NQ ID returned from the `nq_alloc` HWRM command.
31641          */
31642         uint16_t        cmpl_ring;
31643         /*
31644          * The sequence ID is used by the driver for tracking multiple
31645          * commands. This ID is treated as opaque data by the firmware and
31646          * the value is returned in the `hwrm_resp_hdr` upon completion.
31647          */
31648         uint16_t        seq_id;
31649         /*
31650          * The target ID of the command:
31651          * * 0x0-0xFFF8 - The function ID
31652          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31653          * * 0xFFFD - Reserved for user-space HWRM interface
31654          * * 0xFFFF - HWRM
31655          */
31656         uint16_t        target_id;
31657         /*
31658          * A physical address pointer pointing to a host buffer that the
31659          * command's response data will be written. This can be either a host
31660          * physical address (HPA) or a guest physical address (GPA) and must
31661          * point to a physically contiguous block of memory.
31662          */
31663         uint64_t        resp_addr;
31664         /*
31665          * Port ID of port for which the table is being configured.
31666          * The HWRM needs to check whether this function is allowed
31667          * to configure pri2cos mapping on this port.
31668          */
31669         uint16_t        port_id;
31670         uint8_t unused_0[6];
31671 } __rte_packed;
31672
31673 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
31674 struct hwrm_queue_pfcenable_qcfg_output {
31675         /* The specific error status for the command. */
31676         uint16_t        error_code;
31677         /* The HWRM command request type. */
31678         uint16_t        req_type;
31679         /* The sequence ID from the original command. */
31680         uint16_t        seq_id;
31681         /* The length of the response data in number of bytes. */
31682         uint16_t        resp_len;
31683         uint32_t        flags;
31684         /* If set to 1, then PFC is enabled on PRI 0. */
31685         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED \
31686                 UINT32_C(0x1)
31687         /* If set to 1, then PFC is enabled on PRI 1. */
31688         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED \
31689                 UINT32_C(0x2)
31690         /* If set to 1, then PFC is enabled on PRI 2. */
31691         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED \
31692                 UINT32_C(0x4)
31693         /* If set to 1, then PFC is enabled on PRI 3. */
31694         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED \
31695                 UINT32_C(0x8)
31696         /* If set to 1, then PFC is enabled on PRI 4. */
31697         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED \
31698                 UINT32_C(0x10)
31699         /* If set to 1, then PFC is enabled on PRI 5. */
31700         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED \
31701                 UINT32_C(0x20)
31702         /* If set to 1, then PFC is enabled on PRI 6. */
31703         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED \
31704                 UINT32_C(0x40)
31705         /* If set to 1, then PFC is enabled on PRI 7. */
31706         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED \
31707                 UINT32_C(0x80)
31708         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
31709         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED \
31710                 UINT32_C(0x100)
31711         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
31712         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED \
31713                 UINT32_C(0x200)
31714         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
31715         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED \
31716                 UINT32_C(0x400)
31717         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
31718         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED \
31719                 UINT32_C(0x800)
31720         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
31721         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED \
31722                 UINT32_C(0x1000)
31723         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
31724         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED \
31725                 UINT32_C(0x2000)
31726         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
31727         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED \
31728                 UINT32_C(0x4000)
31729         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
31730         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED \
31731                 UINT32_C(0x8000)
31732         uint8_t unused_0[3];
31733         /*
31734          * This field is used in Output records to indicate that the output
31735          * is completely written to RAM. This field should be read as '1'
31736          * to indicate that the output has been completely written.
31737          * When writing a command completion or response to an internal processor,
31738          * the order of writes has to be such that this field is written last.
31739          */
31740         uint8_t valid;
31741 } __rte_packed;
31742
31743 /****************************
31744  * hwrm_queue_pfcenable_cfg *
31745  ****************************/
31746
31747
31748 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
31749 struct hwrm_queue_pfcenable_cfg_input {
31750         /* The HWRM command request type. */
31751         uint16_t        req_type;
31752         /*
31753          * The completion ring to send the completion event on. This should
31754          * be the NQ ID returned from the `nq_alloc` HWRM command.
31755          */
31756         uint16_t        cmpl_ring;
31757         /*
31758          * The sequence ID is used by the driver for tracking multiple
31759          * commands. This ID is treated as opaque data by the firmware and
31760          * the value is returned in the `hwrm_resp_hdr` upon completion.
31761          */
31762         uint16_t        seq_id;
31763         /*
31764          * The target ID of the command:
31765          * * 0x0-0xFFF8 - The function ID
31766          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31767          * * 0xFFFD - Reserved for user-space HWRM interface
31768          * * 0xFFFF - HWRM
31769          */
31770         uint16_t        target_id;
31771         /*
31772          * A physical address pointer pointing to a host buffer that the
31773          * command's response data will be written. This can be either a host
31774          * physical address (HPA) or a guest physical address (GPA) and must
31775          * point to a physically contiguous block of memory.
31776          */
31777         uint64_t        resp_addr;
31778         uint32_t        flags;
31779         /* If set to 1, then PFC is requested to be enabled on PRI 0. */
31780         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED \
31781                 UINT32_C(0x1)
31782         /* If set to 1, then PFC is requested to be enabled on PRI 1. */
31783         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED \
31784                 UINT32_C(0x2)
31785         /* If set to 1, then PFC is requested to be enabled on PRI 2. */
31786         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED \
31787                 UINT32_C(0x4)
31788         /* If set to 1, then PFC is requested to be enabled on PRI 3. */
31789         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED \
31790                 UINT32_C(0x8)
31791         /* If set to 1, then PFC is requested to be enabled on PRI 4. */
31792         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED \
31793                 UINT32_C(0x10)
31794         /* If set to 1, then PFC is requested to be enabled on PRI 5. */
31795         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED \
31796                 UINT32_C(0x20)
31797         /* If set to 1, then PFC is requested to be enabled on PRI 6. */
31798         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED \
31799                 UINT32_C(0x40)
31800         /* If set to 1, then PFC is requested to be enabled on PRI 7. */
31801         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED \
31802                 UINT32_C(0x80)
31803         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
31804         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED \
31805                 UINT32_C(0x100)
31806         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
31807         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED \
31808                 UINT32_C(0x200)
31809         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
31810         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED \
31811                 UINT32_C(0x400)
31812         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
31813         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED \
31814                 UINT32_C(0x800)
31815         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
31816         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED \
31817                 UINT32_C(0x1000)
31818         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
31819         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED \
31820                 UINT32_C(0x2000)
31821         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
31822         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED \
31823                 UINT32_C(0x4000)
31824         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
31825         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED \
31826                 UINT32_C(0x8000)
31827         /*
31828          * Port ID of port for which the table is being configured.
31829          * The HWRM needs to check whether this function is allowed
31830          * to configure pri2cos mapping on this port.
31831          */
31832         uint16_t        port_id;
31833         uint8_t unused_0[2];
31834 } __rte_packed;
31835
31836 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
31837 struct hwrm_queue_pfcenable_cfg_output {
31838         /* The specific error status for the command. */
31839         uint16_t        error_code;
31840         /* The HWRM command request type. */
31841         uint16_t        req_type;
31842         /* The sequence ID from the original command. */
31843         uint16_t        seq_id;
31844         /* The length of the response data in number of bytes. */
31845         uint16_t        resp_len;
31846         uint8_t unused_0[7];
31847         /*
31848          * This field is used in Output records to indicate that the output
31849          * is completely written to RAM. This field should be read as '1'
31850          * to indicate that the output has been completely written.
31851          * When writing a command completion or response to an internal processor,
31852          * the order of writes has to be such that this field is written last.
31853          */
31854         uint8_t valid;
31855 } __rte_packed;
31856
31857 /***************************
31858  * hwrm_queue_pri2cos_qcfg *
31859  ***************************/
31860
31861
31862 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
31863 struct hwrm_queue_pri2cos_qcfg_input {
31864         /* The HWRM command request type. */
31865         uint16_t        req_type;
31866         /*
31867          * The completion ring to send the completion event on. This should
31868          * be the NQ ID returned from the `nq_alloc` HWRM command.
31869          */
31870         uint16_t        cmpl_ring;
31871         /*
31872          * The sequence ID is used by the driver for tracking multiple
31873          * commands. This ID is treated as opaque data by the firmware and
31874          * the value is returned in the `hwrm_resp_hdr` upon completion.
31875          */
31876         uint16_t        seq_id;
31877         /*
31878          * The target ID of the command:
31879          * * 0x0-0xFFF8 - The function ID
31880          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31881          * * 0xFFFD - Reserved for user-space HWRM interface
31882          * * 0xFFFF - HWRM
31883          */
31884         uint16_t        target_id;
31885         /*
31886          * A physical address pointer pointing to a host buffer that the
31887          * command's response data will be written. This can be either a host
31888          * physical address (HPA) or a guest physical address (GPA) and must
31889          * point to a physically contiguous block of memory.
31890          */
31891         uint64_t        resp_addr;
31892         uint32_t        flags;
31893         /*
31894          * Enumeration denoting the RX, TX type of the resource.
31895          * This enumeration is used for resources that are similar for both
31896          * TX and RX paths of the chip.
31897          */
31898         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH      UINT32_C(0x1)
31899         /* tx path */
31900         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
31901         /* rx path */
31902         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
31903         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST \
31904                 HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
31905         /*
31906          * When this bit is set to '0', the query is
31907          * for PRI from tunnel headers.
31908          * When this bit is set to '1', the query is
31909          * for PRI from inner packet headers.
31910          */
31911         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN     UINT32_C(0x2)
31912         /*
31913          * Port ID of port for which the table is being configured.
31914          * The HWRM needs to check whether this function is allowed
31915          * to configure pri2cos mapping on this port.
31916          */
31917         uint8_t port_id;
31918         uint8_t unused_0[3];
31919 } __rte_packed;
31920
31921 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
31922 struct hwrm_queue_pri2cos_qcfg_output {
31923         /* The specific error status for the command. */
31924         uint16_t        error_code;
31925         /* The HWRM command request type. */
31926         uint16_t        req_type;
31927         /* The sequence ID from the original command. */
31928         uint16_t        seq_id;
31929         /* The length of the response data in number of bytes. */
31930         uint16_t        resp_len;
31931         /*
31932          * CoS Queue assigned to priority 0. This value can only
31933          * be changed before traffic has started.
31934          * A value of 0xff indicates that no CoS queue is assigned to the
31935          * specified priority.
31936          */
31937         uint8_t pri0_cos_queue_id;
31938         /*
31939          * CoS Queue assigned to priority 1. This value can only
31940          * be changed before traffic has started.
31941          * A value of 0xff indicates that no CoS queue is assigned to the
31942          * specified priority.
31943          */
31944         uint8_t pri1_cos_queue_id;
31945         /*
31946          * CoS Queue assigned to priority 2. This value can only
31947          * be changed before traffic has started.
31948          * A value of 0xff indicates that no CoS queue is assigned to the
31949          * specified priority.
31950          */
31951         uint8_t pri2_cos_queue_id;
31952         /*
31953          * CoS Queue assigned to priority 3. This value can only
31954          * be changed before traffic has started.
31955          * A value of 0xff indicates that no CoS queue is assigned to the
31956          * specified priority.
31957          */
31958         uint8_t pri3_cos_queue_id;
31959         /*
31960          * CoS Queue assigned to priority 4. This value can only
31961          * be changed before traffic has started.
31962          * A value of 0xff indicates that no CoS queue is assigned to the
31963          * specified priority.
31964          */
31965         uint8_t pri4_cos_queue_id;
31966         /*
31967          * CoS Queue assigned to priority 5. This value can only
31968          * be changed before traffic has started.
31969          * A value of 0xff indicates that no CoS queue is assigned to the
31970          * specified priority.
31971          */
31972         uint8_t pri5_cos_queue_id;
31973         /*
31974          * CoS Queue assigned to priority 6. This value can only
31975          * be changed before traffic has started.
31976          * A value of 0xff indicates that no CoS queue is assigned to the
31977          * specified priority.
31978          */
31979         uint8_t pri6_cos_queue_id;
31980         /*
31981          * CoS Queue assigned to priority 7. This value can only
31982          * be changed before traffic has started.
31983          * A value of 0xff indicates that no CoS queue is assigned to the
31984          * specified priority.
31985          */
31986         uint8_t pri7_cos_queue_id;
31987         /* Information about queue configuration. */
31988         uint8_t queue_cfg_info;
31989         /*
31990          * If this flag is set to '1', then the PRI to CoS
31991          * configuration is asymmetric on TX and RX sides.
31992          * If this flag is set to '0', then PRI to CoS configuration
31993          * is symmetric on TX and RX sides.
31994          */
31995         #define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
31996                 UINT32_C(0x1)
31997         uint8_t unused_0[6];
31998         /*
31999          * This field is used in Output records to indicate that the output
32000          * is completely written to RAM. This field should be read as '1'
32001          * to indicate that the output has been completely written.
32002          * When writing a command completion or response to an internal processor,
32003          * the order of writes has to be such that this field is written last.
32004          */
32005         uint8_t valid;
32006 } __rte_packed;
32007
32008 /**************************
32009  * hwrm_queue_pri2cos_cfg *
32010  **************************/
32011
32012
32013 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
32014 struct hwrm_queue_pri2cos_cfg_input {
32015         /* The HWRM command request type. */
32016         uint16_t        req_type;
32017         /*
32018          * The completion ring to send the completion event on. This should
32019          * be the NQ ID returned from the `nq_alloc` HWRM command.
32020          */
32021         uint16_t        cmpl_ring;
32022         /*
32023          * The sequence ID is used by the driver for tracking multiple
32024          * commands. This ID is treated as opaque data by the firmware and
32025          * the value is returned in the `hwrm_resp_hdr` upon completion.
32026          */
32027         uint16_t        seq_id;
32028         /*
32029          * The target ID of the command:
32030          * * 0x0-0xFFF8 - The function ID
32031          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32032          * * 0xFFFD - Reserved for user-space HWRM interface
32033          * * 0xFFFF - HWRM
32034          */
32035         uint16_t        target_id;
32036         /*
32037          * A physical address pointer pointing to a host buffer that the
32038          * command's response data will be written. This can be either a host
32039          * physical address (HPA) or a guest physical address (GPA) and must
32040          * point to a physically contiguous block of memory.
32041          */
32042         uint64_t        resp_addr;
32043         uint32_t        flags;
32044         /*
32045          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
32046          * This enumeration is used for resources that are similar for both
32047          * TX and RX paths of the chip.
32048          */
32049         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
32050         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT  0
32051         /* tx path */
32052         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
32053         /* rx path */
32054         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
32055         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
32056         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
32057         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST \
32058                 HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
32059         /*
32060          * When this bit is set to '0', the mapping is requested
32061          * for PRI from tunnel headers.
32062          * When this bit is set to '1', the mapping is requested
32063          * for PRI from inner packet headers.
32064          */
32065         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN     UINT32_C(0x4)
32066         uint32_t        enables;
32067         /*
32068          * This bit must be '1' for the pri0_cos_queue_id field to be
32069          * configured.
32070          */
32071         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID \
32072                 UINT32_C(0x1)
32073         /*
32074          * This bit must be '1' for the pri1_cos_queue_id field to be
32075          * configured.
32076          */
32077         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID \
32078                 UINT32_C(0x2)
32079         /*
32080          * This bit must be '1' for the pri2_cos_queue_id field to be
32081          * configured.
32082          */
32083         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID \
32084                 UINT32_C(0x4)
32085         /*
32086          * This bit must be '1' for the pri3_cos_queue_id field to be
32087          * configured.
32088          */
32089         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID \
32090                 UINT32_C(0x8)
32091         /*
32092          * This bit must be '1' for the pri4_cos_queue_id field to be
32093          * configured.
32094          */
32095         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID \
32096                 UINT32_C(0x10)
32097         /*
32098          * This bit must be '1' for the pri5_cos_queue_id field to be
32099          * configured.
32100          */
32101         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID \
32102                 UINT32_C(0x20)
32103         /*
32104          * This bit must be '1' for the pri6_cos_queue_id field to be
32105          * configured.
32106          */
32107         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID \
32108                 UINT32_C(0x40)
32109         /*
32110          * This bit must be '1' for the pri7_cos_queue_id field to be
32111          * configured.
32112          */
32113         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID \
32114                 UINT32_C(0x80)
32115         /*
32116          * Port ID of port for which the table is being configured.
32117          * The HWRM needs to check whether this function is allowed
32118          * to configure pri2cos mapping on this port.
32119          */
32120         uint8_t port_id;
32121         /*
32122          * CoS Queue assigned to priority 0. This value can only
32123          * be changed before traffic has started.
32124          */
32125         uint8_t pri0_cos_queue_id;
32126         /*
32127          * CoS Queue assigned to priority 1. This value can only
32128          * be changed before traffic has started.
32129          */
32130         uint8_t pri1_cos_queue_id;
32131         /*
32132          * CoS Queue assigned to priority 2  This value can only
32133          * be changed before traffic has started.
32134          */
32135         uint8_t pri2_cos_queue_id;
32136         /*
32137          * CoS Queue assigned to priority 3. This value can only
32138          * be changed before traffic has started.
32139          */
32140         uint8_t pri3_cos_queue_id;
32141         /*
32142          * CoS Queue assigned to priority 4. This value can only
32143          * be changed before traffic has started.
32144          */
32145         uint8_t pri4_cos_queue_id;
32146         /*
32147          * CoS Queue assigned to priority 5. This value can only
32148          * be changed before traffic has started.
32149          */
32150         uint8_t pri5_cos_queue_id;
32151         /*
32152          * CoS Queue assigned to priority 6. This value can only
32153          * be changed before traffic has started.
32154          */
32155         uint8_t pri6_cos_queue_id;
32156         /*
32157          * CoS Queue assigned to priority 7. This value can only
32158          * be changed before traffic has started.
32159          */
32160         uint8_t pri7_cos_queue_id;
32161         uint8_t unused_0[7];
32162 } __rte_packed;
32163
32164 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
32165 struct hwrm_queue_pri2cos_cfg_output {
32166         /* The specific error status for the command. */
32167         uint16_t        error_code;
32168         /* The HWRM command request type. */
32169         uint16_t        req_type;
32170         /* The sequence ID from the original command. */
32171         uint16_t        seq_id;
32172         /* The length of the response data in number of bytes. */
32173         uint16_t        resp_len;
32174         uint8_t unused_0[7];
32175         /*
32176          * This field is used in Output records to indicate that the output
32177          * is completely written to RAM. This field should be read as '1'
32178          * to indicate that the output has been completely written.
32179          * When writing a command completion or response to an internal processor,
32180          * the order of writes has to be such that this field is written last.
32181          */
32182         uint8_t valid;
32183 } __rte_packed;
32184
32185 /**************************
32186  * hwrm_queue_cos2bw_qcfg *
32187  **************************/
32188
32189
32190 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
32191 struct hwrm_queue_cos2bw_qcfg_input {
32192         /* The HWRM command request type. */
32193         uint16_t        req_type;
32194         /*
32195          * The completion ring to send the completion event on. This should
32196          * be the NQ ID returned from the `nq_alloc` HWRM command.
32197          */
32198         uint16_t        cmpl_ring;
32199         /*
32200          * The sequence ID is used by the driver for tracking multiple
32201          * commands. This ID is treated as opaque data by the firmware and
32202          * the value is returned in the `hwrm_resp_hdr` upon completion.
32203          */
32204         uint16_t        seq_id;
32205         /*
32206          * The target ID of the command:
32207          * * 0x0-0xFFF8 - The function ID
32208          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32209          * * 0xFFFD - Reserved for user-space HWRM interface
32210          * * 0xFFFF - HWRM
32211          */
32212         uint16_t        target_id;
32213         /*
32214          * A physical address pointer pointing to a host buffer that the
32215          * command's response data will be written. This can be either a host
32216          * physical address (HPA) or a guest physical address (GPA) and must
32217          * point to a physically contiguous block of memory.
32218          */
32219         uint64_t        resp_addr;
32220         /*
32221          * Port ID of port for which the table is being configured.
32222          * The HWRM needs to check whether this function is allowed
32223          * to configure TC BW assignment on this port.
32224          */
32225         uint16_t        port_id;
32226         uint8_t unused_0[6];
32227 } __rte_packed;
32228
32229 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
32230 struct hwrm_queue_cos2bw_qcfg_output {
32231         /* The specific error status for the command. */
32232         uint16_t        error_code;
32233         /* The HWRM command request type. */
32234         uint16_t        req_type;
32235         /* The sequence ID from the original command. */
32236         uint16_t        seq_id;
32237         /* The length of the response data in number of bytes. */
32238         uint16_t        resp_len;
32239         /* ID of CoS Queue 0. */
32240         uint8_t queue_id0;
32241         uint8_t unused_0;
32242         uint16_t        unused_1;
32243         /*
32244          * Minimum BW allocated to CoS Queue.
32245          * The HWRM will translate this value into byte counter and
32246          * time interval used for this COS inside the device.
32247          */
32248         uint32_t        queue_id0_min_bw;
32249         /* The bandwidth value. */
32250         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
32251                 UINT32_C(0xfffffff)
32252         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
32253                 0
32254         /* The granularity of the value (bits or bytes). */
32255         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE \
32256                 UINT32_C(0x10000000)
32257         /* Value is in bits. */
32258         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
32259                 (UINT32_C(0x0) << 28)
32260         /* Value is in bytes. */
32261         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
32262                 (UINT32_C(0x1) << 28)
32263         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
32264                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
32265         /* bw_value_unit is 3 b */
32266         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
32267                 UINT32_C(0xe0000000)
32268         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
32269                 29
32270         /* Value is in Mb or MB (base 10). */
32271         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
32272                 (UINT32_C(0x0) << 29)
32273         /* Value is in Kb or KB (base 10). */
32274         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
32275                 (UINT32_C(0x2) << 29)
32276         /* Value is in bits or bytes. */
32277         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
32278                 (UINT32_C(0x4) << 29)
32279         /* Value is in Gb or GB (base 10). */
32280         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
32281                 (UINT32_C(0x6) << 29)
32282         /* Value is in 1/100th of a percentage of total bandwidth. */
32283         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
32284                 (UINT32_C(0x1) << 29)
32285         /* Invalid unit */
32286         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
32287                 (UINT32_C(0x7) << 29)
32288         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
32289                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
32290         /*
32291          * Maximum BW allocated to CoS Queue.
32292          * The HWRM will translate this value into byte counter and
32293          * time interval used for this COS inside the device.
32294          */
32295         uint32_t        queue_id0_max_bw;
32296         /* The bandwidth value. */
32297         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
32298                 UINT32_C(0xfffffff)
32299         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
32300                 0
32301         /* The granularity of the value (bits or bytes). */
32302         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE \
32303                 UINT32_C(0x10000000)
32304         /* Value is in bits. */
32305         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
32306                 (UINT32_C(0x0) << 28)
32307         /* Value is in bytes. */
32308         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
32309                 (UINT32_C(0x1) << 28)
32310         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
32311                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
32312         /* bw_value_unit is 3 b */
32313         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
32314                 UINT32_C(0xe0000000)
32315         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
32316                 29
32317         /* Value is in Mb or MB (base 10). */
32318         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
32319                 (UINT32_C(0x0) << 29)
32320         /* Value is in Kb or KB (base 10). */
32321         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
32322                 (UINT32_C(0x2) << 29)
32323         /* Value is in bits or bytes. */
32324         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
32325                 (UINT32_C(0x4) << 29)
32326         /* Value is in Gb or GB (base 10). */
32327         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
32328                 (UINT32_C(0x6) << 29)
32329         /* Value is in 1/100th of a percentage of total bandwidth. */
32330         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
32331                 (UINT32_C(0x1) << 29)
32332         /* Invalid unit */
32333         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
32334                 (UINT32_C(0x7) << 29)
32335         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
32336                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
32337         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
32338         uint8_t queue_id0_tsa_assign;
32339         /* Strict Priority */
32340         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP \
32341                 UINT32_C(0x0)
32342         /* Enhanced Transmission Selection */
32343         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
32344                 UINT32_C(0x1)
32345         /* reserved. */
32346         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
32347                 UINT32_C(0x2)
32348         /* reserved. */
32349         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
32350                 UINT32_C(0xff)
32351         /*
32352          * Priority level for strict priority. Valid only when the
32353          * tsa_assign is 0 - Strict Priority (SP)
32354          * 0..7 - Valid values.
32355          * 8..255 - Reserved.
32356          */
32357         uint8_t queue_id0_pri_lvl;
32358         /*
32359          * Weight used to allocate remaining BW for this COS after
32360          * servicing guaranteed bandwidths for all COS.
32361          */
32362         uint8_t queue_id0_bw_weight;
32363         /* ID of CoS Queue 1. */
32364         uint8_t queue_id1;
32365         /*
32366          * Minimum BW allocated to CoS Queue.
32367          * The HWRM will translate this value into byte counter and
32368          * time interval used for this COS inside the device.
32369          */
32370         uint32_t        queue_id1_min_bw;
32371         /* The bandwidth value. */
32372         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
32373                 UINT32_C(0xfffffff)
32374         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
32375                 0
32376         /* The granularity of the value (bits or bytes). */
32377         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE \
32378                 UINT32_C(0x10000000)
32379         /* Value is in bits. */
32380         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
32381                 (UINT32_C(0x0) << 28)
32382         /* Value is in bytes. */
32383         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
32384                 (UINT32_C(0x1) << 28)
32385         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
32386                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
32387         /* bw_value_unit is 3 b */
32388         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
32389                 UINT32_C(0xe0000000)
32390         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
32391                 29
32392         /* Value is in Mb or MB (base 10). */
32393         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
32394                 (UINT32_C(0x0) << 29)
32395         /* Value is in Kb or KB (base 10). */
32396         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
32397                 (UINT32_C(0x2) << 29)
32398         /* Value is in bits or bytes. */
32399         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
32400                 (UINT32_C(0x4) << 29)
32401         /* Value is in Gb or GB (base 10). */
32402         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
32403                 (UINT32_C(0x6) << 29)
32404         /* Value is in 1/100th of a percentage of total bandwidth. */
32405         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
32406                 (UINT32_C(0x1) << 29)
32407         /* Invalid unit */
32408         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
32409                 (UINT32_C(0x7) << 29)
32410         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
32411                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
32412         /*
32413          * Maximum BW allocated to CoS queue.
32414          * The HWRM will translate this value into byte counter and
32415          * time interval used for this COS inside the device.
32416          */
32417         uint32_t        queue_id1_max_bw;
32418         /* The bandwidth value. */
32419         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
32420                 UINT32_C(0xfffffff)
32421         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
32422                 0
32423         /* The granularity of the value (bits or bytes). */
32424         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE \
32425                 UINT32_C(0x10000000)
32426         /* Value is in bits. */
32427         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
32428                 (UINT32_C(0x0) << 28)
32429         /* Value is in bytes. */
32430         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
32431                 (UINT32_C(0x1) << 28)
32432         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
32433                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
32434         /* bw_value_unit is 3 b */
32435         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
32436                 UINT32_C(0xe0000000)
32437         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
32438                 29
32439         /* Value is in Mb or MB (base 10). */
32440         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
32441                 (UINT32_C(0x0) << 29)
32442         /* Value is in Kb or KB (base 10). */
32443         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
32444                 (UINT32_C(0x2) << 29)
32445         /* Value is in bits or bytes. */
32446         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
32447                 (UINT32_C(0x4) << 29)
32448         /* Value is in Gb or GB (base 10). */
32449         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
32450                 (UINT32_C(0x6) << 29)
32451         /* Value is in 1/100th of a percentage of total bandwidth. */
32452         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
32453                 (UINT32_C(0x1) << 29)
32454         /* Invalid unit */
32455         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
32456                 (UINT32_C(0x7) << 29)
32457         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
32458                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
32459         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
32460         uint8_t queue_id1_tsa_assign;
32461         /* Strict Priority */
32462         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP \
32463                 UINT32_C(0x0)
32464         /* Enhanced Transmission Selection */
32465         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
32466                 UINT32_C(0x1)
32467         /* reserved. */
32468         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
32469                 UINT32_C(0x2)
32470         /* reserved. */
32471         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
32472                 UINT32_C(0xff)
32473         /*
32474          * Priority level for strict priority. Valid only when the
32475          * tsa_assign is 0 - Strict Priority (SP)
32476          * 0..7 - Valid values.
32477          * 8..255 - Reserved.
32478          */
32479         uint8_t queue_id1_pri_lvl;
32480         /*
32481          * Weight used to allocate remaining BW for this COS after
32482          * servicing guaranteed bandwidths for all COS.
32483          */
32484         uint8_t queue_id1_bw_weight;
32485         /* ID of CoS Queue 2. */
32486         uint8_t queue_id2;
32487         /*
32488          * Minimum BW allocated to CoS Queue.
32489          * The HWRM will translate this value into byte counter and
32490          * time interval used for this COS inside the device.
32491          */
32492         uint32_t        queue_id2_min_bw;
32493         /* The bandwidth value. */
32494         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
32495                 UINT32_C(0xfffffff)
32496         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
32497                 0
32498         /* The granularity of the value (bits or bytes). */
32499         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE \
32500                 UINT32_C(0x10000000)
32501         /* Value is in bits. */
32502         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
32503                 (UINT32_C(0x0) << 28)
32504         /* Value is in bytes. */
32505         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
32506                 (UINT32_C(0x1) << 28)
32507         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
32508                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
32509         /* bw_value_unit is 3 b */
32510         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
32511                 UINT32_C(0xe0000000)
32512         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
32513                 29
32514         /* Value is in Mb or MB (base 10). */
32515         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
32516                 (UINT32_C(0x0) << 29)
32517         /* Value is in Kb or KB (base 10). */
32518         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
32519                 (UINT32_C(0x2) << 29)
32520         /* Value is in bits or bytes. */
32521         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
32522                 (UINT32_C(0x4) << 29)
32523         /* Value is in Gb or GB (base 10). */
32524         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
32525                 (UINT32_C(0x6) << 29)
32526         /* Value is in 1/100th of a percentage of total bandwidth. */
32527         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
32528                 (UINT32_C(0x1) << 29)
32529         /* Invalid unit */
32530         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
32531                 (UINT32_C(0x7) << 29)
32532         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
32533                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
32534         /*
32535          * Maximum BW allocated to CoS queue.
32536          * The HWRM will translate this value into byte counter and
32537          * time interval used for this COS inside the device.
32538          */
32539         uint32_t        queue_id2_max_bw;
32540         /* The bandwidth value. */
32541         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
32542                 UINT32_C(0xfffffff)
32543         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
32544                 0
32545         /* The granularity of the value (bits or bytes). */
32546         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE \
32547                 UINT32_C(0x10000000)
32548         /* Value is in bits. */
32549         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
32550                 (UINT32_C(0x0) << 28)
32551         /* Value is in bytes. */
32552         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
32553                 (UINT32_C(0x1) << 28)
32554         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
32555                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
32556         /* bw_value_unit is 3 b */
32557         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
32558                 UINT32_C(0xe0000000)
32559         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
32560                 29
32561         /* Value is in Mb or MB (base 10). */
32562         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
32563                 (UINT32_C(0x0) << 29)
32564         /* Value is in Kb or KB (base 10). */
32565         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
32566                 (UINT32_C(0x2) << 29)
32567         /* Value is in bits or bytes. */
32568         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
32569                 (UINT32_C(0x4) << 29)
32570         /* Value is in Gb or GB (base 10). */
32571         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
32572                 (UINT32_C(0x6) << 29)
32573         /* Value is in 1/100th of a percentage of total bandwidth. */
32574         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
32575                 (UINT32_C(0x1) << 29)
32576         /* Invalid unit */
32577         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
32578                 (UINT32_C(0x7) << 29)
32579         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
32580                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
32581         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
32582         uint8_t queue_id2_tsa_assign;
32583         /* Strict Priority */
32584         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP \
32585                 UINT32_C(0x0)
32586         /* Enhanced Transmission Selection */
32587         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
32588                 UINT32_C(0x1)
32589         /* reserved. */
32590         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
32591                 UINT32_C(0x2)
32592         /* reserved. */
32593         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
32594                 UINT32_C(0xff)
32595         /*
32596          * Priority level for strict priority. Valid only when the
32597          * tsa_assign is 0 - Strict Priority (SP)
32598          * 0..7 - Valid values.
32599          * 8..255 - Reserved.
32600          */
32601         uint8_t queue_id2_pri_lvl;
32602         /*
32603          * Weight used to allocate remaining BW for this COS after
32604          * servicing guaranteed bandwidths for all COS.
32605          */
32606         uint8_t queue_id2_bw_weight;
32607         /* ID of CoS Queue 3. */
32608         uint8_t queue_id3;
32609         /*
32610          * Minimum BW allocated to CoS Queue.
32611          * The HWRM will translate this value into byte counter and
32612          * time interval used for this COS inside the device.
32613          */
32614         uint32_t        queue_id3_min_bw;
32615         /* The bandwidth value. */
32616         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
32617                 UINT32_C(0xfffffff)
32618         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
32619                 0
32620         /* The granularity of the value (bits or bytes). */
32621         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE \
32622                 UINT32_C(0x10000000)
32623         /* Value is in bits. */
32624         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
32625                 (UINT32_C(0x0) << 28)
32626         /* Value is in bytes. */
32627         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
32628                 (UINT32_C(0x1) << 28)
32629         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
32630                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
32631         /* bw_value_unit is 3 b */
32632         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
32633                 UINT32_C(0xe0000000)
32634         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
32635                 29
32636         /* Value is in Mb or MB (base 10). */
32637         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
32638                 (UINT32_C(0x0) << 29)
32639         /* Value is in Kb or KB (base 10). */
32640         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
32641                 (UINT32_C(0x2) << 29)
32642         /* Value is in bits or bytes. */
32643         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
32644                 (UINT32_C(0x4) << 29)
32645         /* Value is in Gb or GB (base 10). */
32646         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
32647                 (UINT32_C(0x6) << 29)
32648         /* Value is in 1/100th of a percentage of total bandwidth. */
32649         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
32650                 (UINT32_C(0x1) << 29)
32651         /* Invalid unit */
32652         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
32653                 (UINT32_C(0x7) << 29)
32654         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
32655                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
32656         /*
32657          * Maximum BW allocated to CoS queue.
32658          * The HWRM will translate this value into byte counter and
32659          * time interval used for this COS inside the device.
32660          */
32661         uint32_t        queue_id3_max_bw;
32662         /* The bandwidth value. */
32663         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
32664                 UINT32_C(0xfffffff)
32665         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
32666                 0
32667         /* The granularity of the value (bits or bytes). */
32668         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE \
32669                 UINT32_C(0x10000000)
32670         /* Value is in bits. */
32671         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
32672                 (UINT32_C(0x0) << 28)
32673         /* Value is in bytes. */
32674         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
32675                 (UINT32_C(0x1) << 28)
32676         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
32677                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
32678         /* bw_value_unit is 3 b */
32679         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
32680                 UINT32_C(0xe0000000)
32681         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
32682                 29
32683         /* Value is in Mb or MB (base 10). */
32684         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
32685                 (UINT32_C(0x0) << 29)
32686         /* Value is in Kb or KB (base 10). */
32687         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
32688                 (UINT32_C(0x2) << 29)
32689         /* Value is in bits or bytes. */
32690         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
32691                 (UINT32_C(0x4) << 29)
32692         /* Value is in Gb or GB (base 10). */
32693         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
32694                 (UINT32_C(0x6) << 29)
32695         /* Value is in 1/100th of a percentage of total bandwidth. */
32696         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
32697                 (UINT32_C(0x1) << 29)
32698         /* Invalid unit */
32699         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
32700                 (UINT32_C(0x7) << 29)
32701         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
32702                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
32703         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
32704         uint8_t queue_id3_tsa_assign;
32705         /* Strict Priority */
32706         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP \
32707                 UINT32_C(0x0)
32708         /* Enhanced Transmission Selection */
32709         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
32710                 UINT32_C(0x1)
32711         /* reserved. */
32712         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
32713                 UINT32_C(0x2)
32714         /* reserved. */
32715         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
32716                 UINT32_C(0xff)
32717         /*
32718          * Priority level for strict priority. Valid only when the
32719          * tsa_assign is 0 - Strict Priority (SP)
32720          * 0..7 - Valid values.
32721          * 8..255 - Reserved.
32722          */
32723         uint8_t queue_id3_pri_lvl;
32724         /*
32725          * Weight used to allocate remaining BW for this COS after
32726          * servicing guaranteed bandwidths for all COS.
32727          */
32728         uint8_t queue_id3_bw_weight;
32729         /* ID of CoS Queue 4. */
32730         uint8_t queue_id4;
32731         /*
32732          * Minimum BW allocated to CoS Queue.
32733          * The HWRM will translate this value into byte counter and
32734          * time interval used for this COS inside the device.
32735          */
32736         uint32_t        queue_id4_min_bw;
32737         /* The bandwidth value. */
32738         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
32739                 UINT32_C(0xfffffff)
32740         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
32741                 0
32742         /* The granularity of the value (bits or bytes). */
32743         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE \
32744                 UINT32_C(0x10000000)
32745         /* Value is in bits. */
32746         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
32747                 (UINT32_C(0x0) << 28)
32748         /* Value is in bytes. */
32749         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
32750                 (UINT32_C(0x1) << 28)
32751         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
32752                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
32753         /* bw_value_unit is 3 b */
32754         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
32755                 UINT32_C(0xe0000000)
32756         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
32757                 29
32758         /* Value is in Mb or MB (base 10). */
32759         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
32760                 (UINT32_C(0x0) << 29)
32761         /* Value is in Kb or KB (base 10). */
32762         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
32763                 (UINT32_C(0x2) << 29)
32764         /* Value is in bits or bytes. */
32765         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
32766                 (UINT32_C(0x4) << 29)
32767         /* Value is in Gb or GB (base 10). */
32768         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
32769                 (UINT32_C(0x6) << 29)
32770         /* Value is in 1/100th of a percentage of total bandwidth. */
32771         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
32772                 (UINT32_C(0x1) << 29)
32773         /* Invalid unit */
32774         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
32775                 (UINT32_C(0x7) << 29)
32776         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
32777                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
32778         /*
32779          * Maximum BW allocated to CoS queue.
32780          * The HWRM will translate this value into byte counter and
32781          * time interval used for this COS inside the device.
32782          */
32783         uint32_t        queue_id4_max_bw;
32784         /* The bandwidth value. */
32785         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
32786                 UINT32_C(0xfffffff)
32787         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
32788                 0
32789         /* The granularity of the value (bits or bytes). */
32790         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE \
32791                 UINT32_C(0x10000000)
32792         /* Value is in bits. */
32793         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
32794                 (UINT32_C(0x0) << 28)
32795         /* Value is in bytes. */
32796         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
32797                 (UINT32_C(0x1) << 28)
32798         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
32799                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
32800         /* bw_value_unit is 3 b */
32801         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
32802                 UINT32_C(0xe0000000)
32803         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
32804                 29
32805         /* Value is in Mb or MB (base 10). */
32806         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
32807                 (UINT32_C(0x0) << 29)
32808         /* Value is in Kb or KB (base 10). */
32809         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
32810                 (UINT32_C(0x2) << 29)
32811         /* Value is in bits or bytes. */
32812         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
32813                 (UINT32_C(0x4) << 29)
32814         /* Value is in Gb or GB (base 10). */
32815         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
32816                 (UINT32_C(0x6) << 29)
32817         /* Value is in 1/100th of a percentage of total bandwidth. */
32818         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
32819                 (UINT32_C(0x1) << 29)
32820         /* Invalid unit */
32821         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
32822                 (UINT32_C(0x7) << 29)
32823         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
32824                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
32825         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
32826         uint8_t queue_id4_tsa_assign;
32827         /* Strict Priority */
32828         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP \
32829                 UINT32_C(0x0)
32830         /* Enhanced Transmission Selection */
32831         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
32832                 UINT32_C(0x1)
32833         /* reserved. */
32834         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
32835                 UINT32_C(0x2)
32836         /* reserved. */
32837         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
32838                 UINT32_C(0xff)
32839         /*
32840          * Priority level for strict priority. Valid only when the
32841          * tsa_assign is 0 - Strict Priority (SP)
32842          * 0..7 - Valid values.
32843          * 8..255 - Reserved.
32844          */
32845         uint8_t queue_id4_pri_lvl;
32846         /*
32847          * Weight used to allocate remaining BW for this COS after
32848          * servicing guaranteed bandwidths for all COS.
32849          */
32850         uint8_t queue_id4_bw_weight;
32851         /* ID of CoS Queue 5. */
32852         uint8_t queue_id5;
32853         /*
32854          * Minimum BW allocated to CoS Queue.
32855          * The HWRM will translate this value into byte counter and
32856          * time interval used for this COS inside the device.
32857          */
32858         uint32_t        queue_id5_min_bw;
32859         /* The bandwidth value. */
32860         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
32861                 UINT32_C(0xfffffff)
32862         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
32863                 0
32864         /* The granularity of the value (bits or bytes). */
32865         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE \
32866                 UINT32_C(0x10000000)
32867         /* Value is in bits. */
32868         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
32869                 (UINT32_C(0x0) << 28)
32870         /* Value is in bytes. */
32871         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
32872                 (UINT32_C(0x1) << 28)
32873         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
32874                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
32875         /* bw_value_unit is 3 b */
32876         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
32877                 UINT32_C(0xe0000000)
32878         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
32879                 29
32880         /* Value is in Mb or MB (base 10). */
32881         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
32882                 (UINT32_C(0x0) << 29)
32883         /* Value is in Kb or KB (base 10). */
32884         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
32885                 (UINT32_C(0x2) << 29)
32886         /* Value is in bits or bytes. */
32887         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
32888                 (UINT32_C(0x4) << 29)
32889         /* Value is in Gb or GB (base 10). */
32890         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
32891                 (UINT32_C(0x6) << 29)
32892         /* Value is in 1/100th of a percentage of total bandwidth. */
32893         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
32894                 (UINT32_C(0x1) << 29)
32895         /* Invalid unit */
32896         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
32897                 (UINT32_C(0x7) << 29)
32898         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
32899                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
32900         /*
32901          * Maximum BW allocated to CoS queue.
32902          * The HWRM will translate this value into byte counter and
32903          * time interval used for this COS inside the device.
32904          */
32905         uint32_t        queue_id5_max_bw;
32906         /* The bandwidth value. */
32907         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
32908                 UINT32_C(0xfffffff)
32909         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
32910                 0
32911         /* The granularity of the value (bits or bytes). */
32912         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE \
32913                 UINT32_C(0x10000000)
32914         /* Value is in bits. */
32915         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
32916                 (UINT32_C(0x0) << 28)
32917         /* Value is in bytes. */
32918         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
32919                 (UINT32_C(0x1) << 28)
32920         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
32921                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
32922         /* bw_value_unit is 3 b */
32923         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
32924                 UINT32_C(0xe0000000)
32925         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
32926                 29
32927         /* Value is in Mb or MB (base 10). */
32928         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
32929                 (UINT32_C(0x0) << 29)
32930         /* Value is in Kb or KB (base 10). */
32931         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
32932                 (UINT32_C(0x2) << 29)
32933         /* Value is in bits or bytes. */
32934         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
32935                 (UINT32_C(0x4) << 29)
32936         /* Value is in Gb or GB (base 10). */
32937         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
32938                 (UINT32_C(0x6) << 29)
32939         /* Value is in 1/100th of a percentage of total bandwidth. */
32940         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
32941                 (UINT32_C(0x1) << 29)
32942         /* Invalid unit */
32943         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
32944                 (UINT32_C(0x7) << 29)
32945         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
32946                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
32947         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
32948         uint8_t queue_id5_tsa_assign;
32949         /* Strict Priority */
32950         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP \
32951                 UINT32_C(0x0)
32952         /* Enhanced Transmission Selection */
32953         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
32954                 UINT32_C(0x1)
32955         /* reserved. */
32956         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
32957                 UINT32_C(0x2)
32958         /* reserved. */
32959         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
32960                 UINT32_C(0xff)
32961         /*
32962          * Priority level for strict priority. Valid only when the
32963          * tsa_assign is 0 - Strict Priority (SP)
32964          * 0..7 - Valid values.
32965          * 8..255 - Reserved.
32966          */
32967         uint8_t queue_id5_pri_lvl;
32968         /*
32969          * Weight used to allocate remaining BW for this COS after
32970          * servicing guaranteed bandwidths for all COS.
32971          */
32972         uint8_t queue_id5_bw_weight;
32973         /* ID of CoS Queue 6. */
32974         uint8_t queue_id6;
32975         /*
32976          * Minimum BW allocated to CoS Queue.
32977          * The HWRM will translate this value into byte counter and
32978          * time interval used for this COS inside the device.
32979          */
32980         uint32_t        queue_id6_min_bw;
32981         /* The bandwidth value. */
32982         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
32983                 UINT32_C(0xfffffff)
32984         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
32985                 0
32986         /* The granularity of the value (bits or bytes). */
32987         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE \
32988                 UINT32_C(0x10000000)
32989         /* Value is in bits. */
32990         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
32991                 (UINT32_C(0x0) << 28)
32992         /* Value is in bytes. */
32993         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
32994                 (UINT32_C(0x1) << 28)
32995         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
32996                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
32997         /* bw_value_unit is 3 b */
32998         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
32999                 UINT32_C(0xe0000000)
33000         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
33001                 29
33002         /* Value is in Mb or MB (base 10). */
33003         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
33004                 (UINT32_C(0x0) << 29)
33005         /* Value is in Kb or KB (base 10). */
33006         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
33007                 (UINT32_C(0x2) << 29)
33008         /* Value is in bits or bytes. */
33009         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
33010                 (UINT32_C(0x4) << 29)
33011         /* Value is in Gb or GB (base 10). */
33012         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
33013                 (UINT32_C(0x6) << 29)
33014         /* Value is in 1/100th of a percentage of total bandwidth. */
33015         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
33016                 (UINT32_C(0x1) << 29)
33017         /* Invalid unit */
33018         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
33019                 (UINT32_C(0x7) << 29)
33020         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
33021                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
33022         /*
33023          * Maximum BW allocated to CoS queue.
33024          * The HWRM will translate this value into byte counter and
33025          * time interval used for this COS inside the device.
33026          */
33027         uint32_t        queue_id6_max_bw;
33028         /* The bandwidth value. */
33029         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
33030                 UINT32_C(0xfffffff)
33031         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
33032                 0
33033         /* The granularity of the value (bits or bytes). */
33034         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE \
33035                 UINT32_C(0x10000000)
33036         /* Value is in bits. */
33037         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
33038                 (UINT32_C(0x0) << 28)
33039         /* Value is in bytes. */
33040         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
33041                 (UINT32_C(0x1) << 28)
33042         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
33043                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
33044         /* bw_value_unit is 3 b */
33045         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
33046                 UINT32_C(0xe0000000)
33047         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
33048                 29
33049         /* Value is in Mb or MB (base 10). */
33050         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
33051                 (UINT32_C(0x0) << 29)
33052         /* Value is in Kb or KB (base 10). */
33053         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
33054                 (UINT32_C(0x2) << 29)
33055         /* Value is in bits or bytes. */
33056         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
33057                 (UINT32_C(0x4) << 29)
33058         /* Value is in Gb or GB (base 10). */
33059         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
33060                 (UINT32_C(0x6) << 29)
33061         /* Value is in 1/100th of a percentage of total bandwidth. */
33062         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
33063                 (UINT32_C(0x1) << 29)
33064         /* Invalid unit */
33065         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
33066                 (UINT32_C(0x7) << 29)
33067         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
33068                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
33069         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
33070         uint8_t queue_id6_tsa_assign;
33071         /* Strict Priority */
33072         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP \
33073                 UINT32_C(0x0)
33074         /* Enhanced Transmission Selection */
33075         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
33076                 UINT32_C(0x1)
33077         /* reserved. */
33078         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
33079                 UINT32_C(0x2)
33080         /* reserved. */
33081         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
33082                 UINT32_C(0xff)
33083         /*
33084          * Priority level for strict priority. Valid only when the
33085          * tsa_assign is 0 - Strict Priority (SP)
33086          * 0..7 - Valid values.
33087          * 8..255 - Reserved.
33088          */
33089         uint8_t queue_id6_pri_lvl;
33090         /*
33091          * Weight used to allocate remaining BW for this COS after
33092          * servicing guaranteed bandwidths for all COS.
33093          */
33094         uint8_t queue_id6_bw_weight;
33095         /* ID of CoS Queue 7. */
33096         uint8_t queue_id7;
33097         /*
33098          * Minimum BW allocated to CoS Queue.
33099          * The HWRM will translate this value into byte counter and
33100          * time interval used for this COS inside the device.
33101          */
33102         uint32_t        queue_id7_min_bw;
33103         /* The bandwidth value. */
33104         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
33105                 UINT32_C(0xfffffff)
33106         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
33107                 0
33108         /* The granularity of the value (bits or bytes). */
33109         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE \
33110                 UINT32_C(0x10000000)
33111         /* Value is in bits. */
33112         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
33113                 (UINT32_C(0x0) << 28)
33114         /* Value is in bytes. */
33115         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
33116                 (UINT32_C(0x1) << 28)
33117         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
33118                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
33119         /* bw_value_unit is 3 b */
33120         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
33121                 UINT32_C(0xe0000000)
33122         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
33123                 29
33124         /* Value is in Mb or MB (base 10). */
33125         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
33126                 (UINT32_C(0x0) << 29)
33127         /* Value is in Kb or KB (base 10). */
33128         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
33129                 (UINT32_C(0x2) << 29)
33130         /* Value is in bits or bytes. */
33131         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
33132                 (UINT32_C(0x4) << 29)
33133         /* Value is in Gb or GB (base 10). */
33134         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
33135                 (UINT32_C(0x6) << 29)
33136         /* Value is in 1/100th of a percentage of total bandwidth. */
33137         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
33138                 (UINT32_C(0x1) << 29)
33139         /* Invalid unit */
33140         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
33141                 (UINT32_C(0x7) << 29)
33142         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
33143                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
33144         /*
33145          * Maximum BW allocated to CoS queue.
33146          * The HWRM will translate this value into byte counter and
33147          * time interval used for this COS inside the device.
33148          */
33149         uint32_t        queue_id7_max_bw;
33150         /* The bandwidth value. */
33151         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
33152                 UINT32_C(0xfffffff)
33153         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
33154                 0
33155         /* The granularity of the value (bits or bytes). */
33156         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE \
33157                 UINT32_C(0x10000000)
33158         /* Value is in bits. */
33159         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
33160                 (UINT32_C(0x0) << 28)
33161         /* Value is in bytes. */
33162         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
33163                 (UINT32_C(0x1) << 28)
33164         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
33165                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
33166         /* bw_value_unit is 3 b */
33167         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
33168                 UINT32_C(0xe0000000)
33169         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
33170                 29
33171         /* Value is in Mb or MB (base 10). */
33172         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
33173                 (UINT32_C(0x0) << 29)
33174         /* Value is in Kb or KB (base 10). */
33175         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
33176                 (UINT32_C(0x2) << 29)
33177         /* Value is in bits or bytes. */
33178         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
33179                 (UINT32_C(0x4) << 29)
33180         /* Value is in Gb or GB (base 10). */
33181         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
33182                 (UINT32_C(0x6) << 29)
33183         /* Value is in 1/100th of a percentage of total bandwidth. */
33184         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
33185                 (UINT32_C(0x1) << 29)
33186         /* Invalid unit */
33187         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
33188                 (UINT32_C(0x7) << 29)
33189         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
33190                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
33191         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
33192         uint8_t queue_id7_tsa_assign;
33193         /* Strict Priority */
33194         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP \
33195                 UINT32_C(0x0)
33196         /* Enhanced Transmission Selection */
33197         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
33198                 UINT32_C(0x1)
33199         /* reserved. */
33200         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
33201                 UINT32_C(0x2)
33202         /* reserved. */
33203         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
33204                 UINT32_C(0xff)
33205         /*
33206          * Priority level for strict priority. Valid only when the
33207          * tsa_assign is 0 - Strict Priority (SP)
33208          * 0..7 - Valid values.
33209          * 8..255 - Reserved.
33210          */
33211         uint8_t queue_id7_pri_lvl;
33212         /*
33213          * Weight used to allocate remaining BW for this COS after
33214          * servicing guaranteed bandwidths for all COS.
33215          */
33216         uint8_t queue_id7_bw_weight;
33217         uint8_t unused_2[4];
33218         /*
33219          * This field is used in Output records to indicate that the output
33220          * is completely written to RAM. This field should be read as '1'
33221          * to indicate that the output has been completely written.
33222          * When writing a command completion or response to an internal processor,
33223          * the order of writes has to be such that this field is written last.
33224          */
33225         uint8_t valid;
33226 } __rte_packed;
33227
33228 /*************************
33229  * hwrm_queue_cos2bw_cfg *
33230  *************************/
33231
33232
33233 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
33234 struct hwrm_queue_cos2bw_cfg_input {
33235         /* The HWRM command request type. */
33236         uint16_t        req_type;
33237         /*
33238          * The completion ring to send the completion event on. This should
33239          * be the NQ ID returned from the `nq_alloc` HWRM command.
33240          */
33241         uint16_t        cmpl_ring;
33242         /*
33243          * The sequence ID is used by the driver for tracking multiple
33244          * commands. This ID is treated as opaque data by the firmware and
33245          * the value is returned in the `hwrm_resp_hdr` upon completion.
33246          */
33247         uint16_t        seq_id;
33248         /*
33249          * The target ID of the command:
33250          * * 0x0-0xFFF8 - The function ID
33251          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33252          * * 0xFFFD - Reserved for user-space HWRM interface
33253          * * 0xFFFF - HWRM
33254          */
33255         uint16_t        target_id;
33256         /*
33257          * A physical address pointer pointing to a host buffer that the
33258          * command's response data will be written. This can be either a host
33259          * physical address (HPA) or a guest physical address (GPA) and must
33260          * point to a physically contiguous block of memory.
33261          */
33262         uint64_t        resp_addr;
33263         uint32_t        flags;
33264         uint32_t        enables;
33265         /*
33266          * If this bit is set to 1, then all queue_id0 related
33267          * parameters in this command are valid.
33268          */
33269         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID \
33270                 UINT32_C(0x1)
33271         /*
33272          * If this bit is set to 1, then all queue_id1 related
33273          * parameters in this command are valid.
33274          */
33275         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID \
33276                 UINT32_C(0x2)
33277         /*
33278          * If this bit is set to 1, then all queue_id2 related
33279          * parameters in this command are valid.
33280          */
33281         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID \
33282                 UINT32_C(0x4)
33283         /*
33284          * If this bit is set to 1, then all queue_id3 related
33285          * parameters in this command are valid.
33286          */
33287         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID \
33288                 UINT32_C(0x8)
33289         /*
33290          * If this bit is set to 1, then all queue_id4 related
33291          * parameters in this command are valid.
33292          */
33293         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID \
33294                 UINT32_C(0x10)
33295         /*
33296          * If this bit is set to 1, then all queue_id5 related
33297          * parameters in this command are valid.
33298          */
33299         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID \
33300                 UINT32_C(0x20)
33301         /*
33302          * If this bit is set to 1, then all queue_id6 related
33303          * parameters in this command are valid.
33304          */
33305         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID \
33306                 UINT32_C(0x40)
33307         /*
33308          * If this bit is set to 1, then all queue_id7 related
33309          * parameters in this command are valid.
33310          */
33311         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID \
33312                 UINT32_C(0x80)
33313         /*
33314          * Port ID of port for which the table is being configured.
33315          * The HWRM needs to check whether this function is allowed
33316          * to configure TC BW assignment on this port.
33317          */
33318         uint16_t        port_id;
33319         /* ID of CoS Queue 0. */
33320         uint8_t queue_id0;
33321         uint8_t unused_0;
33322         /*
33323          * Minimum BW allocated to CoS Queue.
33324          * The HWRM will translate this value into byte counter and
33325          * time interval used for this COS inside the device.
33326          */
33327         uint32_t        queue_id0_min_bw;
33328         /* The bandwidth value. */
33329         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
33330                 UINT32_C(0xfffffff)
33331         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
33332                 0
33333         /* The granularity of the value (bits or bytes). */
33334         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE \
33335                 UINT32_C(0x10000000)
33336         /* Value is in bits. */
33337         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
33338                 (UINT32_C(0x0) << 28)
33339         /* Value is in bytes. */
33340         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
33341                 (UINT32_C(0x1) << 28)
33342         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
33343                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
33344         /* bw_value_unit is 3 b */
33345         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
33346                 UINT32_C(0xe0000000)
33347         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
33348                 29
33349         /* Value is in Mb or MB (base 10). */
33350         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
33351                 (UINT32_C(0x0) << 29)
33352         /* Value is in Kb or KB (base 10). */
33353         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
33354                 (UINT32_C(0x2) << 29)
33355         /* Value is in bits or bytes. */
33356         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
33357                 (UINT32_C(0x4) << 29)
33358         /* Value is in Gb or GB (base 10). */
33359         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
33360                 (UINT32_C(0x6) << 29)
33361         /* Value is in 1/100th of a percentage of total bandwidth. */
33362         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
33363                 (UINT32_C(0x1) << 29)
33364         /* Invalid unit */
33365         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
33366                 (UINT32_C(0x7) << 29)
33367         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
33368                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
33369         /*
33370          * Maximum BW allocated to CoS Queue.
33371          * The HWRM will translate this value into byte counter and
33372          * time interval used for this COS inside the device.
33373          */
33374         uint32_t        queue_id0_max_bw;
33375         /* The bandwidth value. */
33376         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
33377                 UINT32_C(0xfffffff)
33378         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
33379                 0
33380         /* The granularity of the value (bits or bytes). */
33381         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE \
33382                 UINT32_C(0x10000000)
33383         /* Value is in bits. */
33384         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
33385                 (UINT32_C(0x0) << 28)
33386         /* Value is in bytes. */
33387         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
33388                 (UINT32_C(0x1) << 28)
33389         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
33390                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
33391         /* bw_value_unit is 3 b */
33392         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
33393                 UINT32_C(0xe0000000)
33394         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
33395                 29
33396         /* Value is in Mb or MB (base 10). */
33397         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
33398                 (UINT32_C(0x0) << 29)
33399         /* Value is in Kb or KB (base 10). */
33400         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
33401                 (UINT32_C(0x2) << 29)
33402         /* Value is in bits or bytes. */
33403         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
33404                 (UINT32_C(0x4) << 29)
33405         /* Value is in Gb or GB (base 10). */
33406         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
33407                 (UINT32_C(0x6) << 29)
33408         /* Value is in 1/100th of a percentage of total bandwidth. */
33409         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
33410                 (UINT32_C(0x1) << 29)
33411         /* Invalid unit */
33412         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
33413                 (UINT32_C(0x7) << 29)
33414         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
33415                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
33416         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
33417         uint8_t queue_id0_tsa_assign;
33418         /* Strict Priority */
33419         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP \
33420                 UINT32_C(0x0)
33421         /* Enhanced Transmission Selection */
33422         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
33423                 UINT32_C(0x1)
33424         /* reserved. */
33425         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
33426                 UINT32_C(0x2)
33427         /* reserved. */
33428         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
33429                 UINT32_C(0xff)
33430         /*
33431          * Priority level for strict priority. Valid only when the
33432          * tsa_assign is 0 - Strict Priority (SP)
33433          * 0..7 - Valid values.
33434          * 8..255 - Reserved.
33435          */
33436         uint8_t queue_id0_pri_lvl;
33437         /*
33438          * Weight used to allocate remaining BW for this COS after
33439          * servicing guaranteed bandwidths for all COS.
33440          */
33441         uint8_t queue_id0_bw_weight;
33442         /* ID of CoS Queue 1. */
33443         uint8_t queue_id1;
33444         /*
33445          * Minimum BW allocated to CoS Queue.
33446          * The HWRM will translate this value into byte counter and
33447          * time interval used for this COS inside the device.
33448          */
33449         uint32_t        queue_id1_min_bw;
33450         /* The bandwidth value. */
33451         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
33452                 UINT32_C(0xfffffff)
33453         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
33454                 0
33455         /* The granularity of the value (bits or bytes). */
33456         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE \
33457                 UINT32_C(0x10000000)
33458         /* Value is in bits. */
33459         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
33460                 (UINT32_C(0x0) << 28)
33461         /* Value is in bytes. */
33462         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
33463                 (UINT32_C(0x1) << 28)
33464         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
33465                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
33466         /* bw_value_unit is 3 b */
33467         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
33468                 UINT32_C(0xe0000000)
33469         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
33470                 29
33471         /* Value is in Mb or MB (base 10). */
33472         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
33473                 (UINT32_C(0x0) << 29)
33474         /* Value is in Kb or KB (base 10). */
33475         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
33476                 (UINT32_C(0x2) << 29)
33477         /* Value is in bits or bytes. */
33478         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
33479                 (UINT32_C(0x4) << 29)
33480         /* Value is in Gb or GB (base 10). */
33481         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
33482                 (UINT32_C(0x6) << 29)
33483         /* Value is in 1/100th of a percentage of total bandwidth. */
33484         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
33485                 (UINT32_C(0x1) << 29)
33486         /* Invalid unit */
33487         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
33488                 (UINT32_C(0x7) << 29)
33489         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
33490                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
33491         /*
33492          * Maximum BW allocated to CoS queue.
33493          * The HWRM will translate this value into byte counter and
33494          * time interval used for this COS inside the device.
33495          */
33496         uint32_t        queue_id1_max_bw;
33497         /* The bandwidth value. */
33498         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
33499                 UINT32_C(0xfffffff)
33500         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
33501                 0
33502         /* The granularity of the value (bits or bytes). */
33503         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE \
33504                 UINT32_C(0x10000000)
33505         /* Value is in bits. */
33506         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
33507                 (UINT32_C(0x0) << 28)
33508         /* Value is in bytes. */
33509         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
33510                 (UINT32_C(0x1) << 28)
33511         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
33512                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
33513         /* bw_value_unit is 3 b */
33514         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
33515                 UINT32_C(0xe0000000)
33516         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
33517                 29
33518         /* Value is in Mb or MB (base 10). */
33519         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
33520                 (UINT32_C(0x0) << 29)
33521         /* Value is in Kb or KB (base 10). */
33522         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
33523                 (UINT32_C(0x2) << 29)
33524         /* Value is in bits or bytes. */
33525         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
33526                 (UINT32_C(0x4) << 29)
33527         /* Value is in Gb or GB (base 10). */
33528         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
33529                 (UINT32_C(0x6) << 29)
33530         /* Value is in 1/100th of a percentage of total bandwidth. */
33531         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
33532                 (UINT32_C(0x1) << 29)
33533         /* Invalid unit */
33534         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
33535                 (UINT32_C(0x7) << 29)
33536         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
33537                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
33538         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
33539         uint8_t queue_id1_tsa_assign;
33540         /* Strict Priority */
33541         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP \
33542                 UINT32_C(0x0)
33543         /* Enhanced Transmission Selection */
33544         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
33545                 UINT32_C(0x1)
33546         /* reserved. */
33547         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
33548                 UINT32_C(0x2)
33549         /* reserved. */
33550         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
33551                 UINT32_C(0xff)
33552         /*
33553          * Priority level for strict priority. Valid only when the
33554          * tsa_assign is 0 - Strict Priority (SP)
33555          * 0..7 - Valid values.
33556          * 8..255 - Reserved.
33557          */
33558         uint8_t queue_id1_pri_lvl;
33559         /*
33560          * Weight used to allocate remaining BW for this COS after
33561          * servicing guaranteed bandwidths for all COS.
33562          */
33563         uint8_t queue_id1_bw_weight;
33564         /* ID of CoS Queue 2. */
33565         uint8_t queue_id2;
33566         /*
33567          * Minimum BW allocated to CoS Queue.
33568          * The HWRM will translate this value into byte counter and
33569          * time interval used for this COS inside the device.
33570          */
33571         uint32_t        queue_id2_min_bw;
33572         /* The bandwidth value. */
33573         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
33574                 UINT32_C(0xfffffff)
33575         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
33576                 0
33577         /* The granularity of the value (bits or bytes). */
33578         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE \
33579                 UINT32_C(0x10000000)
33580         /* Value is in bits. */
33581         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
33582                 (UINT32_C(0x0) << 28)
33583         /* Value is in bytes. */
33584         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
33585                 (UINT32_C(0x1) << 28)
33586         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
33587                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
33588         /* bw_value_unit is 3 b */
33589         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
33590                 UINT32_C(0xe0000000)
33591         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
33592                 29
33593         /* Value is in Mb or MB (base 10). */
33594         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
33595                 (UINT32_C(0x0) << 29)
33596         /* Value is in Kb or KB (base 10). */
33597         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
33598                 (UINT32_C(0x2) << 29)
33599         /* Value is in bits or bytes. */
33600         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
33601                 (UINT32_C(0x4) << 29)
33602         /* Value is in Gb or GB (base 10). */
33603         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
33604                 (UINT32_C(0x6) << 29)
33605         /* Value is in 1/100th of a percentage of total bandwidth. */
33606         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
33607                 (UINT32_C(0x1) << 29)
33608         /* Invalid unit */
33609         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
33610                 (UINT32_C(0x7) << 29)
33611         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
33612                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
33613         /*
33614          * Maximum BW allocated to CoS queue.
33615          * The HWRM will translate this value into byte counter and
33616          * time interval used for this COS inside the device.
33617          */
33618         uint32_t        queue_id2_max_bw;
33619         /* The bandwidth value. */
33620         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
33621                 UINT32_C(0xfffffff)
33622         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
33623                 0
33624         /* The granularity of the value (bits or bytes). */
33625         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE \
33626                 UINT32_C(0x10000000)
33627         /* Value is in bits. */
33628         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
33629                 (UINT32_C(0x0) << 28)
33630         /* Value is in bytes. */
33631         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
33632                 (UINT32_C(0x1) << 28)
33633         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
33634                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
33635         /* bw_value_unit is 3 b */
33636         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
33637                 UINT32_C(0xe0000000)
33638         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
33639                 29
33640         /* Value is in Mb or MB (base 10). */
33641         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
33642                 (UINT32_C(0x0) << 29)
33643         /* Value is in Kb or KB (base 10). */
33644         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
33645                 (UINT32_C(0x2) << 29)
33646         /* Value is in bits or bytes. */
33647         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
33648                 (UINT32_C(0x4) << 29)
33649         /* Value is in Gb or GB (base 10). */
33650         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
33651                 (UINT32_C(0x6) << 29)
33652         /* Value is in 1/100th of a percentage of total bandwidth. */
33653         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
33654                 (UINT32_C(0x1) << 29)
33655         /* Invalid unit */
33656         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
33657                 (UINT32_C(0x7) << 29)
33658         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
33659                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
33660         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
33661         uint8_t queue_id2_tsa_assign;
33662         /* Strict Priority */
33663         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP \
33664                 UINT32_C(0x0)
33665         /* Enhanced Transmission Selection */
33666         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
33667                 UINT32_C(0x1)
33668         /* reserved. */
33669         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
33670                 UINT32_C(0x2)
33671         /* reserved. */
33672         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
33673                 UINT32_C(0xff)
33674         /*
33675          * Priority level for strict priority. Valid only when the
33676          * tsa_assign is 0 - Strict Priority (SP)
33677          * 0..7 - Valid values.
33678          * 8..255 - Reserved.
33679          */
33680         uint8_t queue_id2_pri_lvl;
33681         /*
33682          * Weight used to allocate remaining BW for this COS after
33683          * servicing guaranteed bandwidths for all COS.
33684          */
33685         uint8_t queue_id2_bw_weight;
33686         /* ID of CoS Queue 3. */
33687         uint8_t queue_id3;
33688         /*
33689          * Minimum BW allocated to CoS Queue.
33690          * The HWRM will translate this value into byte counter and
33691          * time interval used for this COS inside the device.
33692          */
33693         uint32_t        queue_id3_min_bw;
33694         /* The bandwidth value. */
33695         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
33696                 UINT32_C(0xfffffff)
33697         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
33698                 0
33699         /* The granularity of the value (bits or bytes). */
33700         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE \
33701                 UINT32_C(0x10000000)
33702         /* Value is in bits. */
33703         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
33704                 (UINT32_C(0x0) << 28)
33705         /* Value is in bytes. */
33706         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
33707                 (UINT32_C(0x1) << 28)
33708         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
33709                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
33710         /* bw_value_unit is 3 b */
33711         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
33712                 UINT32_C(0xe0000000)
33713         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
33714                 29
33715         /* Value is in Mb or MB (base 10). */
33716         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
33717                 (UINT32_C(0x0) << 29)
33718         /* Value is in Kb or KB (base 10). */
33719         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
33720                 (UINT32_C(0x2) << 29)
33721         /* Value is in bits or bytes. */
33722         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
33723                 (UINT32_C(0x4) << 29)
33724         /* Value is in Gb or GB (base 10). */
33725         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
33726                 (UINT32_C(0x6) << 29)
33727         /* Value is in 1/100th of a percentage of total bandwidth. */
33728         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
33729                 (UINT32_C(0x1) << 29)
33730         /* Invalid unit */
33731         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
33732                 (UINT32_C(0x7) << 29)
33733         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
33734                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
33735         /*
33736          * Maximum BW allocated to CoS queue.
33737          * The HWRM will translate this value into byte counter and
33738          * time interval used for this COS inside the device.
33739          */
33740         uint32_t        queue_id3_max_bw;
33741         /* The bandwidth value. */
33742         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
33743                 UINT32_C(0xfffffff)
33744         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
33745                 0
33746         /* The granularity of the value (bits or bytes). */
33747         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE \
33748                 UINT32_C(0x10000000)
33749         /* Value is in bits. */
33750         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
33751                 (UINT32_C(0x0) << 28)
33752         /* Value is in bytes. */
33753         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
33754                 (UINT32_C(0x1) << 28)
33755         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
33756                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
33757         /* bw_value_unit is 3 b */
33758         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
33759                 UINT32_C(0xe0000000)
33760         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
33761                 29
33762         /* Value is in Mb or MB (base 10). */
33763         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
33764                 (UINT32_C(0x0) << 29)
33765         /* Value is in Kb or KB (base 10). */
33766         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
33767                 (UINT32_C(0x2) << 29)
33768         /* Value is in bits or bytes. */
33769         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
33770                 (UINT32_C(0x4) << 29)
33771         /* Value is in Gb or GB (base 10). */
33772         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
33773                 (UINT32_C(0x6) << 29)
33774         /* Value is in 1/100th of a percentage of total bandwidth. */
33775         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
33776                 (UINT32_C(0x1) << 29)
33777         /* Invalid unit */
33778         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
33779                 (UINT32_C(0x7) << 29)
33780         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
33781                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
33782         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
33783         uint8_t queue_id3_tsa_assign;
33784         /* Strict Priority */
33785         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP \
33786                 UINT32_C(0x0)
33787         /* Enhanced Transmission Selection */
33788         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
33789                 UINT32_C(0x1)
33790         /* reserved. */
33791         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
33792                 UINT32_C(0x2)
33793         /* reserved. */
33794         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
33795                 UINT32_C(0xff)
33796         /*
33797          * Priority level for strict priority. Valid only when the
33798          * tsa_assign is 0 - Strict Priority (SP)
33799          * 0..7 - Valid values.
33800          * 8..255 - Reserved.
33801          */
33802         uint8_t queue_id3_pri_lvl;
33803         /*
33804          * Weight used to allocate remaining BW for this COS after
33805          * servicing guaranteed bandwidths for all COS.
33806          */
33807         uint8_t queue_id3_bw_weight;
33808         /* ID of CoS Queue 4. */
33809         uint8_t queue_id4;
33810         /*
33811          * Minimum BW allocated to CoS Queue.
33812          * The HWRM will translate this value into byte counter and
33813          * time interval used for this COS inside the device.
33814          */
33815         uint32_t        queue_id4_min_bw;
33816         /* The bandwidth value. */
33817         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
33818                 UINT32_C(0xfffffff)
33819         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
33820                 0
33821         /* The granularity of the value (bits or bytes). */
33822         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE \
33823                 UINT32_C(0x10000000)
33824         /* Value is in bits. */
33825         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
33826                 (UINT32_C(0x0) << 28)
33827         /* Value is in bytes. */
33828         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
33829                 (UINT32_C(0x1) << 28)
33830         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
33831                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
33832         /* bw_value_unit is 3 b */
33833         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
33834                 UINT32_C(0xe0000000)
33835         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
33836                 29
33837         /* Value is in Mb or MB (base 10). */
33838         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
33839                 (UINT32_C(0x0) << 29)
33840         /* Value is in Kb or KB (base 10). */
33841         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
33842                 (UINT32_C(0x2) << 29)
33843         /* Value is in bits or bytes. */
33844         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
33845                 (UINT32_C(0x4) << 29)
33846         /* Value is in Gb or GB (base 10). */
33847         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
33848                 (UINT32_C(0x6) << 29)
33849         /* Value is in 1/100th of a percentage of total bandwidth. */
33850         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
33851                 (UINT32_C(0x1) << 29)
33852         /* Invalid unit */
33853         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
33854                 (UINT32_C(0x7) << 29)
33855         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
33856                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
33857         /*
33858          * Maximum BW allocated to CoS queue.
33859          * The HWRM will translate this value into byte counter and
33860          * time interval used for this COS inside the device.
33861          */
33862         uint32_t        queue_id4_max_bw;
33863         /* The bandwidth value. */
33864         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
33865                 UINT32_C(0xfffffff)
33866         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
33867                 0
33868         /* The granularity of the value (bits or bytes). */
33869         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE \
33870                 UINT32_C(0x10000000)
33871         /* Value is in bits. */
33872         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
33873                 (UINT32_C(0x0) << 28)
33874         /* Value is in bytes. */
33875         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
33876                 (UINT32_C(0x1) << 28)
33877         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
33878                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
33879         /* bw_value_unit is 3 b */
33880         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
33881                 UINT32_C(0xe0000000)
33882         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
33883                 29
33884         /* Value is in Mb or MB (base 10). */
33885         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
33886                 (UINT32_C(0x0) << 29)
33887         /* Value is in Kb or KB (base 10). */
33888         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
33889                 (UINT32_C(0x2) << 29)
33890         /* Value is in bits or bytes. */
33891         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
33892                 (UINT32_C(0x4) << 29)
33893         /* Value is in Gb or GB (base 10). */
33894         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
33895                 (UINT32_C(0x6) << 29)
33896         /* Value is in 1/100th of a percentage of total bandwidth. */
33897         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
33898                 (UINT32_C(0x1) << 29)
33899         /* Invalid unit */
33900         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
33901                 (UINT32_C(0x7) << 29)
33902         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
33903                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
33904         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
33905         uint8_t queue_id4_tsa_assign;
33906         /* Strict Priority */
33907         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP \
33908                 UINT32_C(0x0)
33909         /* Enhanced Transmission Selection */
33910         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
33911                 UINT32_C(0x1)
33912         /* reserved. */
33913         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
33914                 UINT32_C(0x2)
33915         /* reserved. */
33916         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
33917                 UINT32_C(0xff)
33918         /*
33919          * Priority level for strict priority. Valid only when the
33920          * tsa_assign is 0 - Strict Priority (SP)
33921          * 0..7 - Valid values.
33922          * 8..255 - Reserved.
33923          */
33924         uint8_t queue_id4_pri_lvl;
33925         /*
33926          * Weight used to allocate remaining BW for this COS after
33927          * servicing guaranteed bandwidths for all COS.
33928          */
33929         uint8_t queue_id4_bw_weight;
33930         /* ID of CoS Queue 5. */
33931         uint8_t queue_id5;
33932         /*
33933          * Minimum BW allocated to CoS Queue.
33934          * The HWRM will translate this value into byte counter and
33935          * time interval used for this COS inside the device.
33936          */
33937         uint32_t        queue_id5_min_bw;
33938         /* The bandwidth value. */
33939         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
33940                 UINT32_C(0xfffffff)
33941         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
33942                 0
33943         /* The granularity of the value (bits or bytes). */
33944         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE \
33945                 UINT32_C(0x10000000)
33946         /* Value is in bits. */
33947         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
33948                 (UINT32_C(0x0) << 28)
33949         /* Value is in bytes. */
33950         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
33951                 (UINT32_C(0x1) << 28)
33952         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
33953                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
33954         /* bw_value_unit is 3 b */
33955         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
33956                 UINT32_C(0xe0000000)
33957         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
33958                 29
33959         /* Value is in Mb or MB (base 10). */
33960         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
33961                 (UINT32_C(0x0) << 29)
33962         /* Value is in Kb or KB (base 10). */
33963         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
33964                 (UINT32_C(0x2) << 29)
33965         /* Value is in bits or bytes. */
33966         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
33967                 (UINT32_C(0x4) << 29)
33968         /* Value is in Gb or GB (base 10). */
33969         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
33970                 (UINT32_C(0x6) << 29)
33971         /* Value is in 1/100th of a percentage of total bandwidth. */
33972         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
33973                 (UINT32_C(0x1) << 29)
33974         /* Invalid unit */
33975         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
33976                 (UINT32_C(0x7) << 29)
33977         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
33978                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
33979         /*
33980          * Maximum BW allocated to CoS queue.
33981          * The HWRM will translate this value into byte counter and
33982          * time interval used for this COS inside the device.
33983          */
33984         uint32_t        queue_id5_max_bw;
33985         /* The bandwidth value. */
33986         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
33987                 UINT32_C(0xfffffff)
33988         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
33989                 0
33990         /* The granularity of the value (bits or bytes). */
33991         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE \
33992                 UINT32_C(0x10000000)
33993         /* Value is in bits. */
33994         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
33995                 (UINT32_C(0x0) << 28)
33996         /* Value is in bytes. */
33997         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
33998                 (UINT32_C(0x1) << 28)
33999         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
34000                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
34001         /* bw_value_unit is 3 b */
34002         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
34003                 UINT32_C(0xe0000000)
34004         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
34005                 29
34006         /* Value is in Mb or MB (base 10). */
34007         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
34008                 (UINT32_C(0x0) << 29)
34009         /* Value is in Kb or KB (base 10). */
34010         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
34011                 (UINT32_C(0x2) << 29)
34012         /* Value is in bits or bytes. */
34013         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
34014                 (UINT32_C(0x4) << 29)
34015         /* Value is in Gb or GB (base 10). */
34016         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
34017                 (UINT32_C(0x6) << 29)
34018         /* Value is in 1/100th of a percentage of total bandwidth. */
34019         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
34020                 (UINT32_C(0x1) << 29)
34021         /* Invalid unit */
34022         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
34023                 (UINT32_C(0x7) << 29)
34024         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
34025                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
34026         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
34027         uint8_t queue_id5_tsa_assign;
34028         /* Strict Priority */
34029         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP \
34030                 UINT32_C(0x0)
34031         /* Enhanced Transmission Selection */
34032         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
34033                 UINT32_C(0x1)
34034         /* reserved. */
34035         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
34036                 UINT32_C(0x2)
34037         /* reserved. */
34038         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
34039                 UINT32_C(0xff)
34040         /*
34041          * Priority level for strict priority. Valid only when the
34042          * tsa_assign is 0 - Strict Priority (SP)
34043          * 0..7 - Valid values.
34044          * 8..255 - Reserved.
34045          */
34046         uint8_t queue_id5_pri_lvl;
34047         /*
34048          * Weight used to allocate remaining BW for this COS after
34049          * servicing guaranteed bandwidths for all COS.
34050          */
34051         uint8_t queue_id5_bw_weight;
34052         /* ID of CoS Queue 6. */
34053         uint8_t queue_id6;
34054         /*
34055          * Minimum BW allocated to CoS Queue.
34056          * The HWRM will translate this value into byte counter and
34057          * time interval used for this COS inside the device.
34058          */
34059         uint32_t        queue_id6_min_bw;
34060         /* The bandwidth value. */
34061         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
34062                 UINT32_C(0xfffffff)
34063         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
34064                 0
34065         /* The granularity of the value (bits or bytes). */
34066         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE \
34067                 UINT32_C(0x10000000)
34068         /* Value is in bits. */
34069         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
34070                 (UINT32_C(0x0) << 28)
34071         /* Value is in bytes. */
34072         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
34073                 (UINT32_C(0x1) << 28)
34074         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
34075                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
34076         /* bw_value_unit is 3 b */
34077         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
34078                 UINT32_C(0xe0000000)
34079         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
34080                 29
34081         /* Value is in Mb or MB (base 10). */
34082         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
34083                 (UINT32_C(0x0) << 29)
34084         /* Value is in Kb or KB (base 10). */
34085         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
34086                 (UINT32_C(0x2) << 29)
34087         /* Value is in bits or bytes. */
34088         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
34089                 (UINT32_C(0x4) << 29)
34090         /* Value is in Gb or GB (base 10). */
34091         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
34092                 (UINT32_C(0x6) << 29)
34093         /* Value is in 1/100th of a percentage of total bandwidth. */
34094         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
34095                 (UINT32_C(0x1) << 29)
34096         /* Invalid unit */
34097         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
34098                 (UINT32_C(0x7) << 29)
34099         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
34100                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
34101         /*
34102          * Maximum BW allocated to CoS queue.
34103          * The HWRM will translate this value into byte counter and
34104          * time interval used for this COS inside the device.
34105          */
34106         uint32_t        queue_id6_max_bw;
34107         /* The bandwidth value. */
34108         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
34109                 UINT32_C(0xfffffff)
34110         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
34111                 0
34112         /* The granularity of the value (bits or bytes). */
34113         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE \
34114                 UINT32_C(0x10000000)
34115         /* Value is in bits. */
34116         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
34117                 (UINT32_C(0x0) << 28)
34118         /* Value is in bytes. */
34119         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
34120                 (UINT32_C(0x1) << 28)
34121         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
34122                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
34123         /* bw_value_unit is 3 b */
34124         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
34125                 UINT32_C(0xe0000000)
34126         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
34127                 29
34128         /* Value is in Mb or MB (base 10). */
34129         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
34130                 (UINT32_C(0x0) << 29)
34131         /* Value is in Kb or KB (base 10). */
34132         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
34133                 (UINT32_C(0x2) << 29)
34134         /* Value is in bits or bytes. */
34135         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
34136                 (UINT32_C(0x4) << 29)
34137         /* Value is in Gb or GB (base 10). */
34138         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
34139                 (UINT32_C(0x6) << 29)
34140         /* Value is in 1/100th of a percentage of total bandwidth. */
34141         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
34142                 (UINT32_C(0x1) << 29)
34143         /* Invalid unit */
34144         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
34145                 (UINT32_C(0x7) << 29)
34146         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
34147                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
34148         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
34149         uint8_t queue_id6_tsa_assign;
34150         /* Strict Priority */
34151         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP \
34152                 UINT32_C(0x0)
34153         /* Enhanced Transmission Selection */
34154         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
34155                 UINT32_C(0x1)
34156         /* reserved. */
34157         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
34158                 UINT32_C(0x2)
34159         /* reserved. */
34160         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
34161                 UINT32_C(0xff)
34162         /*
34163          * Priority level for strict priority. Valid only when the
34164          * tsa_assign is 0 - Strict Priority (SP)
34165          * 0..7 - Valid values.
34166          * 8..255 - Reserved.
34167          */
34168         uint8_t queue_id6_pri_lvl;
34169         /*
34170          * Weight used to allocate remaining BW for this COS after
34171          * servicing guaranteed bandwidths for all COS.
34172          */
34173         uint8_t queue_id6_bw_weight;
34174         /* ID of CoS Queue 7. */
34175         uint8_t queue_id7;
34176         /*
34177          * Minimum BW allocated to CoS Queue.
34178          * The HWRM will translate this value into byte counter and
34179          * time interval used for this COS inside the device.
34180          */
34181         uint32_t        queue_id7_min_bw;
34182         /* The bandwidth value. */
34183         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
34184                 UINT32_C(0xfffffff)
34185         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
34186                 0
34187         /* The granularity of the value (bits or bytes). */
34188         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE \
34189                 UINT32_C(0x10000000)
34190         /* Value is in bits. */
34191         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
34192                 (UINT32_C(0x0) << 28)
34193         /* Value is in bytes. */
34194         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
34195                 (UINT32_C(0x1) << 28)
34196         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
34197                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
34198         /* bw_value_unit is 3 b */
34199         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
34200                 UINT32_C(0xe0000000)
34201         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
34202                 29
34203         /* Value is in Mb or MB (base 10). */
34204         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
34205                 (UINT32_C(0x0) << 29)
34206         /* Value is in Kb or KB (base 10). */
34207         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
34208                 (UINT32_C(0x2) << 29)
34209         /* Value is in bits or bytes. */
34210         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
34211                 (UINT32_C(0x4) << 29)
34212         /* Value is in Gb or GB (base 10). */
34213         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
34214                 (UINT32_C(0x6) << 29)
34215         /* Value is in 1/100th of a percentage of total bandwidth. */
34216         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
34217                 (UINT32_C(0x1) << 29)
34218         /* Invalid unit */
34219         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
34220                 (UINT32_C(0x7) << 29)
34221         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
34222                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
34223         /*
34224          * Maximum BW allocated to CoS queue.
34225          * The HWRM will translate this value into byte counter and
34226          * time interval used for this COS inside the device.
34227          */
34228         uint32_t        queue_id7_max_bw;
34229         /* The bandwidth value. */
34230         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
34231                 UINT32_C(0xfffffff)
34232         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
34233                 0
34234         /* The granularity of the value (bits or bytes). */
34235         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE \
34236                 UINT32_C(0x10000000)
34237         /* Value is in bits. */
34238         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
34239                 (UINT32_C(0x0) << 28)
34240         /* Value is in bytes. */
34241         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
34242                 (UINT32_C(0x1) << 28)
34243         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
34244                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
34245         /* bw_value_unit is 3 b */
34246         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
34247                 UINT32_C(0xe0000000)
34248         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
34249                 29
34250         /* Value is in Mb or MB (base 10). */
34251         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
34252                 (UINT32_C(0x0) << 29)
34253         /* Value is in Kb or KB (base 10). */
34254         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
34255                 (UINT32_C(0x2) << 29)
34256         /* Value is in bits or bytes. */
34257         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
34258                 (UINT32_C(0x4) << 29)
34259         /* Value is in Gb or GB (base 10). */
34260         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
34261                 (UINT32_C(0x6) << 29)
34262         /* Value is in 1/100th of a percentage of total bandwidth. */
34263         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
34264                 (UINT32_C(0x1) << 29)
34265         /* Invalid unit */
34266         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
34267                 (UINT32_C(0x7) << 29)
34268         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
34269                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
34270         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
34271         uint8_t queue_id7_tsa_assign;
34272         /* Strict Priority */
34273         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP \
34274                 UINT32_C(0x0)
34275         /* Enhanced Transmission Selection */
34276         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
34277                 UINT32_C(0x1)
34278         /* reserved. */
34279         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
34280                 UINT32_C(0x2)
34281         /* reserved. */
34282         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
34283                 UINT32_C(0xff)
34284         /*
34285          * Priority level for strict priority. Valid only when the
34286          * tsa_assign is 0 - Strict Priority (SP)
34287          * 0..7 - Valid values.
34288          * 8..255 - Reserved.
34289          */
34290         uint8_t queue_id7_pri_lvl;
34291         /*
34292          * Weight used to allocate remaining BW for this COS after
34293          * servicing guaranteed bandwidths for all COS.
34294          */
34295         uint8_t queue_id7_bw_weight;
34296         uint8_t unused_1[5];
34297 } __rte_packed;
34298
34299 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
34300 struct hwrm_queue_cos2bw_cfg_output {
34301         /* The specific error status for the command. */
34302         uint16_t        error_code;
34303         /* The HWRM command request type. */
34304         uint16_t        req_type;
34305         /* The sequence ID from the original command. */
34306         uint16_t        seq_id;
34307         /* The length of the response data in number of bytes. */
34308         uint16_t        resp_len;
34309         uint8_t unused_0[7];
34310         /*
34311          * This field is used in Output records to indicate that the output
34312          * is completely written to RAM. This field should be read as '1'
34313          * to indicate that the output has been completely written.
34314          * When writing a command completion or response to an internal processor,
34315          * the order of writes has to be such that this field is written last.
34316          */
34317         uint8_t valid;
34318 } __rte_packed;
34319
34320 /*************************
34321  * hwrm_queue_dscp_qcaps *
34322  *************************/
34323
34324
34325 /* hwrm_queue_dscp_qcaps_input (size:192b/24B) */
34326 struct hwrm_queue_dscp_qcaps_input {
34327         /* The HWRM command request type. */
34328         uint16_t        req_type;
34329         /*
34330          * The completion ring to send the completion event on. This should
34331          * be the NQ ID returned from the `nq_alloc` HWRM command.
34332          */
34333         uint16_t        cmpl_ring;
34334         /*
34335          * The sequence ID is used by the driver for tracking multiple
34336          * commands. This ID is treated as opaque data by the firmware and
34337          * the value is returned in the `hwrm_resp_hdr` upon completion.
34338          */
34339         uint16_t        seq_id;
34340         /*
34341          * The target ID of the command:
34342          * * 0x0-0xFFF8 - The function ID
34343          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34344          * * 0xFFFD - Reserved for user-space HWRM interface
34345          * * 0xFFFF - HWRM
34346          */
34347         uint16_t        target_id;
34348         /*
34349          * A physical address pointer pointing to a host buffer that the
34350          * command's response data will be written. This can be either a host
34351          * physical address (HPA) or a guest physical address (GPA) and must
34352          * point to a physically contiguous block of memory.
34353          */
34354         uint64_t        resp_addr;
34355         /*
34356          * Port ID of port for which the table is being configured.
34357          * The HWRM needs to check whether this function is allowed
34358          * to configure pri2cos mapping on this port.
34359          */
34360         uint8_t port_id;
34361         uint8_t unused_0[7];
34362 } __rte_packed;
34363
34364 /* hwrm_queue_dscp_qcaps_output (size:128b/16B) */
34365 struct hwrm_queue_dscp_qcaps_output {
34366         /* The specific error status for the command. */
34367         uint16_t        error_code;
34368         /* The HWRM command request type. */
34369         uint16_t        req_type;
34370         /* The sequence ID from the original command. */
34371         uint16_t        seq_id;
34372         /* The length of the response data in number of bytes. */
34373         uint16_t        resp_len;
34374         /* The number of bits provided by the hardware for the DSCP value. */
34375         uint8_t num_dscp_bits;
34376         uint8_t unused_0;
34377         /* Max number of DSCP-MASK-PRI entries supported. */
34378         uint16_t        max_entries;
34379         uint8_t unused_1[3];
34380         /*
34381          * This field is used in Output records to indicate that the output
34382          * is completely written to RAM. This field should be read as '1'
34383          * to indicate that the output has been completely written.
34384          * When writing a command completion or response to an internal processor,
34385          * the order of writes has to be such that this field is written last.
34386          */
34387         uint8_t valid;
34388 } __rte_packed;
34389
34390 /****************************
34391  * hwrm_queue_dscp2pri_qcfg *
34392  ****************************/
34393
34394
34395 /* hwrm_queue_dscp2pri_qcfg_input (size:256b/32B) */
34396 struct hwrm_queue_dscp2pri_qcfg_input {
34397         /* The HWRM command request type. */
34398         uint16_t        req_type;
34399         /*
34400          * The completion ring to send the completion event on. This should
34401          * be the NQ ID returned from the `nq_alloc` HWRM command.
34402          */
34403         uint16_t        cmpl_ring;
34404         /*
34405          * The sequence ID is used by the driver for tracking multiple
34406          * commands. This ID is treated as opaque data by the firmware and
34407          * the value is returned in the `hwrm_resp_hdr` upon completion.
34408          */
34409         uint16_t        seq_id;
34410         /*
34411          * The target ID of the command:
34412          * * 0x0-0xFFF8 - The function ID
34413          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34414          * * 0xFFFD - Reserved for user-space HWRM interface
34415          * * 0xFFFF - HWRM
34416          */
34417         uint16_t        target_id;
34418         /*
34419          * A physical address pointer pointing to a host buffer that the
34420          * command's response data will be written. This can be either a host
34421          * physical address (HPA) or a guest physical address (GPA) and must
34422          * point to a physically contiguous block of memory.
34423          */
34424         uint64_t        resp_addr;
34425         /*
34426          * This is the host address where the 24-bits DSCP-MASK-PRI
34427          * tuple(s) will be copied to.
34428          */
34429         uint64_t        dest_data_addr;
34430         /*
34431          * Port ID of port for which the table is being configured.
34432          * The HWRM needs to check whether this function is allowed
34433          * to configure pri2cos mapping on this port.
34434          */
34435         uint8_t port_id;
34436         uint8_t unused_0;
34437         /* Size of the buffer pointed to by dest_data_addr. */
34438         uint16_t        dest_data_buffer_size;
34439         uint8_t unused_1[4];
34440 } __rte_packed;
34441
34442 /* hwrm_queue_dscp2pri_qcfg_output (size:128b/16B) */
34443 struct hwrm_queue_dscp2pri_qcfg_output {
34444         /* The specific error status for the command. */
34445         uint16_t        error_code;
34446         /* The HWRM command request type. */
34447         uint16_t        req_type;
34448         /* The sequence ID from the original command. */
34449         uint16_t        seq_id;
34450         /* The length of the response data in number of bytes. */
34451         uint16_t        resp_len;
34452         /*
34453          * A count of the number of DSCP-MASK-PRI tuple(s) pointed to
34454          * by the dest_data_addr.
34455          */
34456         uint16_t        entry_cnt;
34457         /*
34458          * This is the default PRI which un-initialized DSCP values are
34459          * mapped to.
34460          */
34461         uint8_t default_pri;
34462         uint8_t unused_0[4];
34463         /*
34464          * This field is used in Output records to indicate that the output
34465          * is completely written to RAM. This field should be read as '1'
34466          * to indicate that the output has been completely written.
34467          * When writing a command completion or response to an internal processor,
34468          * the order of writes has to be such that this field is written last.
34469          */
34470         uint8_t valid;
34471 } __rte_packed;
34472
34473 /***************************
34474  * hwrm_queue_dscp2pri_cfg *
34475  ***************************/
34476
34477
34478 /* hwrm_queue_dscp2pri_cfg_input (size:320b/40B) */
34479 struct hwrm_queue_dscp2pri_cfg_input {
34480         /* The HWRM command request type. */
34481         uint16_t        req_type;
34482         /*
34483          * The completion ring to send the completion event on. This should
34484          * be the NQ ID returned from the `nq_alloc` HWRM command.
34485          */
34486         uint16_t        cmpl_ring;
34487         /*
34488          * The sequence ID is used by the driver for tracking multiple
34489          * commands. This ID is treated as opaque data by the firmware and
34490          * the value is returned in the `hwrm_resp_hdr` upon completion.
34491          */
34492         uint16_t        seq_id;
34493         /*
34494          * The target ID of the command:
34495          * * 0x0-0xFFF8 - The function ID
34496          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34497          * * 0xFFFD - Reserved for user-space HWRM interface
34498          * * 0xFFFF - HWRM
34499          */
34500         uint16_t        target_id;
34501         /*
34502          * A physical address pointer pointing to a host buffer that the
34503          * command's response data will be written. This can be either a host
34504          * physical address (HPA) or a guest physical address (GPA) and must
34505          * point to a physically contiguous block of memory.
34506          */
34507         uint64_t        resp_addr;
34508         /*
34509          * This is the host address where the 24-bits DSCP-MASK-PRI tuple
34510          * will be copied from. A non-zero mask "adds" a tuple, while
34511          * a mask equal to 0 triggers the firmware to remove a tuple.
34512          * Only tuples with unique DSCP values are stored. On chips
34513          * prior to Thor a mask can be 0 - 0x3f, while on Thor it can
34514          * be 0 or 0x3f.
34515          */
34516         uint64_t        src_data_addr;
34517         uint32_t        flags;
34518         /* use_hw_default_pri is 1 b */
34519         #define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_FLAGS_USE_HW_DEFAULT_PRI \
34520                 UINT32_C(0x1)
34521         uint32_t        enables;
34522         /*
34523          * This bit must be '1' for the default_pri field to be
34524          * configured.
34525          */
34526         #define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_ENABLES_DEFAULT_PRI \
34527                 UINT32_C(0x1)
34528         /*
34529          * Port ID of port for which the table is being configured.
34530          * The HWRM needs to check whether this function is allowed
34531          * to configure pri2cos mapping on this port.
34532          */
34533         uint8_t port_id;
34534         /*
34535          * This is the default PRI which un-initialized DSCP values will be
34536          * mapped to.
34537          */
34538         uint8_t default_pri;
34539         /*
34540          * A count of the number of DSCP-MASK-PRI tuple(s) in the data pointed
34541          * to by src_data_addr.
34542          */
34543         uint16_t        entry_cnt;
34544         uint8_t unused_0[4];
34545 } __rte_packed;
34546
34547 /* hwrm_queue_dscp2pri_cfg_output (size:128b/16B) */
34548 struct hwrm_queue_dscp2pri_cfg_output {
34549         /* The specific error status for the command. */
34550         uint16_t        error_code;
34551         /* The HWRM command request type. */
34552         uint16_t        req_type;
34553         /* The sequence ID from the original command. */
34554         uint16_t        seq_id;
34555         /* The length of the response data in number of bytes. */
34556         uint16_t        resp_len;
34557         uint8_t unused_0[7];
34558         /*
34559          * This field is used in Output records to indicate that the output
34560          * is completely written to RAM. This field should be read as '1'
34561          * to indicate that the output has been completely written.
34562          * When writing a command completion or response to an internal processor,
34563          * the order of writes has to be such that this field is written last.
34564          */
34565         uint8_t valid;
34566 } __rte_packed;
34567
34568 /*************************
34569  * hwrm_queue_mpls_qcaps *
34570  *************************/
34571
34572
34573 /* hwrm_queue_mpls_qcaps_input (size:192b/24B) */
34574 struct hwrm_queue_mpls_qcaps_input {
34575         /* The HWRM command request type. */
34576         uint16_t        req_type;
34577         /*
34578          * The completion ring to send the completion event on. This should
34579          * be the NQ ID returned from the `nq_alloc` HWRM command.
34580          */
34581         uint16_t        cmpl_ring;
34582         /*
34583          * The sequence ID is used by the driver for tracking multiple
34584          * commands. This ID is treated as opaque data by the firmware and
34585          * the value is returned in the `hwrm_resp_hdr` upon completion.
34586          */
34587         uint16_t        seq_id;
34588         /*
34589          * The target ID of the command:
34590          * * 0x0-0xFFF8 - The function ID
34591          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34592          * * 0xFFFD - Reserved for user-space HWRM interface
34593          * * 0xFFFF - HWRM
34594          */
34595         uint16_t        target_id;
34596         /*
34597          * A physical address pointer pointing to a host buffer that the
34598          * command's response data will be written. This can be either a host
34599          * physical address (HPA) or a guest physical address (GPA) and must
34600          * point to a physically contiguous block of memory.
34601          */
34602         uint64_t        resp_addr;
34603         /*
34604          * Port ID of port for which the table is being configured.
34605          * The HWRM needs to check whether this function is allowed
34606          * to configure MPLS TC(EXP) to pri mapping on this port.
34607          */
34608         uint8_t port_id;
34609         uint8_t unused_0[7];
34610 } __rte_packed;
34611
34612 /* hwrm_queue_mpls_qcaps_output (size:128b/16B) */
34613 struct hwrm_queue_mpls_qcaps_output {
34614         /* The specific error status for the command. */
34615         uint16_t        error_code;
34616         /* The HWRM command request type. */
34617         uint16_t        req_type;
34618         /* The sequence ID from the original command. */
34619         uint16_t        seq_id;
34620         /* The length of the response data in number of bytes. */
34621         uint16_t        resp_len;
34622         /*
34623          * Bitmask indicating which queues can be configured by the
34624          * hwrm_queue_mplstc2pri_cfg command.
34625          *
34626          * Each bit represents a specific pri where bit 0 represents
34627          * pri 0 and bit 7 represents pri 7.
34628          * # A value of 0 indicates that the pri is not configurable
34629          * by the hwrm_queue_mplstc2pri_cfg command.
34630          * # A value of 1 indicates that the pri is configurable.
34631          * # A hwrm_queue_mplstc2pri_cfg command shall return error when
34632          * trying to configure a pri that is not configurable.
34633          */
34634         uint8_t queue_mplstc2pri_cfg_allowed;
34635         /*
34636          * This is the default PRI which un-initialized MPLS values will be
34637          * mapped to.
34638          */
34639         uint8_t hw_default_pri;
34640         uint8_t unused_0[5];
34641         /*
34642          * This field is used in Output records to indicate that the output
34643          * is completely written to RAM. This field should be read as '1'
34644          * to indicate that the output has been completely written.
34645          * When writing a command completion or response to an internal processor,
34646          * the order of writes has to be such that this field is written last.
34647          */
34648         uint8_t valid;
34649 } __rte_packed;
34650
34651 /******************************
34652  * hwrm_queue_mplstc2pri_qcfg *
34653  ******************************/
34654
34655
34656 /* hwrm_queue_mplstc2pri_qcfg_input (size:192b/24B) */
34657 struct hwrm_queue_mplstc2pri_qcfg_input {
34658         /* The HWRM command request type. */
34659         uint16_t        req_type;
34660         /*
34661          * The completion ring to send the completion event on. This should
34662          * be the NQ ID returned from the `nq_alloc` HWRM command.
34663          */
34664         uint16_t        cmpl_ring;
34665         /*
34666          * The sequence ID is used by the driver for tracking multiple
34667          * commands. This ID is treated as opaque data by the firmware and
34668          * the value is returned in the `hwrm_resp_hdr` upon completion.
34669          */
34670         uint16_t        seq_id;
34671         /*
34672          * The target ID of the command:
34673          * * 0x0-0xFFF8 - The function ID
34674          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34675          * * 0xFFFD - Reserved for user-space HWRM interface
34676          * * 0xFFFF - HWRM
34677          */
34678         uint16_t        target_id;
34679         /*
34680          * A physical address pointer pointing to a host buffer that the
34681          * command's response data will be written. This can be either a host
34682          * physical address (HPA) or a guest physical address (GPA) and must
34683          * point to a physically contiguous block of memory.
34684          */
34685         uint64_t        resp_addr;
34686         /*
34687          * Port ID of port for which the table is being configured.
34688          * The HWRM needs to check whether this function is allowed
34689          * to configure MPLS TC(EXP) to pri mapping on this port.
34690          */
34691         uint8_t port_id;
34692         uint8_t unused_0[7];
34693 } __rte_packed;
34694
34695 /* hwrm_queue_mplstc2pri_qcfg_output (size:192b/24B) */
34696 struct hwrm_queue_mplstc2pri_qcfg_output {
34697         /* The specific error status for the command. */
34698         uint16_t        error_code;
34699         /* The HWRM command request type. */
34700         uint16_t        req_type;
34701         /* The sequence ID from the original command. */
34702         uint16_t        seq_id;
34703         /* The length of the response data in number of bytes. */
34704         uint16_t        resp_len;
34705         /*
34706          * pri assigned to MPLS TC(EXP) 0. This value can only be changed
34707          * before traffic has started.
34708          * A value of 0xff indicates that no pri is assigned to the
34709          * MPLS TC(EXP) 0.
34710          */
34711         uint8_t tc0_pri_queue_id;
34712         /*
34713          * pri assigned to MPLS TC(EXP) 1. This value can only be changed
34714          * before traffic has started.
34715          * A value of 0xff indicates that no pri is assigned to the
34716          * MPLS TC(EXP) 1.
34717          */
34718         uint8_t tc1_pri_queue_id;
34719         /*
34720          * pri assigned to MPLS TC(EXP) 2. This value can only be changed
34721          * before traffic has started.
34722          * A value of 0xff indicates that no pri is assigned to the
34723          * MPLS TC(EXP) 2.
34724          */
34725         uint8_t tc2_pri_queue_id;
34726         /*
34727          * pri assigned to MPLS TC(EXP) 3. This value can only be changed
34728          * before traffic has started.
34729          * A value of 0xff indicates that no pri is assigned to the
34730          * MPLS TC(EXP) 3.
34731          */
34732         uint8_t tc3_pri_queue_id;
34733         /*
34734          * pri assigned to MPLS TC(EXP) 4. This value can only be changed
34735          * before traffic has started.
34736          * A value of 0xff indicates that no pri is assigned to the
34737          * MPLS TC(EXP) 4.
34738          */
34739         uint8_t tc4_pri_queue_id;
34740         /*
34741          * pri assigned to MPLS TC(EXP) 5. This value can only be changed
34742          * before traffic has started.
34743          * A value of 0xff indicates that no pri is assigned to the
34744          * MPLS TC(EXP) 5.
34745          */
34746         uint8_t tc5_pri_queue_id;
34747         /*
34748          * pri assigned to MPLS TC(EXP) 6. This value can only
34749          * be changed before traffic has started.
34750          * A value of 0xff indicates that no pri is assigned to the
34751          * MPLS TC(EXP) 6.
34752          */
34753         uint8_t tc6_pri_queue_id;
34754         /*
34755          * pri assigned to MPLS TC(EXP) 7. This value can only
34756          * be changed before traffic has started.
34757          * A value of 0xff indicates that no pri is assigned to the
34758          * MPLS TC(EXP) 7.
34759          */
34760         uint8_t tc7_pri_queue_id;
34761         uint8_t unused_0[7];
34762         /*
34763          * This field is used in Output records to indicate that the output
34764          * is completely written to RAM. This field should be read as '1'
34765          * to indicate that the output has been completely written.
34766          * When writing a command completion or response to an internal processor,
34767          * the order of writes has to be such that this field is written last.
34768          */
34769         uint8_t valid;
34770 } __rte_packed;
34771
34772 /*****************************
34773  * hwrm_queue_mplstc2pri_cfg *
34774  *****************************/
34775
34776
34777 /* hwrm_queue_mplstc2pri_cfg_input (size:256b/32B) */
34778 struct hwrm_queue_mplstc2pri_cfg_input {
34779         /* The HWRM command request type. */
34780         uint16_t        req_type;
34781         /*
34782          * The completion ring to send the completion event on. This should
34783          * be the NQ ID returned from the `nq_alloc` HWRM command.
34784          */
34785         uint16_t        cmpl_ring;
34786         /*
34787          * The sequence ID is used by the driver for tracking multiple
34788          * commands. This ID is treated as opaque data by the firmware and
34789          * the value is returned in the `hwrm_resp_hdr` upon completion.
34790          */
34791         uint16_t        seq_id;
34792         /*
34793          * The target ID of the command:
34794          * * 0x0-0xFFF8 - The function ID
34795          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34796          * * 0xFFFD - Reserved for user-space HWRM interface
34797          * * 0xFFFF - HWRM
34798          */
34799         uint16_t        target_id;
34800         /*
34801          * A physical address pointer pointing to a host buffer that the
34802          * command's response data will be written. This can be either a host
34803          * physical address (HPA) or a guest physical address (GPA) and must
34804          * point to a physically contiguous block of memory.
34805          */
34806         uint64_t        resp_addr;
34807         uint32_t        enables;
34808         /*
34809          * This bit must be '1' for the mplstc0_pri_queue_id field to be
34810          * configured.
34811          */
34812         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC0_PRI_QUEUE_ID \
34813                 UINT32_C(0x1)
34814         /*
34815          * This bit must be '1' for the mplstc1_pri_queue_id field to be
34816          * configured.
34817          */
34818         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC1_PRI_QUEUE_ID \
34819                 UINT32_C(0x2)
34820         /*
34821          * This bit must be '1' for the mplstc2_pri_queue_id field to be
34822          * configured.
34823          */
34824         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC2_PRI_QUEUE_ID \
34825                 UINT32_C(0x4)
34826         /*
34827          * This bit must be '1' for the mplstc3_pri_queue_id field to be
34828          * configured.
34829          */
34830         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC3_PRI_QUEUE_ID \
34831                 UINT32_C(0x8)
34832         /*
34833          * This bit must be '1' for the mplstc4_pri_queue_id field to be
34834          * configured.
34835          */
34836         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC4_PRI_QUEUE_ID \
34837                 UINT32_C(0x10)
34838         /*
34839          * This bit must be '1' for the mplstc5_pri_queue_id field to be
34840          * configured.
34841          */
34842         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC5_PRI_QUEUE_ID \
34843                 UINT32_C(0x20)
34844         /*
34845          * This bit must be '1' for the mplstc6_pri_queue_id field to be
34846          * configured.
34847          */
34848         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC6_PRI_QUEUE_ID \
34849                 UINT32_C(0x40)
34850         /*
34851          * This bit must be '1' for the mplstc7_pri_queue_id field to be
34852          * configured.
34853          */
34854         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC7_PRI_QUEUE_ID \
34855                 UINT32_C(0x80)
34856         /*
34857          * Port ID of port for which the table is being configured.
34858          * The HWRM needs to check whether this function is allowed
34859          * to configure MPLS TC(EXP)to pri mapping on this port.
34860          */
34861         uint8_t port_id;
34862         uint8_t unused_0[3];
34863         /*
34864          * pri assigned to MPLS TC(EXP) 0. This value can only
34865          * be changed before traffic has started.
34866          */
34867         uint8_t tc0_pri_queue_id;
34868         /*
34869          * pri assigned to MPLS TC(EXP) 1. This value can only
34870          * be changed before traffic has started.
34871          */
34872         uint8_t tc1_pri_queue_id;
34873         /*
34874          * pri assigned to MPLS TC(EXP) 2  This value can only
34875          * be changed before traffic has started.
34876          */
34877         uint8_t tc2_pri_queue_id;
34878         /*
34879          * pri assigned to MPLS TC(EXP) 3. This value can only
34880          * be changed before traffic has started.
34881          */
34882         uint8_t tc3_pri_queue_id;
34883         /*
34884          * pri assigned to MPLS TC(EXP) 4. This value can only
34885          * be changed before traffic has started.
34886          */
34887         uint8_t tc4_pri_queue_id;
34888         /*
34889          * pri assigned to MPLS TC(EXP) 5. This value can only
34890          * be changed before traffic has started.
34891          */
34892         uint8_t tc5_pri_queue_id;
34893         /*
34894          * pri assigned to MPLS TC(EXP) 6. This value can only
34895          * be changed before traffic has started.
34896          */
34897         uint8_t tc6_pri_queue_id;
34898         /*
34899          * pri assigned to MPLS TC(EXP) 7. This value can only
34900          * be changed before traffic has started.
34901          */
34902         uint8_t tc7_pri_queue_id;
34903 } __rte_packed;
34904
34905 /* hwrm_queue_mplstc2pri_cfg_output (size:128b/16B) */
34906 struct hwrm_queue_mplstc2pri_cfg_output {
34907         /* The specific error status for the command. */
34908         uint16_t        error_code;
34909         /* The HWRM command request type. */
34910         uint16_t        req_type;
34911         /* The sequence ID from the original command. */
34912         uint16_t        seq_id;
34913         /* The length of the response data in number of bytes. */
34914         uint16_t        resp_len;
34915         uint8_t unused_0[7];
34916         /*
34917          * This field is used in Output records to indicate that the output
34918          * is completely written to RAM. This field should be read as '1'
34919          * to indicate that the output has been completely written.
34920          * When writing a command completion or response to an internal processor,
34921          * the order of writes has to be such that this field is written last.
34922          */
34923         uint8_t valid;
34924 } __rte_packed;
34925
34926 /****************************
34927  * hwrm_queue_vlanpri_qcaps *
34928  ****************************/
34929
34930
34931 /* hwrm_queue_vlanpri_qcaps_input (size:192b/24B) */
34932 struct hwrm_queue_vlanpri_qcaps_input {
34933         /* The HWRM command request type. */
34934         uint16_t        req_type;
34935         /*
34936          * The completion ring to send the completion event on. This should
34937          * be the NQ ID returned from the `nq_alloc` HWRM command.
34938          */
34939         uint16_t        cmpl_ring;
34940         /*
34941          * The sequence ID is used by the driver for tracking multiple
34942          * commands. This ID is treated as opaque data by the firmware and
34943          * the value is returned in the `hwrm_resp_hdr` upon completion.
34944          */
34945         uint16_t        seq_id;
34946         /*
34947          * The target ID of the command:
34948          * * 0x0-0xFFF8 - The function ID
34949          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34950          * * 0xFFFD - Reserved for user-space HWRM interface
34951          * * 0xFFFF - HWRM
34952          */
34953         uint16_t        target_id;
34954         /*
34955          * A physical address pointer pointing to a host buffer that the
34956          * command's response data will be written. This can be either a host
34957          * physical address (HPA) or a guest physical address (GPA) and must
34958          * point to a physically contiguous block of memory.
34959          */
34960         uint64_t        resp_addr;
34961         /*
34962          * Port ID of port for which the table is being configured.
34963          * The HWRM needs to check whether this function is allowed
34964          * to configure VLAN priority to user priority mapping on this port.
34965          */
34966         uint8_t port_id;
34967         uint8_t unused_0[7];
34968 } __rte_packed;
34969
34970 /* hwrm_queue_vlanpri_qcaps_output (size:128b/16B) */
34971 struct hwrm_queue_vlanpri_qcaps_output {
34972         /* The specific error status for the command. */
34973         uint16_t        error_code;
34974         /* The HWRM command request type. */
34975         uint16_t        req_type;
34976         /* The sequence ID from the original command. */
34977         uint16_t        seq_id;
34978         /* The length of the response data in number of bytes. */
34979         uint16_t        resp_len;
34980         /*
34981          * This is the default user priority which all VLAN priority values
34982          * are mapped to if there is no VLAN priority to user priority mapping.
34983          */
34984         uint8_t hw_default_pri;
34985         uint8_t unused_0[6];
34986         /*
34987          * This field is used in Output records to indicate that the output
34988          * is completely written to RAM. This field should be read as '1'
34989          * to indicate that the output has been completely written.
34990          * When writing a command completion or response to an internal processor,
34991          * the order of writes has to be such that this field is written last.
34992          */
34993         uint8_t valid;
34994 } __rte_packed;
34995
34996 /*******************************
34997  * hwrm_queue_vlanpri2pri_qcfg *
34998  *******************************/
34999
35000
35001 /* hwrm_queue_vlanpri2pri_qcfg_input (size:192b/24B) */
35002 struct hwrm_queue_vlanpri2pri_qcfg_input {
35003         /* The HWRM command request type. */
35004         uint16_t        req_type;
35005         /*
35006          * The completion ring to send the completion event on. This should
35007          * be the NQ ID returned from the `nq_alloc` HWRM command.
35008          */
35009         uint16_t        cmpl_ring;
35010         /*
35011          * The sequence ID is used by the driver for tracking multiple
35012          * commands. This ID is treated as opaque data by the firmware and
35013          * the value is returned in the `hwrm_resp_hdr` upon completion.
35014          */
35015         uint16_t        seq_id;
35016         /*
35017          * The target ID of the command:
35018          * * 0x0-0xFFF8 - The function ID
35019          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35020          * * 0xFFFD - Reserved for user-space HWRM interface
35021          * * 0xFFFF - HWRM
35022          */
35023         uint16_t        target_id;
35024         /*
35025          * A physical address pointer pointing to a host buffer that the
35026          * command's response data will be written. This can be either a host
35027          * physical address (HPA) or a guest physical address (GPA) and must
35028          * point to a physically contiguous block of memory.
35029          */
35030         uint64_t        resp_addr;
35031         /*
35032          * Port ID of port for which the table is being configured.
35033          * The HWRM needs to check whether this function is allowed
35034          * to configure VLAN priority to user priority mapping on this port.
35035          */
35036         uint8_t port_id;
35037         uint8_t unused_0[7];
35038 } __rte_packed;
35039
35040 /* hwrm_queue_vlanpri2pri_qcfg_output (size:192b/24B) */
35041 struct hwrm_queue_vlanpri2pri_qcfg_output {
35042         /* The specific error status for the command. */
35043         uint16_t        error_code;
35044         /* The HWRM command request type. */
35045         uint16_t        req_type;
35046         /* The sequence ID from the original command. */
35047         uint16_t        seq_id;
35048         /* The length of the response data in number of bytes. */
35049         uint16_t        resp_len;
35050         /*
35051          * User priority assigned to VLAN priority 0. A value of 0xff
35052          * indicates that no user priority is assigned. The default user
35053          * priority will be used.
35054          */
35055         uint8_t vlanpri0_user_pri_id;
35056         /*
35057          * User priority assigned to VLAN priority 1. A value of 0xff
35058          * indicates that no user priority is assigned. The default user
35059          * priority will be used.
35060          */
35061         uint8_t vlanpri1_user_pri_id;
35062         /*
35063          * User priority assigned to VLAN priority 2. A value of 0xff
35064          * indicates that no user priority is assigned. The default user
35065          * priority will be used.
35066          */
35067         uint8_t vlanpri2_user_pri_id;
35068         /*
35069          * User priority assigned to VLAN priority 3. A value of 0xff
35070          * indicates that no user priority is assigned. The default user
35071          * priority will be used.
35072          */
35073         uint8_t vlanpri3_user_pri_id;
35074         /*
35075          * User priority assigned to VLAN priority 4. A value of 0xff
35076          * indicates that no user priority is assigned. The default user
35077          * priority will be used.
35078          */
35079         uint8_t vlanpri4_user_pri_id;
35080         /*
35081          * User priority assigned to VLAN priority 5. A value of 0xff
35082          * indicates that no user priority is assigned. The default user
35083          * priority will be used.
35084          */
35085         uint8_t vlanpri5_user_pri_id;
35086         /*
35087          * User priority assigned to VLAN priority 6. A value of 0xff
35088          * indicates that no user priority is assigned. The default user
35089          * priority will be used.
35090          */
35091         uint8_t vlanpri6_user_pri_id;
35092         /*
35093          * User priority assigned to VLAN priority 7. A value of 0xff
35094          * indicates that no user priority is assigned. The default user
35095          * priority will be used.
35096          */
35097         uint8_t vlanpri7_user_pri_id;
35098         uint8_t unused_0[7];
35099         /*
35100          * This field is used in Output records to indicate that the output
35101          * is completely written to RAM. This field should be read as '1'
35102          * to indicate that the output has been completely written.
35103          * When writing a command completion or response to an internal processor,
35104          * the order of writes has to be such that this field is written last.
35105          */
35106         uint8_t valid;
35107 } __rte_packed;
35108
35109 /******************************
35110  * hwrm_queue_vlanpri2pri_cfg *
35111  ******************************/
35112
35113
35114 /* hwrm_queue_vlanpri2pri_cfg_input (size:256b/32B) */
35115 struct hwrm_queue_vlanpri2pri_cfg_input {
35116         /* The HWRM command request type. */
35117         uint16_t        req_type;
35118         /*
35119          * The completion ring to send the completion event on. This should
35120          * be the NQ ID returned from the `nq_alloc` HWRM command.
35121          */
35122         uint16_t        cmpl_ring;
35123         /*
35124          * The sequence ID is used by the driver for tracking multiple
35125          * commands. This ID is treated as opaque data by the firmware and
35126          * the value is returned in the `hwrm_resp_hdr` upon completion.
35127          */
35128         uint16_t        seq_id;
35129         /*
35130          * The target ID of the command:
35131          * * 0x0-0xFFF8 - The function ID
35132          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35133          * * 0xFFFD - Reserved for user-space HWRM interface
35134          * * 0xFFFF - HWRM
35135          */
35136         uint16_t        target_id;
35137         /*
35138          * A physical address pointer pointing to a host buffer that the
35139          * command's response data will be written. This can be either a host
35140          * physical address (HPA) or a guest physical address (GPA) and must
35141          * point to a physically contiguous block of memory.
35142          */
35143         uint64_t        resp_addr;
35144         uint32_t        enables;
35145         /*
35146          * This bit must be '1' for the vlanpri0_user_pri_id field to be
35147          * configured.
35148          */
35149         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI0_USER_PRI_ID \
35150                 UINT32_C(0x1)
35151         /*
35152          * This bit must be '1' for the vlanpri1_user_pri_id field to be
35153          * configured.
35154          */
35155         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI1_USER_PRI_ID \
35156                 UINT32_C(0x2)
35157         /*
35158          * This bit must be '1' for the vlanpri2_user_pri_id field to be
35159          * configured.
35160          */
35161         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI2_USER_PRI_ID \
35162                 UINT32_C(0x4)
35163         /*
35164          * This bit must be '1' for the vlanpri3_user_pri_id field to be
35165          * configured.
35166          */
35167         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI3_USER_PRI_ID \
35168                 UINT32_C(0x8)
35169         /*
35170          * This bit must be '1' for the vlanpri4_user_pri_id field to be
35171          * configured.
35172          */
35173         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI4_USER_PRI_ID \
35174                 UINT32_C(0x10)
35175         /*
35176          * This bit must be '1' for the vlanpri5_user_pri_id field to be
35177          * configured.
35178          */
35179         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI5_USER_PRI_ID \
35180                 UINT32_C(0x20)
35181         /*
35182          * This bit must be '1' for the vlanpri6_user_pri_id field to be
35183          * configured.
35184          */
35185         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI6_USER_PRI_ID \
35186                 UINT32_C(0x40)
35187         /*
35188          * This bit must be '1' for the vlanpri7_user_pri_id field to be
35189          * configured.
35190          */
35191         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI7_USER_PRI_ID \
35192                 UINT32_C(0x80)
35193         /*
35194          * Port ID of port for which the table is being configured.
35195          * The HWRM needs to check whether this function is allowed
35196          * to configure VLAN priority to user priority mapping on this port.
35197          */
35198         uint8_t port_id;
35199         uint8_t unused_0[3];
35200         /*
35201          * User priority assigned to VLAN priority 0. This value can only
35202          * be changed before traffic has started.
35203          */
35204         uint8_t vlanpri0_user_pri_id;
35205         /*
35206          * User priority assigned to VLAN priority 1. This value can only
35207          * be changed before traffic has started.
35208          */
35209         uint8_t vlanpri1_user_pri_id;
35210         /*
35211          * User priority assigned to VLAN priority 2. This value can only
35212          * be changed before traffic has started.
35213          */
35214         uint8_t vlanpri2_user_pri_id;
35215         /*
35216          * User priority assigned to VLAN priority 3. This value can only
35217          * be changed before traffic has started.
35218          */
35219         uint8_t vlanpri3_user_pri_id;
35220         /*
35221          * User priority assigned to VLAN priority 4. This value can only
35222          * be changed before traffic has started.
35223          */
35224         uint8_t vlanpri4_user_pri_id;
35225         /*
35226          * User priority assigned to VLAN priority 5. This value can only
35227          * be changed before traffic has started.
35228          */
35229         uint8_t vlanpri5_user_pri_id;
35230         /*
35231          * User priority assigned to VLAN priority 6. This value can only
35232          * be changed before traffic has started.
35233          */
35234         uint8_t vlanpri6_user_pri_id;
35235         /*
35236          * User priority assigned to VLAN priority 7. This value can only
35237          * be changed before traffic has started.
35238          */
35239         uint8_t vlanpri7_user_pri_id;
35240 } __rte_packed;
35241
35242 /* hwrm_queue_vlanpri2pri_cfg_output (size:128b/16B) */
35243 struct hwrm_queue_vlanpri2pri_cfg_output {
35244         /* The specific error status for the command. */
35245         uint16_t        error_code;
35246         /* The HWRM command request type. */
35247         uint16_t        req_type;
35248         /* The sequence ID from the original command. */
35249         uint16_t        seq_id;
35250         /* The length of the response data in number of bytes. */
35251         uint16_t        resp_len;
35252         uint8_t unused_0[7];
35253         /*
35254          * This field is used in Output records to indicate that the output
35255          * is completely written to RAM. This field should be read as '1'
35256          * to indicate that the output has been completely written.
35257          * When writing a command completion or response to an internal processor,
35258          * the order of writes has to be such that this field is written last.
35259          */
35260         uint8_t valid;
35261 } __rte_packed;
35262
35263 /*************************
35264  * hwrm_queue_global_cfg *
35265  *************************/
35266
35267
35268 /* hwrm_queue_global_cfg_input (size:192b/24B) */
35269 struct hwrm_queue_global_cfg_input {
35270         /* The HWRM command request type. */
35271         uint16_t        req_type;
35272         /*
35273          * The completion ring to send the completion event on. This should
35274          * be the NQ ID returned from the `nq_alloc` HWRM command.
35275          */
35276         uint16_t        cmpl_ring;
35277         /*
35278          * The sequence ID is used by the driver for tracking multiple
35279          * commands. This ID is treated as opaque data by the firmware and
35280          * the value is returned in the `hwrm_resp_hdr` upon completion.
35281          */
35282         uint16_t        seq_id;
35283         /*
35284          * The target ID of the command:
35285          * * 0x0-0xFFF8 - The function ID
35286          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35287          * * 0xFFFD - Reserved for user-space HWRM interface
35288          * * 0xFFFF - HWRM
35289          */
35290         uint16_t        target_id;
35291         /*
35292          * A physical address pointer pointing to a host buffer that the
35293          * command's response data will be written. This can be either a host
35294          * physical address (HPA) or a guest physical address (GPA) and must
35295          * point to a physically contiguous block of memory.
35296          */
35297         uint64_t        resp_addr;
35298         /*
35299          * Configuration mode for rx cos queues, configuring whether they
35300          * use one shared buffer pool (across ports or PCIe endpoints) or
35301          * independent per port or per endpoint buffer pools.
35302          */
35303         uint8_t mode;
35304         /* One shared buffer pool to be used by all RX CoS queues */
35305         #define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_SHARED      UINT32_C(0x0)
35306         /*
35307          * Each port or PCIe endpoint to use an independent buffer pool
35308          * for its RX CoS queues
35309          */
35310         #define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_INDEPENDENT UINT32_C(0x1)
35311         #define HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_LAST \
35312                 HWRM_QUEUE_GLOBAL_CFG_INPUT_MODE_INDEPENDENT
35313         uint8_t unused_0;
35314         uint16_t        enables;
35315         /* This bit must be '1' when the mode field is configured. */
35316         #define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_MODE          UINT32_C(0x1)
35317         /*
35318          * This bit must be '1' when the maximum bandwidth for queue group 0
35319          * (g0_max_bw) is configured.
35320          */
35321         #define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G0_MAX_BW     UINT32_C(0x2)
35322         /*
35323          * This bit must be '1' when the maximum bandwidth for queue group 1
35324          * (g1_max_bw) is configured.
35325          */
35326         #define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G1_MAX_BW     UINT32_C(0x4)
35327         /*
35328          * This bit must be '1' when the maximum bandwidth for queue group 2
35329          * (g2_max_bw) is configured.
35330          */
35331         #define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G2_MAX_BW     UINT32_C(0x8)
35332         /*
35333          * This bit must be '1' when the maximum bandwidth for queue group 3
35334          * (g3_max_bw) is configured.
35335          */
35336         #define HWRM_QUEUE_GLOBAL_CFG_INPUT_ENABLES_G3_MAX_BW \
35337                 UINT32_C(0x10)
35338         /*
35339          * Specifies the maximum receive rate, as a percentage of total link
35340          * bandwidth, of the receive traffic through queue group 0. A value
35341          * of 0 indicates no rate limit.
35342          *
35343          * A queue group is a set of queues, one per traffic class. In
35344          * single-host mode, each panel port has its own queue group, and thus,
35345          * this rate limit shapes the traffic received on a port, in this case,
35346          * through port 0. In multi-root or multi-host mode, each PCIe endpoint
35347          * on the NIC has its own queue group. In these cases, the rate limit
35348          * shapes the traffic sent to the host through one of the PCIe
35349          * endpoints, in this case endpoint 0.
35350          */
35351         uint8_t g0_max_bw;
35352         /*
35353          * Specifies the maximum rate of the traffic through receive CoS queue
35354          * group 1 (for port 1 or PCIe endpoint 1). The rate is a percentage of
35355          * total link bandwidth (the sum of the bandwidths of all links). A
35356          * value of 0 indicates no rate limit.
35357          */
35358         uint8_t g1_max_bw;
35359         /*
35360          * Specifies the maximum rate of the traffic through receive CoS queue
35361          * group 2 (for port 2 or PCIe endpoint 2). The rate is a percentage of
35362          * total link bandwidth (the sum of the bandwidths of all links). A
35363          * value of 0 indicates no rate limit.
35364          */
35365         uint8_t g2_max_bw;
35366         /*
35367          * Specifies the maximum receive rate, in Mbps, of the receive traffic
35368          * through queue group 3 (for port 3 or PCIe endpoint 3). A value of 0
35369          * indicates no rate limit.
35370          */
35371         uint8_t g3_max_bw;
35372 } __rte_packed;
35373
35374 /* hwrm_queue_global_cfg_output (size:128b/16B) */
35375 struct hwrm_queue_global_cfg_output {
35376         /* The specific error status for the command. */
35377         uint16_t        error_code;
35378         /* The HWRM command request type. */
35379         uint16_t        req_type;
35380         /* The sequence ID from the original command. */
35381         uint16_t        seq_id;
35382         /* The length of the response data in number of bytes. */
35383         uint16_t        resp_len;
35384         uint8_t unused_0[7];
35385         /*
35386          * This field is used in Output records to indicate that the output
35387          * is completely written to RAM. This field should be read as '1'
35388          * to indicate that the output has been completely written.
35389          * When writing a command completion or response to an internal processor,
35390          * the order of writes has to be such that this field is written last.
35391          */
35392         uint8_t valid;
35393 } __rte_packed;
35394
35395 /**************************
35396  * hwrm_queue_global_qcfg *
35397  **************************/
35398
35399
35400 /* hwrm_queue_global_qcfg_input (size:128b/16B) */
35401 struct hwrm_queue_global_qcfg_input {
35402         /* The HWRM command request type. */
35403         uint16_t        req_type;
35404         /*
35405          * The completion ring to send the completion event on. This should
35406          * be the NQ ID returned from the `nq_alloc` HWRM command.
35407          */
35408         uint16_t        cmpl_ring;
35409         /*
35410          * The sequence ID is used by the driver for tracking multiple
35411          * commands. This ID is treated as opaque data by the firmware and
35412          * the value is returned in the `hwrm_resp_hdr` upon completion.
35413          */
35414         uint16_t        seq_id;
35415         /*
35416          * The target ID of the command:
35417          * * 0x0-0xFFF8 - The function ID
35418          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35419          * * 0xFFFD - Reserved for user-space HWRM interface
35420          * * 0xFFFF - HWRM
35421          */
35422         uint16_t        target_id;
35423         /*
35424          * A physical address pointer pointing to a host buffer that the
35425          * command's response data will be written. This can be either a host
35426          * physical address (HPA) or a guest physical address (GPA) and must
35427          * point to a physically contiguous block of memory.
35428          */
35429         uint64_t        resp_addr;
35430 } __rte_packed;
35431
35432 /* hwrm_queue_global_qcfg_output (size:320b/40B) */
35433 struct hwrm_queue_global_qcfg_output {
35434         /* The specific error status for the command. */
35435         uint16_t        error_code;
35436         /* The HWRM command request type. */
35437         uint16_t        req_type;
35438         /* The sequence ID from the original command. */
35439         uint16_t        seq_id;
35440         /* The length of the response data in number of bytes. */
35441         uint16_t        resp_len;
35442         /* Port or PCIe endpoint id to be mapped for buffer pool 0. */
35443         uint8_t buffer_pool_id0_map;
35444         /* Port or PCIe endpoint id to be mapped for buffer pool 1. */
35445         uint8_t buffer_pool_id1_map;
35446         /* Port or PCIe endpoint id to be mapped for buffer pool 2. */
35447         uint8_t buffer_pool_id2_map;
35448         /* Port or PCIe endpoint id to be mapped for buffer pool 3. */
35449         uint8_t buffer_pool_id3_map;
35450         /* Size of buffer pool 0 (KBytes). */
35451         uint32_t        buffer_pool_id0_size;
35452         /* Size of buffer pool 1 (KBytes). */
35453         uint32_t        buffer_pool_id1_size;
35454         /* Size of buffer pool 2 (KBytes). */
35455         uint32_t        buffer_pool_id2_size;
35456         /* Size of buffer pool 3 (KBytes). */
35457         uint32_t        buffer_pool_id3_size;
35458         uint16_t        flags;
35459         /*
35460          * Enumeration denoting whether the rx buffer pool mapping is
35461          * per port or per PCIe endpoint
35462          */
35463         #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING \
35464                 UINT32_C(0x1)
35465         /*
35466          * The buffer_pool_id[0-3]_map field represents mapping of rx
35467          * buffer pools to a port.
35468          */
35469         #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_PORT \
35470                 UINT32_C(0x0)
35471         /*
35472          * The buffer_pool_id[0-3]_map field represents mapping of rx
35473          * buffer pools to a PCIe endpoint.
35474          */
35475         #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_ENDPOINT \
35476                 UINT32_C(0x1)
35477         #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_LAST \
35478                 HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_FLAGS_MAPPING_MAPPING_PER_ENDPOINT
35479         /*
35480          * Configuration mode for rx cos queues, configuring whether they
35481          * use one shared buffer pool (across ports or PCIe endpoints) or
35482          * independent per port or per endpoint buffer pools.
35483          */
35484         uint8_t mode;
35485         /* One shared buffer pool to be used by all RX CoS queues */
35486         #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_SHARED      UINT32_C(0x0)
35487         /*
35488          * Each port or PCIe endpoint to use an independent buffer pool
35489          * for its RX CoS queues
35490          */
35491         #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_INDEPENDENT UINT32_C(0x1)
35492         #define HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_LAST \
35493                 HWRM_QUEUE_GLOBAL_QCFG_OUTPUT_MODE_INDEPENDENT
35494         uint8_t unused_0;
35495         /*
35496          * Reports the rate limit applied to traffic through receive CoS queue
35497          * group 0. The rate limit is a percentage of total link bandwidth. A
35498          * value of 0 indicates no rate limit.
35499          *
35500          * A queue group is a set of queues, one per traffic class. In
35501          * single-host mode, each panel port has its own queue group, and thus,
35502          * this rate limit shapes the traffic received on a port, in this case,
35503          * through port 0. In multi-root or multi-host mode, each PCIe endpoint
35504          * on the NIC has its own queue group. In these cases, the rate limit
35505          * shapes the traffic sent to the host through one of the PCIe
35506          * endpoints, in this case endpoint 0.
35507          */
35508         uint8_t g0_max_bw;
35509         /*
35510          * Reports the rate limit applied to traffic through receive CoS queue
35511          * group 1 (for port 1 or PCIe endpoint 1). The rate limit is a
35512          * percentage of total link bandwidth. A value of 0 indicates no rate
35513          * limit.
35514          */
35515         uint8_t g1_max_bw;
35516         /*
35517          * Reports the rate limit applied to traffic through receive CoS queue
35518          * group 2 (for port 2 or PCIe endpoint 2). The rate limit is a
35519          * percentage of total link bandwidth. A value of 0 indicates no rate
35520          * limit.
35521          */
35522         uint8_t g2_max_bw;
35523         /*
35524          * Reports the rate limit applied to traffic through receive CoS queue
35525          * group 3 (for port 3 or PCIe endpoint 3). The rate limit is a
35526          * percentage of total link bandwidth. A value of 0 indicates no rate
35527          * limit.
35528          */
35529         uint8_t g3_max_bw;
35530         uint8_t unused_1[3];
35531         /*
35532          * This field is used in Output records to indicate that the output
35533          * is completely written to RAM. This field should be read as '1'
35534          * to indicate that the output has been completely written.
35535          * When writing a command completion or response to an internal processor,
35536          * the order of writes has to be such that this field is written last.
35537          */
35538         uint8_t valid;
35539 } __rte_packed;
35540
35541 /*******************
35542  * hwrm_vnic_alloc *
35543  *******************/
35544
35545
35546 /* hwrm_vnic_alloc_input (size:192b/24B) */
35547 struct hwrm_vnic_alloc_input {
35548         /* The HWRM command request type. */
35549         uint16_t        req_type;
35550         /*
35551          * The completion ring to send the completion event on. This should
35552          * be the NQ ID returned from the `nq_alloc` HWRM command.
35553          */
35554         uint16_t        cmpl_ring;
35555         /*
35556          * The sequence ID is used by the driver for tracking multiple
35557          * commands. This ID is treated as opaque data by the firmware and
35558          * the value is returned in the `hwrm_resp_hdr` upon completion.
35559          */
35560         uint16_t        seq_id;
35561         /*
35562          * The target ID of the command:
35563          * * 0x0-0xFFF8 - The function ID
35564          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35565          * * 0xFFFD - Reserved for user-space HWRM interface
35566          * * 0xFFFF - HWRM
35567          */
35568         uint16_t        target_id;
35569         /*
35570          * A physical address pointer pointing to a host buffer that the
35571          * command's response data will be written. This can be either a host
35572          * physical address (HPA) or a guest physical address (GPA) and must
35573          * point to a physically contiguous block of memory.
35574          */
35575         uint64_t        resp_addr;
35576         uint32_t        flags;
35577         /*
35578          * When this bit is '1', this VNIC is requested to
35579          * be the default VNIC for this function.
35580          */
35581         #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT \
35582                 UINT32_C(0x1)
35583         /*
35584          * When this bit is '1', proxy VEE PF is requesting
35585          * allocation of a default VNIC on behalf of virtio-net
35586          * function given in virtio_net_fid field.
35587          */
35588         #define HWRM_VNIC_ALLOC_INPUT_FLAGS_VIRTIO_NET_FID_VALID \
35589                 UINT32_C(0x2)
35590         /*
35591          * Virtio-net function's FID.
35592          * This virtio-net function is requesting allocation of default
35593          * VNIC through proxy VEE PF.
35594          */
35595         uint16_t        virtio_net_fid;
35596         uint8_t unused_0[2];
35597 } __rte_packed;
35598
35599 /* hwrm_vnic_alloc_output (size:128b/16B) */
35600 struct hwrm_vnic_alloc_output {
35601         /* The specific error status for the command. */
35602         uint16_t        error_code;
35603         /* The HWRM command request type. */
35604         uint16_t        req_type;
35605         /* The sequence ID from the original command. */
35606         uint16_t        seq_id;
35607         /* The length of the response data in number of bytes. */
35608         uint16_t        resp_len;
35609         /* Logical vnic ID */
35610         uint32_t        vnic_id;
35611         uint8_t unused_0[3];
35612         /*
35613          * This field is used in Output records to indicate that the output
35614          * is completely written to RAM.  This field should be read as '1'
35615          * to indicate that the output has been completely written.
35616          * When writing a command completion or response to an internal processor,
35617          * the order of writes has to be such that this field is written last.
35618          */
35619         uint8_t valid;
35620 } __rte_packed;
35621
35622 /********************
35623  * hwrm_vnic_update *
35624  ********************/
35625
35626
35627 /* hwrm_vnic_update_input (size:256b/32B) */
35628 struct hwrm_vnic_update_input {
35629         /* The HWRM command request type. */
35630         uint16_t        req_type;
35631         /*
35632          * The completion ring to send the completion event on. This should
35633          * be the NQ ID returned from the `nq_alloc` HWRM command.
35634          */
35635         uint16_t        cmpl_ring;
35636         /*
35637          * The sequence ID is used by the driver for tracking multiple
35638          * commands. This ID is treated as opaque data by the firmware and
35639          * the value is returned in the `hwrm_resp_hdr` upon completion.
35640          */
35641         uint16_t        seq_id;
35642         /*
35643          * The target ID of the command:
35644          * * 0x0-0xFFF8 - The function ID
35645          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35646          * * 0xFFFD - Reserved for user-space HWRM interface
35647          * * 0xFFFF - HWRM
35648          */
35649         uint16_t        target_id;
35650         /*
35651          * A physical address pointer pointing to a host buffer that the
35652          * command's response data will be written. This can be either a host
35653          * physical address (HPA) or a guest physical address (GPA) and must
35654          * point to a physically contiguous block of memory.
35655          */
35656         uint64_t        resp_addr;
35657         /* Logical vnic ID */
35658         uint32_t        vnic_id;
35659         uint32_t        enables;
35660         /*
35661          * This bit must be '1' for the vnic_state field to be
35662          * configured.
35663          */
35664         #define HWRM_VNIC_UPDATE_INPUT_ENABLES_VNIC_STATE_VALID \
35665                 UINT32_C(0x1)
35666         /*
35667          * This bit must be '1' for the mru field to be
35668          * configured.
35669          */
35670         #define HWRM_VNIC_UPDATE_INPUT_ENABLES_MRU_VALID \
35671                 UINT32_C(0x2)
35672         /*
35673          * This bit must be '1' for the metadata_format_type field to be
35674          * configured.
35675          */
35676         #define HWRM_VNIC_UPDATE_INPUT_ENABLES_METADATA_FORMAT_TYPE_VALID \
35677                 UINT32_C(0x4)
35678         /*
35679          * This will update the context variable with the same name if
35680          * the corresponding enable is set.
35681          */
35682         uint8_t vnic_state;
35683         /* Normal operation state for the VNIC. */
35684         #define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_NORMAL UINT32_C(0x0)
35685         /* All packets are dropped in this state. */
35686         #define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_DROP   UINT32_C(0x1)
35687         #define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_LAST \
35688                 HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_DROP
35689         /*
35690          * The metadata format type used in all the RX packet completions
35691          * going through this VNIC.
35692          */
35693         uint8_t metadata_format_type;
35694         /* No metadata information. */
35695         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_NONE \
35696                 UINT32_C(0x0)
35697         /*
35698          * Action record pointer (table_scope[4:0], act_rec_ptr[25:0],
35699          * vtag[19:0]).
35700          */
35701         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_ACT_RECORD_PTR \
35702                 UINT32_C(0x1)
35703         /* Tunnel ID (tunnel_id[31:0], vtag[19:0]) */
35704         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_TUNNEL_ID \
35705                 UINT32_C(0x2)
35706         /* Custom header data (updated_chdr_data[31:0], vtag[19:0]) */
35707         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_CUSTOM_HDR_DATA \
35708                 UINT32_C(0x3)
35709         /* Header offsets (hdr_offsets[31:0], vtag[19:0]) */
35710         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_HDR_OFFSETS \
35711                 UINT32_C(0x4)
35712         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_LAST \
35713                 HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_HDR_OFFSETS
35714         /*
35715          * The maximum receive unit of the vnic.
35716          * Each vnic is associated with a function.
35717          * The vnic mru value overwrites the mru setting of the
35718          * associated function.
35719          * The HWRM shall make sure that vnic mru does not exceed
35720          * the mru of the port the function is associated with.
35721          */
35722         uint16_t        mru;
35723         uint8_t unused_1[4];
35724 } __rte_packed;
35725
35726 /* hwrm_vnic_update_output (size:128b/16B) */
35727 struct hwrm_vnic_update_output {
35728         /* The specific error status for the command. */
35729         uint16_t        error_code;
35730         /* The HWRM command request type. */
35731         uint16_t        req_type;
35732         /* The sequence ID from the original command. */
35733         uint16_t        seq_id;
35734         /* The length of the response data in number of bytes. */
35735         uint16_t        resp_len;
35736         uint8_t unused_0[7];
35737         /*
35738          * This field is used in Output records to indicate that the output
35739          * is completely written to RAM.  This field should be read as '1'
35740          * to indicate that the output has been completely written.
35741          * When writing a command completion or response to an internal
35742          * processor, the order of writes has to be such that this field is
35743          * written last.
35744          */
35745         uint8_t valid;
35746 } __rte_packed;
35747
35748 /******************
35749  * hwrm_vnic_free *
35750  ******************/
35751
35752
35753 /* hwrm_vnic_free_input (size:192b/24B) */
35754 struct hwrm_vnic_free_input {
35755         /* The HWRM command request type. */
35756         uint16_t        req_type;
35757         /*
35758          * The completion ring to send the completion event on. This should
35759          * be the NQ ID returned from the `nq_alloc` HWRM command.
35760          */
35761         uint16_t        cmpl_ring;
35762         /*
35763          * The sequence ID is used by the driver for tracking multiple
35764          * commands. This ID is treated as opaque data by the firmware and
35765          * the value is returned in the `hwrm_resp_hdr` upon completion.
35766          */
35767         uint16_t        seq_id;
35768         /*
35769          * The target ID of the command:
35770          * * 0x0-0xFFF8 - The function ID
35771          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35772          * * 0xFFFD - Reserved for user-space HWRM interface
35773          * * 0xFFFF - HWRM
35774          */
35775         uint16_t        target_id;
35776         /*
35777          * A physical address pointer pointing to a host buffer that the
35778          * command's response data will be written. This can be either a host
35779          * physical address (HPA) or a guest physical address (GPA) and must
35780          * point to a physically contiguous block of memory.
35781          */
35782         uint64_t        resp_addr;
35783         /* Logical vnic ID */
35784         uint32_t        vnic_id;
35785         uint8_t unused_0[4];
35786 } __rte_packed;
35787
35788 /* hwrm_vnic_free_output (size:128b/16B) */
35789 struct hwrm_vnic_free_output {
35790         /* The specific error status for the command. */
35791         uint16_t        error_code;
35792         /* The HWRM command request type. */
35793         uint16_t        req_type;
35794         /* The sequence ID from the original command. */
35795         uint16_t        seq_id;
35796         /* The length of the response data in number of bytes. */
35797         uint16_t        resp_len;
35798         uint8_t unused_0[7];
35799         /*
35800          * This field is used in Output records to indicate that the output
35801          * is completely written to RAM.  This field should be read as '1'
35802          * to indicate that the output has been completely written.
35803          * When writing a command completion or response to an internal processor,
35804          * the order of writes has to be such that this field is written last.
35805          */
35806         uint8_t valid;
35807 } __rte_packed;
35808
35809 /*****************
35810  * hwrm_vnic_cfg *
35811  *****************/
35812
35813
35814 /* hwrm_vnic_cfg_input (size:384b/48B) */
35815 struct hwrm_vnic_cfg_input {
35816         /* The HWRM command request type. */
35817         uint16_t        req_type;
35818         /*
35819          * The completion ring to send the completion event on. This should
35820          * be the NQ ID returned from the `nq_alloc` HWRM command.
35821          */
35822         uint16_t        cmpl_ring;
35823         /*
35824          * The sequence ID is used by the driver for tracking multiple
35825          * commands. This ID is treated as opaque data by the firmware and
35826          * the value is returned in the `hwrm_resp_hdr` upon completion.
35827          */
35828         uint16_t        seq_id;
35829         /*
35830          * The target ID of the command:
35831          * * 0x0-0xFFF8 - The function ID
35832          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35833          * * 0xFFFD - Reserved for user-space HWRM interface
35834          * * 0xFFFF - HWRM
35835          */
35836         uint16_t        target_id;
35837         /*
35838          * A physical address pointer pointing to a host buffer that the
35839          * command's response data will be written. This can be either a host
35840          * physical address (HPA) or a guest physical address (GPA) and must
35841          * point to a physically contiguous block of memory.
35842          */
35843         uint64_t        resp_addr;
35844         uint32_t        flags;
35845         /*
35846          * When this bit is '1', the VNIC is requested to
35847          * be the default VNIC for the function.
35848          */
35849         #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT \
35850                 UINT32_C(0x1)
35851         /*
35852          * When this bit is '1', the VNIC is being configured to
35853          * strip VLAN in the RX path.
35854          * If set to '0', then VLAN stripping is disabled on
35855          * this VNIC.
35856          */
35857         #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE \
35858                 UINT32_C(0x2)
35859         /*
35860          * When this bit is '1', the VNIC is being configured to
35861          * buffer receive packets in the hardware until the host
35862          * posts new receive buffers.
35863          * If set to '0', then bd_stall is being configured to be
35864          * disabled on this VNIC.
35865          */
35866         #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE \
35867                 UINT32_C(0x4)
35868         /*
35869          * When this bit is '1', the VNIC is being configured to
35870          * receive both RoCE and non-RoCE traffic.
35871          * If set to '0', then this VNIC is not configured to be
35872          * operating in dual VNIC mode.
35873          */
35874         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
35875                 UINT32_C(0x8)
35876         /*
35877          * When this flag is set to '1', the VNIC is requested to
35878          * be configured to receive only RoCE traffic.
35879          * If this flag is set to '0', then this flag shall be
35880          * ignored by the HWRM.
35881          * If roce_dual_vnic_mode flag is set to '1'
35882          * or roce_mirroring_capable_vnic_mode flag to 1,
35883          * then the HWRM client shall not set this flag to '1'.
35884          */
35885         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
35886                 UINT32_C(0x10)
35887         /*
35888          * When a VNIC uses one destination ring group for certain
35889          * application (e.g. Receive Flow Steering) where
35890          * exact match is used to direct packets to a VNIC with one
35891          * destination ring group only, there is no need to configure
35892          * RSS indirection table for that VNIC as only one destination
35893          * ring group is used.
35894          *
35895          * This flag is used to enable a mode where
35896          * RSS is enabled in the VNIC using a RSS context
35897          * for computing RSS hash but the RSS indirection table is
35898          * not configured using hwrm_vnic_rss_cfg.
35899          *
35900          * If this mode is enabled, then the driver should not program
35901          * RSS indirection table for the RSS context that is used for
35902          * computing RSS hash only.
35903          */
35904         #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE \
35905                 UINT32_C(0x20)
35906         /*
35907          * When this bit is '1', the VNIC is being configured to
35908          * receive both RoCE and non-RoCE traffic, but forward only the
35909          * RoCE traffic further. Also, RoCE traffic can be mirrored to
35910          * L2 driver.
35911          */
35912         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
35913                 UINT32_C(0x40)
35914         uint32_t        enables;
35915         /*
35916          * This bit must be '1' for the dflt_ring_grp field to be
35917          * configured.
35918          */
35919         #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP \
35920                 UINT32_C(0x1)
35921         /*
35922          * This bit must be '1' for the rss_rule field to be
35923          * configured.
35924          */
35925         #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE \
35926                 UINT32_C(0x2)
35927         /*
35928          * This bit must be '1' for the cos_rule field to be
35929          * configured.
35930          */
35931         #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE \
35932                 UINT32_C(0x4)
35933         /*
35934          * This bit must be '1' for the lb_rule field to be
35935          * configured.
35936          */
35937         #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE \
35938                 UINT32_C(0x8)
35939         /*
35940          * This bit must be '1' for the mru field to be
35941          * configured.
35942          */
35943         #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU \
35944                 UINT32_C(0x10)
35945         /*
35946          * This bit must be '1' for the default_rx_ring_id field to be
35947          * configured.
35948          */
35949         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID \
35950                 UINT32_C(0x20)
35951         /*
35952          * This bit must be '1' for the default_cmpl_ring_id field to be
35953          * configured.
35954          */
35955         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID \
35956                 UINT32_C(0x40)
35957         /* This bit must be '1' for the queue_id field to be configured. */
35958         #define HWRM_VNIC_CFG_INPUT_ENABLES_QUEUE_ID \
35959                 UINT32_C(0x80)
35960         /* This bit must be '1' for the rx_csum_v2_mode field to be configured. */
35961         #define HWRM_VNIC_CFG_INPUT_ENABLES_RX_CSUM_V2_MODE \
35962                 UINT32_C(0x100)
35963         /* This bit must be '1' for the l2_cqe_mode field to be configured. */
35964         #define HWRM_VNIC_CFG_INPUT_ENABLES_L2_CQE_MODE \
35965                 UINT32_C(0x200)
35966         /* Logical vnic ID */
35967         uint16_t        vnic_id;
35968         /*
35969          * Default Completion ring for the VNIC.  This ring will
35970          * be chosen if packet does not match any RSS rules and if
35971          * there is no COS rule.
35972          */
35973         uint16_t        dflt_ring_grp;
35974         /*
35975          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
35976          * there is no RSS rule.
35977          */
35978         uint16_t        rss_rule;
35979         /*
35980          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
35981          * there is no COS rule.
35982          */
35983         uint16_t        cos_rule;
35984         /*
35985          * RSS ID for load balancing rule/table structure.
35986          * 0xFF... (All Fs) if there is no LB rule.
35987          */
35988         uint16_t        lb_rule;
35989         /*
35990          * The maximum receive unit of the vnic.
35991          * Each vnic is associated with a function.
35992          * The vnic mru value overwrites the mru setting of the
35993          * associated function.
35994          * The HWRM shall make sure that vnic mru does not exceed
35995          * the mru of the port the function is associated with.
35996          */
35997         uint16_t        mru;
35998         /*
35999          * Default Rx ring for the VNIC.  This ring will
36000          * be chosen if packet does not match any RSS rules.
36001          * The aggregation ring associated with the Rx ring is
36002          * implied based on the Rx ring specified when the
36003          * aggregation ring was allocated.
36004          */
36005         uint16_t        default_rx_ring_id;
36006         /*
36007          * Default completion ring for the VNIC.  This ring will
36008          * be chosen if packet does not match any RSS rules.
36009          */
36010         uint16_t        default_cmpl_ring_id;
36011         /*
36012          * When specified, only incoming packets classified to the specified CoS
36013          * queue ID will be arriving on this VNIC.  Packet priority to CoS mapping
36014          * rules can be specified using HWRM_QUEUE_PRI2COS_CFG.  In this mode,
36015          * ntuple filters with VNIC destination specified are invalid since they
36016          * conflict with the CoS to VNIC steering rules in this mode.
36017          *
36018          * If this field is not specified, packet to VNIC steering will be
36019          * subject to the standard L2 filter rules and any additional ntuple
36020          * filter rules with destination VNIC specified.
36021          */
36022         uint16_t        queue_id;
36023         /*
36024          * If the device supports the RX V2 and RX TPA start V2 completion
36025          * records as indicated by the HWRM_VNIC_QCAPS command, this field is
36026          * used to specify the two RX checksum modes supported by these
36027          * completion records.
36028          */
36029         uint8_t rx_csum_v2_mode;
36030         /*
36031          * When configured with this checksum mode, the number of header
36032          * groups in the delivered packet with a valid IP checksum and
36033          * the number of header groups in the delivered packet with a valid
36034          * L4 checksum are reported. Valid checksums are counted from the
36035          * outermost header group to the innermost header group, stopping at
36036          * the first error.  This is the default checksum mode supported if
36037          * the driver doesn't explicitly configure the RX checksum mode.
36038          */
36039         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
36040         /*
36041          * When configured with this checksum mode, the checksum status is
36042          * reported using 'all ok' mode. In the RX completion record, one
36043          * bit indicates if the IP checksum is valid for all the parsed
36044          * header groups with an IP checksum. Another bit indicates if the
36045          * L4 checksum is valid for all the parsed header groups with an L4
36046          * checksum. The number of header groups that were parsed by the
36047          * chip and passed in the delivered packet is also reported.
36048          */
36049         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_ALL_OK  UINT32_C(0x1)
36050         /*
36051          * Any rx_csum_v2_mode value larger than or equal to this is not
36052          * valid
36053          */
36054         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX     UINT32_C(0x2)
36055         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_LAST \
36056                 HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX
36057         /*
36058          * If the device supports different L2 RX CQE modes, as indicated by
36059          * the HWRM_VNIC_QCAPS command, this field is used to configure the
36060          * CQE mode.
36061          */
36062         uint8_t l2_cqe_mode;
36063         /*
36064          * When configured with this cqe mode, A normal (32B) CQE
36065          * will be generated. This is the default mode.
36066          */
36067         #define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_DEFAULT    UINT32_C(0x0)
36068         /*
36069          * When configured with this cqe mode, A compressed (16B) CQE
36070          * will be generated. In this mode TPA and HDS are not supported.
36071          * Host drivers should not configure the TPA and HDS along with
36072          * compressed mode, per VNIC. FW returns error, if host drivers
36073          * try to configure the VNIC with compressed mode and (TPA or HDS).
36074          * The compressed completion does not include PTP data. Host
36075          * drivers should not use this mode to receive the PTP data.
36076          */
36077         #define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_COMPRESSED UINT32_C(0x1)
36078         /*
36079          * When configured with this cqe mode, HW generates either a 32B
36080          * completion or a 16B completion depending on use case within a
36081          * VNIC. For ex. a simple L2 packet could use the compressed form
36082          * while a PTP packet on the same VNIC would use the 32B form.
36083          */
36084         #define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_MIXED      UINT32_C(0x2)
36085         #define HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_LAST \
36086                 HWRM_VNIC_CFG_INPUT_L2_CQE_MODE_MIXED
36087         uint8_t unused0[4];
36088 } __rte_packed;
36089
36090 /* hwrm_vnic_cfg_output (size:128b/16B) */
36091 struct hwrm_vnic_cfg_output {
36092         /* The specific error status for the command. */
36093         uint16_t        error_code;
36094         /* The HWRM command request type. */
36095         uint16_t        req_type;
36096         /* The sequence ID from the original command. */
36097         uint16_t        seq_id;
36098         /* The length of the response data in number of bytes. */
36099         uint16_t        resp_len;
36100         uint8_t unused_0[7];
36101         /*
36102          * This field is used in Output records to indicate that the output
36103          * is completely written to RAM.  This field should be read as '1'
36104          * to indicate that the output has been completely written.
36105          * When writing a command completion or response to an internal processor,
36106          * the order of writes has to be such that this field is written last.
36107          */
36108         uint8_t valid;
36109 } __rte_packed;
36110
36111 /******************
36112  * hwrm_vnic_qcfg *
36113  ******************/
36114
36115
36116 /* hwrm_vnic_qcfg_input (size:256b/32B) */
36117 struct hwrm_vnic_qcfg_input {
36118         /* The HWRM command request type. */
36119         uint16_t        req_type;
36120         /*
36121          * The completion ring to send the completion event on. This should
36122          * be the NQ ID returned from the `nq_alloc` HWRM command.
36123          */
36124         uint16_t        cmpl_ring;
36125         /*
36126          * The sequence ID is used by the driver for tracking multiple
36127          * commands. This ID is treated as opaque data by the firmware and
36128          * the value is returned in the `hwrm_resp_hdr` upon completion.
36129          */
36130         uint16_t        seq_id;
36131         /*
36132          * The target ID of the command:
36133          * * 0x0-0xFFF8 - The function ID
36134          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36135          * * 0xFFFD - Reserved for user-space HWRM interface
36136          * * 0xFFFF - HWRM
36137          */
36138         uint16_t        target_id;
36139         /*
36140          * A physical address pointer pointing to a host buffer that the
36141          * command's response data will be written. This can be either a host
36142          * physical address (HPA) or a guest physical address (GPA) and must
36143          * point to a physically contiguous block of memory.
36144          */
36145         uint64_t        resp_addr;
36146         uint32_t        enables;
36147         /*
36148          * This bit must be '1' for the vf_id_valid field to be
36149          * configured.
36150          */
36151         #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
36152         /* Logical vnic ID */
36153         uint32_t        vnic_id;
36154         /* ID of Virtual Function whose VNIC resource is being queried. */
36155         uint16_t        vf_id;
36156         uint8_t unused_0[6];
36157 } __rte_packed;
36158
36159 /* hwrm_vnic_qcfg_output (size:256b/32B) */
36160 struct hwrm_vnic_qcfg_output {
36161         /* The specific error status for the command. */
36162         uint16_t        error_code;
36163         /* The HWRM command request type. */
36164         uint16_t        req_type;
36165         /* The sequence ID from the original command. */
36166         uint16_t        seq_id;
36167         /* The length of the response data in number of bytes. */
36168         uint16_t        resp_len;
36169         /* Default Completion ring for the VNIC. */
36170         uint16_t        dflt_ring_grp;
36171         /*
36172          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
36173          * there is no RSS rule.
36174          */
36175         uint16_t        rss_rule;
36176         /*
36177          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
36178          * there is no COS rule.
36179          */
36180         uint16_t        cos_rule;
36181         /*
36182          * RSS ID for load balancing rule/table structure.
36183          * 0xFF... (All Fs) if there is no LB rule.
36184          */
36185         uint16_t        lb_rule;
36186         /* The maximum receive unit of the vnic. */
36187         uint16_t        mru;
36188         uint8_t unused_0[2];
36189         uint32_t        flags;
36190         /*
36191          * When this bit is '1', the VNIC is the default VNIC for
36192          * the function.
36193          */
36194         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT \
36195                 UINT32_C(0x1)
36196         /*
36197          * When this bit is '1', the VNIC is configured to
36198          * strip VLAN in the RX path.
36199          * If set to '0', then VLAN stripping is disabled on
36200          * this VNIC.
36201          */
36202         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE \
36203                 UINT32_C(0x2)
36204         /*
36205          * When this bit is '1', the VNIC is configured to
36206          * buffer receive packets in the hardware until the host
36207          * posts new receive buffers.
36208          * If set to '0', then bd_stall is disabled on
36209          * this VNIC.
36210          */
36211         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE \
36212                 UINT32_C(0x4)
36213         /*
36214          * When this bit is '1', the VNIC is configured to
36215          * receive both RoCE and non-RoCE traffic.
36216          * If set to '0', then this VNIC is not configured to
36217          * operate in dual VNIC mode.
36218          */
36219         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
36220                 UINT32_C(0x8)
36221         /*
36222          * When this flag is set to '1', the VNIC is configured to
36223          * receive only RoCE traffic.
36224          * When this flag is set to '0', the VNIC is not configured
36225          * to receive only RoCE traffic.
36226          * If roce_dual_vnic_mode flag and this flag both are set
36227          * to '1', then it is an invalid configuration of the
36228          * VNIC. The HWRM should not allow that type of
36229          * mis-configuration by HWRM clients.
36230          */
36231         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
36232                 UINT32_C(0x10)
36233         /*
36234          * When a VNIC uses one destination ring group for certain
36235          * application (e.g. Receive Flow Steering) where
36236          * exact match is used to direct packets to a VNIC with one
36237          * destination ring group only, there is no need to configure
36238          * RSS indirection table for that VNIC as only one destination
36239          * ring group is used.
36240          *
36241          * When this bit is set to '1', then the VNIC is enabled in a
36242          * mode where RSS is enabled in the VNIC using a RSS context
36243          * for computing RSS hash but the RSS indirection table is
36244          * not configured.
36245          */
36246         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE \
36247                 UINT32_C(0x20)
36248         /*
36249          * When this bit is '1', the VNIC is configured to
36250          * receive both RoCE and non-RoCE traffic, but forward only
36251          * RoCE traffic further. Also RoCE traffic can be mirrored to
36252          * L2 driver.
36253          */
36254         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
36255                 UINT32_C(0x40)
36256         /*
36257          * When this bit is '0', VNIC is in normal operation state.
36258          * When this bit is '1', VNIC drops all the received packets.
36259          */
36260         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_OPERATION_STATE \
36261                 UINT32_C(0x80)
36262         /*
36263          * When returned with a valid CoS Queue id, the CoS Queue/VNIC association
36264          * is valid.  Otherwise it will return 0xFFFF to indicate no VNIC/CoS
36265          * queue association.
36266          */
36267         uint16_t        queue_id;
36268         /*
36269          * If the device supports the RX V2 and RX TPA start V2 completion
36270          * records as indicated by the HWRM_VNIC_QCAPS command, this field is
36271          * used to specify the current RX checksum mode configured for all the
36272          * RX rings of a VNIC.
36273          */
36274         uint8_t rx_csum_v2_mode;
36275         /*
36276          * This value indicates that the VNIC is configured to use the
36277          * default RX checksum mode for all the rings associated with this
36278          * VNIC.
36279          */
36280         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
36281         /*
36282          * This value indicates that the VNIC is configured to use the RX
36283          * checksum ‘all_ok’ mode for all the rings associated with this
36284          * VNIC.
36285          */
36286         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_ALL_OK  UINT32_C(0x1)
36287         /*
36288          * Any rx_csum_v2_mode value larger than or equal to this is not
36289          * valid
36290          */
36291         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX     UINT32_C(0x2)
36292         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_LAST \
36293                 HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX
36294         /*
36295          * If the device supports different L2 RX CQE modes, as indicated by
36296          * the HWRM_VNIC_QCAPS command, this field is used to convey the
36297          * configured CQE mode.
36298          */
36299         uint8_t l2_cqe_mode;
36300         /*
36301          * This value indicates that the VNIC is configured with normal
36302          * (32B) CQE mode.
36303          */
36304         #define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_DEFAULT    UINT32_C(0x0)
36305         /*
36306          * This value indicates that the VNIC is configured with compressed
36307          * (16B) CQE mode.
36308          */
36309         #define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_COMPRESSED UINT32_C(0x1)
36310         /*
36311          * This value indicates that the VNIC is configured with mixed
36312          * CQE mode. HW generates either a 32B completion or a 16B
36313          * completion depending on use case within a VNIC.
36314          */
36315         #define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_MIXED      UINT32_C(0x2)
36316         #define HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_LAST \
36317                 HWRM_VNIC_QCFG_OUTPUT_L2_CQE_MODE_MIXED
36318         uint8_t unused_1[3];
36319         /*
36320          * This field is used in Output records to indicate that the output
36321          * is completely written to RAM.  This field should be read as '1'
36322          * to indicate that the output has been completely written.
36323          * When writing a command completion or response to an internal processor,
36324          * the order of writes has to be such that this field is written last.
36325          */
36326         uint8_t valid;
36327 } __rte_packed;
36328
36329 /*******************
36330  * hwrm_vnic_qcaps *
36331  *******************/
36332
36333
36334 /* hwrm_vnic_qcaps_input (size:192b/24B) */
36335 struct hwrm_vnic_qcaps_input {
36336         /* The HWRM command request type. */
36337         uint16_t        req_type;
36338         /*
36339          * The completion ring to send the completion event on. This should
36340          * be the NQ ID returned from the `nq_alloc` HWRM command.
36341          */
36342         uint16_t        cmpl_ring;
36343         /*
36344          * The sequence ID is used by the driver for tracking multiple
36345          * commands. This ID is treated as opaque data by the firmware and
36346          * the value is returned in the `hwrm_resp_hdr` upon completion.
36347          */
36348         uint16_t        seq_id;
36349         /*
36350          * The target ID of the command:
36351          * * 0x0-0xFFF8 - The function ID
36352          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36353          * * 0xFFFD - Reserved for user-space HWRM interface
36354          * * 0xFFFF - HWRM
36355          */
36356         uint16_t        target_id;
36357         /*
36358          * A physical address pointer pointing to a host buffer that the
36359          * command's response data will be written. This can be either a host
36360          * physical address (HPA) or a guest physical address (GPA) and must
36361          * point to a physically contiguous block of memory.
36362          */
36363         uint64_t        resp_addr;
36364         uint32_t        enables;
36365         uint8_t unused_0[4];
36366 } __rte_packed;
36367
36368 /* hwrm_vnic_qcaps_output (size:192b/24B) */
36369 struct hwrm_vnic_qcaps_output {
36370         /* The specific error status for the command. */
36371         uint16_t        error_code;
36372         /* The HWRM command request type. */
36373         uint16_t        req_type;
36374         /* The sequence ID from the original command. */
36375         uint16_t        seq_id;
36376         /* The length of the response data in number of bytes. */
36377         uint16_t        resp_len;
36378         /* The maximum receive unit that is settable on a vnic. */
36379         uint16_t        mru;
36380         uint8_t unused_0[2];
36381         uint32_t        flags;
36382         /* Unused. */
36383         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED \
36384                 UINT32_C(0x1)
36385         /*
36386          * When this bit is '1', the capability of stripping VLAN in
36387          * the RX path is supported on VNIC(s).
36388          * If set to '0', then VLAN stripping capability is
36389          * not supported on VNIC(s).
36390          */
36391         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP \
36392                 UINT32_C(0x2)
36393         /*
36394          * When this bit is '1', the capability to buffer receive
36395          * packets in the hardware until the host posts new receive buffers
36396          * is supported on VNIC(s).
36397          * If set to '0', then bd_stall capability is not supported
36398          * on VNIC(s).
36399          */
36400         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP \
36401                 UINT32_C(0x4)
36402         /*
36403          * When this bit is '1', the capability to
36404          * receive both RoCE and non-RoCE traffic on VNIC(s) is
36405          * supported.
36406          * If set to '0', then the capability to receive
36407          * both RoCE and non-RoCE traffic on VNIC(s) is
36408          * not supported.
36409          */
36410         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP \
36411                 UINT32_C(0x8)
36412         /*
36413          * When this bit is set to '1', the capability to configure
36414          * a VNIC to receive only RoCE traffic is supported.
36415          * When this flag is set to '0', the VNIC capability to
36416          * configure to receive only RoCE traffic is not supported.
36417          */
36418         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP \
36419                 UINT32_C(0x10)
36420         /*
36421          * When this bit is set to '1', then the capability to enable
36422          * a VNIC in a mode where RSS context without configuring
36423          * RSS indirection table is supported (for RSS hash computation).
36424          * When this bit is set to '0', then a VNIC can not be configured
36425          * with a mode to enable RSS context without configuring RSS
36426          * indirection table.
36427          */
36428         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP \
36429                 UINT32_C(0x20)
36430         /*
36431          * When this bit is '1', the capability to
36432          * mirror the RoCE traffic is supported.
36433          * If set to '0', then the capability to mirror the
36434          * RoCE traffic is not supported.
36435          */
36436         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP \
36437                 UINT32_C(0x40)
36438         /*
36439          * When this bit is '1', the outermost RSS hashing capability
36440          * is supported. If set to '0', then the outermost RSS hashing
36441          * capability is not supported.
36442          */
36443         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP \
36444                 UINT32_C(0x80)
36445         /*
36446          * When this bit is '1', it indicates that firmware supports the
36447          * ability to steer incoming packets from one CoS queue to one
36448          * VNIC.  This optional feature can then be enabled
36449          * using HWRM_VNIC_CFG on any VNIC.  This feature is only
36450          * available when NVM option “enable_cos_classification” is set
36451          * to 1.  If set to '0', firmware does not support this feature.
36452          */
36453         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_COS_ASSIGNMENT_CAP \
36454                 UINT32_C(0x100)
36455         /*
36456          * When this bit is '1', it indicates that HW and firmware supports
36457          * the use of RX V2 and RX TPA start V2 completion records for all
36458          * the RX rings of a VNIC. Once set, this feature is mandatory to
36459          * be used for the RX rings of the VNIC. Additionally, two new RX
36460          * checksum features supported by these completion records can be
36461          * configured using the HWRM_VNIC_CFG on a VNIC. If set to '0', the
36462          * HW and the firmware does not support this feature.
36463          */
36464         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RX_CMPL_V2_CAP \
36465                 UINT32_C(0x200)
36466         /*
36467          * When this bit is '1', it indicates that HW and firmware support
36468          * vnic state change. Host drivers can change the vnic state using
36469          * HWRM_VNIC_UPDATE. If set to '0', the HW and firmware do not
36470          * support this feature.
36471          */
36472         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VNIC_STATE_CAP \
36473                 UINT32_C(0x400)
36474         /*
36475          * When this bit is '1', it indicates that firmware supports
36476          * virtio-net functions default VNIC allocation using
36477          * HWRM_VNIC_ALLOC.
36478          * This capability is available only on Proxy VEE PF. If set to '0',
36479          * firmware does not support this feature.
36480          */
36481         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VIRTIO_NET_VNIC_ALLOC_CAP \
36482                 UINT32_C(0x800)
36483         /*
36484          * When this bit is set '1', then the capability to configure the
36485          * metadata format in the RX completion is supported for the VNIC.
36486          * When this bit is set to '0', then the capability to configure
36487          * the metadata format in the RX completion is not supported for
36488          * the VNIC.
36489          */
36490         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_METADATA_FORMAT_CAP \
36491                 UINT32_C(0x1000)
36492         /*
36493          * When this bit is set '1', it indicates that firmware returns
36494          * INVALID_PARAM error, if host drivers choose invalid hash type
36495          * bit combinations in vnic_rss_cfg.
36496          */
36497         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_STRICT_HASH_TYPE_CAP \
36498                 UINT32_C(0x2000)
36499         /*
36500          * When this bit is set '1', it indicates that firmware supports
36501          * the hash_type include and exclude flags in hwrm_vnic_rss_cfg.
36502          */
36503         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_HASH_TYPE_DELTA_CAP \
36504                 UINT32_C(0x4000)
36505         /*
36506          * When this bit is '1', it indicates that HW is capable of using
36507          * Toeplitz algorithm. This mode uses Toeplitz algorithm and
36508          * provided Toeplitz hash key to hash the packets according to the
36509          * configured hash type and hash mode. The Toeplitz hash results and
36510          * the provided Toeplitz RSS indirection table are used to determine
36511          * the RSS rings.
36512          */
36513         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_TOEPLITZ_CAP \
36514                 UINT32_C(0x8000)
36515         /*
36516          * When this bit is '1', it indicates that HW is capable of using
36517          * XOR algorithm. This mode uses XOR algorithm to hash the packets
36518          * according to the configured hash type and hash mode. The XOR
36519          * hash results and the provided XOR RSS indirection table are
36520          * used to determine the RSS rings. Host drivers provided hash key
36521          * is not honored in this mode.
36522          */
36523         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_XOR_CAP \
36524                 UINT32_C(0x10000)
36525         /*
36526          * When this bit is '1', it indicates that HW is capable of using
36527          * checksum algorithm. In this mode, HW uses inner packets checksum
36528          * algorithm to distribute the packets across the rings and Toeplitz
36529          * algorithm to calculate the hash to convey it in the RX
36530          * completions. Host drivers should provide Toeplitz hash key.
36531          * As HW uses innermost packets checksum to distribute the packets
36532          * across the rings, host drivers can't convey hash  mode to choose
36533          * outer headers to calculate Toeplitz hash. FW will fail such
36534          * configuration.
36535          */
36536         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_TOEPLITZ_CHKSM_CAP \
36537                 UINT32_C(0x20000)
36538         /*
36539          * When this bit is '1' HW supports hash calculation
36540          * based on IPV6 flow labels.
36541          */
36542         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPV6_FLOW_LABEL_CAP \
36543                 UINT32_C(0x40000)
36544         /*
36545          * When this bit is '1', it indicates that HW and firmware supports
36546          * the use of RX V3 and RX TPA start V3 completion records for all
36547          * the RX rings of a VNIC. Once set, this feature is mandatory to
36548          * be used for the RX rings of the VNIC. If set to '0', the
36549          * HW and the firmware does not support this feature.
36550          */
36551         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RX_CMPL_V3_CAP \
36552                 UINT32_C(0x80000)
36553         /*
36554          * When this bit is '1' HW supports different RX CQE record types.
36555          * Host drivers can choose the mode based on their application
36556          * requirements like performance, TPA, HDS and PTP.
36557          */
36558         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_L2_CQE_MODE_CAP \
36559                 UINT32_C(0x100000)
36560         /*
36561          * This field advertises the maximum concurrent TPA aggregations
36562          * supported by the VNIC on new devices that support TPA v2 or v3.
36563          * '0' means that both the TPA v2 and v3 are not supported.
36564          */
36565         uint16_t        max_aggs_supported;
36566         uint8_t unused_1[5];
36567         /*
36568          * This field is used in Output records to indicate that the output
36569          * is completely written to RAM.  This field should be read as '1'
36570          * to indicate that the output has been completely written.
36571          * When writing a command completion or response to an internal processor,
36572          * the order of writes has to be such that this field is written last.
36573          */
36574         uint8_t valid;
36575 } __rte_packed;
36576
36577 /*********************
36578  * hwrm_vnic_tpa_cfg *
36579  *********************/
36580
36581
36582 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */
36583 struct hwrm_vnic_tpa_cfg_input {
36584         /* The HWRM command request type. */
36585         uint16_t        req_type;
36586         /*
36587          * The completion ring to send the completion event on. This should
36588          * be the NQ ID returned from the `nq_alloc` HWRM command.
36589          */
36590         uint16_t        cmpl_ring;
36591         /*
36592          * The sequence ID is used by the driver for tracking multiple
36593          * commands. This ID is treated as opaque data by the firmware and
36594          * the value is returned in the `hwrm_resp_hdr` upon completion.
36595          */
36596         uint16_t        seq_id;
36597         /*
36598          * The target ID of the command:
36599          * * 0x0-0xFFF8 - The function ID
36600          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36601          * * 0xFFFD - Reserved for user-space HWRM interface
36602          * * 0xFFFF - HWRM
36603          */
36604         uint16_t        target_id;
36605         /*
36606          * A physical address pointer pointing to a host buffer that the
36607          * command's response data will be written. This can be either a host
36608          * physical address (HPA) or a guest physical address (GPA) and must
36609          * point to a physically contiguous block of memory.
36610          */
36611         uint64_t        resp_addr;
36612         uint32_t        flags;
36613         /*
36614          * When this bit is '1', the VNIC shall be configured to
36615          * perform transparent packet aggregation (TPA) of
36616          * non-tunneled TCP packets.
36617          */
36618         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA \
36619                 UINT32_C(0x1)
36620         /*
36621          * When this bit is '1', the VNIC shall be configured to
36622          * perform transparent packet aggregation (TPA) of
36623          * tunneled TCP packets.
36624          */
36625         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA \
36626                 UINT32_C(0x2)
36627         /*
36628          * When this bit is '1', the VNIC shall be configured to
36629          * perform transparent packet aggregation (TPA) according
36630          * to Windows Receive Segment Coalescing (RSC) rules.
36631          */
36632         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE \
36633                 UINT32_C(0x4)
36634         /*
36635          * When this bit is '1', the VNIC shall be configured to
36636          * perform transparent packet aggregation (TPA) according
36637          * to Linux Generic Receive Offload (GRO) rules.
36638          */
36639         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO \
36640                 UINT32_C(0x8)
36641         /*
36642          * When this bit is '1', the VNIC shall be configured to
36643          * perform transparent packet aggregation (TPA) for TCP
36644          * packets with IP ECN set to non-zero.
36645          */
36646         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN \
36647                 UINT32_C(0x10)
36648         /*
36649          * When this bit is '1', the VNIC shall be configured to
36650          * perform transparent packet aggregation (TPA) for
36651          * GRE tunneled TCP packets only if all packets have the
36652          * same GRE sequence.
36653          */
36654         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
36655                 UINT32_C(0x20)
36656         /*
36657          * When this bit is '1' and the GRO mode is enabled,
36658          * the VNIC shall be configured to
36659          * perform transparent packet aggregation (TPA) for
36660          * TCP/IPv4 packets with consecutively increasing IPIDs.
36661          * In other words, the last packet that is being
36662          * aggregated to an already existing aggregation context
36663          * shall have IPID 1 more than the IPID of the last packet
36664          * that was aggregated in that aggregation context.
36665          */
36666         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK \
36667                 UINT32_C(0x40)
36668         /*
36669          * When this bit is '1' and the GRO mode is enabled,
36670          * the VNIC shall be configured to
36671          * perform transparent packet aggregation (TPA) for
36672          * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
36673          * value.
36674          */
36675         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK \
36676                 UINT32_C(0x80)
36677         /*
36678          * When this bit is '1' and the GRO mode is enabled,
36679          * the VNIC shall DMA payload data using GRO rules.
36680          * When this bit is '0', the VNIC shall DMA payload data
36681          * using the more efficient LRO rules of filling all
36682          * aggregation buffers.
36683          */
36684         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_PACK_AS_GRO \
36685                 UINT32_C(0x100)
36686         uint32_t        enables;
36687         /*
36688          * This bit must be '1' for the max_agg_segs field to be
36689          * configured.
36690          */
36691         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS      UINT32_C(0x1)
36692         /*
36693          * This bit must be '1' for the max_aggs field to be
36694          * configured.
36695          */
36696         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS          UINT32_C(0x2)
36697         /*
36698          * This bit must be '1' for the max_agg_timer field to be
36699          * configured.
36700          */
36701         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER     UINT32_C(0x4)
36702         /* deprecated bit.  Do not use!!! */
36703         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN       UINT32_C(0x8)
36704         /* Logical vnic ID */
36705         uint16_t        vnic_id;
36706         /*
36707          * This is the maximum number of TCP segments that can
36708          * be aggregated (unit is Log2). Max value is 31. On new
36709          * devices supporting TPA v2, the unit is multiples of 4 and
36710          * valid values are > 0 and <= 63.
36711          */
36712         uint16_t        max_agg_segs;
36713         /* 1 segment */
36714         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
36715         /* 2 segments */
36716         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
36717         /* 4 segments */
36718         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
36719         /* 8 segments */
36720         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
36721         /* Any segment size larger than this is not valid */
36722         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
36723         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST \
36724                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
36725         /*
36726          * This is the maximum number of aggregations this VNIC is
36727          * allowed (unit is Log2). Max value is 7. On new devices
36728          * supporting TPA v2, this is in unit of 1 and must be > 0
36729          * and <= max_aggs_supported in the hwrm_vnic_qcaps response
36730          * to enable TPA v2.
36731          */
36732         uint16_t        max_aggs;
36733         /* 1 aggregation */
36734         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1   UINT32_C(0x0)
36735         /* 2 aggregations */
36736         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2   UINT32_C(0x1)
36737         /* 4 aggregations */
36738         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4   UINT32_C(0x2)
36739         /* 8 aggregations */
36740         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8   UINT32_C(0x3)
36741         /* 16 aggregations */
36742         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16  UINT32_C(0x4)
36743         /* Any aggregation size larger than this is not valid */
36744         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
36745         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST \
36746                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
36747         uint8_t unused_0[2];
36748         /*
36749          * This is the maximum amount of time allowed for
36750          * an aggregation context to complete after it was initiated.
36751          */
36752         uint32_t        max_agg_timer;
36753         /*
36754          * This is the minimum amount of payload length required to
36755          * start an aggregation context. This field is deprecated and
36756          * should be set to 0.  The minimum length is set by firmware
36757          * and can be queried using hwrm_vnic_tpa_qcfg.
36758          */
36759         uint32_t        min_agg_len;
36760 } __rte_packed;
36761
36762 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
36763 struct hwrm_vnic_tpa_cfg_output {
36764         /* The specific error status for the command. */
36765         uint16_t        error_code;
36766         /* The HWRM command request type. */
36767         uint16_t        req_type;
36768         /* The sequence ID from the original command. */
36769         uint16_t        seq_id;
36770         /* The length of the response data in number of bytes. */
36771         uint16_t        resp_len;
36772         uint8_t unused_0[7];
36773         /*
36774          * This field is used in Output records to indicate that the output
36775          * is completely written to RAM.  This field should be read as '1'
36776          * to indicate that the output has been completely written.
36777          * When writing a command completion or response to an internal processor,
36778          * the order of writes has to be such that this field is written last.
36779          */
36780         uint8_t valid;
36781 } __rte_packed;
36782
36783 /*********************
36784  * hwrm_vnic_rss_cfg *
36785  *********************/
36786
36787
36788 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
36789 struct hwrm_vnic_rss_cfg_input {
36790         /* The HWRM command request type. */
36791         uint16_t        req_type;
36792         /*
36793          * The completion ring to send the completion event on. This should
36794          * be the NQ ID returned from the `nq_alloc` HWRM command.
36795          */
36796         uint16_t        cmpl_ring;
36797         /*
36798          * The sequence ID is used by the driver for tracking multiple
36799          * commands. This ID is treated as opaque data by the firmware and
36800          * the value is returned in the `hwrm_resp_hdr` upon completion.
36801          */
36802         uint16_t        seq_id;
36803         /*
36804          * The target ID of the command:
36805          * * 0x0-0xFFF8 - The function ID
36806          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36807          * * 0xFFFD - Reserved for user-space HWRM interface
36808          * * 0xFFFF - HWRM
36809          */
36810         uint16_t        target_id;
36811         /*
36812          * A physical address pointer pointing to a host buffer that the
36813          * command's response data will be written. This can be either a host
36814          * physical address (HPA) or a guest physical address (GPA) and must
36815          * point to a physically contiguous block of memory.
36816          */
36817         uint64_t        resp_addr;
36818         uint32_t        hash_type;
36819         /*
36820          * When this bit is '1', the RSS hash shall be computed
36821          * over source and destination IPv4 addresses of IPv4
36822          * packets.
36823          */
36824         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4 \
36825                 UINT32_C(0x1)
36826         /*
36827          * When this bit is '1', the RSS hash shall be computed
36828          * over source/destination IPv4 addresses and
36829          * source/destination ports of TCP/IPv4 packets.
36830          */
36831         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4 \
36832                 UINT32_C(0x2)
36833         /*
36834          * When this bit is '1', the RSS hash shall be computed
36835          * over source/destination IPv4 addresses and
36836          * source/destination ports of UDP/IPv4 packets.
36837          */
36838         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4 \
36839                 UINT32_C(0x4)
36840         /*
36841          * When this bit is '1', the RSS hash shall be computed
36842          * over source and destination IPv6 addresses of IPv6
36843          * packets.
36844          */
36845         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6 \
36846                 UINT32_C(0x8)
36847         /*
36848          * When this bit is '1', the RSS hash shall be computed
36849          * over source/destination IPv6 addresses and
36850          * source/destination ports of TCP/IPv6 packets.
36851          */
36852         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6 \
36853                 UINT32_C(0x10)
36854         /*
36855          * When this bit is '1', the RSS hash shall be computed
36856          * over source/destination IPv6 addresses and
36857          * source/destination ports of UDP/IPv6 packets.
36858          */
36859         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6 \
36860                 UINT32_C(0x20)
36861         /*
36862          * When this bit is '1', the RSS hash shall be computed
36863          * over source, destination IPv6 addresses and flow label of IPv6
36864          * packets. Hash type ipv6 and ipv6_flow_label are mutually
36865          * exclusive. HW does not include the flow_label in hash
36866          * calculation for the packets that are matching tcp_ipv6 and
36867          * udp_ipv6 hash types. Host drivers should set this bit based on
36868          * rss_ipv6_flow_label_cap.
36869          */
36870         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL \
36871                 UINT32_C(0x40)
36872         /* VNIC ID of VNIC associated with RSS table being configured. */
36873         uint16_t        vnic_id;
36874         /*
36875          * Specifies which VNIC ring table pair to configure.
36876          * Valid values range from 0 to 7.
36877          */
36878         uint8_t ring_table_pair_index;
36879         /* Flags to specify different RSS hash modes. */
36880         uint8_t hash_mode_flags;
36881         /*
36882          * When this bit is '1', it indicates using current RSS
36883          * hash mode setting configured in the device.
36884          */
36885         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \
36886                 UINT32_C(0x1)
36887         /*
36888          * When this bit is '1', it indicates requesting support of
36889          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
36890          * l4.src, l4.dest} for tunnel packets. For none-tunnel
36891          * packets, the RSS hash is computed over the normal
36892          * src/dest l3 and src/dest l4 headers.
36893          */
36894         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \
36895                 UINT32_C(0x2)
36896         /*
36897          * When this bit is '1', it indicates requesting support of
36898          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
36899          * tunnel packets. For none-tunnel packets, the RSS hash is
36900          * computed over the normal src/dest l3 headers.
36901          */
36902         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \
36903                 UINT32_C(0x4)
36904         /*
36905          * When this bit is '1', it indicates requesting support of
36906          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
36907          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
36908          * packets, the RSS hash is computed over the normal
36909          * src/dest l3 and src/dest l4 headers.
36910          */
36911         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
36912                 UINT32_C(0x8)
36913         /*
36914          * When this bit is '1', it indicates requesting support of
36915          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
36916          * tunnel packets. For none-tunnel packets, the RSS hash is
36917          * computed over the normal src/dest l3 headers.
36918          */
36919         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
36920                 UINT32_C(0x10)
36921         /* This is the address for rss ring group table */
36922         uint64_t        ring_grp_tbl_addr;
36923         /* This is the address for rss hash key table */
36924         uint64_t        hash_key_tbl_addr;
36925         /* Index to the rss indirection table. */
36926         uint16_t        rss_ctx_idx;
36927         uint8_t flags;
36928         /*
36929          * When this bit is '1', it indicates that the hash_type field is
36930          * interpreted as a change relative the current configuration. Each
36931          * '1' bit in hash_type represents a header to add to the current
36932          * hash. Zeroes designate the hash_type state bits that should remain
36933          * unchanged, if possible. If this constraint on the existing state
36934          * cannot be satisfied, then the implementation should preference
36935          * adding other headers so as to honor the request to add the
36936          * specified headers. It is an error to set this flag concurrently
36937          * with hash_type_exclude.
36938          */
36939         #define HWRM_VNIC_RSS_CFG_INPUT_FLAGS_HASH_TYPE_INCLUDE \
36940                 UINT32_C(0x1)
36941         /*
36942          * When this bit is '1', it indicates that the hash_type field is
36943          * interpreted as a change relative the current configuration. Each
36944          * '1' bit in hash_type represents a header to remove from the
36945          * current hash. Zeroes designate the hash_type state bits that
36946          * should remain unchanged, if possible. If this constraint on the
36947          * existing state cannot be satisfied, then the implementation should
36948          * preference removing other headers so as to honor the request to
36949          * remove the specified headers. It is an error to set this flag
36950          * concurrently with hash_type_include.
36951          */
36952         #define HWRM_VNIC_RSS_CFG_INPUT_FLAGS_HASH_TYPE_EXCLUDE \
36953                 UINT32_C(0x2)
36954         uint8_t ring_select_mode;
36955         /*
36956          * In this mode, HW uses Toeplitz algorithm and provided Toeplitz
36957          * hash key to hash the packets according to the configured hash
36958          * type and hash mode. The Toeplitz hash results and the provided
36959          * Toeplitz RSS indirection table are used to determine the RSS
36960          * rings.
36961          */
36962         #define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_TOEPLITZ \
36963                 UINT32_C(0x0)
36964         /*
36965          * In this mode, HW uses XOR algorithm to hash the packets according
36966          * to the configured hash type and hash mode. The XOR hash results
36967          * and the provided XOR RSS indirection table are used to determine
36968          * the RSS rings. Host drivers provided hash key is not honored in
36969          * this mode.
36970          */
36971         #define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_XOR \
36972                 UINT32_C(0x1)
36973         /*
36974          * In this mode, HW uses inner packets checksum algorithm to
36975          * distribute the packets across the rings and Toeplitz algorithm
36976          * to calculate the hash to convey it in the RX completions. Host
36977          * drivers should provide Toeplitz hash key. As HW uses innermost
36978          * packets checksum to distribute the packets across the rings,
36979          * host drivers can't convey hash mode to choose outer headers to
36980          * calculate Toeplitz hash. FW will fail such configuration.
36981          */
36982         #define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM \
36983                 UINT32_C(0x2)
36984         #define HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_LAST \
36985                 HWRM_VNIC_RSS_CFG_INPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM
36986         uint8_t unused_1[4];
36987 } __rte_packed;
36988
36989 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
36990 struct hwrm_vnic_rss_cfg_output {
36991         /* The specific error status for the command. */
36992         uint16_t        error_code;
36993         /* The HWRM command request type. */
36994         uint16_t        req_type;
36995         /* The sequence ID from the original command. */
36996         uint16_t        seq_id;
36997         /* The length of the response data in number of bytes. */
36998         uint16_t        resp_len;
36999         uint8_t unused_0[7];
37000         /*
37001          * This field is used in Output records to indicate that the output
37002          * is completely written to RAM.  This field should be read as '1'
37003          * to indicate that the output has been completely written.
37004          * When writing a command completion or response to an internal processor,
37005          * the order of writes has to be such that this field is written last.
37006          */
37007         uint8_t valid;
37008 } __rte_packed;
37009
37010 /* hwrm_vnic_rss_cfg_cmd_err (size:64b/8B) */
37011 struct hwrm_vnic_rss_cfg_cmd_err {
37012         /*
37013          * command specific error codes that goes to
37014          * the cmd_err field in Common HWRM Error Response.
37015          */
37016         uint8_t code;
37017         /* Unknown error */
37018         #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_UNKNOWN \
37019                 UINT32_C(0x0)
37020         /*
37021          * Unable to change global RSS mode to outer due to all active
37022          * interfaces are not ready to support outer RSS hashing.
37023          */
37024         #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY \
37025                 UINT32_C(0x1)
37026         #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_LAST \
37027                 HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY
37028         uint8_t unused_0[7];
37029 } __rte_packed;
37030
37031 /**********************
37032  * hwrm_vnic_rss_qcfg *
37033  **********************/
37034
37035
37036 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
37037 struct hwrm_vnic_rss_qcfg_input {
37038         /* The HWRM command request type. */
37039         uint16_t        req_type;
37040         /*
37041          * The completion ring to send the completion event on. This should
37042          * be the NQ ID returned from the `nq_alloc` HWRM command.
37043          */
37044         uint16_t        cmpl_ring;
37045         /*
37046          * The sequence ID is used by the driver for tracking multiple
37047          * commands. This ID is treated as opaque data by the firmware and
37048          * the value is returned in the `hwrm_resp_hdr` upon completion.
37049          */
37050         uint16_t        seq_id;
37051         /*
37052          * The target ID of the command:
37053          * * 0x0-0xFFF8 - The function ID
37054          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37055          * * 0xFFFD - Reserved for user-space HWRM interface
37056          * * 0xFFFF - HWRM
37057          */
37058         uint16_t        target_id;
37059         /*
37060          * A physical address pointer pointing to a host buffer that the
37061          * command's response data will be written. This can be either a host
37062          * physical address (HPA) or a guest physical address (GPA) and must
37063          * point to a physically contiguous block of memory.
37064          */
37065         uint64_t        resp_addr;
37066         /* Index to the rss indirection table. */
37067         uint16_t        rss_ctx_idx;
37068         uint8_t unused_0[6];
37069 } __rte_packed;
37070
37071 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
37072 struct hwrm_vnic_rss_qcfg_output {
37073         /* The specific error status for the command. */
37074         uint16_t        error_code;
37075         /* The HWRM command request type. */
37076         uint16_t        req_type;
37077         /* The sequence ID from the original command. */
37078         uint16_t        seq_id;
37079         /* The length of the response data in number of bytes. */
37080         uint16_t        resp_len;
37081         uint32_t        hash_type;
37082         /*
37083          * When this bit is '1', the RSS hash shall be computed
37084          * over source and destination IPv4 addresses of IPv4
37085          * packets.
37086          */
37087         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
37088         /*
37089          * When this bit is '1', the RSS hash shall be computed
37090          * over source/destination IPv4 addresses and
37091          * source/destination ports of TCP/IPv4 packets.
37092          */
37093         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
37094         /*
37095          * When this bit is '1', the RSS hash shall be computed
37096          * over source/destination IPv4 addresses and
37097          * source/destination ports of UDP/IPv4 packets.
37098          */
37099         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
37100         /*
37101          * When this bit is '1', the RSS hash shall be computed
37102          * over source and destination IPv6 addresses of IPv6
37103          * packets.
37104          */
37105         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
37106         /*
37107          * When this bit is '1', the RSS hash shall be computed
37108          * over source/destination IPv6 addresses and
37109          * source/destination ports of TCP/IPv6 packets.
37110          */
37111         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
37112         /*
37113          * When this bit is '1', the RSS hash shall be computed
37114          * over source/destination IPv6 addresses and
37115          * source/destination ports of UDP/IPv6 packets.
37116          */
37117         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
37118         uint8_t unused_0[4];
37119         /* This is the value of rss hash key */
37120         uint32_t        hash_key[10];
37121         /* Flags to specify different RSS hash modes. */
37122         uint8_t hash_mode_flags;
37123         /*
37124          * When this bit is '1', it indicates using current RSS
37125          * hash mode setting configured in the device.
37126          */
37127         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \
37128                 UINT32_C(0x1)
37129         /*
37130          * When this bit is '1', it indicates requesting support of
37131          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
37132          * l4.src, l4.dest} for tunnel packets. For none-tunnel
37133          * packets, the RSS hash is computed over the normal
37134          * src/dest l3 and src/dest l4 headers.
37135          */
37136         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \
37137                 UINT32_C(0x2)
37138         /*
37139          * When this bit is '1', it indicates requesting support of
37140          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
37141          * tunnel packets. For none-tunnel packets, the RSS hash is
37142          * computed over the normal src/dest l3 headers.
37143          */
37144         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \
37145                 UINT32_C(0x4)
37146         /*
37147          * When this bit is '1', it indicates requesting support of
37148          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
37149          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
37150          * packets, the RSS hash is computed over the normal
37151          * src/dest l3 and src/dest l4 headers.
37152          */
37153         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
37154                 UINT32_C(0x8)
37155         /*
37156          * When this bit is '1', it indicates requesting support of
37157          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
37158          * tunnel packets. For none-tunnel packets, the RSS hash is
37159          * computed over the normal src/dest l3 headers.
37160          */
37161         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
37162                 UINT32_C(0x10)
37163         uint8_t ring_select_mode;
37164         /*
37165          * In this mode, HW uses Toeplitz algorithm and provided Toeplitz
37166          * hash key to hash the packets according to the configured hash
37167          * type and hash mode. The Toeplitz hash results and the provided
37168          * Toeplitz RSS indirection table are used to determine the RSS
37169          * rings.
37170          */
37171         #define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_TOEPLITZ \
37172                 UINT32_C(0x0)
37173         /*
37174          * In this mode, HW uses XOR algorithm to hash the packets according
37175          * to the configured hash type and hash mode. The XOR hash results
37176          * and the provided XOR RSS indirection table are used to determine
37177          * the RSS rings. Host drivers provided hash key is not honored in
37178          * this mode.
37179          */
37180         #define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_XOR \
37181                 UINT32_C(0x1)
37182         /*
37183          * In this mode, HW uses inner packets checksum algorithm to
37184          * distribute the packets across the rings and Toeplitz algorithm
37185          * to calculate the hash to convey it in the RX completions. Host
37186          * drivers should provide Toeplitz hash key. As HW uses innermost
37187          * packets checksum to distribute the packets across the rings,
37188          * host drivers can't convey hash mode to choose outer headers to
37189          * calculate Toeplitz hash. FW will fail such configuration.
37190          */
37191         #define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM \
37192                 UINT32_C(0x2)
37193         #define HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_LAST \
37194                 HWRM_VNIC_RSS_QCFG_OUTPUT_RING_SELECT_MODE_TOEPLITZ_CHECKSUM
37195         uint8_t unused_1[5];
37196         /*
37197          * This field is used in Output records to indicate that the output
37198          * is completely written to RAM.  This field should be read as '1'
37199          * to indicate that the output has been completely written.
37200          * When writing a command completion or response to an internal processor,
37201          * the order of writes has to be such that this field is written last.
37202          */
37203         uint8_t valid;
37204 } __rte_packed;
37205
37206 /**************************
37207  * hwrm_vnic_plcmodes_cfg *
37208  **************************/
37209
37210
37211 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
37212 struct hwrm_vnic_plcmodes_cfg_input {
37213         /* The HWRM command request type. */
37214         uint16_t        req_type;
37215         /*
37216          * The completion ring to send the completion event on. This should
37217          * be the NQ ID returned from the `nq_alloc` HWRM command.
37218          */
37219         uint16_t        cmpl_ring;
37220         /*
37221          * The sequence ID is used by the driver for tracking multiple
37222          * commands. This ID is treated as opaque data by the firmware and
37223          * the value is returned in the `hwrm_resp_hdr` upon completion.
37224          */
37225         uint16_t        seq_id;
37226         /*
37227          * The target ID of the command:
37228          * * 0x0-0xFFF8 - The function ID
37229          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37230          * * 0xFFFD - Reserved for user-space HWRM interface
37231          * * 0xFFFF - HWRM
37232          */
37233         uint16_t        target_id;
37234         /*
37235          * A physical address pointer pointing to a host buffer that the
37236          * command's response data will be written. This can be either a host
37237          * physical address (HPA) or a guest physical address (GPA) and must
37238          * point to a physically contiguous block of memory.
37239          */
37240         uint64_t        resp_addr;
37241         uint32_t        flags;
37242         /*
37243          * When this bit is '1', the VNIC shall be configured to
37244          * use regular placement algorithm.
37245          * By default, the regular placement algorithm shall be
37246          * enabled on the VNIC.
37247          */
37248         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
37249                 UINT32_C(0x1)
37250         /*
37251          * When this bit is '1', the VNIC shall be configured
37252          * use the jumbo placement algorithm.
37253          */
37254         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
37255                 UINT32_C(0x2)
37256         /*
37257          * When this bit is '1', the VNIC shall be configured
37258          * to enable Header-Data split for IPv4 packets according
37259          * to the following rules:
37260          * # If the packet is identified as TCP/IPv4, then the
37261          * packet is split at the beginning of the TCP payload.
37262          * # If the packet is identified as UDP/IPv4, then the
37263          * packet is split at the beginning of UDP payload.
37264          * # If the packet is identified as non-TCP and non-UDP
37265          * IPv4 packet, then the packet is split at the beginning
37266          * of the upper layer protocol header carried in the IPv4
37267          * packet.
37268          */
37269         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 \
37270                 UINT32_C(0x4)
37271         /*
37272          * When this bit is '1', the VNIC shall be configured
37273          * to enable Header-Data split for IPv6 packets according
37274          * to the following rules:
37275          * # If the packet is identified as TCP/IPv6, then the
37276          * packet is split at the beginning of the TCP payload.
37277          * # If the packet is identified as UDP/IPv6, then the
37278          * packet is split at the beginning of UDP payload.
37279          * # If the packet is identified as non-TCP and non-UDP
37280          * IPv6 packet, then the packet is split at the beginning
37281          * of the upper layer protocol header carried in the IPv6
37282          * packet.
37283          */
37284         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 \
37285                 UINT32_C(0x8)
37286         /*
37287          * When this bit is '1', the VNIC shall be configured
37288          * to enable Header-Data split for FCoE packets at the
37289          * beginning of FC payload.
37290          */
37291         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE \
37292                 UINT32_C(0x10)
37293         /*
37294          * When this bit is '1', the VNIC shall be configured
37295          * to enable Header-Data split for RoCE packets at the
37296          * beginning of RoCE payload (after BTH/GRH headers).
37297          */
37298         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE \
37299                 UINT32_C(0x20)
37300         /*
37301          * When this bit is '1', the VNIC shall be configured use the virtio
37302          * placement algorithm. This feature can only be configured when
37303          * proxy mode is supported on the function.
37304          */
37305         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_VIRTIO_PLACEMENT \
37306                 UINT32_C(0x40)
37307         uint32_t        enables;
37308         /*
37309          * This bit must be '1' for the jumbo_thresh_valid field to be
37310          * configured.
37311          */
37312         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
37313                 UINT32_C(0x1)
37314         /*
37315          * This bit must be '1' for the hds_offset_valid field to be
37316          * configured.
37317          */
37318         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
37319                 UINT32_C(0x2)
37320         /*
37321          * This bit must be '1' for the hds_threshold_valid field to be
37322          * configured.
37323          */
37324         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
37325                 UINT32_C(0x4)
37326         /*
37327          * This bit must be '1' for the max_bds_valid field to be
37328          * configured.
37329          */
37330         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_MAX_BDS_VALID \
37331                 UINT32_C(0x8)
37332         /* Logical vnic ID */
37333         uint32_t        vnic_id;
37334         /*
37335          * When jumbo placement algorithm is enabled, this value
37336          * is used to determine the threshold for jumbo placement.
37337          * Packets with length larger than this value will be
37338          * placed according to the jumbo placement algorithm.
37339          */
37340         uint16_t        jumbo_thresh;
37341         /*
37342          * This value is used to determine the offset into
37343          * packet buffer where the split data (payload) will be
37344          * placed according to one of HDS placement algorithm.
37345          *
37346          * The lengths of packet buffers provided for split data
37347          * shall be larger than this value.
37348          */
37349         uint16_t        hds_offset;
37350         /*
37351          * When one of the HDS placement algorithm is enabled, this
37352          * value is used to determine the threshold for HDS
37353          * placement.
37354          * Packets with length larger than this value will be
37355          * placed according to the HDS placement algorithm.
37356          * This value shall be in multiple of 4 bytes.
37357          */
37358         uint16_t        hds_threshold;
37359         /*
37360          * When virtio placement algorithm is enabled, this
37361          * value is used to determine the maximum number of BDs
37362          * that can be used to place an Rx Packet.
37363          * If an incoming packet does not fit in the buffers described
37364          * by the max BDs, the packet will be dropped and an error
37365          * will be reported in the completion. Valid values for this
37366          * field are between 1 and 8. If the VNIC uses header-data-
37367          * separation and/or TPA with buffer spanning enabled, valid
37368          * values for this field are between 2 and 8.
37369          * This feature can only be configured when proxy mode is
37370          * supported on the function.
37371          */
37372         uint16_t        max_bds;
37373         uint8_t unused_0[4];
37374 } __rte_packed;
37375
37376 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
37377 struct hwrm_vnic_plcmodes_cfg_output {
37378         /* The specific error status for the command. */
37379         uint16_t        error_code;
37380         /* The HWRM command request type. */
37381         uint16_t        req_type;
37382         /* The sequence ID from the original command. */
37383         uint16_t        seq_id;
37384         /* The length of the response data in number of bytes. */
37385         uint16_t        resp_len;
37386         uint8_t unused_0[7];
37387         /*
37388          * This field is used in Output records to indicate that the output
37389          * is completely written to RAM.  This field should be read as '1'
37390          * to indicate that the output has been completely written.
37391          * When writing a command completion or response to an internal
37392          * processor, the order of writes has to be such that this field is
37393          * written last.
37394          */
37395         uint8_t valid;
37396 } __rte_packed;
37397
37398 /***************************
37399  * hwrm_vnic_plcmodes_qcfg *
37400  ***************************/
37401
37402
37403 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
37404 struct hwrm_vnic_plcmodes_qcfg_input {
37405         /* The HWRM command request type. */
37406         uint16_t        req_type;
37407         /*
37408          * The completion ring to send the completion event on. This should
37409          * be the NQ ID returned from the `nq_alloc` HWRM command.
37410          */
37411         uint16_t        cmpl_ring;
37412         /*
37413          * The sequence ID is used by the driver for tracking multiple
37414          * commands. This ID is treated as opaque data by the firmware and
37415          * the value is returned in the `hwrm_resp_hdr` upon completion.
37416          */
37417         uint16_t        seq_id;
37418         /*
37419          * The target ID of the command:
37420          * * 0x0-0xFFF8 - The function ID
37421          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37422          * * 0xFFFD - Reserved for user-space HWRM interface
37423          * * 0xFFFF - HWRM
37424          */
37425         uint16_t        target_id;
37426         /*
37427          * A physical address pointer pointing to a host buffer that the
37428          * command's response data will be written. This can be either a host
37429          * physical address (HPA) or a guest physical address (GPA) and must
37430          * point to a physically contiguous block of memory.
37431          */
37432         uint64_t        resp_addr;
37433         /* Logical vnic ID */
37434         uint32_t        vnic_id;
37435         uint8_t unused_0[4];
37436 } __rte_packed;
37437
37438 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
37439 struct hwrm_vnic_plcmodes_qcfg_output {
37440         /* The specific error status for the command. */
37441         uint16_t        error_code;
37442         /* The HWRM command request type. */
37443         uint16_t        req_type;
37444         /* The sequence ID from the original command. */
37445         uint16_t        seq_id;
37446         /* The length of the response data in number of bytes. */
37447         uint16_t        resp_len;
37448         uint32_t        flags;
37449         /*
37450          * When this bit is '1', the VNIC is configured to
37451          * use regular placement algorithm.
37452          */
37453         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
37454                 UINT32_C(0x1)
37455         /*
37456          * When this bit is '1', the VNIC is configured to
37457          * use the jumbo placement algorithm.
37458          */
37459         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
37460                 UINT32_C(0x2)
37461         /*
37462          * When this bit is '1', the VNIC is configured
37463          * to enable Header-Data split for IPv4 packets.
37464          */
37465         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 \
37466                 UINT32_C(0x4)
37467         /*
37468          * When this bit is '1', the VNIC is configured
37469          * to enable Header-Data split for IPv6 packets.
37470          */
37471         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 \
37472                 UINT32_C(0x8)
37473         /*
37474          * When this bit is '1', the VNIC is configured
37475          * to enable Header-Data split for FCoE packets.
37476          */
37477         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE \
37478                 UINT32_C(0x10)
37479         /*
37480          * When this bit is '1', the VNIC is configured
37481          * to enable Header-Data split for RoCE packets.
37482          */
37483         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE \
37484                 UINT32_C(0x20)
37485         /*
37486          * When this bit is '1', the VNIC is configured
37487          * to be the default VNIC of the requesting function.
37488          */
37489         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC \
37490                 UINT32_C(0x40)
37491         /*
37492          * When this bit is '1', the VNIC is configured to use the virtio
37493          * placement algorithm. This feature can only be configured when
37494          * proxy mode is supported on the function.
37495          */
37496         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_VIRTIO_PLACEMENT \
37497                 UINT32_C(0x80)
37498         /*
37499          * When jumbo placement algorithm is enabled, this value
37500          * is used to determine the threshold for jumbo placement.
37501          * Packets with length larger than this value will be
37502          * placed according to the jumbo placement algorithm.
37503          */
37504         uint16_t        jumbo_thresh;
37505         /*
37506          * This value is used to determine the offset into
37507          * packet buffer where the split data (payload) will be
37508          * placed according to one of HDS placement algorithm.
37509          *
37510          * The lengths of packet buffers provided for split data
37511          * shall be larger than this value.
37512          */
37513         uint16_t        hds_offset;
37514         /*
37515          * When one of the HDS placement algorithm is enabled, this
37516          * value is used to determine the threshold for HDS
37517          * placement.
37518          * Packets with length larger than this value will be
37519          * placed according to the HDS placement algorithm.
37520          * This value shall be in multiple of 4 bytes.
37521          */
37522         uint16_t        hds_threshold;
37523         /*
37524          * When virtio placement algorithm is enabled, this
37525          * value is used to determine the maximum number of BDs
37526          * that can be used to place an Rx Packet.
37527          * If an incoming packet does not fit in the buffers described
37528          * by the max BDs, the packet will be dropped and an error
37529          * will be reported in the completion. Valid values for this
37530          * field are between 1 and 8. If the VNIC uses header-data-
37531          * separation and/or TPA with buffer spanning enabled, valid
37532          * values for this field are between 2 and 8.
37533          * This feature can only be configured when proxy mode is supported
37534          * on the function
37535          */
37536         uint16_t        max_bds;
37537         uint8_t unused_0[3];
37538         /*
37539          * This field is used in Output records to indicate that the output
37540          * is completely written to RAM.  This field should be read as '1'
37541          * to indicate that the output has been completely written.
37542          * When writing a command completion or response to an internal
37543          * processor, the order of writes has to be such that this field is
37544          * written last.
37545          */
37546         uint8_t valid;
37547 } __rte_packed;
37548
37549 /**********************************
37550  * hwrm_vnic_rss_cos_lb_ctx_alloc *
37551  **********************************/
37552
37553
37554 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
37555 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
37556         /* The HWRM command request type. */
37557         uint16_t        req_type;
37558         /*
37559          * The completion ring to send the completion event on. This should
37560          * be the NQ ID returned from the `nq_alloc` HWRM command.
37561          */
37562         uint16_t        cmpl_ring;
37563         /*
37564          * The sequence ID is used by the driver for tracking multiple
37565          * commands. This ID is treated as opaque data by the firmware and
37566          * the value is returned in the `hwrm_resp_hdr` upon completion.
37567          */
37568         uint16_t        seq_id;
37569         /*
37570          * The target ID of the command:
37571          * * 0x0-0xFFF8 - The function ID
37572          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37573          * * 0xFFFD - Reserved for user-space HWRM interface
37574          * * 0xFFFF - HWRM
37575          */
37576         uint16_t        target_id;
37577         /*
37578          * A physical address pointer pointing to a host buffer that the
37579          * command's response data will be written. This can be either a host
37580          * physical address (HPA) or a guest physical address (GPA) and must
37581          * point to a physically contiguous block of memory.
37582          */
37583         uint64_t        resp_addr;
37584 } __rte_packed;
37585
37586 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
37587 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
37588         /* The specific error status for the command. */
37589         uint16_t        error_code;
37590         /* The HWRM command request type. */
37591         uint16_t        req_type;
37592         /* The sequence ID from the original command. */
37593         uint16_t        seq_id;
37594         /* The length of the response data in number of bytes. */
37595         uint16_t        resp_len;
37596         /* rss_cos_lb_ctx_id is 16 b */
37597         uint16_t        rss_cos_lb_ctx_id;
37598         uint8_t unused_0[5];
37599         /*
37600          * This field is used in Output records to indicate that the output
37601          * is completely written to RAM.  This field should be read as '1'
37602          * to indicate that the output has been completely written.
37603          * When writing a command completion or response to an internal processor,
37604          * the order of writes has to be such that this field is written last.
37605          */
37606         uint8_t valid;
37607 } __rte_packed;
37608
37609 /*********************************
37610  * hwrm_vnic_rss_cos_lb_ctx_free *
37611  *********************************/
37612
37613
37614 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
37615 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
37616         /* The HWRM command request type. */
37617         uint16_t        req_type;
37618         /*
37619          * The completion ring to send the completion event on. This should
37620          * be the NQ ID returned from the `nq_alloc` HWRM command.
37621          */
37622         uint16_t        cmpl_ring;
37623         /*
37624          * The sequence ID is used by the driver for tracking multiple
37625          * commands. This ID is treated as opaque data by the firmware and
37626          * the value is returned in the `hwrm_resp_hdr` upon completion.
37627          */
37628         uint16_t        seq_id;
37629         /*
37630          * The target ID of the command:
37631          * * 0x0-0xFFF8 - The function ID
37632          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37633          * * 0xFFFD - Reserved for user-space HWRM interface
37634          * * 0xFFFF - HWRM
37635          */
37636         uint16_t        target_id;
37637         /*
37638          * A physical address pointer pointing to a host buffer that the
37639          * command's response data will be written. This can be either a host
37640          * physical address (HPA) or a guest physical address (GPA) and must
37641          * point to a physically contiguous block of memory.
37642          */
37643         uint64_t        resp_addr;
37644         /* rss_cos_lb_ctx_id is 16 b */
37645         uint16_t        rss_cos_lb_ctx_id;
37646         uint8_t unused_0[6];
37647 } __rte_packed;
37648
37649 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
37650 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
37651         /* The specific error status for the command. */
37652         uint16_t        error_code;
37653         /* The HWRM command request type. */
37654         uint16_t        req_type;
37655         /* The sequence ID from the original command. */
37656         uint16_t        seq_id;
37657         /* The length of the response data in number of bytes. */
37658         uint16_t        resp_len;
37659         uint8_t unused_0[7];
37660         /*
37661          * This field is used in Output records to indicate that the output
37662          * is completely written to RAM.  This field should be read as '1'
37663          * to indicate that the output has been completely written.
37664          * When writing a command completion or response to an internal processor,
37665          * the order of writes has to be such that this field is written last.
37666          */
37667         uint8_t valid;
37668 } __rte_packed;
37669
37670 /*******************
37671  * hwrm_ring_alloc *
37672  *******************/
37673
37674
37675 /* hwrm_ring_alloc_input (size:704b/88B) */
37676 struct hwrm_ring_alloc_input {
37677         /* The HWRM command request type. */
37678         uint16_t        req_type;
37679         /*
37680          * The completion ring to send the completion event on. This should
37681          * be the NQ ID returned from the `nq_alloc` HWRM command.
37682          */
37683         uint16_t        cmpl_ring;
37684         /*
37685          * The sequence ID is used by the driver for tracking multiple
37686          * commands. This ID is treated as opaque data by the firmware and
37687          * the value is returned in the `hwrm_resp_hdr` upon completion.
37688          */
37689         uint16_t        seq_id;
37690         /*
37691          * The target ID of the command:
37692          * * 0x0-0xFFF8 - The function ID
37693          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37694          * * 0xFFFD - Reserved for user-space HWRM interface
37695          * * 0xFFFF - HWRM
37696          */
37697         uint16_t        target_id;
37698         /*
37699          * A physical address pointer pointing to a host buffer that the
37700          * command's response data will be written. This can be either a host
37701          * physical address (HPA) or a guest physical address (GPA) and must
37702          * point to a physically contiguous block of memory.
37703          */
37704         uint64_t        resp_addr;
37705         uint32_t        enables;
37706         /*
37707          * This bit must be '1' for the ring_arb_cfg field to be
37708          * configured.
37709          */
37710         #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG \
37711                 UINT32_C(0x2)
37712         /*
37713          * This bit must be '1' for the stat_ctx_id_valid field to be
37714          * configured.
37715          */
37716         #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID \
37717                 UINT32_C(0x8)
37718         /*
37719          * This bit must be '1' for the max_bw_valid field to be
37720          * configured.
37721          */
37722         #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID \
37723                 UINT32_C(0x20)
37724         /*
37725          * This bit must be '1' for the rx_ring_id field to be
37726          * configured.
37727          */
37728         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID \
37729                 UINT32_C(0x40)
37730         /*
37731          * This bit must be '1' for the nq_ring_id field to be
37732          * configured.
37733          */
37734         #define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID \
37735                 UINT32_C(0x80)
37736         /*
37737          * This bit must be '1' for the rx_buf_size field to be
37738          * configured.
37739          */
37740         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID \
37741                 UINT32_C(0x100)
37742         /*
37743          * This bit must be '1' for the schq_id field to be
37744          * configured.
37745          */
37746         #define HWRM_RING_ALLOC_INPUT_ENABLES_SCHQ_ID \
37747                 UINT32_C(0x200)
37748         /*
37749          * This bit must be '1' for the mpc_chnls_type field to be
37750          * configured.
37751          */
37752         #define HWRM_RING_ALLOC_INPUT_ENABLES_MPC_CHNLS_TYPE \
37753                 UINT32_C(0x400)
37754         /* Ring Type. */
37755         uint8_t ring_type;
37756         /* L2 Completion Ring (CR) */
37757         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
37758         /* TX Ring (TR) */
37759         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX        UINT32_C(0x1)
37760         /* RX Ring (RR) */
37761         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX        UINT32_C(0x2)
37762         /* RoCE Notification Completion Ring (ROCE_CR) */
37763         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
37764         /* RX Aggregation Ring */
37765         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
37766         /* Notification Queue */
37767         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
37768         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST \
37769                 HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
37770         /*
37771          * This field controls the number of packets transmitted before a TX
37772          * completion is generated. Non-zero values for the field are only
37773          * valid if HWRM_FUNC_QCAPS indicates that the TX coalesced completion
37774          * records capability is supported.
37775          */
37776         uint8_t cmpl_coal_cnt;
37777         /* Generates a legacy TX completion on every packet. */
37778         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_OFF UINT32_C(0x0)
37779         /* Generates a TX coalesced completion for up to 4 TX packets. */
37780         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_4   UINT32_C(0x1)
37781         /* Generates a TX coalesced completion for up to 8 TX packets. */
37782         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_8   UINT32_C(0x2)
37783         /* Generates a TX coalesced completion for up to 12 TX packets. */
37784         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_12  UINT32_C(0x3)
37785         /* Generates a TX coalesced completion for up to 16 TX packets. */
37786         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_16  UINT32_C(0x4)
37787         /* Generates a TX coalesced completion for up to 24 TX packets. */
37788         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_24  UINT32_C(0x5)
37789         /* Generates a TX coalesced completion for up to 32 TX packets. */
37790         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_32  UINT32_C(0x6)
37791         /* Generates a TX coalesced completion for up to 48 TX packets. */
37792         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_48  UINT32_C(0x7)
37793         /* Generates a TX coalesced completion for up to 64 TX packets. */
37794         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_64  UINT32_C(0x8)
37795         /* Generates a TX coalesced completion for up to 96 TX packets. */
37796         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_96  UINT32_C(0x9)
37797         /* Generates a TX coalesced completion for up to 128 TX packets. */
37798         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_128 UINT32_C(0xa)
37799         /* Generates a TX coalesced completion for up to 192 TX packets. */
37800         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_192 UINT32_C(0xb)
37801         /* Generates a TX coalesced completion for up to 256 TX packets. */
37802         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_256 UINT32_C(0xc)
37803         /* Generates a TX coalesced completion for up to 320 TX packets. */
37804         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_320 UINT32_C(0xd)
37805         /* Generates a TX coalesced completion for up to 384 TX packets. */
37806         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_384 UINT32_C(0xe)
37807         /* Generates a TX coalesced completion up to the last packet. (Maximum coalescing). */
37808         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_MAX UINT32_C(0xf)
37809         #define HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_LAST \
37810                 HWRM_RING_ALLOC_INPUT_CMPL_COAL_CNT_COAL_MAX
37811         /* Ring allocation flags. */
37812         uint16_t        flags;
37813         /*
37814          * For Rx rings, the incoming packet data can be placed at either
37815          * a 0B or 2B offset from the start of the Rx packet buffer. When
37816          * '1', the received packet will be padded with 2B of zeros at the
37817          * front of the packet. Note that this flag is only used for
37818          * Rx rings and is ignored for all other rings included Rx
37819          * Aggregation rings.
37820          */
37821         #define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD \
37822                 UINT32_C(0x1)
37823         /*
37824          * When the HW Doorbell Drop Recovery feature is enabled,
37825          * HW can flag false CQ overflow when CQ consumer index
37826          * doorbells are dropped when there really wasn't any overflow.
37827          * The CQE values could have already been processed by the driver,
37828          * but HW doesn't know about this because of the doorbell drop.
37829          * To avoid false detection of CQ overflow events,
37830          * it is recommended that CQ overflow detection is disabled
37831          * by the driver when HW based doorbell recovery is enabled.
37832          */
37833         #define HWRM_RING_ALLOC_INPUT_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION \
37834                 UINT32_C(0x2)
37835         /*
37836          * This value is a pointer to the page table for the
37837          * Ring.
37838          */
37839         uint64_t        page_tbl_addr;
37840         /* First Byte Offset of the first entry in the first page. */
37841         uint32_t        fbo;
37842         /*
37843          * Actual page size in 2^page_size. The supported range is increments
37844          * in powers of 2 from 16 bytes to 1GB.
37845          * - 4 = 16 B
37846          *     Page size is 16 B.
37847          * - 12 = 4 KB
37848          *     Page size is 4 KB.
37849          * - 13 = 8 KB
37850          *     Page size is 8 KB.
37851          * - 16 = 64 KB
37852          *     Page size is 64 KB.
37853          * - 21 = 2 MB
37854          *     Page size is 2 MB.
37855          * - 22 = 4 MB
37856          *     Page size is 4 MB.
37857          * - 30 = 1 GB
37858          *     Page size is 1 GB.
37859          */
37860         uint8_t page_size;
37861         /*
37862          * This value indicates the depth of page table.
37863          * For this version of the specification, value other than 0 or
37864          * 1 shall be considered as an invalid value.
37865          * When the page_tbl_depth = 0, then it is treated as a
37866          * special case with the following.
37867          * 1. FBO and page size fields are not valid.
37868          * 2. page_tbl_addr is the physical address of the first
37869          *    element of the ring.
37870          */
37871         uint8_t page_tbl_depth;
37872         /* Used by a PF driver to associate a SCHQ with one of its TX rings. */
37873         uint16_t        schq_id;
37874         /*
37875          * Number of 16B units in the ring.  Minimum size for
37876          * a ring is 16 16B entries.
37877          */
37878         uint32_t        length;
37879         /*
37880          * Logical ring number for the ring to be allocated.
37881          * This value determines the position in the doorbell
37882          * area where the update to the ring will be made.
37883          *
37884          * For completion rings, this value is also the MSI-X
37885          * vector number for the function the completion ring is
37886          * associated with.
37887          */
37888         uint16_t        logical_id;
37889         /*
37890          * This field is used only when ring_type is a TX ring.
37891          * This value indicates what completion ring the TX ring
37892          * is associated with.
37893          */
37894         uint16_t        cmpl_ring_id;
37895         /*
37896          * This field is used only when ring_type is a TX ring.
37897          * This value indicates what CoS queue the TX ring
37898          * is associated with.
37899          */
37900         uint16_t        queue_id;
37901         /*
37902          * When allocating a Rx ring or Rx aggregation ring, this field
37903          * specifies the size of the buffer descriptors posted to the ring.
37904          */
37905         uint16_t        rx_buf_size;
37906         /*
37907          * When allocating an Rx aggregation ring, this field
37908          * specifies the associated Rx ring ID.
37909          */
37910         uint16_t        rx_ring_id;
37911         /*
37912          * When allocating a completion ring, this field
37913          * specifies the associated NQ ring ID.
37914          */
37915         uint16_t        nq_ring_id;
37916         /*
37917          * This field is used only when ring_type is a TX ring.
37918          * This field is used to configure arbitration related
37919          * parameters for a TX ring.
37920          */
37921         uint16_t        ring_arb_cfg;
37922         /* Arbitration policy used for the ring. */
37923         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK \
37924                 UINT32_C(0xf)
37925         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT       0
37926         /*
37927          * Use strict priority for the TX ring.
37928          * Priority value is specified in arb_policy_param
37929          */
37930         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
37931                 UINT32_C(0x1)
37932         /*
37933          * Use weighted fair queue arbitration for the TX ring.
37934          * Weight is specified in arb_policy_param
37935          */
37936         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
37937                 UINT32_C(0x2)
37938         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
37939                 HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
37940         /* Reserved field. */
37941         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK \
37942                 UINT32_C(0xf0)
37943         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT             4
37944         /*
37945          * Arbitration policy specific parameter.
37946          * # For strict priority arbitration policy, this field
37947          * represents a priority value. If set to 0, then the priority
37948          * is not specified and the HWRM is allowed to select
37949          * any priority for this TX ring.
37950          * # For weighted fair queue arbitration policy, this field
37951          * represents a weight value. If set to 0, then the weight
37952          * is not specified and the HWRM is allowed to select
37953          * any weight for this TX ring.
37954          */
37955         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
37956                 UINT32_C(0xff00)
37957         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
37958         uint16_t        unused_3;
37959         /*
37960          * This field is reserved for the future use.
37961          * It shall be set to 0.
37962          */
37963         uint32_t        reserved3;
37964         /*
37965          * This field is used only when ring_type is a TX ring.
37966          * This input indicates what statistics context this ring
37967          * should be associated with.
37968          */
37969         uint32_t        stat_ctx_id;
37970         /*
37971          * This field is reserved for the future use.
37972          * It shall be set to 0.
37973          */
37974         uint32_t        reserved4;
37975         /*
37976          * This field is used only when ring_type is a TX ring
37977          * to specify maximum BW allocated to the TX ring.
37978          * The HWRM will translate this value into byte counter and
37979          * time interval used for this ring inside the device.
37980          */
37981         uint32_t        max_bw;
37982         /* The bandwidth value. */
37983         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK \
37984                 UINT32_C(0xfffffff)
37985         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT              0
37986         /* The granularity of the value (bits or bytes). */
37987         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE \
37988                 UINT32_C(0x10000000)
37989         /* Value is in bits. */
37990         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS \
37991                 (UINT32_C(0x0) << 28)
37992         /* Value is in bytes. */
37993         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES \
37994                 (UINT32_C(0x1) << 28)
37995         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
37996                 HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
37997         /* bw_value_unit is 3 b */
37998         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
37999                 UINT32_C(0xe0000000)
38000         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
38001         /* Value is in Mb or MB (base 10). */
38002         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
38003                 (UINT32_C(0x0) << 29)
38004         /* Value is in Kb or KB (base 10). */
38005         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
38006                 (UINT32_C(0x2) << 29)
38007         /* Value is in bits or bytes. */
38008         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
38009                 (UINT32_C(0x4) << 29)
38010         /* Value is in Gb or GB (base 10). */
38011         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
38012                 (UINT32_C(0x6) << 29)
38013         /* Value is in 1/100th of a percentage of total bandwidth. */
38014         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
38015                 (UINT32_C(0x1) << 29)
38016         /* Invalid unit */
38017         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
38018                 (UINT32_C(0x7) << 29)
38019         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
38020                 HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
38021         /*
38022          * This field is used only when ring_type is a Completion ring.
38023          * This value indicates what interrupt mode should be used
38024          * on this completion ring.
38025          * Note: In the legacy interrupt mode, no more than 16
38026          * completion rings are allowed.
38027          */
38028         uint8_t int_mode;
38029         /* Legacy INTA */
38030         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
38031         /* Reserved */
38032         #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD   UINT32_C(0x1)
38033         /* MSI-X */
38034         #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX   UINT32_C(0x2)
38035         /* No Interrupt - Polled mode */
38036         #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL   UINT32_C(0x3)
38037         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST \
38038                 HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
38039         /* Midpath channel type */
38040         uint8_t mpc_chnls_type;
38041         /*
38042          * Indicate the TX ring alloc MPC channel type is a MPC channel
38043          * with destination to the TX crypto engine block.
38044          */
38045         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_TCE     UINT32_C(0x0)
38046         /*
38047          * Indicate the RX ring alloc MPC channel type is a MPC channel
38048          * with destination to the RX crypto engine block.
38049          */
38050         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_RCE     UINT32_C(0x1)
38051         /*
38052          * Indicate the RX ring alloc MPC channel type is a MPC channel
38053          * with destination to the TX configurable flow processing block.
38054          */
38055         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_TE_CFA  UINT32_C(0x2)
38056         /*
38057          * Indicate the RX ring alloc MPC channel type is a MPC channel
38058          * with destination to the RX configurable flow processing block.
38059          */
38060         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_RE_CFA  UINT32_C(0x3)
38061         /*
38062          * Indicate the RX ring alloc MPC channel type is a MPC channel
38063          * with destination to the primate processor block.
38064          */
38065         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_PRIMATE UINT32_C(0x4)
38066         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_LAST \
38067                 HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_PRIMATE
38068         uint8_t unused_4[2];
38069         /*
38070          * The cq_handle is specified when allocating a completion ring. For
38071          * devices that support NQs, this cq_handle will be included in the
38072          * NQE to specify which CQ should be read to retrieve the completion
38073          * record.
38074          */
38075         uint64_t        cq_handle;
38076 } __rte_packed;
38077
38078 /* hwrm_ring_alloc_output (size:128b/16B) */
38079 struct hwrm_ring_alloc_output {
38080         /* The specific error status for the command. */
38081         uint16_t        error_code;
38082         /* The HWRM command request type. */
38083         uint16_t        req_type;
38084         /* The sequence ID from the original command. */
38085         uint16_t        seq_id;
38086         /* The length of the response data in number of bytes. */
38087         uint16_t        resp_len;
38088         /*
38089          * Physical number of ring allocated.
38090          * This value shall be unique for a ring type.
38091          */
38092         uint16_t        ring_id;
38093         /* Logical number of ring allocated. */
38094         uint16_t        logical_ring_id;
38095         /*
38096          * This field will tell whether to use ping or pong buffer
38097          * for first push operation.
38098          */
38099         uint8_t push_buffer_index;
38100         /* Start push from ping buffer index */
38101         #define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PING_BUFFER \
38102                 UINT32_C(0x0)
38103         /* Start push from pong buffer index */
38104         #define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER \
38105                 UINT32_C(0x1)
38106         #define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_LAST \
38107                 HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER
38108         uint8_t unused_0[2];
38109         /*
38110          * This field is used in Output records to indicate that the output
38111          * is completely written to RAM.  This field should be read as '1'
38112          * to indicate that the output has been completely written.
38113          * When writing a command completion or response to an internal processor,
38114          * the order of writes has to be such that this field is written last.
38115          */
38116         uint8_t valid;
38117 } __rte_packed;
38118
38119 /******************
38120  * hwrm_ring_free *
38121  ******************/
38122
38123
38124 /* hwrm_ring_free_input (size:256b/32B) */
38125 struct hwrm_ring_free_input {
38126         /* The HWRM command request type. */
38127         uint16_t        req_type;
38128         /*
38129          * The completion ring to send the completion event on. This should
38130          * be the NQ ID returned from the `nq_alloc` HWRM command.
38131          */
38132         uint16_t        cmpl_ring;
38133         /*
38134          * The sequence ID is used by the driver for tracking multiple
38135          * commands. This ID is treated as opaque data by the firmware and
38136          * the value is returned in the `hwrm_resp_hdr` upon completion.
38137          */
38138         uint16_t        seq_id;
38139         /*
38140          * The target ID of the command:
38141          * * 0x0-0xFFF8 - The function ID
38142          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38143          * * 0xFFFD - Reserved for user-space HWRM interface
38144          * * 0xFFFF - HWRM
38145          */
38146         uint16_t        target_id;
38147         /*
38148          * A physical address pointer pointing to a host buffer that the
38149          * command's response data will be written. This can be either a host
38150          * physical address (HPA) or a guest physical address (GPA) and must
38151          * point to a physically contiguous block of memory.
38152          */
38153         uint64_t        resp_addr;
38154         /* Ring Type. */
38155         uint8_t ring_type;
38156         /* L2 Completion Ring (CR) */
38157         #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
38158         /* TX Ring (TR) */
38159         #define HWRM_RING_FREE_INPUT_RING_TYPE_TX        UINT32_C(0x1)
38160         /* RX Ring (RR) */
38161         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX        UINT32_C(0x2)
38162         /* RoCE Notification Completion Ring (ROCE_CR) */
38163         #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
38164         /* RX Aggregation Ring */
38165         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
38166         /* Notification Queue */
38167         #define HWRM_RING_FREE_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
38168         #define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \
38169                 HWRM_RING_FREE_INPUT_RING_TYPE_NQ
38170         uint8_t flags;
38171         /*
38172          * If this bit is set to '1', ring_id in this command belongs to
38173          * virtio function. prod_idx in this command corresponds to doorbell
38174          * producer index. opaque field in this command needs to be inserted
38175          * by firmware in VEE_FLUSH completion record.
38176          * Firmware will poll the corresponding ring context to reach the
38177          * given producer index before sending successful response. It will
38178          * finish the completion using VEE_FLUSH completion record.
38179          *
38180          * If this bit is '0', firmware will not treat ring_id as virtio
38181          * ring and ignore prod_idx, opaque fields.
38182          *
38183          * This feature is not applicable for L2 or RoCE.
38184          */
38185         #define HWRM_RING_FREE_INPUT_FLAGS_VIRTIO_RING_VALID UINT32_C(0x1)
38186         #define HWRM_RING_FREE_INPUT_FLAGS_LAST \
38187                 HWRM_RING_FREE_INPUT_FLAGS_VIRTIO_RING_VALID
38188         /* Physical number of ring allocated. */
38189         uint16_t        ring_id;
38190         /*
38191          * Ring BD producer index posted by the virtio block.
38192          * This field is valid if virtio_ring_valid flag is set.
38193          */
38194         uint32_t        prod_idx;
38195         /*
38196          * User defined opaque field to be inserted into VEE_FLUSH completion
38197          * record. This field is valid if virtio_ring_valid flag is set.
38198          */
38199         uint32_t        opaque;
38200         uint32_t        unused_1;
38201 } __rte_packed;
38202
38203 /* hwrm_ring_free_output (size:128b/16B) */
38204 struct hwrm_ring_free_output {
38205         /* The specific error status for the command. */
38206         uint16_t        error_code;
38207         /* The HWRM command request type. */
38208         uint16_t        req_type;
38209         /* The sequence ID from the original command. */
38210         uint16_t        seq_id;
38211         /* The length of the response data in number of bytes. */
38212         uint16_t        resp_len;
38213         uint8_t unused_0[7];
38214         /*
38215          * This field is used in Output records to indicate that the output
38216          * is completely written to RAM.  This field should be read as '1'
38217          * to indicate that the output has been completely written.
38218          * When writing a command completion or response to an internal processor,
38219          * the order of writes has to be such that this field is written last.
38220          */
38221         uint8_t valid;
38222 } __rte_packed;
38223
38224 /*******************
38225  * hwrm_ring_reset *
38226  *******************/
38227
38228
38229 /* hwrm_ring_reset_input (size:192b/24B) */
38230 struct hwrm_ring_reset_input {
38231         /* The HWRM command request type. */
38232         uint16_t        req_type;
38233         /*
38234          * The completion ring to send the completion event on. This should
38235          * be the NQ ID returned from the `nq_alloc` HWRM command.
38236          */
38237         uint16_t        cmpl_ring;
38238         /*
38239          * The sequence ID is used by the driver for tracking multiple
38240          * commands. This ID is treated as opaque data by the firmware and
38241          * the value is returned in the `hwrm_resp_hdr` upon completion.
38242          */
38243         uint16_t        seq_id;
38244         /*
38245          * The target ID of the command:
38246          * * 0x0-0xFFF8 - The function ID
38247          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38248          * * 0xFFFD - Reserved for user-space HWRM interface
38249          * * 0xFFFF - HWRM
38250          */
38251         uint16_t        target_id;
38252         /*
38253          * A physical address pointer pointing to a host buffer that the
38254          * command's response data will be written. This can be either a host
38255          * physical address (HPA) or a guest physical address (GPA) and must
38256          * point to a physically contiguous block of memory.
38257          */
38258         uint64_t        resp_addr;
38259         /* Ring Type. */
38260         uint8_t ring_type;
38261         /* L2 Completion Ring (CR) */
38262         #define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL     UINT32_C(0x0)
38263         /* TX Ring (TR) */
38264         #define HWRM_RING_RESET_INPUT_RING_TYPE_TX          UINT32_C(0x1)
38265         /* RX Ring (RR) */
38266         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX          UINT32_C(0x2)
38267         /* RoCE Notification Completion Ring (ROCE_CR) */
38268         #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL   UINT32_C(0x3)
38269         /*
38270          * Rx Ring Group.  This is to reset rx and aggregation in an atomic
38271          * operation. Completion ring associated with this ring group is
38272          * not reset.
38273          */
38274         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP UINT32_C(0x6)
38275         #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \
38276                 HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP
38277         uint8_t unused_0;
38278         /*
38279          * Physical number of the ring. When ring type is rx_ring_grp, ring id
38280          * actually refers to ring group id.
38281          */
38282         uint16_t        ring_id;
38283         uint8_t unused_1[4];
38284 } __rte_packed;
38285
38286 /* hwrm_ring_reset_output (size:128b/16B) */
38287 struct hwrm_ring_reset_output {
38288         /* The specific error status for the command. */
38289         uint16_t        error_code;
38290         /* The HWRM command request type. */
38291         uint16_t        req_type;
38292         /* The sequence ID from the original command. */
38293         uint16_t        seq_id;
38294         /* The length of the response data in number of bytes. */
38295         uint16_t        resp_len;
38296         /*
38297          * This field will tell whether to use ping or pong buffer
38298          * for first push operation.
38299          */
38300         uint8_t push_buffer_index;
38301         /* Start push from ping buffer index */
38302         #define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PING_BUFFER \
38303                 UINT32_C(0x0)
38304         /* Start push from pong buffer index */
38305         #define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER \
38306                 UINT32_C(0x1)
38307         #define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_LAST \
38308                 HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER
38309         uint8_t unused_0[3];
38310         /* Position of consumer index after ring reset completes. */
38311         uint8_t consumer_idx[3];
38312         /*
38313          * This field is used in Output records to indicate that the output
38314          * is completely written to RAM.  This field should be read as '1'
38315          * to indicate that the output has been completely written.
38316          * When writing a command completion or response to an internal processor,
38317          * the order of writes has to be such that this field is written last.
38318          */
38319         uint8_t valid;
38320 } __rte_packed;
38321
38322 /*****************
38323  * hwrm_ring_cfg *
38324  *****************/
38325
38326
38327 /* hwrm_ring_cfg_input (size:320b/40B) */
38328 struct hwrm_ring_cfg_input {
38329         /* The HWRM command request type. */
38330         uint16_t        req_type;
38331         /*
38332          * The completion ring to send the completion event on. This should
38333          * be the NQ ID returned from the `nq_alloc` HWRM command.
38334          */
38335         uint16_t        cmpl_ring;
38336         /*
38337          * The sequence ID is used by the driver for tracking multiple
38338          * commands. This ID is treated as opaque data by the firmware and
38339          * the value is returned in the `hwrm_resp_hdr` upon completion.
38340          */
38341         uint16_t        seq_id;
38342         /*
38343          * The target ID of the command:
38344          * * 0x0-0xFFF8 - The function ID
38345          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38346          * * 0xFFFD - Reserved for user-space HWRM interface
38347          * * 0xFFFF - HWRM
38348          */
38349         uint16_t        target_id;
38350         /*
38351          * A physical address pointer pointing to a host buffer that the
38352          * command's response data will be written. This can be either a host
38353          * physical address (HPA) or a guest physical address (GPA) and must
38354          * point to a physically contiguous block of memory.
38355          */
38356         uint64_t        resp_addr;
38357         /* Ring Type. */
38358         uint8_t ring_type;
38359         /* TX Ring (TR) */
38360         #define HWRM_RING_CFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
38361         /* RX Ring (RR) */
38362         #define HWRM_RING_CFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
38363         #define HWRM_RING_CFG_INPUT_RING_TYPE_LAST \
38364                 HWRM_RING_CFG_INPUT_RING_TYPE_RX
38365         uint8_t unused_0;
38366         /* Physical number of the ring. */
38367         uint16_t        ring_id;
38368         /* Ring config enable bits. */
38369         uint16_t        enables;
38370         /*
38371          * For Rx rings, the incoming packet data can be placed at either
38372          * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
38373          * buffer.
38374          * When '1', the received packet will be padded with 2B, 10B or 12B
38375          * of zeros at the front of the packet. The exact offset is specified
38376          * by rx_sop_pad_bytes parameter.
38377          * When '0', the received packet will not be padded.
38378          * Note that this flag is only used for Rx rings and is ignored
38379          * for all other rings included Rx Aggregation rings.
38380          */
38381         #define HWRM_RING_CFG_INPUT_ENABLES_RX_SOP_PAD_ENABLE \
38382                 UINT32_C(0x1)
38383         /*
38384          * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
38385          * When rings are allocated, the PCI function on which driver issues
38386          * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
38387          * the buffer descriptors (BDs) from those rings is assumed to issue
38388          * packet payload DMA using same PCI function. When proxy mode is
38389          * enabled, hardware can perform payload DMA using another PCI
38390          * function on same or different host.
38391          * When set to '0', the PCI function on which driver issues
38392          * HWRM_RING_CFG command is used for host payload DMA operation.
38393          * When set to '1', the host PCI function specified by proxy_fid is
38394          * used for host payload DMA operation.
38395          */
38396         #define HWRM_RING_CFG_INPUT_ENABLES_PROXY_MODE_ENABLE \
38397                 UINT32_C(0x2)
38398         /*
38399          * Tx ring packet source interface override, for Tx rings only.
38400          * When TX rings are allocated, the PCI function on which driver
38401          * issues HWRM_RING_CFG is assumed to be source interface of
38402          * packets sent from TX ring.
38403          * When set to '1', the host PCI function specified by proxy_fid
38404          * is used as source interface of the transmitted packets.
38405          */
38406         #define HWRM_RING_CFG_INPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE \
38407                 UINT32_C(0x4)
38408         /* The schq_id field is valid */
38409         #define HWRM_RING_CFG_INPUT_ENABLES_SCHQ_ID \
38410                 UINT32_C(0x8)
38411         /* Update completion ring ID associated with Tx or Rx ring. */
38412         #define HWRM_RING_CFG_INPUT_ENABLES_CMPL_RING_ID_UPDATE \
38413                 UINT32_C(0x10)
38414         /*
38415          * When set to '1', metadata value provided by tx_metadata
38416          * field in this command is inserted in the lb_header_metadata
38417          * QP context field. When set to '0', no change done to metadata.
38418          * Firmware rejects the tx ring metadata programming with
38419          * HWRM_ERR_CODE_UNSUPPORTED error if the per function CFA BD
38420          * metadata feature is not disabled.
38421          */
38422         #define HWRM_RING_CFG_INPUT_ENABLES_TX_METADATA \
38423                 UINT32_C(0x20)
38424         /*
38425          * Proxy function FID value.
38426          * This value is only used when either proxy_mode_enable flag or
38427          * tx_proxy_svif_override is set to '1'.
38428          * When proxy_mode_enable is set to '1', it identifies a host PCI
38429          * function used for host payload DMA operations.
38430          * When tx_proxy_src_intf is set to '1', it identifies a host PCI
38431          * function as source interface for all transmitted packets from
38432          * the TX ring.
38433          */
38434         uint16_t        proxy_fid;
38435         /*
38436          * Identifies the new scheduler queue (SCHQ) to associate with the
38437          * ring. Only valid for Tx rings.
38438          * A value of zero indicates that the Tx ring should be associated
38439          * with the default scheduler queue (SCHQ).
38440          */
38441         uint16_t        schq_id;
38442         /*
38443          * This field is valid for TX or Rx rings. This value identifies the
38444          * new completion ring ID to associate with the TX or Rx ring.
38445          */
38446         uint16_t        cmpl_ring_id;
38447         /*
38448          * Rx SOP padding amount in bytes.
38449          * This value is only used when rx_sop_pad_enable flag is set to '1'.
38450          */
38451         uint8_t rx_sop_pad_bytes;
38452         uint8_t unused_1[3];
38453         /*
38454          * When tx_metadata enable bit is set, value specified in this field
38455          * is copied to lb_header_metadata in the QP context.
38456          */
38457         uint32_t        tx_metadata;
38458         uint8_t unused_2[4];
38459 } __rte_packed;
38460
38461 /* hwrm_ring_cfg_output (size:128b/16B) */
38462 struct hwrm_ring_cfg_output {
38463         /* The specific error status for the command. */
38464         uint16_t        error_code;
38465         /* The HWRM command request type. */
38466         uint16_t        req_type;
38467         /* The sequence ID from the original command. */
38468         uint16_t        seq_id;
38469         /* The length of the response data in number of bytes. */
38470         uint16_t        resp_len;
38471         uint8_t unused_0[7];
38472         /*
38473          * This field is used in Output records to indicate that the output
38474          * is completely written to RAM.  This field should be read as '1'
38475          * to indicate that the output has been completely written.
38476          * When writing a command completion or response to an internal
38477          * processor, the order of writes has to be such that this field is
38478          * written last.
38479          */
38480         uint8_t valid;
38481 } __rte_packed;
38482
38483 /******************
38484  * hwrm_ring_qcfg *
38485  ******************/
38486
38487
38488 /* hwrm_ring_qcfg_input (size:192b/24B) */
38489 struct hwrm_ring_qcfg_input {
38490         /* The HWRM command request type. */
38491         uint16_t        req_type;
38492         /*
38493          * The completion ring to send the completion event on. This should
38494          * be the NQ ID returned from the `nq_alloc` HWRM command.
38495          */
38496         uint16_t        cmpl_ring;
38497         /*
38498          * The sequence ID is used by the driver for tracking multiple
38499          * commands. This ID is treated as opaque data by the firmware and
38500          * the value is returned in the `hwrm_resp_hdr` upon completion.
38501          */
38502         uint16_t        seq_id;
38503         /*
38504          * The target ID of the command:
38505          * * 0x0-0xFFF8 - The function ID
38506          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38507          * * 0xFFFD - Reserved for user-space HWRM interface
38508          * * 0xFFFF - HWRM
38509          */
38510         uint16_t        target_id;
38511         /*
38512          * A physical address pointer pointing to a host buffer that the
38513          * command's response data will be written. This can be either a host
38514          * physical address (HPA) or a guest physical address (GPA) and must
38515          * point to a physically contiguous block of memory.
38516          */
38517         uint64_t        resp_addr;
38518         /* Ring Type. */
38519         uint8_t ring_type;
38520         /* TX Ring (TR) */
38521         #define HWRM_RING_QCFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
38522         /* RX Ring (RR) */
38523         #define HWRM_RING_QCFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
38524         #define HWRM_RING_QCFG_INPUT_RING_TYPE_LAST \
38525                 HWRM_RING_QCFG_INPUT_RING_TYPE_RX
38526         uint8_t unused_0[5];
38527         /* Physical number of the ring. */
38528         uint16_t        ring_id;
38529 } __rte_packed;
38530
38531 /* hwrm_ring_qcfg_output (size:256b/32B) */
38532 struct hwrm_ring_qcfg_output {
38533         /* The specific error status for the command. */
38534         uint16_t        error_code;
38535         /* The HWRM command request type. */
38536         uint16_t        req_type;
38537         /* The sequence ID from the original command. */
38538         uint16_t        seq_id;
38539         /* The length of the response data in number of bytes. */
38540         uint16_t        resp_len;
38541         /* Ring config enable bits. */
38542         uint16_t        enables;
38543         /*
38544          * For Rx rings, the incoming packet data can be placed at either
38545          * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
38546          * buffer.
38547          * When '1', the received packet will be padded with 2B, 10B or 12B
38548          * of zeros at the front of the packet. The exact offset is specified
38549          * by rx_sop_pad_bytes parameter.
38550          * When '0', the received packet will not be padded.
38551          * Note that this flag is only used for Rx rings and is ignored
38552          * for all other rings included Rx Aggregation rings.
38553          */
38554         #define HWRM_RING_QCFG_OUTPUT_ENABLES_RX_SOP_PAD_ENABLE \
38555                 UINT32_C(0x1)
38556         /*
38557          * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
38558          * When rings are allocated, the PCI function on which driver issues
38559          * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
38560          * the buffer descriptors (BDs) from those rings is assumed to issue
38561          * packet payload DMA using same PCI function. When proxy mode is
38562          * enabled, hardware can perform payload DMA using another PCI
38563          * function on same or different host.
38564          * When set to '0', the PCI function on which driver issues
38565          * HWRM_RING_CFG command is used for host payload DMA operation.
38566          * When set to '1', the host PCI function specified by proxy_fid is
38567          * used for host payload DMA operation.
38568          */
38569         #define HWRM_RING_QCFG_OUTPUT_ENABLES_PROXY_MODE_ENABLE \
38570                 UINT32_C(0x2)
38571         /*
38572          * Tx ring packet source interface override, for Tx rings only.
38573          * When TX rings are allocated, the PCI function on which driver
38574          * issues HWRM_RING_CFG is assumed to be source interface of
38575          * packets sent from TX ring.
38576          * When set to '1', the host PCI function specified by proxy_fid is
38577          * used as source interface of the transmitted packets.
38578          */
38579         #define HWRM_RING_QCFG_OUTPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE \
38580                 UINT32_C(0x4)
38581         /*
38582          * Proxy function FID value.
38583          * This value is only used when either proxy_mode_enable flag or
38584          * tx_proxy_svif_override is set to '1'.
38585          * When proxy_mode_enable is set to '1', it identifies a host PCI
38586          * function used for host payload DMA operations.
38587          * When tx_proxy_src_intf is set to '1', it identifies a host PCI
38588          * function as source interface for all transmitted packets from the TX
38589          * ring.
38590          */
38591         uint16_t        proxy_fid;
38592         /*
38593          * Identifies the new scheduler queue (SCHQ) to associate with the
38594          * ring. Only valid for Tx rings.
38595          * A value of zero indicates that the Tx ring should be associated with
38596          * the default scheduler queue (SCHQ).
38597          */
38598         uint16_t        schq_id;
38599         /*
38600          * This field is used when ring_type is a TX or Rx ring.
38601          * This value indicates what completion ring the TX or Rx ring
38602          * is associated with.
38603          */
38604         uint16_t        cmpl_ring_id;
38605         /*
38606          * Rx SOP padding amount in bytes.
38607          * This value is only used when rx_sop_pad_enable flag is set to '1'.
38608          */
38609         uint8_t rx_sop_pad_bytes;
38610         uint8_t unused_0[3];
38611         /* lb_header_metadata in the QP context is copied to this field. */
38612         uint32_t        tx_metadata;
38613         uint8_t unused_1[7];
38614         /*
38615          * This field is used in Output records to indicate that the output
38616          * is completely written to RAM.  This field should be read as '1'
38617          * to indicate that the output has been completely written.
38618          * When writing a command completion or response to an internal
38619          * processor, the order of writes has to be such that this field is
38620          * written last.
38621          */
38622         uint8_t valid;
38623 } __rte_packed;
38624
38625 /**************************
38626  * hwrm_ring_aggint_qcaps *
38627  **************************/
38628
38629
38630 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */
38631 struct hwrm_ring_aggint_qcaps_input {
38632         /* The HWRM command request type. */
38633         uint16_t        req_type;
38634         /*
38635          * The completion ring to send the completion event on. This should
38636          * be the NQ ID returned from the `nq_alloc` HWRM command.
38637          */
38638         uint16_t        cmpl_ring;
38639         /*
38640          * The sequence ID is used by the driver for tracking multiple
38641          * commands. This ID is treated as opaque data by the firmware and
38642          * the value is returned in the `hwrm_resp_hdr` upon completion.
38643          */
38644         uint16_t        seq_id;
38645         /*
38646          * The target ID of the command:
38647          * * 0x0-0xFFF8 - The function ID
38648          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38649          * * 0xFFFD - Reserved for user-space HWRM interface
38650          * * 0xFFFF - HWRM
38651          */
38652         uint16_t        target_id;
38653         /*
38654          * A physical address pointer pointing to a host buffer that the
38655          * command's response data will be written. This can be either a host
38656          * physical address (HPA) or a guest physical address (GPA) and must
38657          * point to a physically contiguous block of memory.
38658          */
38659         uint64_t        resp_addr;
38660 } __rte_packed;
38661
38662 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
38663 struct hwrm_ring_aggint_qcaps_output {
38664         /* The specific error status for the command. */
38665         uint16_t        error_code;
38666         /* The HWRM command request type. */
38667         uint16_t        req_type;
38668         /* The sequence ID from the original command. */
38669         uint16_t        seq_id;
38670         /* The length of the response data in number of bytes. */
38671         uint16_t        resp_len;
38672         uint32_t        cmpl_params;
38673         /*
38674          * When this bit is set to '1', int_lat_tmr_min can be configured
38675          * on completion rings.
38676          */
38677         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN \
38678                 UINT32_C(0x1)
38679         /*
38680          * When this bit is set to '1', int_lat_tmr_max can be configured
38681          * on completion rings.
38682          */
38683         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX \
38684                 UINT32_C(0x2)
38685         /*
38686          * When this bit is set to '1', timer_reset can be enabled
38687          * on completion rings.
38688          */
38689         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET \
38690                 UINT32_C(0x4)
38691         /*
38692          * When this bit is set to '1', ring_idle can be enabled
38693          * on completion rings.
38694          */
38695         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE \
38696                 UINT32_C(0x8)
38697         /*
38698          * When this bit is set to '1', num_cmpl_dma_aggr can be configured
38699          * on completion rings.
38700          */
38701         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR \
38702                 UINT32_C(0x10)
38703         /*
38704          * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be configured
38705          * on completion rings.
38706          */
38707         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT \
38708                 UINT32_C(0x20)
38709         /*
38710          * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured
38711          * on completion rings.
38712          */
38713         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR \
38714                 UINT32_C(0x40)
38715         /*
38716          * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be configured
38717          * on completion rings.
38718          */
38719         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT \
38720                 UINT32_C(0x80)
38721         /*
38722          * When this bit is set to '1', num_cmpl_aggr_int can be configured
38723          * on completion rings.
38724          */
38725         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT \
38726                 UINT32_C(0x100)
38727         uint32_t        nq_params;
38728         /*
38729          * When this bit is set to '1', int_lat_tmr_min can be configured
38730          * on notification queues.
38731          */
38732         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN \
38733                 UINT32_C(0x1)
38734         /* Minimum value for num_cmpl_dma_aggr */
38735         uint16_t        num_cmpl_dma_aggr_min;
38736         /* Maximum value for num_cmpl_dma_aggr */
38737         uint16_t        num_cmpl_dma_aggr_max;
38738         /* Minimum value for num_cmpl_dma_aggr_during_int */
38739         uint16_t        num_cmpl_dma_aggr_during_int_min;
38740         /* Maximum value for num_cmpl_dma_aggr_during_int */
38741         uint16_t        num_cmpl_dma_aggr_during_int_max;
38742         /* Minimum value for cmpl_aggr_dma_tmr */
38743         uint16_t        cmpl_aggr_dma_tmr_min;
38744         /* Maximum value for cmpl_aggr_dma_tmr */
38745         uint16_t        cmpl_aggr_dma_tmr_max;
38746         /* Minimum value for cmpl_aggr_dma_tmr_during_int */
38747         uint16_t        cmpl_aggr_dma_tmr_during_int_min;
38748         /* Maximum value for cmpl_aggr_dma_tmr_during_int */
38749         uint16_t        cmpl_aggr_dma_tmr_during_int_max;
38750         /* Minimum value for int_lat_tmr_min */
38751         uint16_t        int_lat_tmr_min_min;
38752         /* Maximum value for int_lat_tmr_min */
38753         uint16_t        int_lat_tmr_min_max;
38754         /* Minimum value for int_lat_tmr_max */
38755         uint16_t        int_lat_tmr_max_min;
38756         /* Maximum value for int_lat_tmr_max */
38757         uint16_t        int_lat_tmr_max_max;
38758         /* Minimum value for num_cmpl_aggr_int */
38759         uint16_t        num_cmpl_aggr_int_min;
38760         /* Maximum value for num_cmpl_aggr_int */
38761         uint16_t        num_cmpl_aggr_int_max;
38762         /* The units for timer parameters, in nanoseconds. */
38763         uint16_t        timer_units;
38764         uint8_t unused_0[1];
38765         /*
38766          * This field is used in Output records to indicate that the output
38767          * is completely written to RAM.  This field should be read as '1'
38768          * to indicate that the output has been completely written.
38769          * When writing a command completion or response to an internal processor,
38770          * the order of writes has to be such that this field is written last.
38771          */
38772         uint8_t valid;
38773 } __rte_packed;
38774
38775 /**************************************
38776  * hwrm_ring_cmpl_ring_qaggint_params *
38777  **************************************/
38778
38779
38780 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
38781 struct hwrm_ring_cmpl_ring_qaggint_params_input {
38782         /* The HWRM command request type. */
38783         uint16_t        req_type;
38784         /*
38785          * The completion ring to send the completion event on. This should
38786          * be the NQ ID returned from the `nq_alloc` HWRM command.
38787          */
38788         uint16_t        cmpl_ring;
38789         /*
38790          * The sequence ID is used by the driver for tracking multiple
38791          * commands. This ID is treated as opaque data by the firmware and
38792          * the value is returned in the `hwrm_resp_hdr` upon completion.
38793          */
38794         uint16_t        seq_id;
38795         /*
38796          * The target ID of the command:
38797          * * 0x0-0xFFF8 - The function ID
38798          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38799          * * 0xFFFD - Reserved for user-space HWRM interface
38800          * * 0xFFFF - HWRM
38801          */
38802         uint16_t        target_id;
38803         /*
38804          * A physical address pointer pointing to a host buffer that the
38805          * command's response data will be written. This can be either a host
38806          * physical address (HPA) or a guest physical address (GPA) and must
38807          * point to a physically contiguous block of memory.
38808          */
38809         uint64_t        resp_addr;
38810         /* Physical number of completion ring. */
38811         uint16_t        ring_id;
38812         uint16_t        flags;
38813         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_MASK \
38814                 UINT32_C(0x3)
38815         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_SFT 0
38816         /*
38817          * Set this flag to 1 when querying parameters on a notification
38818          * queue. Set this flag to 0 when querying parameters on a
38819          * completion queue or completion ring.
38820          */
38821         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
38822                 UINT32_C(0x4)
38823         uint8_t unused_0[4];
38824 } __rte_packed;
38825
38826 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
38827 struct hwrm_ring_cmpl_ring_qaggint_params_output {
38828         /* The specific error status for the command. */
38829         uint16_t        error_code;
38830         /* The HWRM command request type. */
38831         uint16_t        req_type;
38832         /* The sequence ID from the original command. */
38833         uint16_t        seq_id;
38834         /* The length of the response data in number of bytes. */
38835         uint16_t        resp_len;
38836         uint16_t        flags;
38837         /*
38838          * When this bit is set to '1', interrupt max
38839          * timer is reset whenever a completion is received.
38840          */
38841         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET \
38842                 UINT32_C(0x1)
38843         /*
38844          * When this bit is set to '1', ring idle mode
38845          * aggregation will be enabled.
38846          */
38847         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE \
38848                 UINT32_C(0x2)
38849         /*
38850          * Number of completions to aggregate before DMA
38851          * during the normal mode.
38852          */
38853         uint16_t        num_cmpl_dma_aggr;
38854         /*
38855          * Number of completions to aggregate before DMA
38856          * during the interrupt mode.
38857          */
38858         uint16_t        num_cmpl_dma_aggr_during_int;
38859         /*
38860          * Timer used to aggregate completions before
38861          * DMA during the normal mode (not in interrupt mode).
38862          */
38863         uint16_t        cmpl_aggr_dma_tmr;
38864         /*
38865          * Timer used to aggregate completions before
38866          * DMA when in interrupt mode.
38867          */
38868         uint16_t        cmpl_aggr_dma_tmr_during_int;
38869         /* Minimum time between two interrupts. */
38870         uint16_t        int_lat_tmr_min;
38871         /*
38872          * Maximum wait time spent aggregating
38873          * completions before signaling the interrupt after the
38874          * interrupt is enabled.
38875          */
38876         uint16_t        int_lat_tmr_max;
38877         /*
38878          * Minimum number of completions aggregated before signaling
38879          * an interrupt.
38880          */
38881         uint16_t        num_cmpl_aggr_int;
38882         uint8_t unused_0[7];
38883         /*
38884          * This field is used in Output records to indicate that the output
38885          * is completely written to RAM.  This field should be read as '1'
38886          * to indicate that the output has been completely written.
38887          * When writing a command completion or response to an internal processor,
38888          * the order of writes has to be such that this field is written last.
38889          */
38890         uint8_t valid;
38891 } __rte_packed;
38892
38893 /*****************************************
38894  * hwrm_ring_cmpl_ring_cfg_aggint_params *
38895  *****************************************/
38896
38897
38898 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
38899 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
38900         /* The HWRM command request type. */
38901         uint16_t        req_type;
38902         /*
38903          * The completion ring to send the completion event on. This should
38904          * be the NQ ID returned from the `nq_alloc` HWRM command.
38905          */
38906         uint16_t        cmpl_ring;
38907         /*
38908          * The sequence ID is used by the driver for tracking multiple
38909          * commands. This ID is treated as opaque data by the firmware and
38910          * the value is returned in the `hwrm_resp_hdr` upon completion.
38911          */
38912         uint16_t        seq_id;
38913         /*
38914          * The target ID of the command:
38915          * * 0x0-0xFFF8 - The function ID
38916          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38917          * * 0xFFFD - Reserved for user-space HWRM interface
38918          * * 0xFFFF - HWRM
38919          */
38920         uint16_t        target_id;
38921         /*
38922          * A physical address pointer pointing to a host buffer that the
38923          * command's response data will be written. This can be either a host
38924          * physical address (HPA) or a guest physical address (GPA) and must
38925          * point to a physically contiguous block of memory.
38926          */
38927         uint64_t        resp_addr;
38928         /* Physical number of completion ring. */
38929         uint16_t        ring_id;
38930         uint16_t        flags;
38931         /*
38932          * When this bit is set to '1', interrupt latency max
38933          * timer is reset whenever a completion is received.
38934          */
38935         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET \
38936                 UINT32_C(0x1)
38937         /*
38938          * When this bit is set to '1', ring idle mode
38939          * aggregation will be enabled.
38940          */
38941         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE \
38942                 UINT32_C(0x2)
38943         /*
38944          * Set this flag to 1 when configuring parameters on a
38945          * notification queue. Set this flag to 0 when configuring
38946          * parameters on a completion queue or completion ring.
38947          */
38948         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
38949                 UINT32_C(0x4)
38950         /*
38951          * Number of completions to aggregate before DMA
38952          * during the normal mode.
38953          */
38954         uint16_t        num_cmpl_dma_aggr;
38955         /*
38956          * Number of completions to aggregate before DMA
38957          * during the interrupt mode.
38958          */
38959         uint16_t        num_cmpl_dma_aggr_during_int;
38960         /*
38961          * Timer used to aggregate completions before
38962          * DMA during the normal mode (not in interrupt mode).
38963          */
38964         uint16_t        cmpl_aggr_dma_tmr;
38965         /*
38966          * Timer used to aggregate completions before
38967          * DMA while in interrupt mode.
38968          */
38969         uint16_t        cmpl_aggr_dma_tmr_during_int;
38970         /* Minimum time between two interrupts. */
38971         uint16_t        int_lat_tmr_min;
38972         /*
38973          * Maximum wait time spent aggregating
38974          * completions before signaling the interrupt after the
38975          * interrupt is enabled.
38976          */
38977         uint16_t        int_lat_tmr_max;
38978         /*
38979          * Minimum number of completions aggregated before signaling
38980          * an interrupt.
38981          */
38982         uint16_t        num_cmpl_aggr_int;
38983         /*
38984          * Bitfield that indicates which parameters are to be applied. Only
38985          * required when configuring devices with notification queues, and
38986          * used in that case to set certain parameters on completion queues
38987          * and others on notification queues.
38988          */
38989         uint16_t        enables;
38990         /*
38991          * This bit must be '1' for the num_cmpl_dma_aggr field to be
38992          * configured.
38993          */
38994         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR \
38995                 UINT32_C(0x1)
38996         /*
38997          * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be
38998          * configured.
38999          */
39000         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT \
39001                 UINT32_C(0x2)
39002         /*
39003          * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
39004          * configured.
39005          */
39006         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR \
39007                 UINT32_C(0x4)
39008         /*
39009          * This bit must be '1' for the int_lat_tmr_min field to be
39010          * configured.
39011          */
39012         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN \
39013                 UINT32_C(0x8)
39014         /*
39015          * This bit must be '1' for the int_lat_tmr_max field to be
39016          * configured.
39017          */
39018         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX \
39019                 UINT32_C(0x10)
39020         /*
39021          * This bit must be '1' for the num_cmpl_aggr_int field to be
39022          * configured.
39023          */
39024         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT \
39025                 UINT32_C(0x20)
39026         uint8_t unused_0[4];
39027 } __rte_packed;
39028
39029 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
39030 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
39031         /* The specific error status for the command. */
39032         uint16_t        error_code;
39033         /* The HWRM command request type. */
39034         uint16_t        req_type;
39035         /* The sequence ID from the original command. */
39036         uint16_t        seq_id;
39037         /* The length of the response data in number of bytes. */
39038         uint16_t        resp_len;
39039         uint8_t unused_0[7];
39040         /*
39041          * This field is used in Output records to indicate that the output
39042          * is completely written to RAM.  This field should be read as '1'
39043          * to indicate that the output has been completely written.
39044          * When writing a command completion or response to an internal processor,
39045          * the order of writes has to be such that this field is written last.
39046          */
39047         uint8_t valid;
39048 } __rte_packed;
39049
39050 /***********************
39051  * hwrm_ring_grp_alloc *
39052  ***********************/
39053
39054
39055 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
39056 struct hwrm_ring_grp_alloc_input {
39057         /* The HWRM command request type. */
39058         uint16_t        req_type;
39059         /*
39060          * The completion ring to send the completion event on. This should
39061          * be the NQ ID returned from the `nq_alloc` HWRM command.
39062          */
39063         uint16_t        cmpl_ring;
39064         /*
39065          * The sequence ID is used by the driver for tracking multiple
39066          * commands. This ID is treated as opaque data by the firmware and
39067          * the value is returned in the `hwrm_resp_hdr` upon completion.
39068          */
39069         uint16_t        seq_id;
39070         /*
39071          * The target ID of the command:
39072          * * 0x0-0xFFF8 - The function ID
39073          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39074          * * 0xFFFD - Reserved for user-space HWRM interface
39075          * * 0xFFFF - HWRM
39076          */
39077         uint16_t        target_id;
39078         /*
39079          * A physical address pointer pointing to a host buffer that the
39080          * command's response data will be written. This can be either a host
39081          * physical address (HPA) or a guest physical address (GPA) and must
39082          * point to a physically contiguous block of memory.
39083          */
39084         uint64_t        resp_addr;
39085         /*
39086          * This value identifies the CR associated with the ring
39087          * group.
39088          */
39089         uint16_t        cr;
39090         /*
39091          * This value identifies the main RR associated with the ring
39092          * group.
39093          */
39094         uint16_t        rr;
39095         /*
39096          * This value identifies the aggregation RR associated with
39097          * the ring group.  If this value is 0xFF... (All Fs), then no
39098          * Aggregation ring will be set.
39099          */
39100         uint16_t        ar;
39101         /*
39102          * This value identifies the statistics context associated
39103          * with the ring group.
39104          */
39105         uint16_t        sc;
39106 } __rte_packed;
39107
39108 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
39109 struct hwrm_ring_grp_alloc_output {
39110         /* The specific error status for the command. */
39111         uint16_t        error_code;
39112         /* The HWRM command request type. */
39113         uint16_t        req_type;
39114         /* The sequence ID from the original command. */
39115         uint16_t        seq_id;
39116         /* The length of the response data in number of bytes. */
39117         uint16_t        resp_len;
39118         /*
39119          * This is the ring group ID value.  Use this value to program
39120          * the default ring group for the VNIC or as table entries
39121          * in an RSS/COS context.
39122          */
39123         uint32_t        ring_group_id;
39124         uint8_t unused_0[3];
39125         /*
39126          * This field is used in Output records to indicate that the output
39127          * is completely written to RAM.  This field should be read as '1'
39128          * to indicate that the output has been completely written.
39129          * When writing a command completion or response to an internal processor,
39130          * the order of writes has to be such that this field is written last.
39131          */
39132         uint8_t valid;
39133 } __rte_packed;
39134
39135 /**********************
39136  * hwrm_ring_grp_free *
39137  **********************/
39138
39139
39140 /* hwrm_ring_grp_free_input (size:192b/24B) */
39141 struct hwrm_ring_grp_free_input {
39142         /* The HWRM command request type. */
39143         uint16_t        req_type;
39144         /*
39145          * The completion ring to send the completion event on. This should
39146          * be the NQ ID returned from the `nq_alloc` HWRM command.
39147          */
39148         uint16_t        cmpl_ring;
39149         /*
39150          * The sequence ID is used by the driver for tracking multiple
39151          * commands. This ID is treated as opaque data by the firmware and
39152          * the value is returned in the `hwrm_resp_hdr` upon completion.
39153          */
39154         uint16_t        seq_id;
39155         /*
39156          * The target ID of the command:
39157          * * 0x0-0xFFF8 - The function ID
39158          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39159          * * 0xFFFD - Reserved for user-space HWRM interface
39160          * * 0xFFFF - HWRM
39161          */
39162         uint16_t        target_id;
39163         /*
39164          * A physical address pointer pointing to a host buffer that the
39165          * command's response data will be written. This can be either a host
39166          * physical address (HPA) or a guest physical address (GPA) and must
39167          * point to a physically contiguous block of memory.
39168          */
39169         uint64_t        resp_addr;
39170         /* This is the ring group ID value. */
39171         uint32_t        ring_group_id;
39172         uint8_t unused_0[4];
39173 } __rte_packed;
39174
39175 /* hwrm_ring_grp_free_output (size:128b/16B) */
39176 struct hwrm_ring_grp_free_output {
39177         /* The specific error status for the command. */
39178         uint16_t        error_code;
39179         /* The HWRM command request type. */
39180         uint16_t        req_type;
39181         /* The sequence ID from the original command. */
39182         uint16_t        seq_id;
39183         /* The length of the response data in number of bytes. */
39184         uint16_t        resp_len;
39185         uint8_t unused_0[7];
39186         /*
39187          * This field is used in Output records to indicate that the output
39188          * is completely written to RAM.  This field should be read as '1'
39189          * to indicate that the output has been completely written.
39190          * When writing a command completion or response to an internal processor,
39191          * the order of writes has to be such that this field is written last.
39192          */
39193         uint8_t valid;
39194 } __rte_packed;
39195
39196 /************************
39197  * hwrm_ring_schq_alloc *
39198  ************************/
39199
39200
39201 /* hwrm_ring_schq_alloc_input (size:1088b/136B) */
39202 struct hwrm_ring_schq_alloc_input {
39203         /* The HWRM command request type. */
39204         uint16_t        req_type;
39205         /*
39206          * The completion ring to send the completion event on. This should
39207          * be the NQ ID returned from the `nq_alloc` HWRM command.
39208          */
39209         uint16_t        cmpl_ring;
39210         /*
39211          * The sequence ID is used by the driver for tracking multiple
39212          * commands. This ID is treated as opaque data by the firmware and
39213          * the value is returned in the `hwrm_resp_hdr` upon completion.
39214          */
39215         uint16_t        seq_id;
39216         /*
39217          * The target ID of the command:
39218          * * 0x0-0xFFF8 - The function ID
39219          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39220          * * 0xFFFD - Reserved for user-space HWRM interface
39221          * * 0xFFFF - HWRM
39222          */
39223         uint16_t        target_id;
39224         /*
39225          * A physical address pointer pointing to a host buffer that the
39226          * command's response data will be written. This can be either a host
39227          * physical address (HPA) or a guest physical address (GPA) and must
39228          * point to a physically contiguous block of memory.
39229          */
39230         uint64_t        resp_addr;
39231         uint32_t        enables;
39232         /*
39233          * This bit must be '1' for the tqm_ring0 fields to be
39234          * configured.
39235          */
39236         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING0     UINT32_C(0x1)
39237         /*
39238          * This bit must be '1' for the tqm_ring1 fields to be
39239          * configured.
39240          */
39241         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING1     UINT32_C(0x2)
39242         /*
39243          * This bit must be '1' for the tqm_ring2 fields to be
39244          * configured.
39245          */
39246         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING2     UINT32_C(0x4)
39247         /*
39248          * This bit must be '1' for the tqm_ring3 fields to be
39249          * configured.
39250          */
39251         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING3     UINT32_C(0x8)
39252         /*
39253          * This bit must be '1' for the tqm_ring4 fields to be
39254          * configured.
39255          */
39256         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING4     UINT32_C(0x10)
39257         /*
39258          * This bit must be '1' for the tqm_ring5 fields to be
39259          * configured.
39260          */
39261         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING5     UINT32_C(0x20)
39262         /*
39263          * This bit must be '1' for the tqm_ring6 fields to be
39264          * configured.
39265          */
39266         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING6     UINT32_C(0x40)
39267         /*
39268          * This bit must be '1' for the tqm_ring7 fields to be
39269          * configured.
39270          */
39271         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING7     UINT32_C(0x80)
39272         /* Reserved for future use. */
39273         uint32_t        reserved;
39274         /* TQM ring 0 page size and level. */
39275         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
39276         /* TQM ring 0 PBL indirect levels. */
39277         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_MASK \
39278                 UINT32_C(0xf)
39279         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_SFT       0
39280         /* PBL pointer is physical start address. */
39281         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_0 \
39282                 UINT32_C(0x0)
39283         /* PBL pointer points to PTE table. */
39284         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_1 \
39285                 UINT32_C(0x1)
39286         /*
39287          * PBL pointer points to PDE table with each entry pointing to PTE
39288          * tables.
39289          */
39290         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2 \
39291                 UINT32_C(0x2)
39292         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LAST \
39293                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2
39294         /* TQM ring 0 page size. */
39295         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_MASK \
39296                 UINT32_C(0xf0)
39297         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_SFT   4
39298         /* 4KB. */
39299         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_4K \
39300                 (UINT32_C(0x0) << 4)
39301         /* 8KB. */
39302         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8K \
39303                 (UINT32_C(0x1) << 4)
39304         /* 64KB. */
39305         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_64K \
39306                 (UINT32_C(0x2) << 4)
39307         /* 2MB. */
39308         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_2M \
39309                 (UINT32_C(0x3) << 4)
39310         /* 8MB. */
39311         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8M \
39312                 (UINT32_C(0x4) << 4)
39313         /* 1GB. */
39314         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G \
39315                 (UINT32_C(0x5) << 4)
39316         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_LAST \
39317                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G
39318         /* TQM ring 1 page size and level. */
39319         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
39320         /* TQM ring 1 PBL indirect levels. */
39321         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_MASK \
39322                 UINT32_C(0xf)
39323         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_SFT       0
39324         /* PBL pointer is physical start address. */
39325         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_0 \
39326                 UINT32_C(0x0)
39327         /* PBL pointer points to PTE table. */
39328         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_1 \
39329                 UINT32_C(0x1)
39330         /*
39331          * PBL pointer points to PDE table with each entry pointing to PTE
39332          * tables.
39333          */
39334         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2 \
39335                 UINT32_C(0x2)
39336         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LAST \
39337                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2
39338         /* TQM ring 1 page size. */
39339         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_MASK \
39340                 UINT32_C(0xf0)
39341         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_SFT   4
39342         /* 4KB. */
39343         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_4K \
39344                 (UINT32_C(0x0) << 4)
39345         /* 8KB. */
39346         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8K \
39347                 (UINT32_C(0x1) << 4)
39348         /* 64KB. */
39349         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_64K \
39350                 (UINT32_C(0x2) << 4)
39351         /* 2MB. */
39352         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_2M \
39353                 (UINT32_C(0x3) << 4)
39354         /* 8MB. */
39355         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8M \
39356                 (UINT32_C(0x4) << 4)
39357         /* 1GB. */
39358         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G \
39359                 (UINT32_C(0x5) << 4)
39360         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_LAST \
39361                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G
39362         /* TQM ring 2 page size and level. */
39363         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
39364         /* TQM ring 2 PBL indirect levels. */
39365         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_MASK \
39366                 UINT32_C(0xf)
39367         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_SFT       0
39368         /* PBL pointer is physical start address. */
39369         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_0 \
39370                 UINT32_C(0x0)
39371         /* PBL pointer points to PTE table. */
39372         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_1 \
39373                 UINT32_C(0x1)
39374         /*
39375          * PBL pointer points to PDE table with each entry pointing to PTE
39376          * tables.
39377          */
39378         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2 \
39379                 UINT32_C(0x2)
39380         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LAST \
39381                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2
39382         /* TQM ring 2 page size. */
39383         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_MASK \
39384                 UINT32_C(0xf0)
39385         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_SFT   4
39386         /* 4KB. */
39387         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_4K \
39388                 (UINT32_C(0x0) << 4)
39389         /* 8KB. */
39390         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8K \
39391                 (UINT32_C(0x1) << 4)
39392         /* 64KB. */
39393         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_64K \
39394                 (UINT32_C(0x2) << 4)
39395         /* 2MB. */
39396         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_2M \
39397                 (UINT32_C(0x3) << 4)
39398         /* 8MB. */
39399         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8M \
39400                 (UINT32_C(0x4) << 4)
39401         /* 1GB. */
39402         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G \
39403                 (UINT32_C(0x5) << 4)
39404         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_LAST \
39405                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G
39406         /* TQM ring 3 page size and level. */
39407         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
39408         /* TQM ring 3 PBL indirect levels. */
39409         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_MASK \
39410                 UINT32_C(0xf)
39411         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_SFT       0
39412         /* PBL pointer is physical start address. */
39413         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_0 \
39414                 UINT32_C(0x0)
39415         /* PBL pointer points to PTE table. */
39416         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_1 \
39417                 UINT32_C(0x1)
39418         /*
39419          * PBL pointer points to PDE table with each entry pointing to PTE
39420          * tables.
39421          */
39422         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2 \
39423                 UINT32_C(0x2)
39424         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LAST \
39425                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2
39426         /* TQM ring 3 page size. */
39427         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_MASK \
39428                 UINT32_C(0xf0)
39429         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_SFT   4
39430         /* 4KB. */
39431         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_4K \
39432                 (UINT32_C(0x0) << 4)
39433         /* 8KB. */
39434         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8K \
39435                 (UINT32_C(0x1) << 4)
39436         /* 64KB. */
39437         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_64K \
39438                 (UINT32_C(0x2) << 4)
39439         /* 2MB. */
39440         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_2M \
39441                 (UINT32_C(0x3) << 4)
39442         /* 8MB. */
39443         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8M \
39444                 (UINT32_C(0x4) << 4)
39445         /* 1GB. */
39446         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G \
39447                 (UINT32_C(0x5) << 4)
39448         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_LAST \
39449                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G
39450         /* TQM ring 4 page size and level. */
39451         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
39452         /* TQM ring 4 PBL indirect levels. */
39453         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_MASK \
39454                 UINT32_C(0xf)
39455         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_SFT       0
39456         /* PBL pointer is physical start address. */
39457         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_0 \
39458                 UINT32_C(0x0)
39459         /* PBL pointer points to PTE table. */
39460         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_1 \
39461                 UINT32_C(0x1)
39462         /*
39463          * PBL pointer points to PDE table with each entry pointing to PTE
39464          * tables.
39465          */
39466         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2 \
39467                 UINT32_C(0x2)
39468         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LAST \
39469                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2
39470         /* TQM ring 4 page size. */
39471         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_MASK \
39472                 UINT32_C(0xf0)
39473         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_SFT   4
39474         /* 4KB. */
39475         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_4K \
39476                 (UINT32_C(0x0) << 4)
39477         /* 8KB. */
39478         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8K \
39479                 (UINT32_C(0x1) << 4)
39480         /* 64KB. */
39481         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_64K \
39482                 (UINT32_C(0x2) << 4)
39483         /* 2MB. */
39484         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_2M \
39485                 (UINT32_C(0x3) << 4)
39486         /* 8MB. */
39487         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8M \
39488                 (UINT32_C(0x4) << 4)
39489         /* 1GB. */
39490         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G \
39491                 (UINT32_C(0x5) << 4)
39492         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_LAST \
39493                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G
39494         /* TQM ring 5 page size and level. */
39495         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
39496         /* TQM ring 5 PBL indirect levels. */
39497         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_MASK \
39498                 UINT32_C(0xf)
39499         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_SFT       0
39500         /* PBL pointer is physical start address. */
39501         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_0 \
39502                 UINT32_C(0x0)
39503         /* PBL pointer points to PTE table. */
39504         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_1 \
39505                 UINT32_C(0x1)
39506         /*
39507          * PBL pointer points to PDE table with each entry pointing to PTE
39508          * tables.
39509          */
39510         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2 \
39511                 UINT32_C(0x2)
39512         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LAST \
39513                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2
39514         /* TQM ring 5 page size. */
39515         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_MASK \
39516                 UINT32_C(0xf0)
39517         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_SFT   4
39518         /* 4KB. */
39519         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_4K \
39520                 (UINT32_C(0x0) << 4)
39521         /* 8KB. */
39522         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8K \
39523                 (UINT32_C(0x1) << 4)
39524         /* 64KB. */
39525         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_64K \
39526                 (UINT32_C(0x2) << 4)
39527         /* 2MB. */
39528         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_2M \
39529                 (UINT32_C(0x3) << 4)
39530         /* 8MB. */
39531         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8M \
39532                 (UINT32_C(0x4) << 4)
39533         /* 1GB. */
39534         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G \
39535                 (UINT32_C(0x5) << 4)
39536         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_LAST \
39537                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G
39538         /* TQM ring 6 page size and level. */
39539         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
39540         /* TQM ring 6 PBL indirect levels. */
39541         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_MASK \
39542                 UINT32_C(0xf)
39543         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_SFT       0
39544         /* PBL pointer is physical start address. */
39545         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_0 \
39546                 UINT32_C(0x0)
39547         /* PBL pointer points to PTE table. */
39548         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_1 \
39549                 UINT32_C(0x1)
39550         /*
39551          * PBL pointer points to PDE table with each entry pointing to PTE
39552          * tables.
39553          */
39554         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2 \
39555                 UINT32_C(0x2)
39556         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LAST \
39557                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2
39558         /* TQM ring 6 page size. */
39559         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_MASK \
39560                 UINT32_C(0xf0)
39561         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_SFT   4
39562         /* 4KB. */
39563         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_4K \
39564                 (UINT32_C(0x0) << 4)
39565         /* 8KB. */
39566         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8K \
39567                 (UINT32_C(0x1) << 4)
39568         /* 64KB. */
39569         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_64K \
39570                 (UINT32_C(0x2) << 4)
39571         /* 2MB. */
39572         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_2M \
39573                 (UINT32_C(0x3) << 4)
39574         /* 8MB. */
39575         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8M \
39576                 (UINT32_C(0x4) << 4)
39577         /* 1GB. */
39578         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G \
39579                 (UINT32_C(0x5) << 4)
39580         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_LAST \
39581                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G
39582         /* TQM ring 7 page size and level. */
39583         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
39584         /* TQM ring 7 PBL indirect levels. */
39585         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_MASK \
39586                 UINT32_C(0xf)
39587         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_SFT       0
39588         /* PBL pointer is physical start address. */
39589         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_0 \
39590                 UINT32_C(0x0)
39591         /* PBL pointer points to PTE table. */
39592         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_1 \
39593                 UINT32_C(0x1)
39594         /*
39595          * PBL pointer points to PDE table with each entry pointing to PTE
39596          * tables.
39597          */
39598         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2 \
39599                 UINT32_C(0x2)
39600         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LAST \
39601                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2
39602         /* TQM ring 7 page size. */
39603         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_MASK \
39604                 UINT32_C(0xf0)
39605         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_SFT   4
39606         /* 4KB. */
39607         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_4K \
39608                 (UINT32_C(0x0) << 4)
39609         /* 8KB. */
39610         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8K \
39611                 (UINT32_C(0x1) << 4)
39612         /* 64KB. */
39613         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_64K \
39614                 (UINT32_C(0x2) << 4)
39615         /* 2MB. */
39616         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_2M \
39617                 (UINT32_C(0x3) << 4)
39618         /* 8MB. */
39619         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8M \
39620                 (UINT32_C(0x4) << 4)
39621         /* 1GB. */
39622         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G \
39623                 (UINT32_C(0x5) << 4)
39624         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_LAST \
39625                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G
39626         /* TQM ring 0 page directory. */
39627         uint64_t        tqm_ring0_page_dir;
39628         /* TQM ring 1 page directory. */
39629         uint64_t        tqm_ring1_page_dir;
39630         /* TQM ring 2 page directory. */
39631         uint64_t        tqm_ring2_page_dir;
39632         /* TQM ring 3 page directory. */
39633         uint64_t        tqm_ring3_page_dir;
39634         /* TQM ring 4 page directory. */
39635         uint64_t        tqm_ring4_page_dir;
39636         /* TQM ring 5 page directory. */
39637         uint64_t        tqm_ring5_page_dir;
39638         /* TQM ring 6 page directory. */
39639         uint64_t        tqm_ring6_page_dir;
39640         /* TQM ring 7 page directory. */
39641         uint64_t        tqm_ring7_page_dir;
39642         /*
39643          * Number of TQM ring 0 entries.
39644          *
39645          * TQM fastpath rings should be sized large enough to accommodate the
39646          * maximum number of QPs (either L2 or RoCE, or both if shared)
39647          * that can be enqueued to the TQM ring.
39648          *
39649          * Note that TQM ring sizes cannot be extended while the system is
39650          * operational. If a PF driver needs to extend a TQM ring, it needs
39651          * to delete the SCHQ and then reallocate it.
39652          */
39653         uint32_t        tqm_ring0_num_entries;
39654         /*
39655          * Number of TQM ring 1 entries.
39656          *
39657          * TQM fastpath rings should be sized large enough to accommodate the
39658          * maximum number of QPs (either L2 or RoCE, or both if shared)
39659          * that can be enqueued to the TQM ring.
39660          *
39661          * Note that TQM ring sizes cannot be extended while the system is
39662          * operational. If a PF driver needs to extend a TQM ring, it needs
39663          * to delete the SCHQ and then reallocate it.
39664          */
39665         uint32_t        tqm_ring1_num_entries;
39666         /*
39667          * Number of TQM ring 2 entries.
39668          *
39669          * TQM fastpath rings should be sized large enough to accommodate the
39670          * maximum number of QPs (either L2 or RoCE, or both if shared)
39671          * that can be enqueued to the TQM ring.
39672          *
39673          * Note that TQM ring sizes cannot be extended while the system is
39674          * operational. If a PF driver needs to extend a TQM ring, it needs
39675          * to delete the SCHQ and then reallocate it.
39676          */
39677         uint32_t        tqm_ring2_num_entries;
39678         /*
39679          * Number of TQM ring 3 entries.
39680          *
39681          * TQM fastpath rings should be sized large enough to accommodate the
39682          * maximum number of QPs (either L2 or RoCE, or both if shared)
39683          * that can be enqueued to the TQM ring.
39684          *
39685          * Note that TQM ring sizes cannot be extended while the system is
39686          * operational. If a PF driver needs to extend a TQM ring, it needs
39687          * to delete the SCHQ and then reallocate it.
39688          */
39689         uint32_t        tqm_ring3_num_entries;
39690         /*
39691          * Number of TQM ring 4 entries.
39692          *
39693          * TQM fastpath rings should be sized large enough to accommodate the
39694          * maximum number of QPs (either L2 or RoCE, or both if shared)
39695          * that can be enqueued to the TQM ring.
39696          *
39697          * Note that TQM ring sizes cannot be extended while the system is
39698          * operational. If a PF driver needs to extend a TQM ring, it needs
39699          * to delete the SCHQ and then reallocate it.
39700          */
39701         uint32_t        tqm_ring4_num_entries;
39702         /*
39703          * Number of TQM ring 5 entries.
39704          *
39705          * TQM fastpath rings should be sized large enough to accommodate the
39706          * maximum number of QPs (either L2 or RoCE, or both if shared)
39707          * that can be enqueued to the TQM ring.
39708          *
39709          * Note that TQM ring sizes cannot be extended while the system is
39710          * operational. If a PF driver needs to extend a TQM ring, it needs
39711          * to delete the SCHQ and then reallocate it.
39712          */
39713         uint32_t        tqm_ring5_num_entries;
39714         /*
39715          * Number of TQM ring 6 entries.
39716          *
39717          * TQM fastpath rings should be sized large enough to accommodate the
39718          * maximum number of QPs (either L2 or RoCE, or both if shared)
39719          * that can be enqueued to the TQM ring.
39720          *
39721          * Note that TQM ring sizes cannot be extended while the system is
39722          * operational. If a PF driver needs to extend a TQM ring, it needs
39723          * to delete the SCHQ and then reallocate it.
39724          */
39725         uint32_t        tqm_ring6_num_entries;
39726         /*
39727          * Number of TQM ring 7 entries.
39728          *
39729          * TQM fastpath rings should be sized large enough to accommodate the
39730          * maximum number of QPs (either L2 or RoCE, or both if shared)
39731          * that can be enqueued to the TQM ring.
39732          *
39733          * Note that TQM ring sizes cannot be extended while the system is
39734          * operational. If a PF driver needs to extend a TQM ring, it needs
39735          * to delete the SCHQ and then reallocate it.
39736          */
39737         uint32_t        tqm_ring7_num_entries;
39738         /* Number of bytes that have been allocated for each context entry. */
39739         uint16_t        tqm_entry_size;
39740         uint8_t unused_0[6];
39741 } __rte_packed;
39742
39743 /* hwrm_ring_schq_alloc_output (size:128b/16B) */
39744 struct hwrm_ring_schq_alloc_output {
39745         /* The specific error status for the command. */
39746         uint16_t        error_code;
39747         /* The HWRM command request type. */
39748         uint16_t        req_type;
39749         /* The sequence ID from the original command. */
39750         uint16_t        seq_id;
39751         /* The length of the response data in number of bytes. */
39752         uint16_t        resp_len;
39753         /*
39754          * This is an identifier for the SCHQ to be used in other HWRM commands
39755          * that need to reference this SCHQ. This value is greater than zero
39756          * (i.e. a schq_id of zero references the default SCHQ).
39757          */
39758         uint16_t        schq_id;
39759         uint8_t unused_0[5];
39760         /*
39761          * This field is used in Output records to indicate that the output
39762          * is completely written to RAM.  This field should be read as '1'
39763          * to indicate that the output has been completely written.
39764          * When writing a command completion or response to an internal processor,
39765          * the order of writes has to be such that this field is written last.
39766          */
39767         uint8_t valid;
39768 } __rte_packed;
39769
39770 /**********************
39771  * hwrm_ring_schq_cfg *
39772  **********************/
39773
39774
39775 /* hwrm_ring_schq_cfg_input (size:768b/96B) */
39776 struct hwrm_ring_schq_cfg_input {
39777         /* The HWRM command request type. */
39778         uint16_t        req_type;
39779         /*
39780          * The completion ring to send the completion event on. This should
39781          * be the NQ ID returned from the `nq_alloc` HWRM command.
39782          */
39783         uint16_t        cmpl_ring;
39784         /*
39785          * The sequence ID is used by the driver for tracking multiple
39786          * commands. This ID is treated as opaque data by the firmware and
39787          * the value is returned in the `hwrm_resp_hdr` upon completion.
39788          */
39789         uint16_t        seq_id;
39790         /*
39791          * The target ID of the command:
39792          * * 0x0-0xFFF8 - The function ID
39793          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39794          * * 0xFFFD - Reserved for user-space HWRM interface
39795          * * 0xFFFF - HWRM
39796          */
39797         uint16_t        target_id;
39798         /*
39799          * A physical address pointer pointing to a host buffer that the
39800          * command's response data will be written. This can be either a host
39801          * physical address (HPA) or a guest physical address (GPA) and must
39802          * point to a physically contiguous block of memory.
39803          */
39804         uint64_t        resp_addr;
39805         /*
39806          * Identifies the SCHQ being configured. A schq_id of zero refers to
39807          * the default SCHQ.
39808          */
39809         uint16_t        schq_id;
39810         /*
39811          * This field is an 8 bit bitmap that indicates which TCs are enabled
39812          * in this SCHQ. Bit 0 represents traffic class 0 and bit 7 represents
39813          * traffic class 7.
39814          */
39815         uint8_t tc_enabled;
39816         uint8_t unused_0;
39817         uint32_t        flags;
39818         /* The tc_max_bw array and the max_bw parameters are valid */
39819         #define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MAX_BW_ENABLED \
39820                 UINT32_C(0x1)
39821         /* The tc_min_bw array is valid */
39822         #define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MIN_BW_ENABLED \
39823                 UINT32_C(0x2)
39824         /* Maximum bandwidth of the traffic class, specified in Mbps. */
39825         uint32_t        max_bw_tc0;
39826         /* Maximum bandwidth of the traffic class, specified in Mbps. */
39827         uint32_t        max_bw_tc1;
39828         /* Maximum bandwidth of the traffic class, specified in Mbps. */
39829         uint32_t        max_bw_tc2;
39830         /* Maximum bandwidth of the traffic class, specified in Mbps. */
39831         uint32_t        max_bw_tc3;
39832         /* Maximum bandwidth of the traffic class, specified in Mbps. */
39833         uint32_t        max_bw_tc4;
39834         /* Maximum bandwidth of the traffic class, specified in Mbps. */
39835         uint32_t        max_bw_tc5;
39836         /* Maximum bandwidth of the traffic class, specified in Mbps. */
39837         uint32_t        max_bw_tc6;
39838         /* Maximum bandwidth of the traffic class, specified in Mbps. */
39839         uint32_t        max_bw_tc7;
39840         /*
39841          * Bandwidth reservation for the traffic class, specified in Mbps.
39842          * A value of zero signifies that traffic belonging to this class
39843          * shares the bandwidth reservation for the same traffic class of
39844          * the default SCHQ.
39845          */
39846         uint32_t        min_bw_tc0;
39847         /*
39848          * Bandwidth reservation for the traffic class, specified in Mbps.
39849          * A value of zero signifies that traffic belonging to this class
39850          * shares the bandwidth reservation for the same traffic class of
39851          * the default SCHQ.
39852          */
39853         uint32_t        min_bw_tc1;
39854         /*
39855          * Bandwidth reservation for the traffic class, specified in Mbps.
39856          * A value of zero signifies that traffic belonging to this class
39857          * shares the bandwidth reservation for the same traffic class of
39858          * the default SCHQ.
39859          */
39860         uint32_t        min_bw_tc2;
39861         /*
39862          * Bandwidth reservation for the traffic class, specified in Mbps.
39863          * A value of zero signifies that traffic belonging to this class
39864          * shares the bandwidth reservation for the same traffic class of
39865          * the default SCHQ.
39866          */
39867         uint32_t        min_bw_tc3;
39868         /*
39869          * Bandwidth reservation for the traffic class, specified in Mbps.
39870          * A value of zero signifies that traffic belonging to this class
39871          * shares the bandwidth reservation for the same traffic class of
39872          * the default SCHQ.
39873          */
39874         uint32_t        min_bw_tc4;
39875         /*
39876          * Bandwidth reservation for the traffic class, specified in Mbps.
39877          * A value of zero signifies that traffic belonging to this class
39878          * shares the bandwidth reservation for the same traffic class of
39879          * the default SCHQ.
39880          */
39881         uint32_t        min_bw_tc5;
39882         /*
39883          * Bandwidth reservation for the traffic class, specified in Mbps.
39884          * A value of zero signifies that traffic belonging to this class
39885          * shares the bandwidth reservation for the same traffic class of
39886          * the default SCHQ.
39887          */
39888         uint32_t        min_bw_tc6;
39889         /*
39890          * Bandwidth reservation for the traffic class, specified in Mbps.
39891          * A value of zero signifies that traffic belonging to this class
39892          * shares the bandwidth reservation for the same traffic class of
39893          * the default SCHQ.
39894          */
39895         uint32_t        min_bw_tc7;
39896         /*
39897          * Indicates the max bandwidth for all enabled traffic classes in
39898          * this SCHQ, specified in Mbps.
39899          */
39900         uint32_t        max_bw;
39901         uint8_t unused_1[4];
39902 } __rte_packed;
39903
39904 /* hwrm_ring_schq_cfg_output (size:128b/16B) */
39905 struct hwrm_ring_schq_cfg_output {
39906         /* The specific error status for the command. */
39907         uint16_t        error_code;
39908         /* The HWRM command request type. */
39909         uint16_t        req_type;
39910         /* The sequence ID from the original command. */
39911         uint16_t        seq_id;
39912         /* The length of the response data in number of bytes. */
39913         uint16_t        resp_len;
39914         uint8_t unused_0[7];
39915         /*
39916          * This field is used in Output records to indicate that the output
39917          * is completely written to RAM.  This field should be read as '1'
39918          * to indicate that the output has been completely written.
39919          * When writing a command completion or response to an internal processor,
39920          * the order of writes has to be such that this field is written last.
39921          */
39922         uint8_t valid;
39923 } __rte_packed;
39924
39925 /***********************
39926  * hwrm_ring_schq_free *
39927  ***********************/
39928
39929
39930 /* hwrm_ring_schq_free_input (size:192b/24B) */
39931 struct hwrm_ring_schq_free_input {
39932         /* The HWRM command request type. */
39933         uint16_t        req_type;
39934         /*
39935          * The completion ring to send the completion event on. This should
39936          * be the NQ ID returned from the `nq_alloc` HWRM command.
39937          */
39938         uint16_t        cmpl_ring;
39939         /*
39940          * The sequence ID is used by the driver for tracking multiple
39941          * commands. This ID is treated as opaque data by the firmware and
39942          * the value is returned in the `hwrm_resp_hdr` upon completion.
39943          */
39944         uint16_t        seq_id;
39945         /*
39946          * The target ID of the command:
39947          * * 0x0-0xFFF8 - The function ID
39948          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39949          * * 0xFFFD - Reserved for user-space HWRM interface
39950          * * 0xFFFF - HWRM
39951          */
39952         uint16_t        target_id;
39953         /*
39954          * A physical address pointer pointing to a host buffer that the
39955          * command's response data will be written. This can be either a host
39956          * physical address (HPA) or a guest physical address (GPA) and must
39957          * point to a physically contiguous block of memory.
39958          */
39959         uint64_t        resp_addr;
39960         /* Identifies the SCHQ being freed. */
39961         uint16_t        schq_id;
39962         uint8_t unused_0[6];
39963 } __rte_packed;
39964
39965 /* hwrm_ring_schq_free_output (size:128b/16B) */
39966 struct hwrm_ring_schq_free_output {
39967         /* The specific error status for the command. */
39968         uint16_t        error_code;
39969         /* The HWRM command request type. */
39970         uint16_t        req_type;
39971         /* The sequence ID from the original command. */
39972         uint16_t        seq_id;
39973         /* The length of the response data in number of bytes. */
39974         uint16_t        resp_len;
39975         uint8_t unused_0[7];
39976         /*
39977          * This field is used in Output records to indicate that the output
39978          * is completely written to RAM.  This field should be read as '1'
39979          * to indicate that the output has been completely written.
39980          * When writing a command completion or response to an internal processor,
39981          * the order of writes has to be such that this field is written last.
39982          */
39983         uint8_t valid;
39984 } __rte_packed;
39985 /*
39986  * special reserved flow ID to identify per function default
39987  * flows for vSwitch offload
39988  */
39989 #define DEFAULT_FLOW_ID 0xFFFFFFFFUL
39990 /*
39991  * special reserved flow ID to identify per function RoCEv1
39992  * flows
39993  */
39994 #define ROCEV1_FLOW_ID 0xFFFFFFFEUL
39995 /*
39996  * special reserved flow ID to identify per function RoCEv2
39997  * flows
39998  */
39999 #define ROCEV2_FLOW_ID 0xFFFFFFFDUL
40000 /*
40001  * special reserved flow ID to identify per function RoCEv2
40002  * CNP flows
40003  */
40004 #define ROCEV2_CNP_FLOW_ID 0xFFFFFFFCUL
40005
40006 /****************************
40007  * hwrm_cfa_l2_filter_alloc *
40008  ****************************/
40009
40010
40011 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
40012 struct hwrm_cfa_l2_filter_alloc_input {
40013         /* The HWRM command request type. */
40014         uint16_t        req_type;
40015         /*
40016          * The completion ring to send the completion event on. This should
40017          * be the NQ ID returned from the `nq_alloc` HWRM command.
40018          */
40019         uint16_t        cmpl_ring;
40020         /*
40021          * The sequence ID is used by the driver for tracking multiple
40022          * commands. This ID is treated as opaque data by the firmware and
40023          * the value is returned in the `hwrm_resp_hdr` upon completion.
40024          */
40025         uint16_t        seq_id;
40026         /*
40027          * The target ID of the command:
40028          * * 0x0-0xFFF8 - The function ID
40029          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40030          * * 0xFFFD - Reserved for user-space HWRM interface
40031          * * 0xFFFF - HWRM
40032          */
40033         uint16_t        target_id;
40034         /*
40035          * A physical address pointer pointing to a host buffer that the
40036          * command's response data will be written. This can be either a host
40037          * physical address (HPA) or a guest physical address (GPA) and must
40038          * point to a physically contiguous block of memory.
40039          */
40040         uint64_t        resp_addr;
40041         uint32_t        flags;
40042         /*
40043          * Enumeration denoting the RX, TX type of the resource.
40044          * This enumeration is used for resources that are similar for both
40045          * TX and RX paths of the chip.
40046          */
40047         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
40048                 UINT32_C(0x1)
40049         /* tx path */
40050         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
40051                 UINT32_C(0x0)
40052         /* rx path */
40053         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
40054                 UINT32_C(0x1)
40055         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
40056                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
40057         /*
40058          * Setting of this flag indicates the applicability to the loopback
40059          * path.
40060          */
40061         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
40062                 UINT32_C(0x2)
40063         /*
40064          * Setting of this flag indicates drop action. If this flag is not
40065          * set, then it should be considered accept action.
40066          */
40067         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
40068                 UINT32_C(0x4)
40069         /*
40070          * If this flag is set, all t_l2_* fields are invalid
40071          * and they should not be specified.
40072          * If this flag is set, then l2_* fields refer to
40073          * fields of outermost L2 header.
40074          */
40075         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
40076                 UINT32_C(0x8)
40077         /*
40078          * Enumeration denoting NO_ROCE_L2 to support old drivers.
40079          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
40080          */
40081         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK \
40082                 UINT32_C(0x30)
40083         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT       4
40084         /* To support old drivers */
40085         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
40086                 (UINT32_C(0x0) << 4)
40087         /* Only L2 traffic */
40088         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2 \
40089                 (UINT32_C(0x1) << 4)
40090         /* Roce & L2 traffic */
40091         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE \
40092                 (UINT32_C(0x2) << 4)
40093         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST \
40094                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE
40095         /*
40096          * Setting of this flag indicates that no XDP filter is created with
40097          * L2 filter.
40098          * 0 - legacy behavior, XDP filter is created with L2 filter
40099          * 1 - XDP filter won't be created with L2 filter
40100          */
40101         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_XDP_DISABLE \
40102                 UINT32_C(0x40)
40103         /*
40104          * Setting this flag to 1 indicate the L2 fields in this command
40105          * pertain to source fields. Setting this flag to 0 indicate the
40106          * L2 fields in this command pertain to the destination fields
40107          * and this is the default/legacy behavior.
40108          */
40109         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_SOURCE_VALID \
40110                 UINT32_C(0x80)
40111         uint32_t        enables;
40112         /*
40113          * This bit must be '1' for the l2_addr field to be
40114          * configured.
40115          */
40116         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
40117                 UINT32_C(0x1)
40118         /*
40119          * This bit must be '1' for the l2_addr_mask field to be
40120          * configured.
40121          */
40122         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
40123                 UINT32_C(0x2)
40124         /*
40125          * This bit must be '1' for the l2_ovlan field to be
40126          * configured.
40127          */
40128         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
40129                 UINT32_C(0x4)
40130         /*
40131          * This bit must be '1' for the l2_ovlan_mask field to be
40132          * configured.
40133          */
40134         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
40135                 UINT32_C(0x8)
40136         /*
40137          * This bit must be '1' for the l2_ivlan field to be
40138          * configured.
40139          */
40140         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
40141                 UINT32_C(0x10)
40142         /*
40143          * This bit must be '1' for the l2_ivlan_mask field to be
40144          * configured.
40145          */
40146         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
40147                 UINT32_C(0x20)
40148         /*
40149          * This bit must be '1' for the t_l2_addr field to be
40150          * configured.
40151          */
40152         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
40153                 UINT32_C(0x40)
40154         /*
40155          * This bit must be '1' for the t_l2_addr_mask field to be
40156          * configured.
40157          */
40158         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
40159                 UINT32_C(0x80)
40160         /*
40161          * This bit must be '1' for the t_l2_ovlan field to be
40162          * configured.
40163          */
40164         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
40165                 UINT32_C(0x100)
40166         /*
40167          * This bit must be '1' for the t_l2_ovlan_mask field to be
40168          * configured.
40169          */
40170         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
40171                 UINT32_C(0x200)
40172         /*
40173          * This bit must be '1' for the t_l2_ivlan field to be
40174          * configured.
40175          */
40176         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
40177                 UINT32_C(0x400)
40178         /*
40179          * This bit must be '1' for the t_l2_ivlan_mask field to be
40180          * configured.
40181          */
40182         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
40183                 UINT32_C(0x800)
40184         /*
40185          * This bit must be '1' for the src_type field to be
40186          * configured.
40187          */
40188         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
40189                 UINT32_C(0x1000)
40190         /*
40191          * This bit must be '1' for the src_id field to be
40192          * configured.
40193          */
40194         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
40195                 UINT32_C(0x2000)
40196         /*
40197          * This bit must be '1' for the tunnel_type field to be
40198          * configured.
40199          */
40200         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
40201                 UINT32_C(0x4000)
40202         /*
40203          * This bit must be '1' for the dst_id field to be
40204          * configured.
40205          */
40206         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
40207                 UINT32_C(0x8000)
40208         /*
40209          * This bit must be '1' for the mirror_vnic_id field to be
40210          * configured.
40211          */
40212         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
40213                 UINT32_C(0x10000)
40214         /*
40215          * This bit must be '1' for the num_vlans field to be
40216          * configured.
40217          */
40218         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_NUM_VLANS \
40219                 UINT32_C(0x20000)
40220         /*
40221          * This bit must be '1' for the t_num_vlans field to be
40222          * configured.
40223          */
40224         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_NUM_VLANS \
40225                 UINT32_C(0x40000)
40226         /*
40227          * This value sets the match value for the L2 MAC address.
40228          * Destination MAC address for RX path.
40229          * Source MAC address for TX path.
40230          */
40231         uint8_t l2_addr[6];
40232         /* This value sets the match value for the number of VLANs. */
40233         uint8_t num_vlans;
40234         /*
40235          * This value sets the match value for the number of VLANs
40236          * in the tunnel headers.
40237          */
40238         uint8_t t_num_vlans;
40239         /*
40240          * This value sets the mask value for the L2 address.
40241          * A value of 0 will mask the corresponding bit from
40242          * compare.
40243          */
40244         uint8_t l2_addr_mask[6];
40245         /* This value sets VLAN ID value for outer VLAN. */
40246         uint16_t        l2_ovlan;
40247         /*
40248          * This value sets the mask value for the ovlan id.
40249          * A value of 0 will mask the corresponding bit from
40250          * compare.
40251          */
40252         uint16_t        l2_ovlan_mask;
40253         /* This value sets VLAN ID value for inner VLAN. */
40254         uint16_t        l2_ivlan;
40255         /*
40256          * This value sets the mask value for the ivlan id.
40257          * A value of 0 will mask the corresponding bit from
40258          * compare.
40259          */
40260         uint16_t        l2_ivlan_mask;
40261         uint8_t unused_1[2];
40262         /*
40263          * This value sets the match value for the tunnel
40264          * L2 MAC address.
40265          * Destination MAC address for RX path.
40266          * Source MAC address for TX path.
40267          */
40268         uint8_t t_l2_addr[6];
40269         uint8_t unused_2[2];
40270         /*
40271          * This value sets the mask value for the tunnel L2
40272          * address.
40273          * A value of 0 will mask the corresponding bit from
40274          * compare.
40275          */
40276         uint8_t t_l2_addr_mask[6];
40277         /* This value sets VLAN ID value for tunnel outer VLAN. */
40278         uint16_t        t_l2_ovlan;
40279         /*
40280          * This value sets the mask value for the tunnel ovlan id.
40281          * A value of 0 will mask the corresponding bit from
40282          * compare.
40283          */
40284         uint16_t        t_l2_ovlan_mask;
40285         /* This value sets VLAN ID value for tunnel inner VLAN. */
40286         uint16_t        t_l2_ivlan;
40287         /*
40288          * This value sets the mask value for the tunnel ivlan id.
40289          * A value of 0 will mask the corresponding bit from
40290          * compare.
40291          */
40292         uint16_t        t_l2_ivlan_mask;
40293         /* This value identifies the type of source of the packet. */
40294         uint8_t src_type;
40295         /* Network port */
40296         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
40297         /* Physical function */
40298         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF    UINT32_C(0x1)
40299         /* Virtual function */
40300         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF    UINT32_C(0x2)
40301         /* Virtual NIC of a function */
40302         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC  UINT32_C(0x3)
40303         /* Embedded processor for CFA management */
40304         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG  UINT32_C(0x4)
40305         /* Embedded processor for OOB management */
40306         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE   UINT32_C(0x5)
40307         /* Embedded processor for RoCE */
40308         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO  UINT32_C(0x6)
40309         /* Embedded processor for network proxy functions */
40310         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG  UINT32_C(0x7)
40311         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST \
40312                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
40313         uint8_t unused_3;
40314         /*
40315          * This value is the id of the source.
40316          * For a network port, it represents port_id.
40317          * For a physical function, it represents fid.
40318          * For a virtual function, it represents vf_id.
40319          * For a vnic, it represents vnic_id.
40320          * For embedded processors, this id is not valid.
40321          *
40322          * Notes:
40323          * 1. The function ID is implied if it src_id is
40324          *    not provided for a src_type that is either
40325          */
40326         uint32_t        src_id;
40327         /* Tunnel Type. */
40328         uint8_t tunnel_type;
40329         /* Non-tunnel */
40330         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
40331                 UINT32_C(0x0)
40332         /* Virtual eXtensible Local Area Network (VXLAN) */
40333         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
40334                 UINT32_C(0x1)
40335         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
40336         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
40337                 UINT32_C(0x2)
40338         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
40339         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
40340                 UINT32_C(0x3)
40341         /* IP in IP */
40342         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
40343                 UINT32_C(0x4)
40344         /* Generic Network Virtualization Encapsulation (Geneve) */
40345         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
40346                 UINT32_C(0x5)
40347         /* Multi-Protocol Label Switching (MPLS) */
40348         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
40349                 UINT32_C(0x6)
40350         /* Stateless Transport Tunnel (STT) */
40351         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
40352                 UINT32_C(0x7)
40353         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
40354         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
40355                 UINT32_C(0x8)
40356         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
40357         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
40358                 UINT32_C(0x9)
40359         /*
40360          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
40361          * datagram payload
40362          */
40363         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
40364                 UINT32_C(0xa)
40365         /* Use fixed layer 2 ether type of 0xFFFF */
40366         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
40367                 UINT32_C(0xb)
40368         /*
40369          * IPV6 over virtual eXtensible Local Area Network with GPE header
40370          * (IPV6oVXLANGPE)
40371          */
40372         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
40373                 UINT32_C(0xc)
40374         /* Any tunneled traffic */
40375         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
40376                 UINT32_C(0xff)
40377         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
40378                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
40379         uint8_t unused_4;
40380         /*
40381          * If set, this value shall represent the
40382          * Logical VNIC ID of the destination VNIC for the RX
40383          * path and network port id of the destination port for
40384          * the TX path.
40385          */
40386         uint16_t        dst_id;
40387         /*
40388          * Logical VNIC ID of the VNIC where traffic is
40389          * mirrored.
40390          */
40391         uint16_t        mirror_vnic_id;
40392         /*
40393          * This hint is provided to help in placing
40394          * the filter in the filter table.
40395          */
40396         uint8_t pri_hint;
40397         /* No preference */
40398         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
40399                 UINT32_C(0x0)
40400         /* Above the given filter */
40401         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
40402                 UINT32_C(0x1)
40403         /* Below the given filter */
40404         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
40405                 UINT32_C(0x2)
40406         /* As high as possible */
40407         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
40408                 UINT32_C(0x3)
40409         /* As low as possible */
40410         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
40411                 UINT32_C(0x4)
40412         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
40413                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
40414         uint8_t unused_5;
40415         uint32_t        unused_6;
40416         /*
40417          * This is the ID of the filter that goes along with
40418          * the pri_hint.
40419          *
40420          * This field is valid only for the following values.
40421          * 1 - Above the given filter
40422          * 2 - Below the given filter
40423          */
40424         uint64_t        l2_filter_id_hint;
40425 } __rte_packed;
40426
40427 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
40428 struct hwrm_cfa_l2_filter_alloc_output {
40429         /* The specific error status for the command. */
40430         uint16_t        error_code;
40431         /* The HWRM command request type. */
40432         uint16_t        req_type;
40433         /* The sequence ID from the original command. */
40434         uint16_t        seq_id;
40435         /* The length of the response data in number of bytes. */
40436         uint16_t        resp_len;
40437         /*
40438          * This value identifies a set of CFA data structures used for an L2
40439          * context.
40440          */
40441         uint64_t        l2_filter_id;
40442         /*
40443          * The flow id value in bit 0-29 is the actual ID of the flow
40444          * associated with this filter and it shall be used to match
40445          * and associate the flow identifier returned in completion
40446          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
40447          * shall indicate no valid flow id.
40448          */
40449         uint32_t        flow_id;
40450         /* Indicate the flow id value. */
40451         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
40452                 UINT32_C(0x3fffffff)
40453         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
40454         /* Indicate type of the flow. */
40455         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
40456                 UINT32_C(0x40000000)
40457         /*
40458          * If this bit set to 0, then it indicates that the flow is
40459          * internal flow.
40460          */
40461         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
40462                 (UINT32_C(0x0) << 30)
40463         /*
40464          * If this bit is set to 1, then it indicates that the flow is
40465          * external flow.
40466          */
40467         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
40468                 (UINT32_C(0x1) << 30)
40469         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
40470                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
40471         /* Indicate the flow direction. */
40472         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
40473                 UINT32_C(0x80000000)
40474         /* If this bit set to 0, then it indicates rx flow. */
40475         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
40476                 (UINT32_C(0x0) << 31)
40477         /* If this bit is set to 1, then it indicates that tx flow. */
40478         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
40479                 (UINT32_C(0x1) << 31)
40480         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
40481                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
40482         uint8_t unused_0[3];
40483         /*
40484          * This field is used in Output records to indicate that the output
40485          * is completely written to RAM. This field should be read as '1'
40486          * to indicate that the output has been completely written.
40487          * When writing a command completion or response to an internal
40488          * processor, the order of writes has to be such that this field is
40489          * written last.
40490          */
40491         uint8_t valid;
40492 } __rte_packed;
40493
40494 /***************************
40495  * hwrm_cfa_l2_filter_free *
40496  ***************************/
40497
40498
40499 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
40500 struct hwrm_cfa_l2_filter_free_input {
40501         /* The HWRM command request type. */
40502         uint16_t        req_type;
40503         /*
40504          * The completion ring to send the completion event on. This should
40505          * be the NQ ID returned from the `nq_alloc` HWRM command.
40506          */
40507         uint16_t        cmpl_ring;
40508         /*
40509          * The sequence ID is used by the driver for tracking multiple
40510          * commands. This ID is treated as opaque data by the firmware and
40511          * the value is returned in the `hwrm_resp_hdr` upon completion.
40512          */
40513         uint16_t        seq_id;
40514         /*
40515          * The target ID of the command:
40516          * * 0x0-0xFFF8 - The function ID
40517          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40518          * * 0xFFFD - Reserved for user-space HWRM interface
40519          * * 0xFFFF - HWRM
40520          */
40521         uint16_t        target_id;
40522         /*
40523          * A physical address pointer pointing to a host buffer that the
40524          * command's response data will be written. This can be either a host
40525          * physical address (HPA) or a guest physical address (GPA) and must
40526          * point to a physically contiguous block of memory.
40527          */
40528         uint64_t        resp_addr;
40529         /*
40530          * This value identifies a set of CFA data structures used for an L2
40531          * context.
40532          */
40533         uint64_t        l2_filter_id;
40534 } __rte_packed;
40535
40536 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
40537 struct hwrm_cfa_l2_filter_free_output {
40538         /* The specific error status for the command. */
40539         uint16_t        error_code;
40540         /* The HWRM command request type. */
40541         uint16_t        req_type;
40542         /* The sequence ID from the original command. */
40543         uint16_t        seq_id;
40544         /* The length of the response data in number of bytes. */
40545         uint16_t        resp_len;
40546         uint8_t unused_0[7];
40547         /*
40548          * This field is used in Output records to indicate that the output
40549          * is completely written to RAM. This field should be read as '1'
40550          * to indicate that the output has been completely written.
40551          * When writing a command completion or response to an internal
40552          * processor, the order of writes has to be such that this field is
40553          * written last.
40554          */
40555         uint8_t valid;
40556 } __rte_packed;
40557
40558 /**************************
40559  * hwrm_cfa_l2_filter_cfg *
40560  **************************/
40561
40562
40563 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
40564 struct hwrm_cfa_l2_filter_cfg_input {
40565         /* The HWRM command request type. */
40566         uint16_t        req_type;
40567         /*
40568          * The completion ring to send the completion event on. This should
40569          * be the NQ ID returned from the `nq_alloc` HWRM command.
40570          */
40571         uint16_t        cmpl_ring;
40572         /*
40573          * The sequence ID is used by the driver for tracking multiple
40574          * commands. This ID is treated as opaque data by the firmware and
40575          * the value is returned in the `hwrm_resp_hdr` upon completion.
40576          */
40577         uint16_t        seq_id;
40578         /*
40579          * The target ID of the command:
40580          * * 0x0-0xFFF8 - The function ID
40581          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40582          * * 0xFFFD - Reserved for user-space HWRM interface
40583          * * 0xFFFF - HWRM
40584          */
40585         uint16_t        target_id;
40586         /*
40587          * A physical address pointer pointing to a host buffer that the
40588          * command's response data will be written. This can be either a host
40589          * physical address (HPA) or a guest physical address (GPA) and must
40590          * point to a physically contiguous block of memory.
40591          */
40592         uint64_t        resp_addr;
40593         uint32_t        flags;
40594         /*
40595          * Enumeration denoting the RX, TX type of the resource.
40596          * This enumeration is used for resources that are similar for both
40597          * TX and RX paths of the chip.
40598          */
40599         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH \
40600                 UINT32_C(0x1)
40601         /* tx path */
40602         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \
40603                 UINT32_C(0x0)
40604         /* rx path */
40605         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \
40606                 UINT32_C(0x1)
40607         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
40608                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
40609         /*
40610          * Setting of this flag indicates drop action. If this flag is not
40611          * set, then it should be considered accept action.
40612          */
40613         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP \
40614                 UINT32_C(0x2)
40615         /*
40616          * Enumeration denoting NO_ROCE_L2 to support old drivers.
40617          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
40618          */
40619         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK \
40620                 UINT32_C(0xc)
40621         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT       2
40622         /* To support old drivers */
40623         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
40624                 (UINT32_C(0x0) << 2)
40625         /* Only L2 traffic */
40626         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2 \
40627                 (UINT32_C(0x1) << 2)
40628         /* Roce & L2 traffic */
40629         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE \
40630                 (UINT32_C(0x2) << 2)
40631         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST \
40632                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE
40633         uint32_t        enables;
40634         /*
40635          * This bit must be '1' for the dst_id field to be
40636          * configured.
40637          */
40638         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID \
40639                 UINT32_C(0x1)
40640         /*
40641          * This bit must be '1' for the new_mirror_vnic_id field to be
40642          * configured.
40643          */
40644         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
40645                 UINT32_C(0x2)
40646         /*
40647          * This value identifies a set of CFA data structures used for an L2
40648          * context.
40649          */
40650         uint64_t        l2_filter_id;
40651         /*
40652          * If set, this value shall represent the
40653          * Logical VNIC ID of the destination VNIC for the RX
40654          * path and network port id of the destination port for
40655          * the TX path.
40656          */
40657         uint32_t        dst_id;
40658         /*
40659          * New Logical VNIC ID of the VNIC where traffic is
40660          * mirrored.
40661          */
40662         uint32_t        new_mirror_vnic_id;
40663 } __rte_packed;
40664
40665 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
40666 struct hwrm_cfa_l2_filter_cfg_output {
40667         /* The specific error status for the command. */
40668         uint16_t        error_code;
40669         /* The HWRM command request type. */
40670         uint16_t        req_type;
40671         /* The sequence ID from the original command. */
40672         uint16_t        seq_id;
40673         /* The length of the response data in number of bytes. */
40674         uint16_t        resp_len;
40675         uint8_t unused_0[7];
40676         /*
40677          * This field is used in Output records to indicate that the output
40678          * is completely written to RAM. This field should be read as '1'
40679          * to indicate that the output has been completely written.
40680          * When writing a command completion or response to an internal
40681          * processor, the order of writes has to be such that this field is
40682          * written last.
40683          */
40684         uint8_t valid;
40685 } __rte_packed;
40686
40687 /***************************
40688  * hwrm_cfa_l2_set_rx_mask *
40689  ***************************/
40690
40691
40692 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
40693 struct hwrm_cfa_l2_set_rx_mask_input {
40694         /* The HWRM command request type. */
40695         uint16_t        req_type;
40696         /*
40697          * The completion ring to send the completion event on. This should
40698          * be the NQ ID returned from the `nq_alloc` HWRM command.
40699          */
40700         uint16_t        cmpl_ring;
40701         /*
40702          * The sequence ID is used by the driver for tracking multiple
40703          * commands. This ID is treated as opaque data by the firmware and
40704          * the value is returned in the `hwrm_resp_hdr` upon completion.
40705          */
40706         uint16_t        seq_id;
40707         /*
40708          * The target ID of the command:
40709          * * 0x0-0xFFF8 - The function ID
40710          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40711          * * 0xFFFD - Reserved for user-space HWRM interface
40712          * * 0xFFFF - HWRM
40713          */
40714         uint16_t        target_id;
40715         /*
40716          * A physical address pointer pointing to a host buffer that the
40717          * command's response data will be written. This can be either a host
40718          * physical address (HPA) or a guest physical address (GPA) and must
40719          * point to a physically contiguous block of memory.
40720          */
40721         uint64_t        resp_addr;
40722         /* VNIC ID */
40723         uint32_t        vnic_id;
40724         uint32_t        mask;
40725         /*
40726          * When this bit is '1', the function is requested to accept
40727          * multi-cast packets specified by the multicast addr table.
40728          */
40729         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST \
40730                 UINT32_C(0x2)
40731         /*
40732          * When this bit is '1', the function is requested to accept
40733          * all multi-cast packets.
40734          */
40735         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST \
40736                 UINT32_C(0x4)
40737         /*
40738          * When this bit is '1', the function is requested to accept
40739          * broadcast packets.
40740          */
40741         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST \
40742                 UINT32_C(0x8)
40743         /*
40744          * When this bit is '1', the function is requested to be
40745          * put in the promiscuous mode.
40746          *
40747          * The HWRM should accept any function to set up
40748          * promiscuous mode.
40749          *
40750          * The HWRM shall follow the semantics below for the
40751          * promiscuous mode support.
40752          * # When partitioning is not enabled on a port
40753          * (i.e. single PF on the port), then the PF shall
40754          * be allowed to be in the promiscuous mode. When the
40755          * PF is in the promiscuous mode, then it shall
40756          * receive all host bound traffic on that port.
40757          * # When partitioning is enabled on a port
40758          * (i.e. multiple PFs per port) and a PF on that
40759          * port is in the promiscuous mode, then the PF
40760          * receives all traffic within that partition as
40761          * identified by a unique identifier for the
40762          * PF (e.g. S-Tag). If a unique outer VLAN
40763          * for the PF is specified, then the setting of
40764          * promiscuous mode on that PF shall result in the
40765          * PF receiving all host bound traffic with matching
40766          * outer VLAN.
40767          * # A VF shall can be set in the promiscuous mode.
40768          * In the promiscuous mode, the VF does not receive any
40769          * traffic unless a unique outer VLAN for the
40770          * VF is specified. If a unique outer VLAN
40771          * for the VF is specified, then the setting of
40772          * promiscuous mode on that VF shall result in the
40773          * VF receiving all host bound traffic with the
40774          * matching outer VLAN.
40775          * # The HWRM shall allow the setting of promiscuous
40776          * mode on a function independently from the
40777          * promiscuous mode settings on other functions.
40778          */
40779         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS \
40780                 UINT32_C(0x10)
40781         /*
40782          * If this flag is set, the corresponding RX
40783          * filters shall be set up to cover multicast/broadcast
40784          * filters for the outermost Layer 2 destination MAC
40785          * address field.
40786          */
40787         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST \
40788                 UINT32_C(0x20)
40789         /*
40790          * If this flag is set, the corresponding RX
40791          * filters shall be set up to cover multicast/broadcast
40792          * filters for the VLAN-tagged packets that match the
40793          * TPID and VID fields of VLAN tags in the VLAN tag
40794          * table specified in this command.
40795          */
40796         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY \
40797                 UINT32_C(0x40)
40798         /*
40799          * If this flag is set, the corresponding RX
40800          * filters shall be set up to cover multicast/broadcast
40801          * filters for non-VLAN tagged packets and VLAN-tagged
40802          * packets that match the TPID and VID fields of VLAN
40803          * tags in the VLAN tag table specified in this command.
40804          */
40805         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN \
40806                 UINT32_C(0x80)
40807         /*
40808          * If this flag is set, the corresponding RX
40809          * filters shall be set up to cover multicast/broadcast
40810          * filters for non-VLAN tagged packets and VLAN-tagged
40811          * packets matching any VLAN tag.
40812          *
40813          * If this flag is set, then the HWRM shall ignore
40814          * VLAN tags specified in vlan_tag_tbl.
40815          *
40816          * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
40817          * flags is set, then the HWRM shall ignore
40818          * VLAN tags specified in vlan_tag_tbl.
40819          *
40820          * The HWRM client shall set at most one flag out of
40821          * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
40822          */
40823         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
40824                 UINT32_C(0x100)
40825         /* This is the address for mcast address tbl. */
40826         uint64_t        mc_tbl_addr;
40827         /*
40828          * This value indicates how many entries in mc_tbl are valid.
40829          * Each entry is 6 bytes.
40830          */
40831         uint32_t        num_mc_entries;
40832         uint8_t unused_0[4];
40833         /*
40834          * This is the address for VLAN tag table.
40835          * Each VLAN entry in the table is 4 bytes of a VLAN tag
40836          * including TPID, PCP, DEI, and VID fields in network byte
40837          * order.
40838          */
40839         uint64_t        vlan_tag_tbl_addr;
40840         /*
40841          * This value indicates how many entries in vlan_tag_tbl are
40842          * valid. Each entry is 4 bytes.
40843          */
40844         uint32_t        num_vlan_tags;
40845         uint8_t unused_1[4];
40846 } __rte_packed;
40847
40848 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
40849 struct hwrm_cfa_l2_set_rx_mask_output {
40850         /* The specific error status for the command. */
40851         uint16_t        error_code;
40852         /* The HWRM command request type. */
40853         uint16_t        req_type;
40854         /* The sequence ID from the original command. */
40855         uint16_t        seq_id;
40856         /* The length of the response data in number of bytes. */
40857         uint16_t        resp_len;
40858         uint8_t unused_0[7];
40859         /*
40860          * This field is used in Output records to indicate that the output
40861          * is completely written to RAM. This field should be read as '1'
40862          * to indicate that the output has been completely written.
40863          * When writing a command completion or response to an internal
40864          * processor, the order of writes has to be such that this field is
40865          * written last.
40866          */
40867         uint8_t valid;
40868 } __rte_packed;
40869
40870 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
40871 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
40872         /*
40873          * command specific error codes that goes to
40874          * the cmd_err field in Common HWRM Error Response.
40875          */
40876         uint8_t code;
40877         /* Unknown error */
40878         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN \
40879                 UINT32_C(0x0)
40880         /* Unable to complete operation due to conflict with Ntuple Filter */
40881         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR \
40882                 UINT32_C(0x1)
40883         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST \
40884                 HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
40885         uint8_t unused_0[7];
40886 } __rte_packed;
40887
40888 /*******************************
40889  * hwrm_cfa_vlan_antispoof_cfg *
40890  *******************************/
40891
40892
40893 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
40894 struct hwrm_cfa_vlan_antispoof_cfg_input {
40895         /* The HWRM command request type. */
40896         uint16_t        req_type;
40897         /*
40898          * The completion ring to send the completion event on. This should
40899          * be the NQ ID returned from the `nq_alloc` HWRM command.
40900          */
40901         uint16_t        cmpl_ring;
40902         /*
40903          * The sequence ID is used by the driver for tracking multiple
40904          * commands. This ID is treated as opaque data by the firmware and
40905          * the value is returned in the `hwrm_resp_hdr` upon completion.
40906          */
40907         uint16_t        seq_id;
40908         /*
40909          * The target ID of the command:
40910          * * 0x0-0xFFF8 - The function ID
40911          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40912          * * 0xFFFD - Reserved for user-space HWRM interface
40913          * * 0xFFFF - HWRM
40914          */
40915         uint16_t        target_id;
40916         /*
40917          * A physical address pointer pointing to a host buffer that the
40918          * command's response data will be written. This can be either a host
40919          * physical address (HPA) or a guest physical address (GPA) and must
40920          * point to a physically contiguous block of memory.
40921          */
40922         uint64_t        resp_addr;
40923         /*
40924          * Function ID of the function that is being configured.
40925          * Only valid for a VF FID configured by the PF.
40926          */
40927         uint16_t        fid;
40928         uint8_t unused_0[2];
40929         /* Number of VLAN entries in the vlan_tag_mask_tbl. */
40930         uint32_t        num_vlan_entries;
40931         /*
40932          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
40933          * antispoof table. Each table entry contains the 16-bit TPID
40934          * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
40935          * all in network order to match hwrm_cfa_l2_set_rx_mask.
40936          * For an individual VLAN entry, the mask value should be 0xfff
40937          * for the 12-bit VLAN ID.
40938          */
40939         uint64_t        vlan_tag_mask_tbl_addr;
40940 } __rte_packed;
40941
40942 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
40943 struct hwrm_cfa_vlan_antispoof_cfg_output {
40944         /* The specific error status for the command. */
40945         uint16_t        error_code;
40946         /* The HWRM command request type. */
40947         uint16_t        req_type;
40948         /* The sequence ID from the original command. */
40949         uint16_t        seq_id;
40950         /* The length of the response data in number of bytes. */
40951         uint16_t        resp_len;
40952         uint8_t unused_0[7];
40953         /*
40954          * This field is used in Output records to indicate that the output
40955          * is completely written to RAM. This field should be read as '1'
40956          * to indicate that the output has been completely written.
40957          * When writing a command completion or response to an internal
40958          * processor, the order of writes has to be such that this field is
40959          * written last.
40960          */
40961         uint8_t valid;
40962 } __rte_packed;
40963
40964 /********************************
40965  * hwrm_cfa_vlan_antispoof_qcfg *
40966  ********************************/
40967
40968
40969 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
40970 struct hwrm_cfa_vlan_antispoof_qcfg_input {
40971         /* The HWRM command request type. */
40972         uint16_t        req_type;
40973         /*
40974          * The completion ring to send the completion event on. This should
40975          * be the NQ ID returned from the `nq_alloc` HWRM command.
40976          */
40977         uint16_t        cmpl_ring;
40978         /*
40979          * The sequence ID is used by the driver for tracking multiple
40980          * commands. This ID is treated as opaque data by the firmware and
40981          * the value is returned in the `hwrm_resp_hdr` upon completion.
40982          */
40983         uint16_t        seq_id;
40984         /*
40985          * The target ID of the command:
40986          * * 0x0-0xFFF8 - The function ID
40987          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40988          * * 0xFFFD - Reserved for user-space HWRM interface
40989          * * 0xFFFF - HWRM
40990          */
40991         uint16_t        target_id;
40992         /*
40993          * A physical address pointer pointing to a host buffer that the
40994          * command's response data will be written. This can be either a host
40995          * physical address (HPA) or a guest physical address (GPA) and must
40996          * point to a physically contiguous block of memory.
40997          */
40998         uint64_t        resp_addr;
40999         /*
41000          * Function ID of the function that is being queried.
41001          * Only valid for a VF FID queried by the PF.
41002          */
41003         uint16_t        fid;
41004         uint8_t unused_0[2];
41005         /*
41006          * Maximum number of VLAN entries the firmware is allowed to DMA
41007          * to vlan_tag_mask_tbl.
41008          */
41009         uint32_t        max_vlan_entries;
41010         /*
41011          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
41012          * antispoof table to which firmware will DMA to. Each table
41013          * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
41014          * 16-bit VLAN ID, and a 16-bit mask, all in network order to
41015          * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
41016          * the mask value should be 0xfff for the 12-bit VLAN ID.
41017          */
41018         uint64_t        vlan_tag_mask_tbl_addr;
41019 } __rte_packed;
41020
41021 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
41022 struct hwrm_cfa_vlan_antispoof_qcfg_output {
41023         /* The specific error status for the command. */
41024         uint16_t        error_code;
41025         /* The HWRM command request type. */
41026         uint16_t        req_type;
41027         /* The sequence ID from the original command. */
41028         uint16_t        seq_id;
41029         /* The length of the response data in number of bytes. */
41030         uint16_t        resp_len;
41031         /* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
41032         uint32_t        num_vlan_entries;
41033         uint8_t unused_0[3];
41034         /*
41035          * This field is used in Output records to indicate that the output
41036          * is completely written to RAM. This field should be read as '1'
41037          * to indicate that the output has been completely written.
41038          * When writing a command completion or response to an internal
41039          * processor, the order of writes has to be such that this field is
41040          * written last.
41041          */
41042         uint8_t valid;
41043 } __rte_packed;
41044
41045 /********************************
41046  * hwrm_cfa_tunnel_filter_alloc *
41047  ********************************/
41048
41049
41050 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */
41051 struct hwrm_cfa_tunnel_filter_alloc_input {
41052         /* The HWRM command request type. */
41053         uint16_t        req_type;
41054         /*
41055          * The completion ring to send the completion event on. This should
41056          * be the NQ ID returned from the `nq_alloc` HWRM command.
41057          */
41058         uint16_t        cmpl_ring;
41059         /*
41060          * The sequence ID is used by the driver for tracking multiple
41061          * commands. This ID is treated as opaque data by the firmware and
41062          * the value is returned in the `hwrm_resp_hdr` upon completion.
41063          */
41064         uint16_t        seq_id;
41065         /*
41066          * The target ID of the command:
41067          * * 0x0-0xFFF8 - The function ID
41068          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41069          * * 0xFFFD - Reserved for user-space HWRM interface
41070          * * 0xFFFF - HWRM
41071          */
41072         uint16_t        target_id;
41073         /*
41074          * A physical address pointer pointing to a host buffer that the
41075          * command's response data will be written. This can be either a host
41076          * physical address (HPA) or a guest physical address (GPA) and must
41077          * point to a physically contiguous block of memory.
41078          */
41079         uint64_t        resp_addr;
41080         uint32_t        flags;
41081         /*
41082          * Setting of this flag indicates the applicability to the loopback
41083          * path.
41084          */
41085         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
41086                 UINT32_C(0x1)
41087         uint32_t        enables;
41088         /*
41089          * This bit must be '1' for the l2_filter_id field to be
41090          * configured.
41091          */
41092         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
41093                 UINT32_C(0x1)
41094         /*
41095          * This bit must be '1' for the l2_addr field to be
41096          * configured.
41097          */
41098         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
41099                 UINT32_C(0x2)
41100         /*
41101          * This bit must be '1' for the l2_ivlan field to be
41102          * configured.
41103          */
41104         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
41105                 UINT32_C(0x4)
41106         /*
41107          * This bit must be '1' for the l3_addr field to be
41108          * configured.
41109          */
41110         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR \
41111                 UINT32_C(0x8)
41112         /*
41113          * This bit must be '1' for the l3_addr_type field to be
41114          * configured.
41115          */
41116         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE \
41117                 UINT32_C(0x10)
41118         /*
41119          * This bit must be '1' for the t_l3_addr_type field to be
41120          * configured.
41121          */
41122         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE \
41123                 UINT32_C(0x20)
41124         /*
41125          * This bit must be '1' for the t_l3_addr field to be
41126          * configured.
41127          */
41128         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR \
41129                 UINT32_C(0x40)
41130         /*
41131          * This bit must be '1' for the tunnel_type field to be
41132          * configured.
41133          */
41134         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
41135                 UINT32_C(0x80)
41136         /*
41137          * This bit must be '1' for the vni field to be
41138          * configured.
41139          */
41140         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI \
41141                 UINT32_C(0x100)
41142         /*
41143          * This bit must be '1' for the dst_vnic_id field to be
41144          * configured.
41145          */
41146         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID \
41147                 UINT32_C(0x200)
41148         /*
41149          * This bit must be '1' for the mirror_vnic_id field to be
41150          * configured.
41151          */
41152         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
41153                 UINT32_C(0x400)
41154         /*
41155          * This value identifies a set of CFA data structures used for an L2
41156          * context.
41157          */
41158         uint64_t        l2_filter_id;
41159         /*
41160          * This value sets the match value for the inner L2
41161          * MAC address.
41162          * Destination MAC address for RX path.
41163          * Source MAC address for TX path.
41164          */
41165         uint8_t l2_addr[6];
41166         /*
41167          * This value sets VLAN ID value for inner VLAN.
41168          * Only 12-bits of VLAN ID are used in setting the filter.
41169          */
41170         uint16_t        l2_ivlan;
41171         /*
41172          * The value of inner destination IP address to be used in filtering.
41173          * For IPv4, first four bytes represent the IP address.
41174          */
41175         uint32_t        l3_addr[4];
41176         /*
41177          * The value of tunnel destination IP address to be used in filtering.
41178          * For IPv4, first four bytes represent the IP address.
41179          */
41180         uint32_t        t_l3_addr[4];
41181         /*
41182          * This value indicates the type of inner IP address.
41183          * 4 - IPv4
41184          * 6 - IPv6
41185          * All others are invalid.
41186          */
41187         uint8_t l3_addr_type;
41188         /*
41189          * This value indicates the type of tunnel IP address.
41190          * 4 - IPv4
41191          * 6 - IPv6
41192          * All others are invalid.
41193          */
41194         uint8_t t_l3_addr_type;
41195         /* Tunnel Type. */
41196         uint8_t tunnel_type;
41197         /* Non-tunnel */
41198         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
41199                 UINT32_C(0x0)
41200         /* Virtual eXtensible Local Area Network (VXLAN) */
41201         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
41202                 UINT32_C(0x1)
41203         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
41204         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
41205                 UINT32_C(0x2)
41206         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
41207         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
41208                 UINT32_C(0x3)
41209         /* IP in IP */
41210         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
41211                 UINT32_C(0x4)
41212         /* Generic Network Virtualization Encapsulation (Geneve) */
41213         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
41214                 UINT32_C(0x5)
41215         /* Multi-Protocol Label Switching (MPLS) */
41216         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
41217                 UINT32_C(0x6)
41218         /* Stateless Transport Tunnel (STT) */
41219         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
41220                 UINT32_C(0x7)
41221         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
41222         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
41223                 UINT32_C(0x8)
41224         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
41225         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
41226                 UINT32_C(0x9)
41227         /*
41228          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
41229          * datagram payload
41230          */
41231         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
41232                 UINT32_C(0xa)
41233         /* Use fixed layer 2 ether type of 0xFFFF */
41234         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
41235                 UINT32_C(0xb)
41236         /*
41237          * IPV6 over virtual eXtensible Local Area Network with GPE header
41238          * (IPV6oVXLANGPE)
41239          */
41240         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
41241                 UINT32_C(0xc)
41242         /* Any tunneled traffic */
41243         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
41244                 UINT32_C(0xff)
41245         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
41246                 HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
41247         /*
41248          * tunnel_flags allows the user to indicate the tunnel tag detection
41249          * for the tunnel type specified in tunnel_type.
41250          */
41251         uint8_t tunnel_flags;
41252         /*
41253          * If the tunnel_type is geneve, then this bit indicates if we
41254          * need to match the geneve OAM packet.
41255          * If the tunnel_type is nvgre or gre, then this bit indicates if
41256          * we need to detect checksum present bit in geneve header.
41257          * If the tunnel_type is mpls, then this bit indicates if we need
41258          * to match mpls packet with explicit IPV4/IPV6 null header.
41259          */
41260         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR \
41261                 UINT32_C(0x1)
41262         /*
41263          * If the tunnel_type is geneve, then this bit indicates if we
41264          * need to detect the critical option bit set in the oam packet.
41265          * If the tunnel_type is nvgre or gre, then this bit indicates
41266          * if we need to match nvgre packets with key present bit set in
41267          * gre header.
41268          * If the tunnel_type is mpls, then this bit indicates if we
41269          * need to match mpls packet with S bit from inner/second label.
41270          */
41271         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1 \
41272                 UINT32_C(0x2)
41273         /*
41274          * If the tunnel_type is geneve, then this bit indicates if we
41275          * need to match geneve packet with extended header bit set in
41276          * geneve header.
41277          * If the tunnel_type is nvgre or gre, then this bit indicates
41278          * if we need to match nvgre packets with sequence number
41279          * present bit set in gre header.
41280          * If the tunnel_type is mpls, then this bit indicates if we
41281          * need to match mpls packet with S bit from out/first label.
41282          */
41283         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0 \
41284                 UINT32_C(0x4)
41285         /*
41286          * Virtual Network Identifier (VNI). Only valid with
41287          * tunnel_types VXLAN, NVGRE, and Geneve.
41288          * Only lower 24-bits of VNI field are used
41289          * in setting up the filter.
41290          */
41291         uint32_t        vni;
41292         /* Logical VNIC ID of the destination VNIC. */
41293         uint32_t        dst_vnic_id;
41294         /*
41295          * Logical VNIC ID of the VNIC where traffic is
41296          * mirrored.
41297          */
41298         uint32_t        mirror_vnic_id;
41299 } __rte_packed;
41300
41301 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
41302 struct hwrm_cfa_tunnel_filter_alloc_output {
41303         /* The specific error status for the command. */
41304         uint16_t        error_code;
41305         /* The HWRM command request type. */
41306         uint16_t        req_type;
41307         /* The sequence ID from the original command. */
41308         uint16_t        seq_id;
41309         /* The length of the response data in number of bytes. */
41310         uint16_t        resp_len;
41311         /* This value is an opaque id into CFA data structures. */
41312         uint64_t        tunnel_filter_id;
41313         /*
41314          * The flow id value in bit 0-29 is the actual ID of the flow
41315          * associated with this filter and it shall be used to match
41316          * and associate the flow identifier returned in completion
41317          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
41318          * shall indicate no valid flow id.
41319          */
41320         uint32_t        flow_id;
41321         /* Indicate the flow id value. */
41322         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
41323                 UINT32_C(0x3fffffff)
41324         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
41325         /* Indicate type of the flow. */
41326         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
41327                 UINT32_C(0x40000000)
41328         /*
41329          * If this bit set to 0, then it indicates that the flow is
41330          * internal flow.
41331          */
41332         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
41333                 (UINT32_C(0x0) << 30)
41334         /*
41335          * If this bit is set to 1, then it indicates that the flow is
41336          * external flow.
41337          */
41338         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
41339                 (UINT32_C(0x1) << 30)
41340         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
41341                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
41342         /* Indicate the flow direction. */
41343         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
41344                 UINT32_C(0x80000000)
41345         /* If this bit set to 0, then it indicates rx flow. */
41346         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
41347                 (UINT32_C(0x0) << 31)
41348         /* If this bit is set to 1, then it indicates that tx flow. */
41349         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
41350                 (UINT32_C(0x1) << 31)
41351         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
41352                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
41353         uint8_t unused_0[3];
41354         /*
41355          * This field is used in Output records to indicate that the output
41356          * is completely written to RAM. This field should be read as '1'
41357          * to indicate that the output has been completely written.
41358          * When writing a command completion or response to an internal
41359          * processor, the order of writes has to be such that this field is
41360          * written last.
41361          */
41362         uint8_t valid;
41363 } __rte_packed;
41364
41365 /*******************************
41366  * hwrm_cfa_tunnel_filter_free *
41367  *******************************/
41368
41369
41370 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */
41371 struct hwrm_cfa_tunnel_filter_free_input {
41372         /* The HWRM command request type. */
41373         uint16_t        req_type;
41374         /*
41375          * The completion ring to send the completion event on. This should
41376          * be the NQ ID returned from the `nq_alloc` HWRM command.
41377          */
41378         uint16_t        cmpl_ring;
41379         /*
41380          * The sequence ID is used by the driver for tracking multiple
41381          * commands. This ID is treated as opaque data by the firmware and
41382          * the value is returned in the `hwrm_resp_hdr` upon completion.
41383          */
41384         uint16_t        seq_id;
41385         /*
41386          * The target ID of the command:
41387          * * 0x0-0xFFF8 - The function ID
41388          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41389          * * 0xFFFD - Reserved for user-space HWRM interface
41390          * * 0xFFFF - HWRM
41391          */
41392         uint16_t        target_id;
41393         /*
41394          * A physical address pointer pointing to a host buffer that the
41395          * command's response data will be written. This can be either a host
41396          * physical address (HPA) or a guest physical address (GPA) and must
41397          * point to a physically contiguous block of memory.
41398          */
41399         uint64_t        resp_addr;
41400         /* This value is an opaque id into CFA data structures. */
41401         uint64_t        tunnel_filter_id;
41402 } __rte_packed;
41403
41404 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
41405 struct hwrm_cfa_tunnel_filter_free_output {
41406         /* The specific error status for the command. */
41407         uint16_t        error_code;
41408         /* The HWRM command request type. */
41409         uint16_t        req_type;
41410         /* The sequence ID from the original command. */
41411         uint16_t        seq_id;
41412         /* The length of the response data in number of bytes. */
41413         uint16_t        resp_len;
41414         uint8_t unused_0[7];
41415         /*
41416          * This field is used in Output records to indicate that the output
41417          * is completely written to RAM. This field should be read as '1'
41418          * to indicate that the output has been completely written.
41419          * When writing a command completion or response to an internal
41420          * processor, the order of writes has to be such that this field is
41421          * written last.
41422          */
41423         uint8_t valid;
41424 } __rte_packed;
41425
41426 /***************************************
41427  * hwrm_cfa_redirect_tunnel_type_alloc *
41428  ***************************************/
41429
41430
41431 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */
41432 struct hwrm_cfa_redirect_tunnel_type_alloc_input {
41433         /* The HWRM command request type. */
41434         uint16_t        req_type;
41435         /*
41436          * The completion ring to send the completion event on. This should
41437          * be the NQ ID returned from the `nq_alloc` HWRM command.
41438          */
41439         uint16_t        cmpl_ring;
41440         /*
41441          * The sequence ID is used by the driver for tracking multiple
41442          * commands. This ID is treated as opaque data by the firmware and
41443          * the value is returned in the `hwrm_resp_hdr` upon completion.
41444          */
41445         uint16_t        seq_id;
41446         /*
41447          * The target ID of the command:
41448          * * 0x0-0xFFF8 - The function ID
41449          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41450          * * 0xFFFD - Reserved for user-space HWRM interface
41451          * * 0xFFFF - HWRM
41452          */
41453         uint16_t        target_id;
41454         /*
41455          * A physical address pointer pointing to a host buffer that the
41456          * command's response data will be written. This can be either a host
41457          * physical address (HPA) or a guest physical address (GPA) and must
41458          * point to a physically contiguous block of memory.
41459          */
41460         uint64_t        resp_addr;
41461         /* The destination function id, to whom the traffic is redirected. */
41462         uint16_t        dest_fid;
41463         /* Tunnel Type. */
41464         uint8_t tunnel_type;
41465         /* Non-tunnel */
41466         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
41467                 UINT32_C(0x0)
41468         /* Virtual eXtensible Local Area Network (VXLAN) */
41469         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
41470                 UINT32_C(0x1)
41471         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
41472         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
41473                 UINT32_C(0x2)
41474         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
41475         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
41476                 UINT32_C(0x3)
41477         /* IP in IP */
41478         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
41479                 UINT32_C(0x4)
41480         /* Generic Network Virtualization Encapsulation (Geneve) */
41481         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
41482                 UINT32_C(0x5)
41483         /* Multi-Protocol Label Switching (MPLS) */
41484         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
41485                 UINT32_C(0x6)
41486         /* Stateless Transport Tunnel (STT) */
41487         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT \
41488                 UINT32_C(0x7)
41489         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
41490         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
41491                 UINT32_C(0x8)
41492         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
41493         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
41494                 UINT32_C(0x9)
41495         /*
41496          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
41497          * datagram payload
41498          */
41499         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
41500                 UINT32_C(0xa)
41501         /* Use fixed layer 2 ether type of 0xFFFF */
41502         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
41503                 UINT32_C(0xb)
41504         /*
41505          * IPV6 over virtual eXtensible Local Area Network with GPE header
41506          * (IPV6oVXLANGPE)
41507          */
41508         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
41509                 UINT32_C(0xc)
41510         /* Any tunneled traffic */
41511         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
41512                 UINT32_C(0xff)
41513         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST \
41514                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
41515         /* Tunnel alloc flags. */
41516         uint8_t flags;
41517         /*
41518          * Setting of this flag indicates modify existing redirect tunnel
41519          * to new destination function ID.
41520          */
41521         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST \
41522                 UINT32_C(0x1)
41523         uint8_t unused_0[4];
41524 } __rte_packed;
41525
41526 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
41527 struct hwrm_cfa_redirect_tunnel_type_alloc_output {
41528         /* The specific error status for the command. */
41529         uint16_t        error_code;
41530         /* The HWRM command request type. */
41531         uint16_t        req_type;
41532         /* The sequence ID from the original command. */
41533         uint16_t        seq_id;
41534         /* The length of the response data in number of bytes. */
41535         uint16_t        resp_len;
41536         uint8_t unused_0[7];
41537         /*
41538          * This field is used in Output records to indicate that the output
41539          * is completely written to RAM. This field should be read as '1'
41540          * to indicate that the output has been completely written.
41541          * When writing a command completion or response to an internal
41542          * processor, the order of writes has to be such that this field is
41543          * written last.
41544          */
41545         uint8_t valid;
41546 } __rte_packed;
41547
41548 /**************************************
41549  * hwrm_cfa_redirect_tunnel_type_free *
41550  **************************************/
41551
41552
41553 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */
41554 struct hwrm_cfa_redirect_tunnel_type_free_input {
41555         /* The HWRM command request type. */
41556         uint16_t        req_type;
41557         /*
41558          * The completion ring to send the completion event on. This should
41559          * be the NQ ID returned from the `nq_alloc` HWRM command.
41560          */
41561         uint16_t        cmpl_ring;
41562         /*
41563          * The sequence ID is used by the driver for tracking multiple
41564          * commands. This ID is treated as opaque data by the firmware and
41565          * the value is returned in the `hwrm_resp_hdr` upon completion.
41566          */
41567         uint16_t        seq_id;
41568         /*
41569          * The target ID of the command:
41570          * * 0x0-0xFFF8 - The function ID
41571          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41572          * * 0xFFFD - Reserved for user-space HWRM interface
41573          * * 0xFFFF - HWRM
41574          */
41575         uint16_t        target_id;
41576         /*
41577          * A physical address pointer pointing to a host buffer that the
41578          * command's response data will be written. This can be either a host
41579          * physical address (HPA) or a guest physical address (GPA) and must
41580          * point to a physically contiguous block of memory.
41581          */
41582         uint64_t        resp_addr;
41583         /* The destination function id, to whom the traffic is redirected. */
41584         uint16_t        dest_fid;
41585         /* Tunnel Type. */
41586         uint8_t tunnel_type;
41587         /* Non-tunnel */
41588         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL \
41589                 UINT32_C(0x0)
41590         /* Virtual eXtensible Local Area Network (VXLAN) */
41591         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN \
41592                 UINT32_C(0x1)
41593         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
41594         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE \
41595                 UINT32_C(0x2)
41596         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
41597         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE \
41598                 UINT32_C(0x3)
41599         /* IP in IP */
41600         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP \
41601                 UINT32_C(0x4)
41602         /* Generic Network Virtualization Encapsulation (Geneve) */
41603         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE \
41604                 UINT32_C(0x5)
41605         /* Multi-Protocol Label Switching (MPLS) */
41606         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS \
41607                 UINT32_C(0x6)
41608         /* Stateless Transport Tunnel (STT) */
41609         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT \
41610                 UINT32_C(0x7)
41611         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
41612         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE \
41613                 UINT32_C(0x8)
41614         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
41615         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
41616                 UINT32_C(0x9)
41617         /*
41618          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
41619          * datagram payload
41620          */
41621         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
41622                 UINT32_C(0xa)
41623         /* Use fixed layer 2 ether type of 0xFFFF */
41624         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
41625                 UINT32_C(0xb)
41626         /*
41627          * IPV6 over virtual eXtensible Local Area Network with GPE header
41628          * (IPV6oVXLANGPE)
41629          */
41630         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
41631                 UINT32_C(0xc)
41632         /* Any tunneled traffic */
41633         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL \
41634                 UINT32_C(0xff)
41635         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST \
41636                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
41637         uint8_t unused_0[5];
41638 } __rte_packed;
41639
41640 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
41641 struct hwrm_cfa_redirect_tunnel_type_free_output {
41642         /* The specific error status for the command. */
41643         uint16_t        error_code;
41644         /* The HWRM command request type. */
41645         uint16_t        req_type;
41646         /* The sequence ID from the original command. */
41647         uint16_t        seq_id;
41648         /* The length of the response data in number of bytes. */
41649         uint16_t        resp_len;
41650         uint8_t unused_0[7];
41651         /*
41652          * This field is used in Output records to indicate that the output
41653          * is completely written to RAM. This field should be read as '1'
41654          * to indicate that the output has been completely written.
41655          * When writing a command completion or response to an internal
41656          * processor, the order of writes has to be such that this field is
41657          * written last.
41658          */
41659         uint8_t valid;
41660 } __rte_packed;
41661
41662 /**************************************
41663  * hwrm_cfa_redirect_tunnel_type_info *
41664  **************************************/
41665
41666
41667 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */
41668 struct hwrm_cfa_redirect_tunnel_type_info_input {
41669         /* The HWRM command request type. */
41670         uint16_t        req_type;
41671         /*
41672          * The completion ring to send the completion event on. This should
41673          * be the NQ ID returned from the `nq_alloc` HWRM command.
41674          */
41675         uint16_t        cmpl_ring;
41676         /*
41677          * The sequence ID is used by the driver for tracking multiple
41678          * commands. This ID is treated as opaque data by the firmware and
41679          * the value is returned in the `hwrm_resp_hdr` upon completion.
41680          */
41681         uint16_t        seq_id;
41682         /*
41683          * The target ID of the command:
41684          * * 0x0-0xFFF8 - The function ID
41685          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41686          * * 0xFFFD - Reserved for user-space HWRM interface
41687          * * 0xFFFF - HWRM
41688          */
41689         uint16_t        target_id;
41690         /*
41691          * A physical address pointer pointing to a host buffer that the
41692          * command's response data will be written. This can be either a host
41693          * physical address (HPA) or a guest physical address (GPA) and must
41694          * point to a physically contiguous block of memory.
41695          */
41696         uint64_t        resp_addr;
41697         /* The source function id. */
41698         uint16_t        src_fid;
41699         /* Tunnel Type. */
41700         uint8_t tunnel_type;
41701         /* Non-tunnel */
41702         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL \
41703                 UINT32_C(0x0)
41704         /* Virtual eXtensible Local Area Network (VXLAN) */
41705         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN \
41706                 UINT32_C(0x1)
41707         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
41708         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE \
41709                 UINT32_C(0x2)
41710         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
41711         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE \
41712                 UINT32_C(0x3)
41713         /* IP in IP */
41714         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP \
41715                 UINT32_C(0x4)
41716         /* Generic Network Virtualization Encapsulation (Geneve) */
41717         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE \
41718                 UINT32_C(0x5)
41719         /* Multi-Protocol Label Switching (MPLS) */
41720         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS \
41721                 UINT32_C(0x6)
41722         /* Stateless Transport Tunnel (STT) */
41723         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT \
41724                 UINT32_C(0x7)
41725         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
41726         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE \
41727                 UINT32_C(0x8)
41728         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
41729         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4 \
41730                 UINT32_C(0x9)
41731         /*
41732          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
41733          * datagram payload
41734          */
41735         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1 \
41736                 UINT32_C(0xa)
41737         /* Use fixed layer 2 ether type of 0xFFFF */
41738         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2_ETYPE \
41739                 UINT32_C(0xb)
41740         /*
41741          * IPV6 over virtual eXtensible Local Area Network with GPE header
41742          * (IPV6oVXLANGPE)
41743          */
41744         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
41745                 UINT32_C(0xc)
41746         /* Any tunneled traffic */
41747         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL \
41748                 UINT32_C(0xff)
41749         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST \
41750                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
41751         uint8_t unused_0[5];
41752 } __rte_packed;
41753
41754 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
41755 struct hwrm_cfa_redirect_tunnel_type_info_output {
41756         /* The specific error status for the command. */
41757         uint16_t        error_code;
41758         /* The HWRM command request type. */
41759         uint16_t        req_type;
41760         /* The sequence ID from the original command. */
41761         uint16_t        seq_id;
41762         /* The length of the response data in number of bytes. */
41763         uint16_t        resp_len;
41764         /* The destination function id, to whom the traffic is redirected. */
41765         uint16_t        dest_fid;
41766         uint8_t unused_0[5];
41767         /*
41768          * This field is used in Output records to indicate that the output
41769          * is completely written to RAM. This field should be read as '1'
41770          * to indicate that the output has been completely written.
41771          * When writing a command completion or response to an internal
41772          * processor, the order of writes has to be such that this field is
41773          * written last.
41774          */
41775         uint8_t valid;
41776 } __rte_packed;
41777
41778 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
41779 struct hwrm_vxlan_ipv4_hdr {
41780         /* IPv4 version and header length. */
41781         uint8_t ver_hlen;
41782         /* IPv4 header length */
41783         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf)
41784         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0
41785         /* Version */
41786         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK      UINT32_C(0xf0)
41787         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT       4
41788         /* IPv4 type of service. */
41789         uint8_t tos;
41790         /* IPv4 identification. */
41791         uint16_t        ip_id;
41792         /* IPv4 flags and offset. */
41793         uint16_t        flags_frag_offset;
41794         /* IPv4 TTL. */
41795         uint8_t ttl;
41796         /* IPv4 protocol. */
41797         uint8_t protocol;
41798         /* IPv4 source address. */
41799         uint32_t        src_ip_addr;
41800         /* IPv4 destination address. */
41801         uint32_t        dest_ip_addr;
41802 } __rte_packed;
41803
41804 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
41805 struct hwrm_vxlan_ipv6_hdr {
41806         /* IPv6 version, traffic class and flow label. */
41807         uint32_t        ver_tc_flow_label;
41808         /* IPv6 version shift */
41809         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT \
41810                 UINT32_C(0x1c)
41811         /* IPv6 version mask */
41812         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK \
41813                 UINT32_C(0xf0000000)
41814         /* IPv6 TC shift */
41815         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT \
41816                 UINT32_C(0x14)
41817         /* IPv6 TC mask */
41818         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK \
41819                 UINT32_C(0xff00000)
41820         /* IPv6 flow label shift */
41821         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT \
41822                 UINT32_C(0x0)
41823         /* IPv6 flow label mask */
41824         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK \
41825                 UINT32_C(0xfffff)
41826         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST \
41827                 HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK
41828         /* IPv6 payload length. */
41829         uint16_t        payload_len;
41830         /* IPv6 next header. */
41831         uint8_t next_hdr;
41832         /* IPv6 TTL. */
41833         uint8_t ttl;
41834         /* IPv6 source address. */
41835         uint32_t        src_ip_addr[4];
41836         /* IPv6 destination address. */
41837         uint32_t        dest_ip_addr[4];
41838 } __rte_packed;
41839
41840 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
41841 struct hwrm_cfa_encap_data_vxlan {
41842         /* Source MAC address. */
41843         uint8_t src_mac_addr[6];
41844         /* reserved. */
41845         uint16_t        unused_0;
41846         /* Destination MAC address. */
41847         uint8_t dst_mac_addr[6];
41848         /* Number of VLAN tags. */
41849         uint8_t num_vlan_tags;
41850         /* reserved. */
41851         uint8_t unused_1;
41852         /* Outer VLAN TPID. */
41853         uint16_t        ovlan_tpid;
41854         /* Outer VLAN TCI. */
41855         uint16_t        ovlan_tci;
41856         /* Inner VLAN TPID. */
41857         uint16_t        ivlan_tpid;
41858         /* Inner VLAN TCI. */
41859         uint16_t        ivlan_tci;
41860         /* L3 header fields. */
41861         uint32_t        l3[10];
41862         /* IP version mask. */
41863         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf)
41864         /* IP version 4. */
41865         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4)
41866         /* IP version 6. */
41867         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6)
41868         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST \
41869                 HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6
41870         /* UDP source port. */
41871         uint16_t        src_port;
41872         /* UDP destination port. */
41873         uint16_t        dst_port;
41874         /* VXLAN Network Identifier. */
41875         uint32_t        vni;
41876         /*
41877          * 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN
41878          * header.
41879          */
41880         uint8_t hdr_rsvd0[3];
41881         /* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */
41882         uint8_t hdr_rsvd1;
41883         /* VXLAN header flags field. */
41884         uint8_t hdr_flags;
41885         uint8_t unused[3];
41886 } __rte_packed;
41887
41888 /*******************************
41889  * hwrm_cfa_encap_record_alloc *
41890  *******************************/
41891
41892
41893 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */
41894 struct hwrm_cfa_encap_record_alloc_input {
41895         /* The HWRM command request type. */
41896         uint16_t        req_type;
41897         /*
41898          * The completion ring to send the completion event on. This should
41899          * be the NQ ID returned from the `nq_alloc` HWRM command.
41900          */
41901         uint16_t        cmpl_ring;
41902         /*
41903          * The sequence ID is used by the driver for tracking multiple
41904          * commands. This ID is treated as opaque data by the firmware and
41905          * the value is returned in the `hwrm_resp_hdr` upon completion.
41906          */
41907         uint16_t        seq_id;
41908         /*
41909          * The target ID of the command:
41910          * * 0x0-0xFFF8 - The function ID
41911          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41912          * * 0xFFFD - Reserved for user-space HWRM interface
41913          * * 0xFFFF - HWRM
41914          */
41915         uint16_t        target_id;
41916         /*
41917          * A physical address pointer pointing to a host buffer that the
41918          * command's response data will be written. This can be either a host
41919          * physical address (HPA) or a guest physical address (GPA) and must
41920          * point to a physically contiguous block of memory.
41921          */
41922         uint64_t        resp_addr;
41923         uint32_t        flags;
41924         /*
41925          * Setting of this flag indicates the applicability to the loopback
41926          * path.
41927          */
41928         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK \
41929                 UINT32_C(0x1)
41930         /*
41931          * Setting of this flag indicates this encap record is external
41932          * encap record. Resetting of this flag indicates this flag is
41933          * internal encap record and this is the default setting.
41934          */
41935         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_EXTERNAL \
41936                 UINT32_C(0x2)
41937         /* Encapsulation Type. */
41938         uint8_t encap_type;
41939         /* Virtual eXtensible Local Area Network (VXLAN) */
41940         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN \
41941                 UINT32_C(0x1)
41942         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
41943         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE \
41944                 UINT32_C(0x2)
41945         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
41946         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE \
41947                 UINT32_C(0x3)
41948         /* IP in IP */
41949         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP \
41950                 UINT32_C(0x4)
41951         /* Generic Network Virtualization Encapsulation (Geneve) */
41952         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE \
41953                 UINT32_C(0x5)
41954         /* Multi-Protocol Label Switching (MPLS) */
41955         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS \
41956                 UINT32_C(0x6)
41957         /* VLAN */
41958         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN \
41959                 UINT32_C(0x7)
41960         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
41961         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE \
41962                 UINT32_C(0x8)
41963         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
41964         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4 \
41965                 UINT32_C(0x9)
41966         /*
41967          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
41968          * datagram payload
41969          */
41970         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE_V1 \
41971                 UINT32_C(0xa)
41972         /* Use fixed layer 2 ether type of 0xFFFF */
41973         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE \
41974                 UINT32_C(0xb)
41975         /*
41976          * IPV6 over virtual eXtensible Local Area Network with GPE header
41977          * (IPV6oVXLANGPE)
41978          */
41979         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6 \
41980                 UINT32_C(0xc)
41981         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST \
41982                 HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6
41983         uint8_t unused_0[3];
41984         /* This value is encap data used for the given encap type. */
41985         uint32_t        encap_data[20];
41986 } __rte_packed;
41987
41988 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
41989 struct hwrm_cfa_encap_record_alloc_output {
41990         /* The specific error status for the command. */
41991         uint16_t        error_code;
41992         /* The HWRM command request type. */
41993         uint16_t        req_type;
41994         /* The sequence ID from the original command. */
41995         uint16_t        seq_id;
41996         /* The length of the response data in number of bytes. */
41997         uint16_t        resp_len;
41998         /* This value is an opaque id into CFA data structures. */
41999         uint32_t        encap_record_id;
42000         uint8_t unused_0[3];
42001         /*
42002          * This field is used in Output records to indicate that the output
42003          * is completely written to RAM. This field should be read as '1'
42004          * to indicate that the output has been completely written.
42005          * When writing a command completion or response to an internal
42006          * processor, the order of writes has to be such that this field is
42007          * written last.
42008          */
42009         uint8_t valid;
42010 } __rte_packed;
42011
42012 /******************************
42013  * hwrm_cfa_encap_record_free *
42014  ******************************/
42015
42016
42017 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */
42018 struct hwrm_cfa_encap_record_free_input {
42019         /* The HWRM command request type. */
42020         uint16_t        req_type;
42021         /*
42022          * The completion ring to send the completion event on. This should
42023          * be the NQ ID returned from the `nq_alloc` HWRM command.
42024          */
42025         uint16_t        cmpl_ring;
42026         /*
42027          * The sequence ID is used by the driver for tracking multiple
42028          * commands. This ID is treated as opaque data by the firmware and
42029          * the value is returned in the `hwrm_resp_hdr` upon completion.
42030          */
42031         uint16_t        seq_id;
42032         /*
42033          * The target ID of the command:
42034          * * 0x0-0xFFF8 - The function ID
42035          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42036          * * 0xFFFD - Reserved for user-space HWRM interface
42037          * * 0xFFFF - HWRM
42038          */
42039         uint16_t        target_id;
42040         /*
42041          * A physical address pointer pointing to a host buffer that the
42042          * command's response data will be written. This can be either a host
42043          * physical address (HPA) or a guest physical address (GPA) and must
42044          * point to a physically contiguous block of memory.
42045          */
42046         uint64_t        resp_addr;
42047         /* This value is an opaque id into CFA data structures. */
42048         uint32_t        encap_record_id;
42049         uint8_t unused_0[4];
42050 } __rte_packed;
42051
42052 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
42053 struct hwrm_cfa_encap_record_free_output {
42054         /* The specific error status for the command. */
42055         uint16_t        error_code;
42056         /* The HWRM command request type. */
42057         uint16_t        req_type;
42058         /* The sequence ID from the original command. */
42059         uint16_t        seq_id;
42060         /* The length of the response data in number of bytes. */
42061         uint16_t        resp_len;
42062         uint8_t unused_0[7];
42063         /*
42064          * This field is used in Output records to indicate that the output
42065          * is completely written to RAM. This field should be read as '1'
42066          * to indicate that the output has been completely written.
42067          * When writing a command completion or response to an internal
42068          * processor, the order of writes has to be such that this field is
42069          * written last.
42070          */
42071         uint8_t valid;
42072 } __rte_packed;
42073
42074 /********************************
42075  * hwrm_cfa_ntuple_filter_alloc *
42076  ********************************/
42077
42078
42079 /* hwrm_cfa_ntuple_filter_alloc_input (size:1024b/128B) */
42080 struct hwrm_cfa_ntuple_filter_alloc_input {
42081         /* The HWRM command request type. */
42082         uint16_t        req_type;
42083         /*
42084          * The completion ring to send the completion event on. This should
42085          * be the NQ ID returned from the `nq_alloc` HWRM command.
42086          */
42087         uint16_t        cmpl_ring;
42088         /*
42089          * The sequence ID is used by the driver for tracking multiple
42090          * commands. This ID is treated as opaque data by the firmware and
42091          * the value is returned in the `hwrm_resp_hdr` upon completion.
42092          */
42093         uint16_t        seq_id;
42094         /*
42095          * The target ID of the command:
42096          * * 0x0-0xFFF8 - The function ID
42097          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42098          * * 0xFFFD - Reserved for user-space HWRM interface
42099          * * 0xFFFF - HWRM
42100          */
42101         uint16_t        target_id;
42102         /*
42103          * A physical address pointer pointing to a host buffer that the
42104          * command's response data will be written. This can be either a host
42105          * physical address (HPA) or a guest physical address (GPA) and must
42106          * point to a physically contiguous block of memory.
42107          */
42108         uint64_t        resp_addr;
42109         uint32_t        flags;
42110         /*
42111          * Setting of this flag indicates the applicability to the loopback
42112          * path.
42113          */
42114         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
42115                 UINT32_C(0x1)
42116         /*
42117          * Setting of this flag indicates drop action. If this flag is not
42118          * set, then it should be considered accept action.
42119          */
42120         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP \
42121                 UINT32_C(0x2)
42122         /*
42123          * Setting of this flag indicates that a meter is expected to be
42124          * attached to this flow. This hint can be used when choosing the
42125          * action record format required for the flow.
42126          */
42127         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER \
42128                 UINT32_C(0x4)
42129         /*
42130          * Setting of this flag indicates that the dst_id field contains
42131          * function ID. If this is not set it indicates dest_id is VNIC
42132          * or VPORT.
42133          */
42134         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_FID \
42135                 UINT32_C(0x8)
42136         /*
42137          * Setting of this flag indicates match on arp reply when ethertype
42138          * is 0x0806. If this is not set it indicates no specific arp opcode
42139          * matching.
42140          */
42141         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_ARP_REPLY \
42142                 UINT32_C(0x10)
42143         /*
42144          * Setting of this flag indicates that the dst_id field contains RFS
42145          * ring table index. If this is not set it indicates dst_id is VNIC
42146          * or VPORT or function ID.  Note dest_fid and dest_rfs_ring_idx
42147          * can’t be set at the same time.
42148          */
42149         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_RFS_RING_IDX \
42150                 UINT32_C(0x20)
42151         /*
42152          * Setting of this flag indicates that when the ntuple filter is
42153          * created, the L2 context should not be used in the filter.  This
42154          * allows packet from different L2 contexts to match and be directed
42155          * to the same destination.
42156          */
42157         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_NO_L2_CONTEXT \
42158                 UINT32_C(0x40)
42159         uint32_t        enables;
42160         /*
42161          * This bit must be '1' for the l2_filter_id field to be
42162          * configured.
42163          */
42164         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
42165                 UINT32_C(0x1)
42166         /*
42167          * This bit must be '1' for the ethertype field to be
42168          * configured.
42169          */
42170         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
42171                 UINT32_C(0x2)
42172         /*
42173          * This bit must be '1' for the tunnel_type field to be
42174          * configured.
42175          */
42176         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
42177                 UINT32_C(0x4)
42178         /*
42179          * This bit must be '1' for the src_macaddr field to be
42180          * configured.
42181          */
42182         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
42183                 UINT32_C(0x8)
42184         /*
42185          * This bit must be '1' for the ipaddr_type field to be
42186          * configured.
42187          */
42188         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
42189                 UINT32_C(0x10)
42190         /*
42191          * This bit must be '1' for the src_ipaddr field to be
42192          * configured.
42193          */
42194         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
42195                 UINT32_C(0x20)
42196         /*
42197          * This bit must be '1' for the src_ipaddr_mask field to be
42198          * configured.
42199          */
42200         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK \
42201                 UINT32_C(0x40)
42202         /*
42203          * This bit must be '1' for the dst_ipaddr field to be
42204          * configured.
42205          */
42206         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
42207                 UINT32_C(0x80)
42208         /*
42209          * This bit must be '1' for the dst_ipaddr_mask field to be
42210          * configured.
42211          */
42212         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK \
42213                 UINT32_C(0x100)
42214         /*
42215          * This bit must be '1' for the ip_protocol field to be
42216          * configured.
42217          */
42218         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
42219                 UINT32_C(0x200)
42220         /*
42221          * This bit must be '1' for the src_port field to be
42222          * configured.
42223          */
42224         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
42225                 UINT32_C(0x400)
42226         /*
42227          * This bit must be '1' for the src_port_mask field to be
42228          * configured.
42229          */
42230         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK \
42231                 UINT32_C(0x800)
42232         /*
42233          * This bit must be '1' for the dst_port field to be
42234          * configured.
42235          */
42236         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
42237                 UINT32_C(0x1000)
42238         /*
42239          * This bit must be '1' for the dst_port_mask field to be
42240          * configured.
42241          */
42242         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK \
42243                 UINT32_C(0x2000)
42244         /*
42245          * This bit must be '1' for the pri_hint field to be
42246          * configured.
42247          */
42248         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT \
42249                 UINT32_C(0x4000)
42250         /*
42251          * This bit must be '1' for the ntuple_filter_id field to be
42252          * configured.
42253          */
42254         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID \
42255                 UINT32_C(0x8000)
42256         /*
42257          * This bit must be '1' for the dst_id field to be
42258          * configured.
42259          */
42260         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
42261                 UINT32_C(0x10000)
42262         /*
42263          * This bit must be '1' for the mirror_vnic_id field to be
42264          * configured.
42265          */
42266         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
42267                 UINT32_C(0x20000)
42268         /*
42269          * This bit must be '1' for the dst_macaddr field to be
42270          * configured.
42271          */
42272         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
42273                 UINT32_C(0x40000)
42274         /* This flag is deprecated. */
42275         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_RFS_RING_TBL_IDX \
42276                 UINT32_C(0x80000)
42277         /*
42278          * This value identifies a set of CFA data structures used for an L2
42279          * context.
42280          */
42281         uint64_t        l2_filter_id;
42282         /*
42283          * This value indicates the source MAC address in
42284          * the Ethernet header.
42285          */
42286         uint8_t src_macaddr[6];
42287         /* This value indicates the ethertype in the Ethernet header. */
42288         uint16_t        ethertype;
42289         /*
42290          * This value indicates the type of IP address.
42291          * 4 - IPv4
42292          * 6 - IPv6
42293          * All others are invalid.
42294          */
42295         uint8_t ip_addr_type;
42296         /* invalid */
42297         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
42298                 UINT32_C(0x0)
42299         /* IPv4 */
42300         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
42301                 UINT32_C(0x4)
42302         /* IPv6 */
42303         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
42304                 UINT32_C(0x6)
42305         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
42306                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
42307         /*
42308          * The value of protocol filed in IP header.
42309          * Applies to UDP and TCP traffic.
42310          * 6 - TCP
42311          * 17 - UDP
42312          */
42313         uint8_t ip_protocol;
42314         /* invalid */
42315         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
42316                 UINT32_C(0x0)
42317         /* TCP */
42318         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
42319                 UINT32_C(0x6)
42320         /* UDP */
42321         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
42322                 UINT32_C(0x11)
42323         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
42324                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
42325         /*
42326          * If set, this value shall represent the
42327          * Logical VNIC ID of the destination VNIC for the RX
42328          * path and network port id of the destination port for
42329          * the TX path.
42330          */
42331         uint16_t        dst_id;
42332         /*
42333          * Logical VNIC ID of the VNIC where traffic is
42334          * mirrored.
42335          */
42336         uint16_t        mirror_vnic_id;
42337         /*
42338          * This value indicates the tunnel type for this filter.
42339          * If this field is not specified, then the filter shall
42340          * apply to both non-tunneled and tunneled packets.
42341          * If this field conflicts with the tunnel_type specified
42342          * in the l2_filter_id, then the HWRM shall return an
42343          * error for this command.
42344          */
42345         uint8_t tunnel_type;
42346         /* Non-tunnel */
42347         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
42348                 UINT32_C(0x0)
42349         /* Virtual eXtensible Local Area Network (VXLAN) */
42350         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
42351                 UINT32_C(0x1)
42352         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
42353         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
42354                 UINT32_C(0x2)
42355         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
42356         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
42357                 UINT32_C(0x3)
42358         /* IP in IP */
42359         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
42360                 UINT32_C(0x4)
42361         /* Generic Network Virtualization Encapsulation (Geneve) */
42362         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
42363                 UINT32_C(0x5)
42364         /* Multi-Protocol Label Switching (MPLS) */
42365         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
42366                 UINT32_C(0x6)
42367         /* Stateless Transport Tunnel (STT) */
42368         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
42369                 UINT32_C(0x7)
42370         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
42371         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
42372                 UINT32_C(0x8)
42373         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
42374         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
42375                 UINT32_C(0x9)
42376         /*
42377          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
42378          * datagram payload
42379          */
42380         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
42381                 UINT32_C(0xa)
42382         /* Use fixed layer 2 ether type of 0xFFFF */
42383         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
42384                 UINT32_C(0xb)
42385         /*
42386          * IPV6 over virtual eXtensible Local Area Network with GPE header
42387          * (IPV6oVXLANGPE)
42388          */
42389         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
42390                 UINT32_C(0xc)
42391         /* Any tunneled traffic */
42392         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
42393                 UINT32_C(0xff)
42394         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
42395                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
42396         /*
42397          * This hint is provided to help in placing
42398          * the filter in the filter table.
42399          */
42400         uint8_t pri_hint;
42401         /* No preference */
42402         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
42403                 UINT32_C(0x0)
42404         /* Above the given filter */
42405         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE \
42406                 UINT32_C(0x1)
42407         /* Below the given filter */
42408         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW \
42409                 UINT32_C(0x2)
42410         /* As high as possible */
42411         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST \
42412                 UINT32_C(0x3)
42413         /* As low as possible */
42414         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST \
42415                 UINT32_C(0x4)
42416         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
42417                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
42418         /*
42419          * The value of source IP address to be used in filtering.
42420          * For IPv4, first four bytes represent the IP address.
42421          */
42422         uint32_t        src_ipaddr[4];
42423         /*
42424          * The value of source IP address mask to be used in
42425          * filtering.
42426          * For IPv4, first four bytes represent the IP address mask.
42427          */
42428         uint32_t        src_ipaddr_mask[4];
42429         /*
42430          * The value of destination IP address to be used in filtering.
42431          * For IPv4, first four bytes represent the IP address.
42432          */
42433         uint32_t        dst_ipaddr[4];
42434         /*
42435          * The value of destination IP address mask to be used in
42436          * filtering.
42437          * For IPv4, first four bytes represent the IP address mask.
42438          */
42439         uint32_t        dst_ipaddr_mask[4];
42440         /*
42441          * The value of source port to be used in filtering.
42442          * Applies to UDP and TCP traffic.
42443          */
42444         uint16_t        src_port;
42445         /*
42446          * The value of source port mask to be used in filtering.
42447          * Applies to UDP and TCP traffic.
42448          */
42449         uint16_t        src_port_mask;
42450         /*
42451          * The value of destination port to be used in filtering.
42452          * Applies to UDP and TCP traffic.
42453          */
42454         uint16_t        dst_port;
42455         /*
42456          * The value of destination port mask to be used in
42457          * filtering.
42458          * Applies to UDP and TCP traffic.
42459          */
42460         uint16_t        dst_port_mask;
42461         /*
42462          * This is the ID of the filter that goes along with
42463          * the pri_hint.
42464          */
42465         uint64_t        ntuple_filter_id_hint;
42466 } __rte_packed;
42467
42468 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
42469 struct hwrm_cfa_ntuple_filter_alloc_output {
42470         /* The specific error status for the command. */
42471         uint16_t        error_code;
42472         /* The HWRM command request type. */
42473         uint16_t        req_type;
42474         /* The sequence ID from the original command. */
42475         uint16_t        seq_id;
42476         /* The length of the response data in number of bytes. */
42477         uint16_t        resp_len;
42478         /* This value is an opaque id into CFA data structures. */
42479         uint64_t        ntuple_filter_id;
42480         /*
42481          * The flow id value in bit 0-29 is the actual ID of the flow
42482          * associated with this filter and it shall be used to match
42483          * and associate the flow identifier returned in completion
42484          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
42485          * shall indicate no valid flow id.
42486          */
42487         uint32_t        flow_id;
42488         /* Indicate the flow id value. */
42489         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
42490                 UINT32_C(0x3fffffff)
42491         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
42492         /* Indicate type of the flow. */
42493         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
42494                 UINT32_C(0x40000000)
42495         /*
42496          * If this bit set to 0, then it indicates that the flow is
42497          * internal flow.
42498          */
42499         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
42500                 (UINT32_C(0x0) << 30)
42501         /*
42502          * If this bit is set to 1, then it indicates that the flow is
42503          * external flow.
42504          */
42505         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
42506                 (UINT32_C(0x1) << 30)
42507         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
42508                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
42509         /* Indicate the flow direction. */
42510         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
42511                 UINT32_C(0x80000000)
42512         /* If this bit set to 0, then it indicates rx flow. */
42513         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
42514                 (UINT32_C(0x0) << 31)
42515         /* If this bit is set to 1, then it indicates that tx flow. */
42516         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
42517                 (UINT32_C(0x1) << 31)
42518         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
42519                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
42520         uint8_t unused_0[3];
42521         /*
42522          * This field is used in Output records to indicate that the output
42523          * is completely written to RAM. This field should be read as '1'
42524          * to indicate that the output has been completely written.
42525          * When writing a command completion or response to an internal
42526          * processor, the order of writes has to be such that this field is
42527          * written last.
42528          */
42529         uint8_t valid;
42530 } __rte_packed;
42531
42532 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
42533 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
42534         /*
42535          * command specific error codes that goes to
42536          * the cmd_err field in Common HWRM Error Response.
42537          */
42538         uint8_t code;
42539         /* Unknown error */
42540         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN \
42541                 UINT32_C(0x0)
42542         /* Unable to complete operation due to conflict with Rx Mask VLAN */
42543         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR \
42544                 UINT32_C(0x1)
42545         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST \
42546                 HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
42547         uint8_t unused_0[7];
42548 } __rte_packed;
42549
42550 /*******************************
42551  * hwrm_cfa_ntuple_filter_free *
42552  *******************************/
42553
42554
42555 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
42556 struct hwrm_cfa_ntuple_filter_free_input {
42557         /* The HWRM command request type. */
42558         uint16_t        req_type;
42559         /*
42560          * The completion ring to send the completion event on. This should
42561          * be the NQ ID returned from the `nq_alloc` HWRM command.
42562          */
42563         uint16_t        cmpl_ring;
42564         /*
42565          * The sequence ID is used by the driver for tracking multiple
42566          * commands. This ID is treated as opaque data by the firmware and
42567          * the value is returned in the `hwrm_resp_hdr` upon completion.
42568          */
42569         uint16_t        seq_id;
42570         /*
42571          * The target ID of the command:
42572          * * 0x0-0xFFF8 - The function ID
42573          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42574          * * 0xFFFD - Reserved for user-space HWRM interface
42575          * * 0xFFFF - HWRM
42576          */
42577         uint16_t        target_id;
42578         /*
42579          * A physical address pointer pointing to a host buffer that the
42580          * command's response data will be written. This can be either a host
42581          * physical address (HPA) or a guest physical address (GPA) and must
42582          * point to a physically contiguous block of memory.
42583          */
42584         uint64_t        resp_addr;
42585         /* This value is an opaque id into CFA data structures. */
42586         uint64_t        ntuple_filter_id;
42587 } __rte_packed;
42588
42589 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
42590 struct hwrm_cfa_ntuple_filter_free_output {
42591         /* The specific error status for the command. */
42592         uint16_t        error_code;
42593         /* The HWRM command request type. */
42594         uint16_t        req_type;
42595         /* The sequence ID from the original command. */
42596         uint16_t        seq_id;
42597         /* The length of the response data in number of bytes. */
42598         uint16_t        resp_len;
42599         uint8_t unused_0[7];
42600         /*
42601          * This field is used in Output records to indicate that the output
42602          * is completely written to RAM. This field should be read as '1'
42603          * to indicate that the output has been completely written.
42604          * When writing a command completion or response to an internal
42605          * processor, the order of writes has to be such that this field is
42606          * written last.
42607          */
42608         uint8_t valid;
42609 } __rte_packed;
42610
42611 /******************************
42612  * hwrm_cfa_ntuple_filter_cfg *
42613  ******************************/
42614
42615
42616 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
42617 struct hwrm_cfa_ntuple_filter_cfg_input {
42618         /* The HWRM command request type. */
42619         uint16_t        req_type;
42620         /*
42621          * The completion ring to send the completion event on. This should
42622          * be the NQ ID returned from the `nq_alloc` HWRM command.
42623          */
42624         uint16_t        cmpl_ring;
42625         /*
42626          * The sequence ID is used by the driver for tracking multiple
42627          * commands. This ID is treated as opaque data by the firmware and
42628          * the value is returned in the `hwrm_resp_hdr` upon completion.
42629          */
42630         uint16_t        seq_id;
42631         /*
42632          * The target ID of the command:
42633          * * 0x0-0xFFF8 - The function ID
42634          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42635          * * 0xFFFD - Reserved for user-space HWRM interface
42636          * * 0xFFFF - HWRM
42637          */
42638         uint16_t        target_id;
42639         /*
42640          * A physical address pointer pointing to a host buffer that the
42641          * command's response data will be written. This can be either a host
42642          * physical address (HPA) or a guest physical address (GPA) and must
42643          * point to a physically contiguous block of memory.
42644          */
42645         uint64_t        resp_addr;
42646         uint32_t        enables;
42647         /*
42648          * This bit must be '1' for the new_dst_id field to be
42649          * configured.
42650          */
42651         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID \
42652                 UINT32_C(0x1)
42653         /*
42654          * This bit must be '1' for the new_mirror_vnic_id field to be
42655          * configured.
42656          */
42657         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
42658                 UINT32_C(0x2)
42659         /*
42660          * This bit must be '1' for the new_meter_instance_id field to be
42661          * configured.
42662          */
42663         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
42664                 UINT32_C(0x4)
42665         uint32_t        flags;
42666         /*
42667          * Setting this bit to 1 indicates that dest_id field contains FID.
42668          * Setting this to 0 indicates that dest_id field contains VNIC or
42669          * VPORT.
42670          */
42671         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_FID \
42672                 UINT32_C(0x1)
42673         /*
42674          * Setting of this flag indicates that the new_dst_id field contains
42675          * RFS ring table index. If this is not set it indicates new_dst_id
42676          * is VNIC or VPORT or function ID.  Note dest_fid and
42677          * dest_rfs_ring_idx can’t be set at the same time.
42678          */
42679         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_RFS_RING_IDX \
42680                 UINT32_C(0x2)
42681         /*
42682          * Setting of this flag indicates that when the ntuple filter is
42683          * created, the L2 context should not be used in the filter.  This
42684          * allows packet from different L2 contexts to match and be directed
42685          * to the same destination.
42686          */
42687         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_NO_L2_CONTEXT \
42688                 UINT32_C(0x4)
42689         /* This value is an opaque id into CFA data structures. */
42690         uint64_t        ntuple_filter_id;
42691         /*
42692          * If set, this value shall represent the new
42693          * Logical VNIC ID of the destination VNIC for the RX
42694          * path and new network port id of the destination port for
42695          * the TX path.
42696          */
42697         uint32_t        new_dst_id;
42698         /*
42699          * New Logical VNIC ID of the VNIC where traffic is
42700          * mirrored.
42701          */
42702         uint32_t        new_mirror_vnic_id;
42703         /*
42704          * New meter to attach to the flow. Specifying the
42705          * invalid instance ID is used to remove any existing
42706          * meter from the flow.
42707          */
42708         uint16_t        new_meter_instance_id;
42709         /*
42710          * A value of 0xfff is considered invalid and implies the
42711          * instance is not configured.
42712          */
42713         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
42714                 UINT32_C(0xffff)
42715         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \
42716                 HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
42717         uint8_t unused_1[6];
42718 } __rte_packed;
42719
42720 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
42721 struct hwrm_cfa_ntuple_filter_cfg_output {
42722         /* The specific error status for the command. */
42723         uint16_t        error_code;
42724         /* The HWRM command request type. */
42725         uint16_t        req_type;
42726         /* The sequence ID from the original command. */
42727         uint16_t        seq_id;
42728         /* The length of the response data in number of bytes. */
42729         uint16_t        resp_len;
42730         uint8_t unused_0[7];
42731         /*
42732          * This field is used in Output records to indicate that the output
42733          * is completely written to RAM. This field should be read as '1'
42734          * to indicate that the output has been completely written.
42735          * When writing a command completion or response to an internal
42736          * processor, the order of writes has to be such that this field is
42737          * written last.
42738          */
42739         uint8_t valid;
42740 } __rte_packed;
42741
42742 /**************************
42743  * hwrm_cfa_em_flow_alloc *
42744  **************************/
42745
42746
42747 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
42748 struct hwrm_cfa_em_flow_alloc_input {
42749         /* The HWRM command request type. */
42750         uint16_t        req_type;
42751         /*
42752          * The completion ring to send the completion event on. This should
42753          * be the NQ ID returned from the `nq_alloc` HWRM command.
42754          */
42755         uint16_t        cmpl_ring;
42756         /*
42757          * The sequence ID is used by the driver for tracking multiple
42758          * commands. This ID is treated as opaque data by the firmware and
42759          * the value is returned in the `hwrm_resp_hdr` upon completion.
42760          */
42761         uint16_t        seq_id;
42762         /*
42763          * The target ID of the command:
42764          * * 0x0-0xFFF8 - The function ID
42765          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42766          * * 0xFFFD - Reserved for user-space HWRM interface
42767          * * 0xFFFF - HWRM
42768          */
42769         uint16_t        target_id;
42770         /*
42771          * A physical address pointer pointing to a host buffer that the
42772          * command's response data will be written. This can be either a host
42773          * physical address (HPA) or a guest physical address (GPA) and must
42774          * point to a physically contiguous block of memory.
42775          */
42776         uint64_t        resp_addr;
42777         uint32_t        flags;
42778         /*
42779          * Enumeration denoting the RX, TX type of the resource.
42780          * This enumeration is used for resources that are similar for both
42781          * TX and RX paths of the chip.
42782          */
42783         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH         UINT32_C(0x1)
42784         /* tx path */
42785         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX        UINT32_C(0x0)
42786         /* rx path */
42787         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX        UINT32_C(0x1)
42788         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST \
42789                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
42790         /*
42791          * Setting of this flag indicates enabling of a byte counter for a
42792          * given flow.
42793          */
42794         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR     UINT32_C(0x2)
42795         /*
42796          * Setting of this flag indicates enabling of a packet counter for a
42797          * given flow.
42798          */
42799         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR      UINT32_C(0x4)
42800         /*
42801          * Setting of this flag indicates de-capsulation action for the
42802          * given flow.
42803          */
42804         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP        UINT32_C(0x8)
42805         /*
42806          * Setting of this flag indicates encapsulation action for the
42807          * given flow.
42808          */
42809         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP        UINT32_C(0x10)
42810         /*
42811          * Setting of this flag indicates drop action. If this flag is not
42812          * set, then it should be considered accept action.
42813          */
42814         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP         UINT32_C(0x20)
42815         /*
42816          * Setting of this flag indicates that a meter is expected to be
42817          * attached to this flow. This hint can be used when choosing the
42818          * action record format required for the flow.
42819          */
42820         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER        UINT32_C(0x40)
42821         uint32_t        enables;
42822         /*
42823          * This bit must be '1' for the l2_filter_id field to be
42824          * configured.
42825          */
42826         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
42827                 UINT32_C(0x1)
42828         /*
42829          * This bit must be '1' for the tunnel_type field to be
42830          * configured.
42831          */
42832         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
42833                 UINT32_C(0x2)
42834         /*
42835          * This bit must be '1' for the tunnel_id field to be
42836          * configured.
42837          */
42838         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID \
42839                 UINT32_C(0x4)
42840         /*
42841          * This bit must be '1' for the src_macaddr field to be
42842          * configured.
42843          */
42844         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR \
42845                 UINT32_C(0x8)
42846         /*
42847          * This bit must be '1' for the dst_macaddr field to be
42848          * configured.
42849          */
42850         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR \
42851                 UINT32_C(0x10)
42852         /*
42853          * This bit must be '1' for the ovlan_vid field to be
42854          * configured.
42855          */
42856         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID \
42857                 UINT32_C(0x20)
42858         /*
42859          * This bit must be '1' for the ivlan_vid field to be
42860          * configured.
42861          */
42862         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID \
42863                 UINT32_C(0x40)
42864         /*
42865          * This bit must be '1' for the ethertype field to be
42866          * configured.
42867          */
42868         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE \
42869                 UINT32_C(0x80)
42870         /*
42871          * This bit must be '1' for the src_ipaddr field to be
42872          * configured.
42873          */
42874         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR \
42875                 UINT32_C(0x100)
42876         /*
42877          * This bit must be '1' for the dst_ipaddr field to be
42878          * configured.
42879          */
42880         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR \
42881                 UINT32_C(0x200)
42882         /*
42883          * This bit must be '1' for the ipaddr_type field to be
42884          * configured.
42885          */
42886         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
42887                 UINT32_C(0x400)
42888         /*
42889          * This bit must be '1' for the ip_protocol field to be
42890          * configured.
42891          */
42892         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
42893                 UINT32_C(0x800)
42894         /*
42895          * This bit must be '1' for the src_port field to be
42896          * configured.
42897          */
42898         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT \
42899                 UINT32_C(0x1000)
42900         /*
42901          * This bit must be '1' for the dst_port field to be
42902          * configured.
42903          */
42904         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT \
42905                 UINT32_C(0x2000)
42906         /*
42907          * This bit must be '1' for the dst_id field to be
42908          * configured.
42909          */
42910         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID \
42911                 UINT32_C(0x4000)
42912         /*
42913          * This bit must be '1' for the mirror_vnic_id field to be
42914          * configured.
42915          */
42916         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
42917                 UINT32_C(0x8000)
42918         /*
42919          * This bit must be '1' for the encap_record_id field to be
42920          * configured.
42921          */
42922         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID \
42923                 UINT32_C(0x10000)
42924         /*
42925          * This bit must be '1' for the meter_instance_id field to be
42926          * configured.
42927          */
42928         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID \
42929                 UINT32_C(0x20000)
42930         /*
42931          * This value identifies a set of CFA data structures used for an L2
42932          * context.
42933          */
42934         uint64_t        l2_filter_id;
42935         /* Tunnel Type. */
42936         uint8_t tunnel_type;
42937         /* Non-tunnel */
42938         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
42939                 UINT32_C(0x0)
42940         /* Virtual eXtensible Local Area Network (VXLAN) */
42941         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
42942                 UINT32_C(0x1)
42943         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
42944         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
42945                 UINT32_C(0x2)
42946         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
42947         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
42948                 UINT32_C(0x3)
42949         /* IP in IP */
42950         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
42951                 UINT32_C(0x4)
42952         /* Generic Network Virtualization Encapsulation (Geneve) */
42953         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
42954                 UINT32_C(0x5)
42955         /* Multi-Protocol Label Switching (MPLS) */
42956         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
42957                 UINT32_C(0x6)
42958         /* Stateless Transport Tunnel (STT) */
42959         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
42960                 UINT32_C(0x7)
42961         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
42962         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
42963                 UINT32_C(0x8)
42964         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
42965         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
42966                 UINT32_C(0x9)
42967         /*
42968          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
42969          * datagram payload
42970          */
42971         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
42972                 UINT32_C(0xa)
42973         /* Use fixed layer 2 ether type of 0xFFFF */
42974         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
42975                 UINT32_C(0xb)
42976         /*
42977          * IPV6 over virtual eXtensible Local Area Network with GPE header
42978          * (IPV6oVXLANGPE)
42979          */
42980         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
42981                 UINT32_C(0xc)
42982         /* Any tunneled traffic */
42983         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
42984                 UINT32_C(0xff)
42985         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
42986                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
42987         uint8_t unused_0[3];
42988         /*
42989          * Tunnel identifier.
42990          * Virtual Network Identifier (VNI). Only valid with
42991          * tunnel_types VXLAN, NVGRE, and Geneve.
42992          * Only lower 24-bits of VNI field are used
42993          * in setting up the filter.
42994          */
42995         uint32_t        tunnel_id;
42996         /*
42997          * This value indicates the source MAC address in
42998          * the Ethernet header.
42999          */
43000         uint8_t src_macaddr[6];
43001         /* The meter instance to attach to the flow. */
43002         uint16_t        meter_instance_id;
43003         /*
43004          * A value of 0xfff is considered invalid and implies the
43005          * instance is not configured.
43006          */
43007         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID \
43008                 UINT32_C(0xffff)
43009         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST \
43010                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
43011         /*
43012          * This value indicates the destination MAC address in
43013          * the Ethernet header.
43014          */
43015         uint8_t dst_macaddr[6];
43016         /*
43017          * This value indicates the VLAN ID of the outer VLAN tag
43018          * in the Ethernet header.
43019          */
43020         uint16_t        ovlan_vid;
43021         /*
43022          * This value indicates the VLAN ID of the inner VLAN tag
43023          * in the Ethernet header.
43024          */
43025         uint16_t        ivlan_vid;
43026         /* This value indicates the ethertype in the Ethernet header. */
43027         uint16_t        ethertype;
43028         /*
43029          * This value indicates the type of IP address.
43030          * 4 - IPv4
43031          * 6 - IPv6
43032          * All others are invalid.
43033          */
43034         uint8_t ip_addr_type;
43035         /* invalid */
43036         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
43037         /* IPv4 */
43038         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4    UINT32_C(0x4)
43039         /* IPv6 */
43040         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6    UINT32_C(0x6)
43041         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
43042                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
43043         /*
43044          * The value of protocol filed in IP header.
43045          * Applies to UDP and TCP traffic.
43046          * 6 - TCP
43047          * 17 - UDP
43048          */
43049         uint8_t ip_protocol;
43050         /* invalid */
43051         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
43052         /* TCP */
43053         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP     UINT32_C(0x6)
43054         /* UDP */
43055         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP     UINT32_C(0x11)
43056         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST \
43057                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
43058         uint8_t unused_1[2];
43059         /*
43060          * The value of source IP address to be used in filtering.
43061          * For IPv4, first four bytes represent the IP address.
43062          */
43063         uint32_t        src_ipaddr[4];
43064         /*
43065          * big_endian = True
43066          *     The value of destination IP address to be used in filtering.
43067          *     For IPv4, first four bytes represent the IP address.
43068          */
43069         uint32_t        dst_ipaddr[4];
43070         /*
43071          * The value of source port to be used in filtering.
43072          * Applies to UDP and TCP traffic.
43073          */
43074         uint16_t        src_port;
43075         /*
43076          * The value of destination port to be used in filtering.
43077          * Applies to UDP and TCP traffic.
43078          */
43079         uint16_t        dst_port;
43080         /*
43081          * If set, this value shall represent the
43082          * Logical VNIC ID of the destination VNIC for the RX
43083          * path and network port id of the destination port for
43084          * the TX path.
43085          */
43086         uint16_t        dst_id;
43087         /*
43088          * Logical VNIC ID of the VNIC where traffic is
43089          * mirrored.
43090          */
43091         uint16_t        mirror_vnic_id;
43092         /* Logical ID of the encapsulation record. */
43093         uint32_t        encap_record_id;
43094         uint8_t unused_2[4];
43095 } __rte_packed;
43096
43097 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
43098 struct hwrm_cfa_em_flow_alloc_output {
43099         /* The specific error status for the command. */
43100         uint16_t        error_code;
43101         /* The HWRM command request type. */
43102         uint16_t        req_type;
43103         /* The sequence ID from the original command. */
43104         uint16_t        seq_id;
43105         /* The length of the response data in number of bytes. */
43106         uint16_t        resp_len;
43107         /* This value is an opaque id into CFA data structures. */
43108         uint64_t        em_filter_id;
43109         /*
43110          * The flow id value in bit 0-29 is the actual ID of the flow
43111          * associated with this filter and it shall be used to match
43112          * and associate the flow identifier returned in completion
43113          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
43114          * shall indicate no valid flow id.
43115          */
43116         uint32_t        flow_id;
43117         /* Indicate the flow id value. */
43118         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
43119                 UINT32_C(0x3fffffff)
43120         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
43121         /* Indicate type of the flow. */
43122         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
43123                 UINT32_C(0x40000000)
43124         /*
43125          * If this bit set to 0, then it indicates that the flow is
43126          * internal flow.
43127          */
43128         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
43129                 (UINT32_C(0x0) << 30)
43130         /*
43131          * If this bit is set to 1, then it indicates that the flow is
43132          * external flow.
43133          */
43134         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
43135                 (UINT32_C(0x1) << 30)
43136         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
43137                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
43138         /* Indicate the flow direction. */
43139         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
43140                 UINT32_C(0x80000000)
43141         /* If this bit set to 0, then it indicates rx flow. */
43142         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
43143                 (UINT32_C(0x0) << 31)
43144         /* If this bit is set to 1, then it indicates that tx flow. */
43145         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
43146                 (UINT32_C(0x1) << 31)
43147         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
43148                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
43149         uint8_t unused_0[3];
43150         /*
43151          * This field is used in Output records to indicate that the output
43152          * is completely written to RAM. This field should be read as '1'
43153          * to indicate that the output has been completely written.
43154          * When writing a command completion or response to an internal
43155          * processor, the order of writes has to be such that this field is
43156          * written last.
43157          */
43158         uint8_t valid;
43159 } __rte_packed;
43160
43161 /*************************
43162  * hwrm_cfa_em_flow_free *
43163  *************************/
43164
43165
43166 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
43167 struct hwrm_cfa_em_flow_free_input {
43168         /* The HWRM command request type. */
43169         uint16_t        req_type;
43170         /*
43171          * The completion ring to send the completion event on. This should
43172          * be the NQ ID returned from the `nq_alloc` HWRM command.
43173          */
43174         uint16_t        cmpl_ring;
43175         /*
43176          * The sequence ID is used by the driver for tracking multiple
43177          * commands. This ID is treated as opaque data by the firmware and
43178          * the value is returned in the `hwrm_resp_hdr` upon completion.
43179          */
43180         uint16_t        seq_id;
43181         /*
43182          * The target ID of the command:
43183          * * 0x0-0xFFF8 - The function ID
43184          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43185          * * 0xFFFD - Reserved for user-space HWRM interface
43186          * * 0xFFFF - HWRM
43187          */
43188         uint16_t        target_id;
43189         /*
43190          * A physical address pointer pointing to a host buffer that the
43191          * command's response data will be written. This can be either a host
43192          * physical address (HPA) or a guest physical address (GPA) and must
43193          * point to a physically contiguous block of memory.
43194          */
43195         uint64_t        resp_addr;
43196         /* This value is an opaque id into CFA data structures. */
43197         uint64_t        em_filter_id;
43198 } __rte_packed;
43199
43200 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
43201 struct hwrm_cfa_em_flow_free_output {
43202         /* The specific error status for the command. */
43203         uint16_t        error_code;
43204         /* The HWRM command request type. */
43205         uint16_t        req_type;
43206         /* The sequence ID from the original command. */
43207         uint16_t        seq_id;
43208         /* The length of the response data in number of bytes. */
43209         uint16_t        resp_len;
43210         uint8_t unused_0[7];
43211         /*
43212          * This field is used in Output records to indicate that the output
43213          * is completely written to RAM. This field should be read as '1'
43214          * to indicate that the output has been completely written.
43215          * When writing a command completion or response to an internal
43216          * processor, the order of writes has to be such that this field is
43217          * written last.
43218          */
43219         uint8_t valid;
43220 } __rte_packed;
43221
43222 /************************
43223  * hwrm_cfa_meter_qcaps *
43224  ************************/
43225
43226
43227 /* hwrm_cfa_meter_qcaps_input (size:128b/16B) */
43228 struct hwrm_cfa_meter_qcaps_input {
43229         /* The HWRM command request type. */
43230         uint16_t        req_type;
43231         /*
43232          * The completion ring to send the completion event on. This should
43233          * be the NQ ID returned from the `nq_alloc` HWRM command.
43234          */
43235         uint16_t        cmpl_ring;
43236         /*
43237          * The sequence ID is used by the driver for tracking multiple
43238          * commands. This ID is treated as opaque data by the firmware and
43239          * the value is returned in the `hwrm_resp_hdr` upon completion.
43240          */
43241         uint16_t        seq_id;
43242         /*
43243          * The target ID of the command:
43244          * * 0x0-0xFFF8 - The function ID
43245          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43246          * * 0xFFFD - Reserved for user-space HWRM interface
43247          * * 0xFFFF - HWRM
43248          */
43249         uint16_t        target_id;
43250         /*
43251          * A physical address pointer pointing to a host buffer that the
43252          * command's response data will be written. This can be either a host
43253          * physical address (HPA) or a guest physical address (GPA) and must
43254          * point to a physically contiguous block of memory.
43255          */
43256         uint64_t        resp_addr;
43257 } __rte_packed;
43258
43259 /* hwrm_cfa_meter_qcaps_output (size:320b/40B) */
43260 struct hwrm_cfa_meter_qcaps_output {
43261         /* The specific error status for the command. */
43262         uint16_t        error_code;
43263         /* The HWRM command request type. */
43264         uint16_t        req_type;
43265         /* The sequence ID from the original command. */
43266         uint16_t        seq_id;
43267         /* The length of the response data in number of bytes. */
43268         uint16_t        resp_len;
43269         uint32_t        flags;
43270         /*
43271          * Enumeration denoting the clock at which the Meter is running
43272          * with. This enumeration is used for resources that are similar
43273          * for both TX and RX paths of the chip.
43274          */
43275         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_MASK  UINT32_C(0xf)
43276         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_SFT   0
43277         /* 375 MHz */
43278         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_375MHZ  UINT32_C(0x0)
43279         /* 625 MHz */
43280         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ  UINT32_C(0x1)
43281         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_LAST \
43282                 HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ
43283         uint8_t unused_0[4];
43284         /*
43285          * The minimum guaranteed number of tx meter profiles supported
43286          * for this function.
43287          */
43288         uint16_t        min_tx_profile;
43289         /*
43290          * The maximum non-guaranteed number of tx meter profiles supported
43291          * for this function.
43292          */
43293         uint16_t        max_tx_profile;
43294         /*
43295          * The minimum guaranteed number of rx meter profiles supported
43296          * for this function.
43297          */
43298         uint16_t        min_rx_profile;
43299         /*
43300          * The maximum non-guaranteed number of rx meter profiles supported
43301          * for this function.
43302          */
43303         uint16_t        max_rx_profile;
43304         /*
43305          * The minimum guaranteed number of tx meter instances supported
43306          * for this function.
43307          */
43308         uint16_t        min_tx_instance;
43309         /*
43310          * The maximum non-guaranteed number of tx meter instances supported
43311          * for this function.
43312          */
43313         uint16_t        max_tx_instance;
43314         /*
43315          * The minimum guaranteed number of rx meter instances supported
43316          * for this function.
43317          */
43318         uint16_t        min_rx_instance;
43319         /*
43320          * The maximum non-guaranteed number of rx meter instances supported
43321          * for this function.
43322          */
43323         uint16_t        max_rx_instance;
43324         uint8_t unused_1[7];
43325         /*
43326          * This field is used in Output records to indicate that the output
43327          * is completely written to RAM. This field should be read as '1'
43328          * to indicate that the output has been completely written.
43329          * When writing a command completion or response to an internal
43330          * processor, the order of writes has to be such that this field is
43331          * written last.
43332          */
43333         uint8_t valid;
43334 } __rte_packed;
43335
43336 /********************************
43337  * hwrm_cfa_meter_profile_alloc *
43338  ********************************/
43339
43340
43341 /* hwrm_cfa_meter_profile_alloc_input (size:320b/40B) */
43342 struct hwrm_cfa_meter_profile_alloc_input {
43343         /* The HWRM command request type. */
43344         uint16_t        req_type;
43345         /*
43346          * The completion ring to send the completion event on. This should
43347          * be the NQ ID returned from the `nq_alloc` HWRM command.
43348          */
43349         uint16_t        cmpl_ring;
43350         /*
43351          * The sequence ID is used by the driver for tracking multiple
43352          * commands. This ID is treated as opaque data by the firmware and
43353          * the value is returned in the `hwrm_resp_hdr` upon completion.
43354          */
43355         uint16_t        seq_id;
43356         /*
43357          * The target ID of the command:
43358          * * 0x0-0xFFF8 - The function ID
43359          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43360          * * 0xFFFD - Reserved for user-space HWRM interface
43361          * * 0xFFFF - HWRM
43362          */
43363         uint16_t        target_id;
43364         /*
43365          * A physical address pointer pointing to a host buffer that the
43366          * command's response data will be written. This can be either a host
43367          * physical address (HPA) or a guest physical address (GPA) and must
43368          * point to a physically contiguous block of memory.
43369          */
43370         uint64_t        resp_addr;
43371         uint8_t flags;
43372         /*
43373          * Enumeration denoting the RX, TX type of the resource.
43374          * This enumeration is used for resources that are similar for both
43375          * TX and RX paths of the chip.
43376          */
43377         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH     UINT32_C(0x1)
43378         /* tx path */
43379         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX \
43380                 UINT32_C(0x0)
43381         /* rx path */
43382         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX \
43383                 UINT32_C(0x1)
43384         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST \
43385                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
43386         /* The meter algorithm type. */
43387         uint8_t meter_type;
43388         /* RFC 2697 (srTCM) */
43389         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 \
43390                 UINT32_C(0x0)
43391         /* RFC 2698 (trTCM) */
43392         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 \
43393                 UINT32_C(0x1)
43394         /* RFC 4115 (trTCM) */
43395         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 \
43396                 UINT32_C(0x2)
43397         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_LAST \
43398                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115
43399         /*
43400          * This field is reserved for the future use.
43401          * It shall be set to 0.
43402          */
43403         uint16_t        reserved1;
43404         /*
43405          * This field is reserved for the future use.
43406          * It shall be set to 0.
43407          */
43408         uint32_t        reserved2;
43409         /* A meter rate specified in bytes-per-second. */
43410         uint32_t        commit_rate;
43411         /* The bandwidth value. */
43412         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK \
43413                 UINT32_C(0xfffffff)
43414         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT \
43415                 0
43416         /* The granularity of the value (bits or bytes). */
43417         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE \
43418                 UINT32_C(0x10000000)
43419         /* Value is in bits. */
43420         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS \
43421                 (UINT32_C(0x0) << 28)
43422         /* Value is in bytes. */
43423         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES \
43424                 (UINT32_C(0x1) << 28)
43425         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST \
43426                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
43427         /* bw_value_unit is 3 b */
43428         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
43429                 UINT32_C(0xe0000000)
43430         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
43431                 29
43432         /* Value is in Mb or MB (base 10). */
43433         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
43434                 (UINT32_C(0x0) << 29)
43435         /* Value is in Kb or KB (base 10). */
43436         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
43437                 (UINT32_C(0x2) << 29)
43438         /* Value is in bits or bytes. */
43439         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
43440                 (UINT32_C(0x4) << 29)
43441         /* Value is in Gb or GB (base 10). */
43442         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
43443                 (UINT32_C(0x6) << 29)
43444         /* Value is in 1/100th of a percentage of total bandwidth. */
43445         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
43446                 (UINT32_C(0x1) << 29)
43447         /* Raw value */
43448         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
43449                 (UINT32_C(0x7) << 29)
43450         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
43451                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
43452         /* A meter burst size specified in bytes. */
43453         uint32_t        commit_burst;
43454         /* The bandwidth value. */
43455         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK \
43456                 UINT32_C(0xfffffff)
43457         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT \
43458                 0
43459         /* The granularity of the value (bits or bytes). */
43460         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE \
43461                 UINT32_C(0x10000000)
43462         /* Value is in bits. */
43463         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS \
43464                 (UINT32_C(0x0) << 28)
43465         /* Value is in bytes. */
43466         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES \
43467                 (UINT32_C(0x1) << 28)
43468         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST \
43469                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
43470         /* bw_value_unit is 3 b */
43471         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
43472                 UINT32_C(0xe0000000)
43473         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
43474                 29
43475         /* Value is in Mb or MB (base 10). */
43476         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
43477                 (UINT32_C(0x0) << 29)
43478         /* Value is in Kb or KB (base 10). */
43479         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
43480                 (UINT32_C(0x2) << 29)
43481         /* Value is in bits or bytes. */
43482         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
43483                 (UINT32_C(0x4) << 29)
43484         /* Value is in Gb or GB (base 10). */
43485         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
43486                 (UINT32_C(0x6) << 29)
43487         /* Value is in 1/100th of a percentage of total bandwidth. */
43488         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
43489                 (UINT32_C(0x1) << 29)
43490         /* Invalid value */
43491         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
43492                 (UINT32_C(0x7) << 29)
43493         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
43494                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
43495         /* A meter rate specified in bytes-per-second. */
43496         uint32_t        excess_peak_rate;
43497         /* The bandwidth value. */
43498         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
43499                 UINT32_C(0xfffffff)
43500         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
43501                 0
43502         /* The granularity of the value (bits or bytes). */
43503         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE \
43504                 UINT32_C(0x10000000)
43505         /* Value is in bits. */
43506         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
43507                 (UINT32_C(0x0) << 28)
43508         /* Value is in bytes. */
43509         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
43510                 (UINT32_C(0x1) << 28)
43511         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
43512                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
43513         /* bw_value_unit is 3 b */
43514         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
43515                 UINT32_C(0xe0000000)
43516         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
43517                 29
43518         /* Value is in Mb or MB (base 10). */
43519         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
43520                 (UINT32_C(0x0) << 29)
43521         /* Value is in Kb or KB (base 10). */
43522         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
43523                 (UINT32_C(0x2) << 29)
43524         /* Value is in bits or bytes. */
43525         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
43526                 (UINT32_C(0x4) << 29)
43527         /* Value is in Gb or GB (base 10). */
43528         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
43529                 (UINT32_C(0x6) << 29)
43530         /* Value is in 1/100th of a percentage of total bandwidth. */
43531         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
43532                 (UINT32_C(0x1) << 29)
43533         /* Raw unit */
43534         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
43535                 (UINT32_C(0x7) << 29)
43536         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
43537                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
43538         /* A meter burst size specified in bytes. */
43539         uint32_t        excess_peak_burst;
43540         /* The bandwidth value. */
43541         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
43542                 UINT32_C(0xfffffff)
43543         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
43544                 0
43545         /* The granularity of the value (bits or bytes). */
43546         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE \
43547                 UINT32_C(0x10000000)
43548         /* Value is in bits. */
43549         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
43550                 (UINT32_C(0x0) << 28)
43551         /* Value is in bytes. */
43552         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
43553                 (UINT32_C(0x1) << 28)
43554         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
43555                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
43556         /* bw_value_unit is 3 b */
43557         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
43558                 UINT32_C(0xe0000000)
43559         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
43560                 29
43561         /* Value is in Mb or MB (base 10). */
43562         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
43563                 (UINT32_C(0x0) << 29)
43564         /* Value is in Kb or KB (base 10). */
43565         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
43566                 (UINT32_C(0x2) << 29)
43567         /* Value is in bits or bytes. */
43568         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
43569                 (UINT32_C(0x4) << 29)
43570         /* Value is in Gb or GB (base 10). */
43571         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
43572                 (UINT32_C(0x6) << 29)
43573         /* Value is in 1/100th of a percentage of total bandwidth. */
43574         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
43575                 (UINT32_C(0x1) << 29)
43576         /* Invalid unit */
43577         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
43578                 (UINT32_C(0x7) << 29)
43579         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
43580                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
43581 } __rte_packed;
43582
43583 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
43584 struct hwrm_cfa_meter_profile_alloc_output {
43585         /* The specific error status for the command. */
43586         uint16_t        error_code;
43587         /* The HWRM command request type. */
43588         uint16_t        req_type;
43589         /* The sequence ID from the original command. */
43590         uint16_t        seq_id;
43591         /* The length of the response data in number of bytes. */
43592         uint16_t        resp_len;
43593         /* This value identifies a meter profile in CFA. */
43594         uint16_t        meter_profile_id;
43595         /*
43596          * A value of 0xfff is considered invalid and implies the
43597          * profile is not configured.
43598          */
43599         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID \
43600                 UINT32_C(0xffff)
43601         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_LAST \
43602                 HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID
43603         uint8_t unused_0[5];
43604         /*
43605          * This field is used in Output records to indicate that the output
43606          * is completely written to RAM. This field should be read as '1'
43607          * to indicate that the output has been completely written.
43608          * When writing a command completion or response to an internal
43609          * processor, the order of writes has to be such that this field is
43610          * written last.
43611          */
43612         uint8_t valid;
43613 } __rte_packed;
43614
43615 /*******************************
43616  * hwrm_cfa_meter_profile_free *
43617  *******************************/
43618
43619
43620 /* hwrm_cfa_meter_profile_free_input (size:192b/24B) */
43621 struct hwrm_cfa_meter_profile_free_input {
43622         /* The HWRM command request type. */
43623         uint16_t        req_type;
43624         /*
43625          * The completion ring to send the completion event on. This should
43626          * be the NQ ID returned from the `nq_alloc` HWRM command.
43627          */
43628         uint16_t        cmpl_ring;
43629         /*
43630          * The sequence ID is used by the driver for tracking multiple
43631          * commands. This ID is treated as opaque data by the firmware and
43632          * the value is returned in the `hwrm_resp_hdr` upon completion.
43633          */
43634         uint16_t        seq_id;
43635         /*
43636          * The target ID of the command:
43637          * * 0x0-0xFFF8 - The function ID
43638          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43639          * * 0xFFFD - Reserved for user-space HWRM interface
43640          * * 0xFFFF - HWRM
43641          */
43642         uint16_t        target_id;
43643         /*
43644          * A physical address pointer pointing to a host buffer that the
43645          * command's response data will be written. This can be either a host
43646          * physical address (HPA) or a guest physical address (GPA) and must
43647          * point to a physically contiguous block of memory.
43648          */
43649         uint64_t        resp_addr;
43650         uint8_t flags;
43651         /*
43652          * Enumeration denoting the RX, TX type of the resource.
43653          * This enumeration is used for resources that are similar for both
43654          * TX and RX paths of the chip.
43655          */
43656         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
43657         /* tx path */
43658         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX \
43659                 UINT32_C(0x0)
43660         /* rx path */
43661         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX \
43662                 UINT32_C(0x1)
43663         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST \
43664                 HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
43665         uint8_t unused_0;
43666         /* This value identifies a meter profile in CFA. */
43667         uint16_t        meter_profile_id;
43668         /*
43669          * A value of 0xfff is considered invalid and implies the
43670          * profile is not configured.
43671          */
43672         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID \
43673                 UINT32_C(0xffff)
43674         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST \
43675                 HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
43676         uint8_t unused_1[4];
43677 } __rte_packed;
43678
43679 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
43680 struct hwrm_cfa_meter_profile_free_output {
43681         /* The specific error status for the command. */
43682         uint16_t        error_code;
43683         /* The HWRM command request type. */
43684         uint16_t        req_type;
43685         /* The sequence ID from the original command. */
43686         uint16_t        seq_id;
43687         /* The length of the response data in number of bytes. */
43688         uint16_t        resp_len;
43689         uint8_t unused_0[7];
43690         /*
43691          * This field is used in Output records to indicate that the output
43692          * is completely written to RAM. This field should be read as '1'
43693          * to indicate that the output has been completely written.
43694          * When writing a command completion or response to an internal
43695          * processor, the order of writes has to be such that this field is
43696          * written last.
43697          */
43698         uint8_t valid;
43699 } __rte_packed;
43700
43701 /******************************
43702  * hwrm_cfa_meter_profile_cfg *
43703  ******************************/
43704
43705
43706 /* hwrm_cfa_meter_profile_cfg_input (size:320b/40B) */
43707 struct hwrm_cfa_meter_profile_cfg_input {
43708         /* The HWRM command request type. */
43709         uint16_t        req_type;
43710         /*
43711          * The completion ring to send the completion event on. This should
43712          * be the NQ ID returned from the `nq_alloc` HWRM command.
43713          */
43714         uint16_t        cmpl_ring;
43715         /*
43716          * The sequence ID is used by the driver for tracking multiple
43717          * commands. This ID is treated as opaque data by the firmware and
43718          * the value is returned in the `hwrm_resp_hdr` upon completion.
43719          */
43720         uint16_t        seq_id;
43721         /*
43722          * The target ID of the command:
43723          * * 0x0-0xFFF8 - The function ID
43724          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43725          * * 0xFFFD - Reserved for user-space HWRM interface
43726          * * 0xFFFF - HWRM
43727          */
43728         uint16_t        target_id;
43729         /*
43730          * A physical address pointer pointing to a host buffer that the
43731          * command's response data will be written. This can be either a host
43732          * physical address (HPA) or a guest physical address (GPA) and must
43733          * point to a physically contiguous block of memory.
43734          */
43735         uint64_t        resp_addr;
43736         uint8_t flags;
43737         /*
43738          * Enumeration denoting the RX, TX type of the resource.
43739          * This enumeration is used for resources that are similar for both
43740          * TX and RX paths of the chip.
43741          */
43742         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
43743         /* tx path */
43744         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
43745         /* rx path */
43746         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
43747         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST \
43748                 HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
43749         /* The meter algorithm type. */
43750         uint8_t meter_type;
43751         /* RFC 2697 (srTCM) */
43752         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 \
43753                 UINT32_C(0x0)
43754         /* RFC 2698 (trTCM) */
43755         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 \
43756                 UINT32_C(0x1)
43757         /* RFC 4115 (trTCM) */
43758         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 \
43759                 UINT32_C(0x2)
43760         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_LAST \
43761                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115
43762         /* This value identifies a meter profile in CFA. */
43763         uint16_t        meter_profile_id;
43764         /*
43765          * A value of 0xfff is considered invalid and implies the
43766          * profile is not configured.
43767          */
43768         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID \
43769                 UINT32_C(0xffff)
43770         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_LAST \
43771                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID
43772         /*
43773          * This field is reserved for the future use.
43774          * It shall be set to 0.
43775          */
43776         uint32_t        reserved;
43777         /* A meter rate specified in bytes-per-second. */
43778         uint32_t        commit_rate;
43779         /* The bandwidth value. */
43780         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK \
43781                 UINT32_C(0xfffffff)
43782         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT \
43783                 0
43784         /* The granularity of the value (bits or bytes). */
43785         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE \
43786                 UINT32_C(0x10000000)
43787         /* Value is in bits. */
43788         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS \
43789                 (UINT32_C(0x0) << 28)
43790         /* Value is in bytes. */
43791         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES \
43792                 (UINT32_C(0x1) << 28)
43793         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST \
43794                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
43795         /* bw_value_unit is 3 b */
43796         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
43797                 UINT32_C(0xe0000000)
43798         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
43799                 29
43800         /* Value is in Mb or MB (base 10). */
43801         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
43802                 (UINT32_C(0x0) << 29)
43803         /* Value is in Kb or KB (base 10). */
43804         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
43805                 (UINT32_C(0x2) << 29)
43806         /* Value is in bits or bytes. */
43807         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
43808                 (UINT32_C(0x4) << 29)
43809         /* Value is in Gb or GB (base 10). */
43810         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
43811                 (UINT32_C(0x6) << 29)
43812         /* Value is in 1/100th of a percentage of total bandwidth. */
43813         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
43814                 (UINT32_C(0x1) << 29)
43815         /* Raw value */
43816         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
43817                 (UINT32_C(0x7) << 29)
43818         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
43819                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
43820         /* A meter burst size specified in bytes. */
43821         uint32_t        commit_burst;
43822         /* The bandwidth value. */
43823         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK \
43824                 UINT32_C(0xfffffff)
43825         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT \
43826                 0
43827         /* The granularity of the value (bits or bytes). */
43828         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE \
43829                 UINT32_C(0x10000000)
43830         /* Value is in bits. */
43831         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS \
43832                 (UINT32_C(0x0) << 28)
43833         /* Value is in bytes. */
43834         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES \
43835                 (UINT32_C(0x1) << 28)
43836         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST \
43837                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
43838         /* bw_value_unit is 3 b */
43839         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
43840                 UINT32_C(0xe0000000)
43841         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
43842                 29
43843         /* Value is in Mb or MB (base 10). */
43844         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
43845                 (UINT32_C(0x0) << 29)
43846         /* Value is in Kb or KB (base 10). */
43847         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
43848                 (UINT32_C(0x2) << 29)
43849         /* Value is in bits or bytes. */
43850         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
43851                 (UINT32_C(0x4) << 29)
43852         /* Value is in Gb or GB (base 10). */
43853         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
43854                 (UINT32_C(0x6) << 29)
43855         /* Value is in 1/100th of a percentage of total bandwidth. */
43856         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
43857                 (UINT32_C(0x1) << 29)
43858         /* Invalid value */
43859         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
43860                 (UINT32_C(0x7) << 29)
43861         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
43862                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
43863         /* A meter rate specified in bytes-per-second. */
43864         uint32_t        excess_peak_rate;
43865         /* The bandwidth value. */
43866         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
43867                 UINT32_C(0xfffffff)
43868         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
43869                 0
43870         /* The granularity of the value (bits or bytes). */
43871         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE \
43872                 UINT32_C(0x10000000)
43873         /* Value is in bits. */
43874         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
43875                 (UINT32_C(0x0) << 28)
43876         /* Value is in bytes. */
43877         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
43878                 (UINT32_C(0x1) << 28)
43879         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
43880                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
43881         /* bw_value_unit is 3 b */
43882         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
43883                 UINT32_C(0xe0000000)
43884         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
43885                 29
43886         /* Value is in Mb or MB (base 10). */
43887         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
43888                 (UINT32_C(0x0) << 29)
43889         /* Value is in Kb or KB (base 10). */
43890         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
43891                 (UINT32_C(0x2) << 29)
43892         /* Value is in bits or bytes. */
43893         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
43894                 (UINT32_C(0x4) << 29)
43895         /* Value is in Gb or GB (base 10). */
43896         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
43897                 (UINT32_C(0x6) << 29)
43898         /* Value is in 1/100th of a percentage of total bandwidth. */
43899         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
43900                 (UINT32_C(0x1) << 29)
43901         /* Raw unit */
43902         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
43903                 (UINT32_C(0x7) << 29)
43904         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
43905                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
43906         /* A meter burst size specified in bytes. */
43907         uint32_t        excess_peak_burst;
43908         /* The bandwidth value. */
43909         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
43910                 UINT32_C(0xfffffff)
43911         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
43912                 0
43913         /* The granularity of the value (bits or bytes). */
43914         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE \
43915                 UINT32_C(0x10000000)
43916         /* Value is in bits. */
43917         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
43918                 (UINT32_C(0x0) << 28)
43919         /* Value is in bytes. */
43920         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
43921                 (UINT32_C(0x1) << 28)
43922         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
43923                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
43924         /* bw_value_unit is 3 b */
43925         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
43926                 UINT32_C(0xe0000000)
43927         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
43928                 29
43929         /* Value is in Mb or MB (base 10). */
43930         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
43931                 (UINT32_C(0x0) << 29)
43932         /* Value is in Kb or KB (base 10). */
43933         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
43934                 (UINT32_C(0x2) << 29)
43935         /* Value is in bits or bytes. */
43936         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
43937                 (UINT32_C(0x4) << 29)
43938         /* Value is in Gb or GB (base 10). */
43939         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
43940                 (UINT32_C(0x6) << 29)
43941         /* Value is in 1/100th of a percentage of total bandwidth. */
43942         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
43943                 (UINT32_C(0x1) << 29)
43944         /* Invalid unit */
43945         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
43946                 (UINT32_C(0x7) << 29)
43947         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
43948                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
43949 } __rte_packed;
43950
43951 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
43952 struct hwrm_cfa_meter_profile_cfg_output {
43953         /* The specific error status for the command. */
43954         uint16_t        error_code;
43955         /* The HWRM command request type. */
43956         uint16_t        req_type;
43957         /* The sequence ID from the original command. */
43958         uint16_t        seq_id;
43959         /* The length of the response data in number of bytes. */
43960         uint16_t        resp_len;
43961         uint8_t unused_0[7];
43962         /*
43963          * This field is used in Output records to indicate that the output
43964          * is completely written to RAM. This field should be read as '1'
43965          * to indicate that the output has been completely written.
43966          * When writing a command completion or response to an internal
43967          * processor, the order of writes has to be such that this field is
43968          * written last.
43969          */
43970         uint8_t valid;
43971 } __rte_packed;
43972
43973 /*********************************
43974  * hwrm_cfa_meter_instance_alloc *
43975  *********************************/
43976
43977
43978 /* hwrm_cfa_meter_instance_alloc_input (size:192b/24B) */
43979 struct hwrm_cfa_meter_instance_alloc_input {
43980         /* The HWRM command request type. */
43981         uint16_t        req_type;
43982         /*
43983          * The completion ring to send the completion event on. This should
43984          * be the NQ ID returned from the `nq_alloc` HWRM command.
43985          */
43986         uint16_t        cmpl_ring;
43987         /*
43988          * The sequence ID is used by the driver for tracking multiple
43989          * commands. This ID is treated as opaque data by the firmware and
43990          * the value is returned in the `hwrm_resp_hdr` upon completion.
43991          */
43992         uint16_t        seq_id;
43993         /*
43994          * The target ID of the command:
43995          * * 0x0-0xFFF8 - The function ID
43996          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43997          * * 0xFFFD - Reserved for user-space HWRM interface
43998          * * 0xFFFF - HWRM
43999          */
44000         uint16_t        target_id;
44001         /*
44002          * A physical address pointer pointing to a host buffer that the
44003          * command's response data will be written. This can be either a host
44004          * physical address (HPA) or a guest physical address (GPA) and must
44005          * point to a physically contiguous block of memory.
44006          */
44007         uint64_t        resp_addr;
44008         uint8_t flags;
44009         /*
44010          * Enumeration denoting the RX, TX type of the resource.
44011          * This enumeration is used for resources that are similar for both
44012          * TX and RX paths of the chip.
44013          */
44014         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH \
44015                 UINT32_C(0x1)
44016         /* tx path */
44017         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX \
44018                 UINT32_C(0x0)
44019         /* rx path */
44020         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX \
44021                 UINT32_C(0x1)
44022         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST \
44023                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
44024         uint8_t unused_0;
44025         /* This value identifies a meter profile in CFA. */
44026         uint16_t        meter_profile_id;
44027         /*
44028          * A value of 0xffff is considered invalid and implies the
44029          * profile is not configured.
44030          */
44031         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID \
44032                 UINT32_C(0xffff)
44033         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST \
44034                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
44035         uint8_t unused_1[4];
44036 } __rte_packed;
44037
44038 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
44039 struct hwrm_cfa_meter_instance_alloc_output {
44040         /* The specific error status for the command. */
44041         uint16_t        error_code;
44042         /* The HWRM command request type. */
44043         uint16_t        req_type;
44044         /* The sequence ID from the original command. */
44045         uint16_t        seq_id;
44046         /* The length of the response data in number of bytes. */
44047         uint16_t        resp_len;
44048         /* This value identifies a meter instance in CFA. */
44049         uint16_t        meter_instance_id;
44050         /*
44051          * A value of 0xffff is considered invalid and implies the
44052          * instance is not configured.
44053          */
44054         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID \
44055                 UINT32_C(0xffff)
44056         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_LAST \
44057                 HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID
44058         uint8_t unused_0[5];
44059         /*
44060          * This field is used in Output records to indicate that the output
44061          * is completely written to RAM. This field should be read as '1'
44062          * to indicate that the output has been completely written.
44063          * When writing a command completion or response to an internal
44064          * processor, the order of writes has to be such that this field is
44065          * written last.
44066          */
44067         uint8_t valid;
44068 } __rte_packed;
44069
44070 /*******************************
44071  * hwrm_cfa_meter_instance_cfg *
44072  *******************************/
44073
44074
44075 /* hwrm_cfa_meter_instance_cfg_input (size:192b/24B) */
44076 struct hwrm_cfa_meter_instance_cfg_input {
44077         /* The HWRM command request type. */
44078         uint16_t        req_type;
44079         /*
44080          * The completion ring to send the completion event on. This should
44081          * be the NQ ID returned from the `nq_alloc` HWRM command.
44082          */
44083         uint16_t        cmpl_ring;
44084         /*
44085          * The sequence ID is used by the driver for tracking multiple
44086          * commands. This ID is treated as opaque data by the firmware and
44087          * the value is returned in the `hwrm_resp_hdr` upon completion.
44088          */
44089         uint16_t        seq_id;
44090         /*
44091          * The target ID of the command:
44092          * * 0x0-0xFFF8 - The function ID
44093          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44094          * * 0xFFFD - Reserved for user-space HWRM interface
44095          * * 0xFFFF - HWRM
44096          */
44097         uint16_t        target_id;
44098         /*
44099          * A physical address pointer pointing to a host buffer that the
44100          * command's response data will be written. This can be either a host
44101          * physical address (HPA) or a guest physical address (GPA) and must
44102          * point to a physically contiguous block of memory.
44103          */
44104         uint64_t        resp_addr;
44105         uint8_t flags;
44106         /*
44107          * Enumeration denoting the RX, TX type of the resource.
44108          * This enumeration is used for resources that are similar for both
44109          * TX and RX paths of the chip.
44110          */
44111         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
44112         /* tx path */
44113         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_TX \
44114                 UINT32_C(0x0)
44115         /* rx path */
44116         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX \
44117                 UINT32_C(0x1)
44118         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_LAST \
44119                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX
44120         uint8_t unused_0;
44121         /*
44122          * This value identifies a new meter profile to be associated with
44123          * the meter instance specified in this command.
44124          */
44125         uint16_t        meter_profile_id;
44126         /*
44127          * A value of 0xffff is considered invalid and implies the
44128          * profile is not configured.
44129          */
44130         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID \
44131                 UINT32_C(0xffff)
44132         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_LAST \
44133                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID
44134         /*
44135          * This value identifies the ID of a meter instance that needs to be
44136          * updated with a new meter profile specified in this command.
44137          */
44138         uint16_t        meter_instance_id;
44139         uint8_t unused_1[2];
44140 } __rte_packed;
44141
44142 /* hwrm_cfa_meter_instance_cfg_output (size:128b/16B) */
44143 struct hwrm_cfa_meter_instance_cfg_output {
44144         /* The specific error status for the command. */
44145         uint16_t        error_code;
44146         /* The HWRM command request type. */
44147         uint16_t        req_type;
44148         /* The sequence ID from the original command. */
44149         uint16_t        seq_id;
44150         /* The length of the response data in number of bytes. */
44151         uint16_t        resp_len;
44152         uint8_t unused_0[7];
44153         /*
44154          * This field is used in Output records to indicate that the output
44155          * is completely written to RAM. This field should be read as '1'
44156          * to indicate that the output has been completely written.
44157          * When writing a command completion or response to an internal
44158          * processor, the order of writes has to be such that this field is
44159          * written last.
44160          */
44161         uint8_t valid;
44162 } __rte_packed;
44163
44164 /********************************
44165  * hwrm_cfa_meter_instance_free *
44166  ********************************/
44167
44168
44169 /* hwrm_cfa_meter_instance_free_input (size:192b/24B) */
44170 struct hwrm_cfa_meter_instance_free_input {
44171         /* The HWRM command request type. */
44172         uint16_t        req_type;
44173         /*
44174          * The completion ring to send the completion event on. This should
44175          * be the NQ ID returned from the `nq_alloc` HWRM command.
44176          */
44177         uint16_t        cmpl_ring;
44178         /*
44179          * The sequence ID is used by the driver for tracking multiple
44180          * commands. This ID is treated as opaque data by the firmware and
44181          * the value is returned in the `hwrm_resp_hdr` upon completion.
44182          */
44183         uint16_t        seq_id;
44184         /*
44185          * The target ID of the command:
44186          * * 0x0-0xFFF8 - The function ID
44187          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44188          * * 0xFFFD - Reserved for user-space HWRM interface
44189          * * 0xFFFF - HWRM
44190          */
44191         uint16_t        target_id;
44192         /*
44193          * A physical address pointer pointing to a host buffer that the
44194          * command's response data will be written. This can be either a host
44195          * physical address (HPA) or a guest physical address (GPA) and must
44196          * point to a physically contiguous block of memory.
44197          */
44198         uint64_t        resp_addr;
44199         uint8_t flags;
44200         /*
44201          * Enumeration denoting the RX, TX type of the resource.
44202          * This enumeration is used for resources that are similar for both
44203          * TX and RX paths of the chip.
44204          */
44205         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
44206         /* tx path */
44207         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX \
44208                 UINT32_C(0x0)
44209         /* rx path */
44210         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX \
44211                 UINT32_C(0x1)
44212         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST \
44213                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
44214         uint8_t unused_0;
44215         /* This value identifies a meter instance in CFA. */
44216         uint16_t        meter_instance_id;
44217         /*
44218          * A value of 0xfff is considered invalid and implies the
44219          * instance is not configured.
44220          */
44221         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID \
44222                 UINT32_C(0xffff)
44223         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST \
44224                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
44225         uint8_t unused_1[4];
44226 } __rte_packed;
44227
44228 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
44229 struct hwrm_cfa_meter_instance_free_output {
44230         /* The specific error status for the command. */
44231         uint16_t        error_code;
44232         /* The HWRM command request type. */
44233         uint16_t        req_type;
44234         /* The sequence ID from the original command. */
44235         uint16_t        seq_id;
44236         /* The length of the response data in number of bytes. */
44237         uint16_t        resp_len;
44238         uint8_t unused_0[7];
44239         /*
44240          * This field is used in Output records to indicate that the output
44241          * is completely written to RAM. This field should be read as '1'
44242          * to indicate that the output has been completely written.
44243          * When writing a command completion or response to an internal
44244          * processor, the order of writes has to be such that this field is
44245          * written last.
44246          */
44247         uint8_t valid;
44248 } __rte_packed;
44249
44250 /*******************************
44251  * hwrm_cfa_decap_filter_alloc *
44252  *******************************/
44253
44254
44255 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */
44256 struct hwrm_cfa_decap_filter_alloc_input {
44257         /* The HWRM command request type. */
44258         uint16_t        req_type;
44259         /*
44260          * The completion ring to send the completion event on. This should
44261          * be the NQ ID returned from the `nq_alloc` HWRM command.
44262          */
44263         uint16_t        cmpl_ring;
44264         /*
44265          * The sequence ID is used by the driver for tracking multiple
44266          * commands. This ID is treated as opaque data by the firmware and
44267          * the value is returned in the `hwrm_resp_hdr` upon completion.
44268          */
44269         uint16_t        seq_id;
44270         /*
44271          * The target ID of the command:
44272          * * 0x0-0xFFF8 - The function ID
44273          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44274          * * 0xFFFD - Reserved for user-space HWRM interface
44275          * * 0xFFFF - HWRM
44276          */
44277         uint16_t        target_id;
44278         /*
44279          * A physical address pointer pointing to a host buffer that the
44280          * command's response data will be written. This can be either a host
44281          * physical address (HPA) or a guest physical address (GPA) and must
44282          * point to a physically contiguous block of memory.
44283          */
44284         uint64_t        resp_addr;
44285         uint32_t        flags;
44286         /* ovs_tunnel is 1 b */
44287         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL \
44288                 UINT32_C(0x1)
44289         uint32_t        enables;
44290         /*
44291          * This bit must be '1' for the tunnel_type field to be
44292          * configured.
44293          */
44294         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
44295                 UINT32_C(0x1)
44296         /*
44297          * This bit must be '1' for the tunnel_id field to be
44298          * configured.
44299          */
44300         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID \
44301                 UINT32_C(0x2)
44302         /*
44303          * This bit must be '1' for the src_macaddr field to be
44304          * configured.
44305          */
44306         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
44307                 UINT32_C(0x4)
44308         /*
44309          * This bit must be '1' for the dst_macaddr field to be
44310          * configured.
44311          */
44312         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
44313                 UINT32_C(0x8)
44314         /*
44315          * This bit must be '1' for the ovlan_vid field to be
44316          * configured.
44317          */
44318         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID \
44319                 UINT32_C(0x10)
44320         /*
44321          * This bit must be '1' for the ivlan_vid field to be
44322          * configured.
44323          */
44324         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID \
44325                 UINT32_C(0x20)
44326         /*
44327          * This bit must be '1' for the t_ovlan_vid field to be
44328          * configured.
44329          */
44330         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID \
44331                 UINT32_C(0x40)
44332         /*
44333          * This bit must be '1' for the t_ivlan_vid field to be
44334          * configured.
44335          */
44336         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID \
44337                 UINT32_C(0x80)
44338         /*
44339          * This bit must be '1' for the ethertype field to be
44340          * configured.
44341          */
44342         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
44343                 UINT32_C(0x100)
44344         /*
44345          * This bit must be '1' for the src_ipaddr field to be
44346          * configured.
44347          */
44348         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
44349                 UINT32_C(0x200)
44350         /*
44351          * This bit must be '1' for the dst_ipaddr field to be
44352          * configured.
44353          */
44354         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
44355                 UINT32_C(0x400)
44356         /*
44357          * This bit must be '1' for the ipaddr_type field to be
44358          * configured.
44359          */
44360         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
44361                 UINT32_C(0x800)
44362         /*
44363          * This bit must be '1' for the ip_protocol field to be
44364          * configured.
44365          */
44366         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
44367                 UINT32_C(0x1000)
44368         /*
44369          * This bit must be '1' for the src_port field to be
44370          * configured.
44371          */
44372         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
44373                 UINT32_C(0x2000)
44374         /*
44375          * This bit must be '1' for the dst_port field to be
44376          * configured.
44377          */
44378         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
44379                 UINT32_C(0x4000)
44380         /*
44381          * This bit must be '1' for the dst_id field to be
44382          * configured.
44383          */
44384         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
44385                 UINT32_C(0x8000)
44386         /*
44387          * This bit must be '1' for the mirror_vnic_id field to be
44388          * configured.
44389          */
44390         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
44391                 UINT32_C(0x10000)
44392         /*
44393          * Tunnel identifier.
44394          * Virtual Network Identifier (VNI). Only valid with
44395          * tunnel_types VXLAN, NVGRE, and Geneve.
44396          * Only lower 24-bits of VNI field are used
44397          * in setting up the filter.
44398          */
44399         uint32_t        tunnel_id;
44400         /* Tunnel Type. */
44401         uint8_t tunnel_type;
44402         /* Non-tunnel */
44403         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
44404                 UINT32_C(0x0)
44405         /* Virtual eXtensible Local Area Network (VXLAN) */
44406         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
44407                 UINT32_C(0x1)
44408         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
44409         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
44410                 UINT32_C(0x2)
44411         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
44412         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
44413                 UINT32_C(0x3)
44414         /* IP in IP */
44415         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
44416                 UINT32_C(0x4)
44417         /* Generic Network Virtualization Encapsulation (Geneve) */
44418         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
44419                 UINT32_C(0x5)
44420         /* Multi-Protocol Label Switching (MPLS) */
44421         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
44422                 UINT32_C(0x6)
44423         /* Stateless Transport Tunnel (STT) */
44424         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
44425                 UINT32_C(0x7)
44426         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
44427         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
44428                 UINT32_C(0x8)
44429         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
44430         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
44431                 UINT32_C(0x9)
44432         /*
44433          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
44434          * datagram payload
44435          */
44436         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
44437                 UINT32_C(0xa)
44438         /* Use fixed layer 2 ether type of 0xFFFF */
44439         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
44440                 UINT32_C(0xb)
44441         /*
44442          * IPV6 over virtual eXtensible Local Area Network with GPE header
44443          * (IPV6oVXLANGPE)
44444          */
44445         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
44446                 UINT32_C(0xc)
44447         /* Any tunneled traffic */
44448         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
44449                 UINT32_C(0xff)
44450         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
44451                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
44452         uint8_t unused_0;
44453         uint16_t        unused_1;
44454         /*
44455          * This value indicates the source MAC address in
44456          * the Ethernet header.
44457          */
44458         uint8_t src_macaddr[6];
44459         uint8_t unused_2[2];
44460         /*
44461          * This value indicates the destination MAC address in
44462          * the Ethernet header.
44463          */
44464         uint8_t dst_macaddr[6];
44465         /*
44466          * This value indicates the VLAN ID of the outer VLAN tag
44467          * in the Ethernet header.
44468          */
44469         uint16_t        ovlan_vid;
44470         /*
44471          * This value indicates the VLAN ID of the inner VLAN tag
44472          * in the Ethernet header.
44473          */
44474         uint16_t        ivlan_vid;
44475         /*
44476          * This value indicates the VLAN ID of the outer VLAN tag
44477          * in the tunnel Ethernet header.
44478          */
44479         uint16_t        t_ovlan_vid;
44480         /*
44481          * This value indicates the VLAN ID of the inner VLAN tag
44482          * in the tunnel Ethernet header.
44483          */
44484         uint16_t        t_ivlan_vid;
44485         /* This value indicates the ethertype in the Ethernet header. */
44486         uint16_t        ethertype;
44487         /*
44488          * This value indicates the type of IP address.
44489          * 4 - IPv4
44490          * 6 - IPv6
44491          * All others are invalid.
44492          */
44493         uint8_t ip_addr_type;
44494         /* invalid */
44495         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
44496                 UINT32_C(0x0)
44497         /* IPv4 */
44498         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
44499                 UINT32_C(0x4)
44500         /* IPv6 */
44501         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
44502                 UINT32_C(0x6)
44503         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
44504                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
44505         /*
44506          * The value of protocol filed in IP header.
44507          * Applies to UDP and TCP traffic.
44508          * 6 - TCP
44509          * 17 - UDP
44510          */
44511         uint8_t ip_protocol;
44512         /* invalid */
44513         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
44514                 UINT32_C(0x0)
44515         /* TCP */
44516         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
44517                 UINT32_C(0x6)
44518         /* UDP */
44519         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
44520                 UINT32_C(0x11)
44521         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
44522                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
44523         uint16_t        unused_3;
44524         uint32_t        unused_4;
44525         /*
44526          * The value of source IP address to be used in filtering.
44527          * For IPv4, first four bytes represent the IP address.
44528          */
44529         uint32_t        src_ipaddr[4];
44530         /*
44531          * The value of destination IP address to be used in filtering.
44532          * For IPv4, first four bytes represent the IP address.
44533          */
44534         uint32_t        dst_ipaddr[4];
44535         /*
44536          * The value of source port to be used in filtering.
44537          * Applies to UDP and TCP traffic.
44538          */
44539         uint16_t        src_port;
44540         /*
44541          * The value of destination port to be used in filtering.
44542          * Applies to UDP and TCP traffic.
44543          */
44544         uint16_t        dst_port;
44545         /*
44546          * If set, this value shall represent the
44547          * Logical VNIC ID of the destination VNIC for the RX
44548          * path.
44549          */
44550         uint16_t        dst_id;
44551         /*
44552          * If set, this value shall represent the L2 context that matches the
44553          * L2 information of the decap filter.
44554          */
44555         uint16_t        l2_ctxt_ref_id;
44556 } __rte_packed;
44557
44558 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
44559 struct hwrm_cfa_decap_filter_alloc_output {
44560         /* The specific error status for the command. */
44561         uint16_t        error_code;
44562         /* The HWRM command request type. */
44563         uint16_t        req_type;
44564         /* The sequence ID from the original command. */
44565         uint16_t        seq_id;
44566         /* The length of the response data in number of bytes. */
44567         uint16_t        resp_len;
44568         /* This value is an opaque id into CFA data structures. */
44569         uint32_t        decap_filter_id;
44570         uint8_t unused_0[3];
44571         /*
44572          * This field is used in Output records to indicate that the output
44573          * is completely written to RAM. This field should be read as '1'
44574          * to indicate that the output has been completely written.
44575          * When writing a command completion or response to an internal
44576          * processor, the order of writes has to be such that this field is
44577          * written last.
44578          */
44579         uint8_t valid;
44580 } __rte_packed;
44581
44582 /******************************
44583  * hwrm_cfa_decap_filter_free *
44584  ******************************/
44585
44586
44587 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */
44588 struct hwrm_cfa_decap_filter_free_input {
44589         /* The HWRM command request type. */
44590         uint16_t        req_type;
44591         /*
44592          * The completion ring to send the completion event on. This should
44593          * be the NQ ID returned from the `nq_alloc` HWRM command.
44594          */
44595         uint16_t        cmpl_ring;
44596         /*
44597          * The sequence ID is used by the driver for tracking multiple
44598          * commands. This ID is treated as opaque data by the firmware and
44599          * the value is returned in the `hwrm_resp_hdr` upon completion.
44600          */
44601         uint16_t        seq_id;
44602         /*
44603          * The target ID of the command:
44604          * * 0x0-0xFFF8 - The function ID
44605          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44606          * * 0xFFFD - Reserved for user-space HWRM interface
44607          * * 0xFFFF - HWRM
44608          */
44609         uint16_t        target_id;
44610         /*
44611          * A physical address pointer pointing to a host buffer that the
44612          * command's response data will be written. This can be either a host
44613          * physical address (HPA) or a guest physical address (GPA) and must
44614          * point to a physically contiguous block of memory.
44615          */
44616         uint64_t        resp_addr;
44617         /* This value is an opaque id into CFA data structures. */
44618         uint32_t        decap_filter_id;
44619         uint8_t unused_0[4];
44620 } __rte_packed;
44621
44622 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
44623 struct hwrm_cfa_decap_filter_free_output {
44624         /* The specific error status for the command. */
44625         uint16_t        error_code;
44626         /* The HWRM command request type. */
44627         uint16_t        req_type;
44628         /* The sequence ID from the original command. */
44629         uint16_t        seq_id;
44630         /* The length of the response data in number of bytes. */
44631         uint16_t        resp_len;
44632         uint8_t unused_0[7];
44633         /*
44634          * This field is used in Output records to indicate that the output
44635          * is completely written to RAM. This field should be read as '1'
44636          * to indicate that the output has been completely written.
44637          * When writing a command completion or response to an internal
44638          * processor, the order of writes has to be such that this field is
44639          * written last.
44640          */
44641         uint8_t valid;
44642 } __rte_packed;
44643
44644 /***********************
44645  * hwrm_cfa_flow_alloc *
44646  ***********************/
44647
44648
44649 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */
44650 struct hwrm_cfa_flow_alloc_input {
44651         /* The HWRM command request type. */
44652         uint16_t        req_type;
44653         /*
44654          * The completion ring to send the completion event on. This should
44655          * be the NQ ID returned from the `nq_alloc` HWRM command.
44656          */
44657         uint16_t        cmpl_ring;
44658         /*
44659          * The sequence ID is used by the driver for tracking multiple
44660          * commands. This ID is treated as opaque data by the firmware and
44661          * the value is returned in the `hwrm_resp_hdr` upon completion.
44662          */
44663         uint16_t        seq_id;
44664         /*
44665          * The target ID of the command:
44666          * * 0x0-0xFFF8 - The function ID
44667          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44668          * * 0xFFFD - Reserved for user-space HWRM interface
44669          * * 0xFFFF - HWRM
44670          */
44671         uint16_t        target_id;
44672         /*
44673          * A physical address pointer pointing to a host buffer that the
44674          * command's response data will be written. This can be either a host
44675          * physical address (HPA) or a guest physical address (GPA) and must
44676          * point to a physically contiguous block of memory.
44677          */
44678         uint64_t        resp_addr;
44679         uint16_t        flags;
44680         /* tunnel is 1 b */
44681         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL \
44682                 UINT32_C(0x1)
44683         /* num_vlan is 2 b */
44684         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK \
44685                 UINT32_C(0x6)
44686         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT           1
44687         /* no tags */
44688         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE \
44689                 (UINT32_C(0x0) << 1)
44690         /* 1 tag */
44691         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE \
44692                 (UINT32_C(0x1) << 1)
44693         /* 2 tags */
44694         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO \
44695                 (UINT32_C(0x2) << 1)
44696         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST \
44697                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
44698         /* Enumeration denoting the Flow Type. */
44699         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK \
44700                 UINT32_C(0x38)
44701         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT           3
44702         /* L2 flow */
44703         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2 \
44704                 (UINT32_C(0x0) << 3)
44705         /* IPV4 flow */
44706         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4 \
44707                 (UINT32_C(0x1) << 3)
44708         /* IPV6 flow */
44709         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6 \
44710                 (UINT32_C(0x2) << 3)
44711         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST \
44712                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
44713         /*
44714          * when set to 1, indicates TX flow offload for function specified
44715          * in src_fid and the dst_fid should be set to invalid value. To
44716          * indicate a VM to VM flow, both of the path_tx and path_rx flags
44717          * need to be set. For virtio vSwitch offload case, the src_fid and
44718          * dst_fid is set to the same fid value. For the SRIOV vSwitch
44719          * offload case, the src_fid and dst_fid must be set to the same VF
44720          * FID belong to the children VFs of the same PF to indicate VM to
44721          * VM flow.
44722          */
44723         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX \
44724                 UINT32_C(0x40)
44725         /*
44726          * when set to 1, indicates RX flow offload for function specified
44727          * in dst_fid and the src_fid should be set to invalid value.
44728          */
44729         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX \
44730                 UINT32_C(0x80)
44731         /*
44732          * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan
44733          * header is required and the VXLAN VNI value is stored in the first
44734          * 24 bits of the dmac field. This flag is only valid when the flow
44735          * direction is RX.
44736          */
44737         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI \
44738                 UINT32_C(0x100)
44739         /*
44740          * Set to 1 to indicate vhost_id is specified in the outer_vlan_tci
44741          * field.
44742          */
44743         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_VHOST_ID_USE_VLAN \
44744                 UINT32_C(0x200)
44745         /*
44746          * Tx Flow: vf fid.
44747          * Rx Flow: pf fid.
44748          */
44749         uint16_t        src_fid;
44750         /* Tunnel handle valid when tunnel flag is set. */
44751         uint32_t        tunnel_handle;
44752         uint16_t        action_flags;
44753         /*
44754          * Setting of this flag indicates drop action. If this flag is not
44755          * set, then it should be considered accept action.
44756          */
44757         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD \
44758                 UINT32_C(0x1)
44759         /* recycle is 1 b */
44760         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE \
44761                 UINT32_C(0x2)
44762         /*
44763          * Setting of this flag indicates drop action. If this flag is not
44764          * set, then it should be considered accept action.
44765          */
44766         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP \
44767                 UINT32_C(0x4)
44768         /* meter is 1 b */
44769         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER \
44770                 UINT32_C(0x8)
44771         /* tunnel is 1 b */
44772         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL \
44773                 UINT32_C(0x10)
44774         /* nat_src is 1 b */
44775         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC \
44776                 UINT32_C(0x20)
44777         /* nat_dest is 1 b */
44778         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST \
44779                 UINT32_C(0x40)
44780         /* nat_ipv4_address is 1 b */
44781         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS \
44782                 UINT32_C(0x80)
44783         /* l2_header_rewrite is 1 b */
44784         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE \
44785                 UINT32_C(0x100)
44786         /* ttl_decrement is 1 b */
44787         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT \
44788                 UINT32_C(0x200)
44789         /*
44790          * If set to 1 and flow direction is TX, it indicates decap of L2
44791          * header and encap of tunnel header. If set to 1 and flow direction
44792          * is RX, it indicates decap of tunnel header and encap L2 header.
44793          * The type of tunnel is specified in the tunnel_type field.
44794          */
44795         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP \
44796                 UINT32_C(0x400)
44797         /* If set to 1, flow aging is enabled for this flow. */
44798         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FLOW_AGING_ENABLED \
44799                 UINT32_C(0x800)
44800         /*
44801          * If set to 1 an attempt will be made to try to offload this flow
44802          * to the most optimal flow table resource. If set to 0, the flow
44803          * will be placed to the default flow table resource.
44804          */
44805         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_PRI_HINT \
44806                 UINT32_C(0x1000)
44807         /*
44808          * If set to 1 there will be no attempt to allocate an on-chip try
44809          * to offload this flow. If set to 0, which will keep compatibility
44810          * with the older drivers, will cause the FW to attempt to allocate
44811          * an on-chip flow counter for the newly created flow. This will
44812          * keep the existing behavior with EM flows which always had an
44813          * associated flow counter.
44814          */
44815         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NO_FLOW_COUNTER_ALLOC \
44816                 UINT32_C(0x2000)
44817         /*
44818          * Tx Flow: pf or vf fid.
44819          * Rx Flow: vf fid.
44820          */
44821         uint16_t        dst_fid;
44822         /* VLAN tpid, valid when push_vlan flag is set. */
44823         uint16_t        l2_rewrite_vlan_tpid;
44824         /* VLAN tci, valid when push_vlan flag is set. */
44825         uint16_t        l2_rewrite_vlan_tci;
44826         /* Meter id, valid when meter flag is set. */
44827         uint16_t        act_meter_id;
44828         /* Flow with the same l2 context tcam key. */
44829         uint16_t        ref_flow_handle;
44830         /* This value sets the match value for the ethertype. */
44831         uint16_t        ethertype;
44832         /* valid when num tags is 1 or 2. */
44833         uint16_t        outer_vlan_tci;
44834         /* This value sets the match value for the Destination MAC address. */
44835         uint16_t        dmac[3];
44836         /* valid when num tags is 2. */
44837         uint16_t        inner_vlan_tci;
44838         /* This value sets the match value for the Source MAC address. */
44839         uint16_t        smac[3];
44840         /* The bit length of destination IP address mask. */
44841         uint8_t ip_dst_mask_len;
44842         /* The bit length of source IP address mask. */
44843         uint8_t ip_src_mask_len;
44844         /* The value of destination IPv4/IPv6 address. */
44845         uint32_t        ip_dst[4];
44846         /* The source IPv4/IPv6 address. */
44847         uint32_t        ip_src[4];
44848         /*
44849          * The value of source port.
44850          * Applies to UDP and TCP traffic.
44851          */
44852         uint16_t        l4_src_port;
44853         /*
44854          * The value of source port mask.
44855          * Applies to UDP and TCP traffic.
44856          */
44857         uint16_t        l4_src_port_mask;
44858         /*
44859          * The value of destination port.
44860          * Applies to UDP and TCP traffic.
44861          */
44862         uint16_t        l4_dst_port;
44863         /*
44864          * The value of destination port mask.
44865          * Applies to UDP and TCP traffic.
44866          */
44867         uint16_t        l4_dst_port_mask;
44868         /*
44869          * NAT IPv4/6 address based on address type flag.
44870          * 0 values are ignored.
44871          */
44872         uint32_t        nat_ip_address[4];
44873         /* L2 header re-write Destination MAC address. */
44874         uint16_t        l2_rewrite_dmac[3];
44875         /*
44876          * The NAT source/destination port based on direction flag.
44877          * Applies to UDP and TCP traffic.
44878          * 0 values are ignored.
44879          */
44880         uint16_t        nat_port;
44881         /* L2 header re-write Source MAC address. */
44882         uint16_t        l2_rewrite_smac[3];
44883         /* The value of ip protocol. */
44884         uint8_t ip_proto;
44885         /* Tunnel Type. */
44886         uint8_t tunnel_type;
44887         /* Non-tunnel */
44888         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
44889                 UINT32_C(0x0)
44890         /* Virtual eXtensible Local Area Network (VXLAN) */
44891         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
44892                 UINT32_C(0x1)
44893         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
44894         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
44895                 UINT32_C(0x2)
44896         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
44897         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
44898                 UINT32_C(0x3)
44899         /* IP in IP */
44900         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
44901                 UINT32_C(0x4)
44902         /* Generic Network Virtualization Encapsulation (Geneve) */
44903         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
44904                 UINT32_C(0x5)
44905         /* Multi-Protocol Label Switching (MPLS) */
44906         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
44907                 UINT32_C(0x6)
44908         /* Stateless Transport Tunnel (STT) */
44909         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
44910                 UINT32_C(0x7)
44911         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
44912         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
44913                 UINT32_C(0x8)
44914         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
44915         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
44916                 UINT32_C(0x9)
44917         /*
44918          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
44919          * datagram payload
44920          */
44921         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
44922                 UINT32_C(0xa)
44923         /* Use fixed layer 2 ether type of 0xFFFF */
44924         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
44925                 UINT32_C(0xb)
44926         /*
44927          * IPV6 over virtual eXtensible Local Area Network with GPE header
44928          * (IPV6oVXLANGPE)
44929          */
44930         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
44931                 UINT32_C(0xc)
44932         /* Any tunneled traffic */
44933         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
44934                 UINT32_C(0xff)
44935         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
44936                 HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
44937 } __rte_packed;
44938
44939 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
44940 struct hwrm_cfa_flow_alloc_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         /* Flow record index. */
44950         uint16_t        flow_handle;
44951         uint8_t unused_0[2];
44952         /*
44953          * The flow id value in bit 0-29 is the actual ID of the flow
44954          * associated with this filter and it shall be used to match
44955          * and associate the flow identifier returned in completion
44956          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
44957          * shall indicate no valid flow id.
44958          */
44959         uint32_t        flow_id;
44960         /* Indicate the flow id value. */
44961         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
44962                 UINT32_C(0x3fffffff)
44963         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
44964         /* Indicate type of the flow. */
44965         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
44966                 UINT32_C(0x40000000)
44967         /*
44968          * If this bit set to 0, then it indicates that the flow is
44969          * internal flow.
44970          */
44971         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
44972                 (UINT32_C(0x0) << 30)
44973         /*
44974          * If this bit is set to 1, then it indicates that the flow is
44975          * external flow.
44976          */
44977         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
44978                 (UINT32_C(0x1) << 30)
44979         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
44980                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
44981         /* Indicate the flow direction. */
44982         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
44983                 UINT32_C(0x80000000)
44984         /* If this bit set to 0, then it indicates rx flow. */
44985         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
44986                 (UINT32_C(0x0) << 31)
44987         /* If this bit is set to 1, then it indicates that tx flow. */
44988         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
44989                 (UINT32_C(0x1) << 31)
44990         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
44991                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
44992         /* This value identifies a set of CFA data structures used for a flow. */
44993         uint64_t        ext_flow_handle;
44994         uint32_t        flow_counter_id;
44995         uint8_t unused_1[3];
44996         /*
44997          * This field is used in Output records to indicate that the output
44998          * is completely written to RAM. This field should be read as '1'
44999          * to indicate that the output has been completely written.
45000          * When writing a command completion or response to an internal
45001          * processor, the order of writes has to be such that this field is
45002          * written last.
45003          */
45004         uint8_t valid;
45005 } __rte_packed;
45006
45007 /* hwrm_cfa_flow_alloc_cmd_err (size:64b/8B) */
45008 struct hwrm_cfa_flow_alloc_cmd_err {
45009         /*
45010          * command specific error codes that goes to
45011          * the cmd_err field in Common HWRM Error Response.
45012          */
45013         uint8_t code;
45014         /* Unknown error */
45015         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_UNKNOWN         UINT32_C(0x0)
45016         /* No more L2 Context TCAM */
45017         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_L2_CONTEXT_TCAM UINT32_C(0x1)
45018         /* No more action records */
45019         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_ACTION_RECORD   UINT32_C(0x2)
45020         /* No more flow counters */
45021         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_COUNTER    UINT32_C(0x3)
45022         /* No more wild-card TCAM */
45023         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_WILD_CARD_TCAM  UINT32_C(0x4)
45024         /* Hash collision in exact match tables */
45025         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_HASH_COLLISION  UINT32_C(0x5)
45026         /* Key is already installed */
45027         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_KEY_EXISTS      UINT32_C(0x6)
45028         /* Flow Context DB is out of resource */
45029         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB    UINT32_C(0x7)
45030         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_LAST \
45031                 HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB
45032         uint8_t unused_0[7];
45033 } __rte_packed;
45034
45035 /**********************
45036  * hwrm_cfa_flow_free *
45037  **********************/
45038
45039
45040 /* hwrm_cfa_flow_free_input (size:256b/32B) */
45041 struct hwrm_cfa_flow_free_input {
45042         /* The HWRM command request type. */
45043         uint16_t        req_type;
45044         /*
45045          * The completion ring to send the completion event on. This should
45046          * be the NQ ID returned from the `nq_alloc` HWRM command.
45047          */
45048         uint16_t        cmpl_ring;
45049         /*
45050          * The sequence ID is used by the driver for tracking multiple
45051          * commands. This ID is treated as opaque data by the firmware and
45052          * the value is returned in the `hwrm_resp_hdr` upon completion.
45053          */
45054         uint16_t        seq_id;
45055         /*
45056          * The target ID of the command:
45057          * * 0x0-0xFFF8 - The function ID
45058          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45059          * * 0xFFFD - Reserved for user-space HWRM interface
45060          * * 0xFFFF - HWRM
45061          */
45062         uint16_t        target_id;
45063         /*
45064          * A physical address pointer pointing to a host buffer that the
45065          * command's response data will be written. This can be either a host
45066          * physical address (HPA) or a guest physical address (GPA) and must
45067          * point to a physically contiguous block of memory.
45068          */
45069         uint64_t        resp_addr;
45070         /* Flow record index. */
45071         uint16_t        flow_handle;
45072         uint16_t        unused_0;
45073         /* Flow counter id to be freed. */
45074         uint32_t        flow_counter_id;
45075         /* This value identifies a set of CFA data structures used for a flow. */
45076         uint64_t        ext_flow_handle;
45077 } __rte_packed;
45078
45079 /* hwrm_cfa_flow_free_output (size:256b/32B) */
45080 struct hwrm_cfa_flow_free_output {
45081         /* The specific error status for the command. */
45082         uint16_t        error_code;
45083         /* The HWRM command request type. */
45084         uint16_t        req_type;
45085         /* The sequence ID from the original command. */
45086         uint16_t        seq_id;
45087         /* The length of the response data in number of bytes. */
45088         uint16_t        resp_len;
45089         /* packet is 64 b */
45090         uint64_t        packet;
45091         /* byte is 64 b */
45092         uint64_t        byte;
45093         uint8_t unused_0[7];
45094         /*
45095          * This field is used in Output records to indicate that the output
45096          * is completely written to RAM. This field should be read as '1'
45097          * to indicate that the output has been completely written.
45098          * When writing a command completion or response to an internal
45099          * processor, the order of writes has to be such that this field is
45100          * written last.
45101          */
45102         uint8_t valid;
45103 } __rte_packed;
45104
45105 /* hwrm_cfa_flow_action_data (size:960b/120B) */
45106 struct hwrm_cfa_flow_action_data {
45107         uint16_t        action_flags;
45108         /* Setting of this flag indicates accept action. */
45109         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FWD \
45110                 UINT32_C(0x1)
45111         /* Setting of this flag indicates recycle action. */
45112         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_RECYCLE \
45113                 UINT32_C(0x2)
45114         /* Setting of this flag indicates drop action. */
45115         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DROP \
45116                 UINT32_C(0x4)
45117         /* Setting of this flag indicates meter action. */
45118         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_METER \
45119                 UINT32_C(0x8)
45120         /* Setting of this flag indicates tunnel action. */
45121         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL \
45122                 UINT32_C(0x10)
45123         /*
45124          * If set to 1 and flow direction is TX, it indicates decap of L2
45125          * header and encap of tunnel header. If set to 1 and flow direction
45126          * is RX, it indicates decap of tunnel header and encap L2 header.
45127          */
45128         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL_IP \
45129                 UINT32_C(0x20)
45130         /* Setting of this flag indicates ttl decrement action. */
45131         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TTL_DECREMENT \
45132                 UINT32_C(0x40)
45133         /* If set to 1, flow aging is enabled for this flow. */
45134         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FLOW_AGING_ENABLED \
45135                 UINT32_C(0x80)
45136         /* Setting of this flag indicates encap action. */
45137         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_ENCAP \
45138                 UINT32_C(0x100)
45139         /* Setting of this flag indicates decap action. */
45140         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DECAP \
45141                 UINT32_C(0x200)
45142         /* Meter id. */
45143         uint16_t        act_meter_id;
45144         /* VNIC id. */
45145         uint16_t        vnic_id;
45146         /* vport number. */
45147         uint16_t        vport_id;
45148         /* The NAT source/destination. */
45149         uint16_t        nat_port;
45150         uint16_t        unused_0[3];
45151         /* NAT IPv4/IPv6 address. */
45152         uint32_t        nat_ip_address[4];
45153         /* Encapsulation Type. */
45154         uint8_t encap_type;
45155         /* Virtual eXtensible Local Area Network (VXLAN) */
45156         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN        UINT32_C(0x1)
45157         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
45158         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_NVGRE        UINT32_C(0x2)
45159         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
45160         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2GRE        UINT32_C(0x3)
45161         /* IP in IP */
45162         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPIP         UINT32_C(0x4)
45163         /* Generic Network Virtualization Encapsulation (Geneve) */
45164         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_GENEVE       UINT32_C(0x5)
45165         /* Multi-Protocol Label Switching (MPLS) */
45166         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_MPLS         UINT32_C(0x6)
45167         /* VLAN */
45168         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VLAN         UINT32_C(0x7)
45169         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
45170         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE        UINT32_C(0x8)
45171         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
45172         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_V4     UINT32_C(0x9)
45173         /*
45174          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
45175          * datagram payload
45176          */
45177         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE_V1     UINT32_C(0xa)
45178         /* Use fixed layer 2 ether type of 0xFFFF */
45179         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2_ETYPE     UINT32_C(0xb)
45180         /*
45181          * IPV6 over virtual eXtensible Local Area Network with GPE header
45182          * (IPV6oVXLANGPE)
45183          */
45184         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
45185         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_LAST \
45186                 HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6
45187         uint8_t unused[7];
45188         /* This value is encap data for the associated encap type. */
45189         uint32_t        encap_data[20];
45190 } __rte_packed;
45191
45192 /* hwrm_cfa_flow_tunnel_hdr_data (size:64b/8B) */
45193 struct hwrm_cfa_flow_tunnel_hdr_data {
45194         /* Tunnel Type. */
45195         uint8_t tunnel_type;
45196         /* Non-tunnel */
45197         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NONTUNNEL \
45198                 UINT32_C(0x0)
45199         /* Virtual eXtensible Local Area Network (VXLAN) */
45200         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN \
45201                 UINT32_C(0x1)
45202         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
45203         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NVGRE \
45204                 UINT32_C(0x2)
45205         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
45206         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2GRE \
45207                 UINT32_C(0x3)
45208         /* IP in IP */
45209         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPIP \
45210                 UINT32_C(0x4)
45211         /* Generic Network Virtualization Encapsulation (Geneve) */
45212         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_GENEVE \
45213                 UINT32_C(0x5)
45214         /* Multi-Protocol Label Switching (MPLS) */
45215         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_MPLS \
45216                 UINT32_C(0x6)
45217         /* Stateless Transport Tunnel (STT) */
45218         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_STT \
45219                 UINT32_C(0x7)
45220         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
45221         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE \
45222                 UINT32_C(0x8)
45223         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
45224         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_V4 \
45225                 UINT32_C(0x9)
45226         /*
45227          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
45228          * datagram payload
45229          */
45230         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE_V1 \
45231                 UINT32_C(0xa)
45232         /* Use fixed layer 2 ether type of 0xFFFF */
45233         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2_ETYPE \
45234                 UINT32_C(0xb)
45235         /*
45236          * IPV6 over virtual eXtensible Local Area Network with GPE header
45237          * (IPV6oVXLANGPE)
45238          */
45239         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE_V6 \
45240                 UINT32_C(0xc)
45241         /* Any tunneled traffic */
45242         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL \
45243                 UINT32_C(0xff)
45244         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_LAST \
45245                 HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL
45246         uint8_t unused[3];
45247         /*
45248          * Tunnel identifier.
45249          * Virtual Network Identifier (VNI).
45250          */
45251         uint32_t        tunnel_id;
45252 } __rte_packed;
45253
45254 /* hwrm_cfa_flow_l4_key_data (size:64b/8B) */
45255 struct hwrm_cfa_flow_l4_key_data {
45256         /* The value of source port. */
45257         uint16_t        l4_src_port;
45258         /* The value of destination port. */
45259         uint16_t        l4_dst_port;
45260         uint32_t        unused;
45261 } __rte_packed;
45262
45263 /* hwrm_cfa_flow_l3_key_data (size:512b/64B) */
45264 struct hwrm_cfa_flow_l3_key_data {
45265         /* The value of ip protocol. */
45266         uint8_t ip_protocol;
45267         uint8_t unused_0[7];
45268         /* The value of destination IPv4/IPv6 address. */
45269         uint32_t        ip_dst[4];
45270         /* The source IPv4/IPv6 address. */
45271         uint32_t        ip_src[4];
45272         /* NAT IPv4/IPv6 address. */
45273         uint32_t        nat_ip_address[4];
45274         uint32_t        unused[2];
45275 } __rte_packed;
45276
45277 /* hwrm_cfa_flow_l2_key_data (size:448b/56B) */
45278 struct hwrm_cfa_flow_l2_key_data {
45279         /* Destination MAC address. */
45280         uint16_t        dmac[3];
45281         uint16_t        unused_0;
45282         /* Source MAC address. */
45283         uint16_t        smac[3];
45284         uint16_t        unused_1;
45285         /* L2 header re-write Destination MAC address. */
45286         uint16_t        l2_rewrite_dmac[3];
45287         uint16_t        unused_2;
45288         /* L2 header re-write Source MAC address. */
45289         uint16_t        l2_rewrite_smac[3];
45290         /* Ethertype. */
45291         uint16_t        ethertype;
45292         /* Number of VLAN tags. */
45293         uint16_t        num_vlan_tags;
45294         /* VLAN tpid. */
45295         uint16_t        l2_rewrite_vlan_tpid;
45296         /* VLAN tci. */
45297         uint16_t        l2_rewrite_vlan_tci;
45298         uint8_t unused_3[2];
45299         /* Outer VLAN TPID. */
45300         uint16_t        ovlan_tpid;
45301         /* Outer VLAN TCI. */
45302         uint16_t        ovlan_tci;
45303         /* Inner VLAN TPID. */
45304         uint16_t        ivlan_tpid;
45305         /* Inner VLAN TCI. */
45306         uint16_t        ivlan_tci;
45307         uint8_t unused[8];
45308 } __rte_packed;
45309
45310 /* hwrm_cfa_flow_key_data (size:4160b/520B) */
45311 struct hwrm_cfa_flow_key_data {
45312         /* Flow associated tunnel L2 header key info. */
45313         uint32_t        t_l2_key_data[14];
45314         /* Flow associated tunnel L2 header mask info. */
45315         uint32_t        t_l2_key_mask[14];
45316         /* Flow associated tunnel L3 header key info. */
45317         uint32_t        t_l3_key_data[16];
45318         /* Flow associated tunnel L3 header mask info. */
45319         uint32_t        t_l3_key_mask[16];
45320         /* Flow associated tunnel L4 header key info. */
45321         uint32_t        t_l4_key_data[2];
45322         /* Flow associated tunnel L4 header mask info. */
45323         uint32_t        t_l4_key_mask[2];
45324         /* Flow associated tunnel header info. */
45325         uint32_t        tunnel_hdr[2];
45326         /* Flow associated L2 header key info. */
45327         uint32_t        l2_key_data[14];
45328         /* Flow associated L2 header mask info. */
45329         uint32_t        l2_key_mask[14];
45330         /* Flow associated L3 header key info. */
45331         uint32_t        l3_key_data[16];
45332         /* Flow associated L3 header mask info. */
45333         uint32_t        l3_key_mask[16];
45334         /* Flow associated L4 header key info. */
45335         uint32_t        l4_key_data[2];
45336         /* Flow associated L4 header mask info. */
45337         uint32_t        l4_key_mask[2];
45338 } __rte_packed;
45339
45340 /**********************
45341  * hwrm_cfa_flow_info *
45342  **********************/
45343
45344
45345 /* hwrm_cfa_flow_info_input (size:256b/32B) */
45346 struct hwrm_cfa_flow_info_input {
45347         /* The HWRM command request type. */
45348         uint16_t        req_type;
45349         /*
45350          * The completion ring to send the completion event on. This should
45351          * be the NQ ID returned from the `nq_alloc` HWRM command.
45352          */
45353         uint16_t        cmpl_ring;
45354         /*
45355          * The sequence ID is used by the driver for tracking multiple
45356          * commands. This ID is treated as opaque data by the firmware and
45357          * the value is returned in the `hwrm_resp_hdr` upon completion.
45358          */
45359         uint16_t        seq_id;
45360         /*
45361          * The target ID of the command:
45362          * * 0x0-0xFFF8 - The function ID
45363          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45364          * * 0xFFFD - Reserved for user-space HWRM interface
45365          * * 0xFFFF - HWRM
45366          */
45367         uint16_t        target_id;
45368         /*
45369          * A physical address pointer pointing to a host buffer that the
45370          * command's response data will be written. This can be either a host
45371          * physical address (HPA) or a guest physical address (GPA) and must
45372          * point to a physically contiguous block of memory.
45373          */
45374         uint64_t        resp_addr;
45375         /* Flow record index. */
45376         uint16_t        flow_handle;
45377         /* Max flow handle */
45378         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK \
45379                 UINT32_C(0xfff)
45380         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_SFT        0
45381         /* CNP flow handle */
45382         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT \
45383                 UINT32_C(0x1000)
45384         /* RoCEv1 flow handle */
45385         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT \
45386                 UINT32_C(0x2000)
45387         /* RoCEv2 flow handle */
45388         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT \
45389                 UINT32_C(0x4000)
45390         /* Direction rx = 1 */
45391         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX \
45392                 UINT32_C(0x8000)
45393         uint8_t unused_0[6];
45394         /* This value identifies a set of CFA data structures used for a flow. */
45395         uint64_t        ext_flow_handle;
45396 } __rte_packed;
45397
45398 /* hwrm_cfa_flow_info_output (size:5632b/704B) */
45399 struct hwrm_cfa_flow_info_output {
45400         /* The specific error status for the command. */
45401         uint16_t        error_code;
45402         /* The HWRM command request type. */
45403         uint16_t        req_type;
45404         /* The sequence ID from the original command. */
45405         uint16_t        seq_id;
45406         /* The length of the response data in number of bytes. */
45407         uint16_t        resp_len;
45408         uint8_t flags;
45409         /* When set to 1, indicates the configuration is the TX flow. */
45410         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_TX     UINT32_C(0x1)
45411         /* When set to 1, indicates the configuration is the RX flow. */
45412         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_RX     UINT32_C(0x2)
45413         /* profile is 8 b */
45414         uint8_t profile;
45415         /* src_fid is 16 b */
45416         uint16_t        src_fid;
45417         /* dst_fid is 16 b */
45418         uint16_t        dst_fid;
45419         /* l2_ctxt_id is 16 b */
45420         uint16_t        l2_ctxt_id;
45421         /* em_info is 64 b */
45422         uint64_t        em_info;
45423         /* tcam_info is 64 b */
45424         uint64_t        tcam_info;
45425         /* vfp_tcam_info is 64 b */
45426         uint64_t        vfp_tcam_info;
45427         /* ar_id is 16 b */
45428         uint16_t        ar_id;
45429         /* flow_handle is 16 b */
45430         uint16_t        flow_handle;
45431         /* tunnel_handle is 32 b */
45432         uint32_t        tunnel_handle;
45433         /* The flow aging timer for the flow, the unit is 100 milliseconds */
45434         uint16_t        flow_timer;
45435         uint8_t unused_0[6];
45436         /* Flow associated L2, L3 and L4 headers info. */
45437         uint32_t        flow_key_data[130];
45438         /* Flow associated action record info. */
45439         uint32_t        flow_action_info[30];
45440         uint8_t unused_1[7];
45441         /*
45442          * This field is used in Output records to indicate that the output
45443          * is completely written to RAM. This field should be read as '1'
45444          * to indicate that the output has been completely written.
45445          * When writing a command completion or response to an internal
45446          * processor, the order of writes has to be such that this field is
45447          * written last.
45448          */
45449         uint8_t valid;
45450 } __rte_packed;
45451
45452 /***********************
45453  * hwrm_cfa_flow_flush *
45454  ***********************/
45455
45456
45457 /* hwrm_cfa_flow_flush_input (size:256b/32B) */
45458 struct hwrm_cfa_flow_flush_input {
45459         /* The HWRM command request type. */
45460         uint16_t        req_type;
45461         /*
45462          * The completion ring to send the completion event on. This should
45463          * be the NQ ID returned from the `nq_alloc` HWRM command.
45464          */
45465         uint16_t        cmpl_ring;
45466         /*
45467          * The sequence ID is used by the driver for tracking multiple
45468          * commands. This ID is treated as opaque data by the firmware and
45469          * the value is returned in the `hwrm_resp_hdr` upon completion.
45470          */
45471         uint16_t        seq_id;
45472         /*
45473          * The target ID of the command:
45474          * * 0x0-0xFFF8 - The function ID
45475          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45476          * * 0xFFFD - Reserved for user-space HWRM interface
45477          * * 0xFFFF - HWRM
45478          */
45479         uint16_t        target_id;
45480         /*
45481          * A physical address pointer pointing to a host buffer that the
45482          * command's response data will be written. This can be either a host
45483          * physical address (HPA) or a guest physical address (GPA) and must
45484          * point to a physically contiguous block of memory.
45485          */
45486         uint64_t        resp_addr;
45487         /* flags is 32 b */
45488         uint32_t        flags;
45489         /*
45490          * Set to 1 to indicate the page size, page layers, and
45491          * flow_handle_table_dma_addr fields are valid. The flow flush
45492          * operation should only flush the flows from the flow table
45493          * specified. This flag is set to 0 by older driver. For older
45494          * firmware, setting this flag has no effect.
45495          */
45496         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_TABLE_VALID \
45497                 UINT32_C(0x1)
45498         /*
45499          * Set to 1 to indicate flow flush operation to cleanup all the
45500          * flows, meters, CFA context memory tables etc. This flag is set to
45501          * 0 by older driver. For older firmware, setting this flag has no
45502          * effect.
45503          */
45504         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_ALL \
45505                 UINT32_C(0x2)
45506         /*
45507          * Set to 1 to indicate flow flush operation to cleanup all the
45508          * flows by the caller. This flag is set to 0 by older driver. For
45509          * older firmware, setting this flag has no effect.
45510          */
45511         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_PORT \
45512                 UINT32_C(0x4)
45513         /*
45514          * Set to 1 to indicate the flow counter IDs are included in the
45515          * flow table.
45516          */
45517         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_INCL_FC \
45518                 UINT32_C(0x8000000)
45519         /*
45520          * This specifies the size of flow handle entries provided by the
45521          * driver in the flow table specified below. Only two flow handle
45522          * size enums are defined.
45523          */
45524         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_MASK \
45525                 UINT32_C(0xc0000000)
45526         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_SFT \
45527                 30
45528         /* The flow handle is 16bit */
45529         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_16BIT \
45530                 (UINT32_C(0x0) << 30)
45531         /* The flow handle is 64bit */
45532         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT \
45533                 (UINT32_C(0x1) << 30)
45534         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_LAST \
45535                 HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT
45536         /* Specify page size of the flow table memory. */
45537         uint8_t page_size;
45538         /* The page size is 4K */
45539         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
45540         /* The page size is 8K */
45541         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
45542         /* The page size is 64K */
45543         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
45544         /* The page size is 256K */
45545         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
45546         /* The page size is 1M */
45547         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
45548         /* The page size is 2M */
45549         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
45550         /* The page size is 4M */
45551         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
45552         /* The page size is 1G */
45553         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
45554         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_LAST \
45555                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G
45556         /* FLow table memory indirect levels. */
45557         uint8_t page_level;
45558         /* PBL pointer is physical start address. */
45559         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
45560         /* PBL pointer points to PTE table. */
45561         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
45562         /*
45563          * PBL pointer points to PDE table with each entry pointing to PTE
45564          * tables.
45565          */
45566         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
45567         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LAST \
45568                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2
45569         /* number of flows in the flow table */
45570         uint16_t        num_flows;
45571         /* Pointer to the PBL, or PDL depending on number of levels */
45572         uint64_t        page_dir;
45573 } __rte_packed;
45574
45575 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
45576 struct hwrm_cfa_flow_flush_output {
45577         /* The specific error status for the command. */
45578         uint16_t        error_code;
45579         /* The HWRM command request type. */
45580         uint16_t        req_type;
45581         /* The sequence ID from the original command. */
45582         uint16_t        seq_id;
45583         /* The length of the response data in number of bytes. */
45584         uint16_t        resp_len;
45585         uint8_t unused_0[7];
45586         /*
45587          * This field is used in Output records to indicate that the output
45588          * is completely written to RAM. This field should be read as '1'
45589          * to indicate that the output has been completely written.
45590          * When writing a command completion or response to an internal
45591          * processor, the order of writes has to be such that this field is
45592          * written last.
45593          */
45594         uint8_t valid;
45595 } __rte_packed;
45596
45597 /***********************
45598  * hwrm_cfa_flow_stats *
45599  ***********************/
45600
45601
45602 /* hwrm_cfa_flow_stats_input (size:640b/80B) */
45603 struct hwrm_cfa_flow_stats_input {
45604         /* The HWRM command request type. */
45605         uint16_t        req_type;
45606         /*
45607          * The completion ring to send the completion event on. This should
45608          * be the NQ ID returned from the `nq_alloc` HWRM command.
45609          */
45610         uint16_t        cmpl_ring;
45611         /*
45612          * The sequence ID is used by the driver for tracking multiple
45613          * commands. This ID is treated as opaque data by the firmware and
45614          * the value is returned in the `hwrm_resp_hdr` upon completion.
45615          */
45616         uint16_t        seq_id;
45617         /*
45618          * The target ID of the command:
45619          * * 0x0-0xFFF8 - The function ID
45620          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45621          * * 0xFFFD - Reserved for user-space HWRM interface
45622          * * 0xFFFF - HWRM
45623          */
45624         uint16_t        target_id;
45625         /*
45626          * A physical address pointer pointing to a host buffer that the
45627          * command's response data will be written. This can be either a host
45628          * physical address (HPA) or a guest physical address (GPA) and must
45629          * point to a physically contiguous block of memory.
45630          */
45631         uint64_t        resp_addr;
45632         /* Flow handle. */
45633         uint16_t        num_flows;
45634         /* Flow handle. */
45635         uint16_t        flow_handle_0;
45636         /* Flow handle. */
45637         uint16_t        flow_handle_1;
45638         /* Flow handle. */
45639         uint16_t        flow_handle_2;
45640         /* Flow handle. */
45641         uint16_t        flow_handle_3;
45642         /* Flow handle. */
45643         uint16_t        flow_handle_4;
45644         /* Flow handle. */
45645         uint16_t        flow_handle_5;
45646         /* Flow handle. */
45647         uint16_t        flow_handle_6;
45648         /* Flow handle. */
45649         uint16_t        flow_handle_7;
45650         /* Flow handle. */
45651         uint16_t        flow_handle_8;
45652         /* Flow handle. */
45653         uint16_t        flow_handle_9;
45654         uint8_t unused_0[2];
45655         /* Flow ID of a flow. */
45656         uint32_t        flow_id_0;
45657         /* Flow ID of a flow. */
45658         uint32_t        flow_id_1;
45659         /* Flow ID of a flow. */
45660         uint32_t        flow_id_2;
45661         /* Flow ID of a flow. */
45662         uint32_t        flow_id_3;
45663         /* Flow ID of a flow. */
45664         uint32_t        flow_id_4;
45665         /* Flow ID of a flow. */
45666         uint32_t        flow_id_5;
45667         /* Flow ID of a flow. */
45668         uint32_t        flow_id_6;
45669         /* Flow ID of a flow. */
45670         uint32_t        flow_id_7;
45671         /* Flow ID of a flow. */
45672         uint32_t        flow_id_8;
45673         /* Flow ID of a flow. */
45674         uint32_t        flow_id_9;
45675 } __rte_packed;
45676
45677 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
45678 struct hwrm_cfa_flow_stats_output {
45679         /* The specific error status for the command. */
45680         uint16_t        error_code;
45681         /* The HWRM command request type. */
45682         uint16_t        req_type;
45683         /* The sequence ID from the original command. */
45684         uint16_t        seq_id;
45685         /* The length of the response data in number of bytes. */
45686         uint16_t        resp_len;
45687         /* packet_0 is 64 b */
45688         uint64_t        packet_0;
45689         /* packet_1 is 64 b */
45690         uint64_t        packet_1;
45691         /* packet_2 is 64 b */
45692         uint64_t        packet_2;
45693         /* packet_3 is 64 b */
45694         uint64_t        packet_3;
45695         /* packet_4 is 64 b */
45696         uint64_t        packet_4;
45697         /* packet_5 is 64 b */
45698         uint64_t        packet_5;
45699         /* packet_6 is 64 b */
45700         uint64_t        packet_6;
45701         /* packet_7 is 64 b */
45702         uint64_t        packet_7;
45703         /* packet_8 is 64 b */
45704         uint64_t        packet_8;
45705         /* packet_9 is 64 b */
45706         uint64_t        packet_9;
45707         /* byte_0 is 64 b */
45708         uint64_t        byte_0;
45709         /* byte_1 is 64 b */
45710         uint64_t        byte_1;
45711         /* byte_2 is 64 b */
45712         uint64_t        byte_2;
45713         /* byte_3 is 64 b */
45714         uint64_t        byte_3;
45715         /* byte_4 is 64 b */
45716         uint64_t        byte_4;
45717         /* byte_5 is 64 b */
45718         uint64_t        byte_5;
45719         /* byte_6 is 64 b */
45720         uint64_t        byte_6;
45721         /* byte_7 is 64 b */
45722         uint64_t        byte_7;
45723         /* byte_8 is 64 b */
45724         uint64_t        byte_8;
45725         /* byte_9 is 64 b */
45726         uint64_t        byte_9;
45727         uint8_t unused_0[7];
45728         /*
45729          * This field is used in Output records to indicate that the output
45730          * is completely written to RAM. This field should be read as '1'
45731          * to indicate that the output has been completely written.
45732          * When writing a command completion or response to an internal
45733          * processor, the order of writes has to be such that this field is
45734          * written last.
45735          */
45736         uint8_t valid;
45737 } __rte_packed;
45738
45739 /***********************************
45740  * hwrm_cfa_flow_aging_timer_reset *
45741  ***********************************/
45742
45743
45744 /* hwrm_cfa_flow_aging_timer_reset_input (size:256b/32B) */
45745 struct hwrm_cfa_flow_aging_timer_reset_input {
45746         /* The HWRM command request type. */
45747         uint16_t        req_type;
45748         /*
45749          * The completion ring to send the completion event on. This should
45750          * be the NQ ID returned from the `nq_alloc` HWRM command.
45751          */
45752         uint16_t        cmpl_ring;
45753         /*
45754          * The sequence ID is used by the driver for tracking multiple
45755          * commands. This ID is treated as opaque data by the firmware and
45756          * the value is returned in the `hwrm_resp_hdr` upon completion.
45757          */
45758         uint16_t        seq_id;
45759         /*
45760          * The target ID of the command:
45761          * * 0x0-0xFFF8 - The function ID
45762          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45763          * * 0xFFFD - Reserved for user-space HWRM interface
45764          * * 0xFFFF - HWRM
45765          */
45766         uint16_t        target_id;
45767         /*
45768          * A physical address pointer pointing to a host buffer that the
45769          * command's response data will be written. This can be either a host
45770          * physical address (HPA) or a guest physical address (GPA) and must
45771          * point to a physically contiguous block of memory.
45772          */
45773         uint64_t        resp_addr;
45774         /* Flow record index. */
45775         uint16_t        flow_handle;
45776         uint8_t unused_0[2];
45777         /*
45778          * New flow timer value for the flow specified in the ext_flow_handle.
45779          * The flow timer unit is 100ms.
45780          */
45781         uint32_t        flow_timer;
45782         /* This value identifies a set of CFA data structures used for a flow. */
45783         uint64_t        ext_flow_handle;
45784 } __rte_packed;
45785
45786 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
45787 struct hwrm_cfa_flow_aging_timer_reset_output {
45788         /* The specific error status for the command. */
45789         uint16_t        error_code;
45790         /* The HWRM command request type. */
45791         uint16_t        req_type;
45792         /* The sequence ID from the original command. */
45793         uint16_t        seq_id;
45794         /* The length of the response data in number of bytes. */
45795         uint16_t        resp_len;
45796         uint8_t unused_0[7];
45797         /*
45798          * This field is used in Output records to indicate that the output
45799          * is completely written to RAM. This field should be read as '1'
45800          * to indicate that the output has been completely written.
45801          * When writing a command completion or response to an internal
45802          * processor, the order of writes has to be such that this field is
45803          * written last.
45804          */
45805         uint8_t valid;
45806 } __rte_packed;
45807
45808 /***************************
45809  * hwrm_cfa_flow_aging_cfg *
45810  ***************************/
45811
45812
45813 /* hwrm_cfa_flow_aging_cfg_input (size:384b/48B) */
45814 struct hwrm_cfa_flow_aging_cfg_input {
45815         /* The HWRM command request type. */
45816         uint16_t        req_type;
45817         /*
45818          * The completion ring to send the completion event on. This should
45819          * be the NQ ID returned from the `nq_alloc` HWRM command.
45820          */
45821         uint16_t        cmpl_ring;
45822         /*
45823          * The sequence ID is used by the driver for tracking multiple
45824          * commands. This ID is treated as opaque data by the firmware and
45825          * the value is returned in the `hwrm_resp_hdr` upon completion.
45826          */
45827         uint16_t        seq_id;
45828         /*
45829          * The target ID of the command:
45830          * * 0x0-0xFFF8 - The function ID
45831          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45832          * * 0xFFFD - Reserved for user-space HWRM interface
45833          * * 0xFFFF - HWRM
45834          */
45835         uint16_t        target_id;
45836         /*
45837          * A physical address pointer pointing to a host buffer that the
45838          * command's response data will be written. This can be either a host
45839          * physical address (HPA) or a guest physical address (GPA) and must
45840          * point to a physically contiguous block of memory.
45841          */
45842         uint64_t        resp_addr;
45843         /* The bit field to enable per flow aging configuration. */
45844         uint16_t        enables;
45845         /*
45846          * This bit must be '1' for the tcp flow timer field to be
45847          * configured
45848          */
45849         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FLOW_TIMER \
45850                 UINT32_C(0x1)
45851         /*
45852          * This bit must be '1' for the tcp finish timer field to be
45853          * configured
45854          */
45855         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FIN_TIMER \
45856                 UINT32_C(0x2)
45857         /*
45858          * This bit must be '1' for the udp flow timer field to be
45859          * configured
45860          */
45861         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_UDP_FLOW_TIMER \
45862                 UINT32_C(0x4)
45863         /*
45864          * This bit must be '1' for the eem dma interval field to be
45865          * configured
45866          */
45867         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_DMA_INTERVAL \
45868                 UINT32_C(0x8)
45869         /*
45870          * This bit must be '1' for the eem notice interval field to be
45871          * configured
45872          */
45873         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_NOTICE_INTERVAL \
45874                 UINT32_C(0x10)
45875         /*
45876          * This bit must be '1' for the eem context memory maximum entries
45877          * field to be configured
45878          */
45879         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MAX_ENTRIES \
45880                 UINT32_C(0x20)
45881         /*
45882          * This bit must be '1' for the eem context memory ID field to be
45883          * configured
45884          */
45885         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_ID \
45886                 UINT32_C(0x40)
45887         /*
45888          * This bit must be '1' for the eem context memory type field to be
45889          * configured
45890          */
45891         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MEM_TYPE \
45892                 UINT32_C(0x80)
45893         uint8_t flags;
45894         /* Enumeration denoting the RX, TX type of the resource. */
45895         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH       UINT32_C(0x1)
45896         /* tx path */
45897         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_TX      UINT32_C(0x0)
45898         /* rx path */
45899         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX      UINT32_C(0x1)
45900         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_LAST \
45901                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX
45902         /*
45903          * Enumeration denoting the enable, disable eem flow aging
45904          * configuration.
45905          */
45906         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM        UINT32_C(0x2)
45907         /* tx path */
45908         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_DISABLE \
45909                 (UINT32_C(0x0) << 1)
45910         /* rx path */
45911         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE \
45912                 (UINT32_C(0x1) << 1)
45913         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_LAST \
45914                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE
45915         uint8_t unused_0;
45916         /*
45917          * The flow aging timer for all TCP flows, the unit is 100
45918          * milliseconds.
45919          */
45920         uint32_t        tcp_flow_timer;
45921         /*
45922          * The TCP finished timer for all TCP flows, the unit is 100
45923          * milliseconds.
45924          */
45925         uint32_t        tcp_fin_timer;
45926         /*
45927          * The flow aging timer for all UDP flows, the unit is 100
45928          * milliseconds.
45929          */
45930         uint32_t        udp_flow_timer;
45931         /*
45932          * The interval to dma eem ejection data to host memory, the unit is
45933          * milliseconds.
45934          */
45935         uint16_t        eem_dma_interval;
45936         /*
45937          * The interval to notify driver to read the eem ejection data, the
45938          * unit is milliseconds.
45939          */
45940         uint16_t        eem_notice_interval;
45941         /* The maximum entries number in the eem context memory. */
45942         uint32_t        eem_ctx_max_entries;
45943         /* The context memory ID for eem flow aging. */
45944         uint16_t        eem_ctx_id;
45945         uint16_t        eem_ctx_mem_type;
45946         /*
45947          * The content of context memory is eem ejection data, the size of
45948          * each entry is 4 bytes.
45949          */
45950         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA \
45951                 UINT32_C(0x0)
45952         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_LAST \
45953                 HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA
45954         uint8_t unused_1[4];
45955 } __rte_packed;
45956
45957 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
45958 struct hwrm_cfa_flow_aging_cfg_output {
45959         /* The specific error status for the command. */
45960         uint16_t        error_code;
45961         /* The HWRM command request type. */
45962         uint16_t        req_type;
45963         /* The sequence ID from the original command. */
45964         uint16_t        seq_id;
45965         /* The length of the response data in number of bytes. */
45966         uint16_t        resp_len;
45967         uint8_t unused_0[7];
45968         /*
45969          * This field is used in Output records to indicate that the output
45970          * is completely written to RAM. This field should be read as '1'
45971          * to indicate that the output has been completely written.
45972          * When writing a command completion or response to an internal
45973          * processor, the order of writes has to be such that this field is
45974          * written last.
45975          */
45976         uint8_t valid;
45977 } __rte_packed;
45978
45979 /****************************
45980  * hwrm_cfa_flow_aging_qcfg *
45981  ****************************/
45982
45983
45984 /* hwrm_cfa_flow_aging_qcfg_input (size:192b/24B) */
45985 struct hwrm_cfa_flow_aging_qcfg_input {
45986         /* The HWRM command request type. */
45987         uint16_t        req_type;
45988         /*
45989          * The completion ring to send the completion event on. This should
45990          * be the NQ ID returned from the `nq_alloc` HWRM command.
45991          */
45992         uint16_t        cmpl_ring;
45993         /*
45994          * The sequence ID is used by the driver for tracking multiple
45995          * commands. This ID is treated as opaque data by the firmware and
45996          * the value is returned in the `hwrm_resp_hdr` upon completion.
45997          */
45998         uint16_t        seq_id;
45999         /*
46000          * The target ID of the command:
46001          * * 0x0-0xFFF8 - The function ID
46002          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46003          * * 0xFFFD - Reserved for user-space HWRM interface
46004          * * 0xFFFF - HWRM
46005          */
46006         uint16_t        target_id;
46007         /*
46008          * A physical address pointer pointing to a host buffer that the
46009          * command's response data will be written. This can be either a host
46010          * physical address (HPA) or a guest physical address (GPA) and must
46011          * point to a physically contiguous block of memory.
46012          */
46013         uint64_t        resp_addr;
46014         /*
46015          * The direction for the flow aging configuration, 1 is rx path, 2 is
46016          * tx path.
46017          */
46018         uint8_t flags;
46019         /* Enumeration denoting the RX, TX type of the resource. */
46020         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
46021         /* tx path */
46022         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
46023         /* rx path */
46024         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
46025         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST \
46026                 HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
46027         uint8_t unused_0[7];
46028 } __rte_packed;
46029
46030 /* hwrm_cfa_flow_aging_qcfg_output (size:320b/40B) */
46031 struct hwrm_cfa_flow_aging_qcfg_output {
46032         /* The specific error status for the command. */
46033         uint16_t        error_code;
46034         /* The HWRM command request type. */
46035         uint16_t        req_type;
46036         /* The sequence ID from the original command. */
46037         uint16_t        seq_id;
46038         /* The length of the response data in number of bytes. */
46039         uint16_t        resp_len;
46040         /*
46041          * The current flow aging timer for all TCP flows, the unit is 100
46042          * millisecond.
46043          */
46044         uint32_t        tcp_flow_timer;
46045         /*
46046          * The current TCP finished timer for all TCP flows, the unit is 100
46047          * millisecond.
46048          */
46049         uint32_t        tcp_fin_timer;
46050         /*
46051          * The current flow aging timer for all UDP flows, the unit is 100
46052          * millisecond.
46053          */
46054         uint32_t        udp_flow_timer;
46055         /*
46056          * The interval to dma eem ejection data to host memory, the unit is
46057          * milliseconds.
46058          */
46059         uint16_t        eem_dma_interval;
46060         /*
46061          * The interval to notify driver to read the eem ejection data, the
46062          * unit is milliseconds.
46063          */
46064         uint16_t        eem_notice_interval;
46065         /* The maximum entries number in the eem context memory. */
46066         uint32_t        eem_ctx_max_entries;
46067         /* The context memory ID for eem flow aging. */
46068         uint16_t        eem_ctx_id;
46069         /* The context memory type for eem flow aging. */
46070         uint16_t        eem_ctx_mem_type;
46071         uint8_t unused_0[7];
46072         /*
46073          * This field is used in Output records to indicate that the output
46074          * is completely written to RAM. This field should be read as '1'
46075          * to indicate that the output has been completely written.
46076          * When writing a command completion or response to an internal
46077          * processor, the order of writes has to be such that this field is
46078          * written last.
46079          */
46080         uint8_t valid;
46081 } __rte_packed;
46082
46083 /*****************************
46084  * hwrm_cfa_flow_aging_qcaps *
46085  *****************************/
46086
46087
46088 /* hwrm_cfa_flow_aging_qcaps_input (size:192b/24B) */
46089 struct hwrm_cfa_flow_aging_qcaps_input {
46090         /* The HWRM command request type. */
46091         uint16_t        req_type;
46092         /*
46093          * The completion ring to send the completion event on. This should
46094          * be the NQ ID returned from the `nq_alloc` HWRM command.
46095          */
46096         uint16_t        cmpl_ring;
46097         /*
46098          * The sequence ID is used by the driver for tracking multiple
46099          * commands. This ID is treated as opaque data by the firmware and
46100          * the value is returned in the `hwrm_resp_hdr` upon completion.
46101          */
46102         uint16_t        seq_id;
46103         /*
46104          * The target ID of the command:
46105          * * 0x0-0xFFF8 - The function ID
46106          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46107          * * 0xFFFD - Reserved for user-space HWRM interface
46108          * * 0xFFFF - HWRM
46109          */
46110         uint16_t        target_id;
46111         /*
46112          * A physical address pointer pointing to a host buffer that the
46113          * command's response data will be written. This can be either a host
46114          * physical address (HPA) or a guest physical address (GPA) and must
46115          * point to a physically contiguous block of memory.
46116          */
46117         uint64_t        resp_addr;
46118         /*
46119          * The direction for the flow aging configuration, 1 is rx path, 2 is
46120          * tx path.
46121          */
46122         uint8_t flags;
46123         /* Enumeration denoting the RX, TX type of the resource. */
46124         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH     UINT32_C(0x1)
46125         /* tx path */
46126         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
46127         /* rx path */
46128         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
46129         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST \
46130                 HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
46131         uint8_t unused_0[7];
46132 } __rte_packed;
46133
46134 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
46135 struct hwrm_cfa_flow_aging_qcaps_output {
46136         /* The specific error status for the command. */
46137         uint16_t        error_code;
46138         /* The HWRM command request type. */
46139         uint16_t        req_type;
46140         /* The sequence ID from the original command. */
46141         uint16_t        seq_id;
46142         /* The length of the response data in number of bytes. */
46143         uint16_t        resp_len;
46144         /*
46145          * The maximum flow aging timer for all TCP flows, the unit is 100
46146          * millisecond.
46147          */
46148         uint32_t        max_tcp_flow_timer;
46149         /*
46150          * The maximum TCP finished timer for all TCP flows, the unit is 100
46151          * millisecond.
46152          */
46153         uint32_t        max_tcp_fin_timer;
46154         /*
46155          * The maximum flow aging timer for all UDP flows, the unit is 100
46156          * millisecond.
46157          */
46158         uint32_t        max_udp_flow_timer;
46159         /* The maximum aging flows that HW can support. */
46160         uint32_t        max_aging_flows;
46161         uint8_t unused_0[7];
46162         /*
46163          * This field is used in Output records to indicate that the output
46164          * is completely written to RAM. This field should be read as '1'
46165          * to indicate that the output has been completely written.
46166          * When writing a command completion or response to an internal
46167          * processor, the order of writes has to be such that this field is
46168          * written last.
46169          */
46170         uint8_t valid;
46171 } __rte_packed;
46172
46173 /**********************************
46174  * hwrm_cfa_tcp_flag_process_qcfg *
46175  **********************************/
46176
46177
46178 /* hwrm_cfa_tcp_flag_process_qcfg_input (size:128b/16B) */
46179 struct hwrm_cfa_tcp_flag_process_qcfg_input {
46180         /* The HWRM command request type. */
46181         uint16_t        req_type;
46182         /*
46183          * The completion ring to send the completion event on. This should
46184          * be the NQ ID returned from the `nq_alloc` HWRM command.
46185          */
46186         uint16_t        cmpl_ring;
46187         /*
46188          * The sequence ID is used by the driver for tracking multiple
46189          * commands. This ID is treated as opaque data by the firmware and
46190          * the value is returned in the `hwrm_resp_hdr` upon completion.
46191          */
46192         uint16_t        seq_id;
46193         /*
46194          * The target ID of the command:
46195          * * 0x0-0xFFF8 - The function ID
46196          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46197          * * 0xFFFD - Reserved for user-space HWRM interface
46198          * * 0xFFFF - HWRM
46199          */
46200         uint16_t        target_id;
46201         /*
46202          * A physical address pointer pointing to a host buffer that the
46203          * command's response data will be written. This can be either a host
46204          * physical address (HPA) or a guest physical address (GPA) and must
46205          * point to a physically contiguous block of memory.
46206          */
46207         uint64_t        resp_addr;
46208 } __rte_packed;
46209
46210 /* hwrm_cfa_tcp_flag_process_qcfg_output (size:192b/24B) */
46211 struct hwrm_cfa_tcp_flag_process_qcfg_output {
46212         /* The specific error status for the command. */
46213         uint16_t        error_code;
46214         /* The HWRM command request type. */
46215         uint16_t        req_type;
46216         /* The sequence ID from the original command. */
46217         uint16_t        seq_id;
46218         /* The length of the response data in number of bytes. */
46219         uint16_t        resp_len;
46220         /* The port 0 RX mirror action record ID. */
46221         uint16_t        rx_ar_id_port0;
46222         /* The port 1 RX mirror action record ID. */
46223         uint16_t        rx_ar_id_port1;
46224         /*
46225          * The port 0 RX action record ID for TX TCP flag packets from
46226          * loopback path.
46227          */
46228         uint16_t        tx_ar_id_port0;
46229         /*
46230          * The port 1 RX action record ID for TX TCP flag packets from
46231          * loopback path.
46232          */
46233         uint16_t        tx_ar_id_port1;
46234         uint8_t unused_0[7];
46235         /*
46236          * This field is used in Output records to indicate that the output
46237          * is completely written to RAM. This field should be read as '1'
46238          * to indicate that the output has been completely written.
46239          * When writing a command completion or response to an internal
46240          * processor, the order of writes has to be such that this field is
46241          * written last.
46242          */
46243         uint8_t valid;
46244 } __rte_packed;
46245
46246 /**************************
46247  * hwrm_cfa_vf_pair_alloc *
46248  **************************/
46249
46250
46251 /* hwrm_cfa_vf_pair_alloc_input (size:448b/56B) */
46252 struct hwrm_cfa_vf_pair_alloc_input {
46253         /* The HWRM command request type. */
46254         uint16_t        req_type;
46255         /*
46256          * The completion ring to send the completion event on. This should
46257          * be the NQ ID returned from the `nq_alloc` HWRM command.
46258          */
46259         uint16_t        cmpl_ring;
46260         /*
46261          * The sequence ID is used by the driver for tracking multiple
46262          * commands. This ID is treated as opaque data by the firmware and
46263          * the value is returned in the `hwrm_resp_hdr` upon completion.
46264          */
46265         uint16_t        seq_id;
46266         /*
46267          * The target ID of the command:
46268          * * 0x0-0xFFF8 - The function ID
46269          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46270          * * 0xFFFD - Reserved for user-space HWRM interface
46271          * * 0xFFFF - HWRM
46272          */
46273         uint16_t        target_id;
46274         /*
46275          * A physical address pointer pointing to a host buffer that the
46276          * command's response data will be written. This can be either a host
46277          * physical address (HPA) or a guest physical address (GPA) and must
46278          * point to a physically contiguous block of memory.
46279          */
46280         uint64_t        resp_addr;
46281         /* Logical VF number (range: 0 -> MAX_VFS -1). */
46282         uint16_t        vf_a_id;
46283         /* Logical VF number (range: 0 -> MAX_VFS -1). */
46284         uint16_t        vf_b_id;
46285         uint8_t unused_0[4];
46286         /* VF Pair name (32 byte string). */
46287         char    pair_name[32];
46288 } __rte_packed;
46289
46290 /* hwrm_cfa_vf_pair_alloc_output (size:128b/16B) */
46291 struct hwrm_cfa_vf_pair_alloc_output {
46292         /* The specific error status for the command. */
46293         uint16_t        error_code;
46294         /* The HWRM command request type. */
46295         uint16_t        req_type;
46296         /* The sequence ID from the original command. */
46297         uint16_t        seq_id;
46298         /* The length of the response data in number of bytes. */
46299         uint16_t        resp_len;
46300         uint8_t unused_0[7];
46301         /*
46302          * This field is used in Output records to indicate that the output
46303          * is completely written to RAM. This field should be read as '1'
46304          * to indicate that the output has been completely written.
46305          * When writing a command completion or response to an internal
46306          * processor, the order of writes has to be such that this field is
46307          * written last.
46308          */
46309         uint8_t valid;
46310 } __rte_packed;
46311
46312 /*************************
46313  * hwrm_cfa_vf_pair_free *
46314  *************************/
46315
46316
46317 /* hwrm_cfa_vf_pair_free_input (size:384b/48B) */
46318 struct hwrm_cfa_vf_pair_free_input {
46319         /* The HWRM command request type. */
46320         uint16_t        req_type;
46321         /*
46322          * The completion ring to send the completion event on. This should
46323          * be the NQ ID returned from the `nq_alloc` HWRM command.
46324          */
46325         uint16_t        cmpl_ring;
46326         /*
46327          * The sequence ID is used by the driver for tracking multiple
46328          * commands. This ID is treated as opaque data by the firmware and
46329          * the value is returned in the `hwrm_resp_hdr` upon completion.
46330          */
46331         uint16_t        seq_id;
46332         /*
46333          * The target ID of the command:
46334          * * 0x0-0xFFF8 - The function ID
46335          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46336          * * 0xFFFD - Reserved for user-space HWRM interface
46337          * * 0xFFFF - HWRM
46338          */
46339         uint16_t        target_id;
46340         /*
46341          * A physical address pointer pointing to a host buffer that the
46342          * command's response data will be written. This can be either a host
46343          * physical address (HPA) or a guest physical address (GPA) and must
46344          * point to a physically contiguous block of memory.
46345          */
46346         uint64_t        resp_addr;
46347         /* VF Pair name (32 byte string). */
46348         char    pair_name[32];
46349 } __rte_packed;
46350
46351 /* hwrm_cfa_vf_pair_free_output (size:128b/16B) */
46352 struct hwrm_cfa_vf_pair_free_output {
46353         /* The specific error status for the command. */
46354         uint16_t        error_code;
46355         /* The HWRM command request type. */
46356         uint16_t        req_type;
46357         /* The sequence ID from the original command. */
46358         uint16_t        seq_id;
46359         /* The length of the response data in number of bytes. */
46360         uint16_t        resp_len;
46361         uint8_t unused_0[7];
46362         /*
46363          * This field is used in Output records to indicate that the output
46364          * is completely written to RAM. This field should be read as '1'
46365          * to indicate that the output has been completely written.
46366          * When writing a command completion or response to an internal
46367          * processor, the order of writes has to be such that this field is
46368          * written last.
46369          */
46370         uint8_t valid;
46371 } __rte_packed;
46372
46373 /*************************
46374  * hwrm_cfa_vf_pair_info *
46375  *************************/
46376
46377
46378 /* hwrm_cfa_vf_pair_info_input (size:448b/56B) */
46379 struct hwrm_cfa_vf_pair_info_input {
46380         /* The HWRM command request type. */
46381         uint16_t        req_type;
46382         /*
46383          * The completion ring to send the completion event on. This should
46384          * be the NQ ID returned from the `nq_alloc` HWRM command.
46385          */
46386         uint16_t        cmpl_ring;
46387         /*
46388          * The sequence ID is used by the driver for tracking multiple
46389          * commands. This ID is treated as opaque data by the firmware and
46390          * the value is returned in the `hwrm_resp_hdr` upon completion.
46391          */
46392         uint16_t        seq_id;
46393         /*
46394          * The target ID of the command:
46395          * * 0x0-0xFFF8 - The function ID
46396          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46397          * * 0xFFFD - Reserved for user-space HWRM interface
46398          * * 0xFFFF - HWRM
46399          */
46400         uint16_t        target_id;
46401         /*
46402          * A physical address pointer pointing to a host buffer that the
46403          * command's response data will be written. This can be either a host
46404          * physical address (HPA) or a guest physical address (GPA) and must
46405          * point to a physically contiguous block of memory.
46406          */
46407         uint64_t        resp_addr;
46408         uint32_t        flags;
46409         /* If this flag is set, lookup by name else lookup by index. */
46410         #define HWRM_CFA_VF_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE     UINT32_C(0x1)
46411         /* vf pair table index. */
46412         uint16_t        vf_pair_index;
46413         uint8_t unused_0[2];
46414         /* VF Pair name (32 byte string). */
46415         char    vf_pair_name[32];
46416 } __rte_packed;
46417
46418 /* hwrm_cfa_vf_pair_info_output (size:512b/64B) */
46419 struct hwrm_cfa_vf_pair_info_output {
46420         /* The specific error status for the command. */
46421         uint16_t        error_code;
46422         /* The HWRM command request type. */
46423         uint16_t        req_type;
46424         /* The sequence ID from the original command. */
46425         uint16_t        seq_id;
46426         /* The length of the response data in number of bytes. */
46427         uint16_t        resp_len;
46428         /* vf pair table index. */
46429         uint16_t        next_vf_pair_index;
46430         /* vf pair member a's vf_fid. */
46431         uint16_t        vf_a_fid;
46432         /* vf pair member a's Linux logical VF number. */
46433         uint16_t        vf_a_index;
46434         /* vf pair member b's vf_fid. */
46435         uint16_t        vf_b_fid;
46436         /* vf pair member a's Linux logical VF number. */
46437         uint16_t        vf_b_index;
46438         /* vf pair state. */
46439         uint8_t pair_state;
46440         /* Pair has been allocated */
46441         #define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
46442         /* Both pair members are active */
46443         #define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE    UINT32_C(0x2)
46444         #define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_LAST \
46445                 HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
46446         uint8_t unused_0[5];
46447         /* VF Pair name (32 byte string). */
46448         char    pair_name[32];
46449         uint8_t unused_1[7];
46450         /*
46451          * This field is used in Output records to indicate that the output
46452          * is completely written to RAM. This field should be read as '1'
46453          * to indicate that the output has been completely written.
46454          * When writing a command completion or response to an internal
46455          * processor, the order of writes has to be such that this field is
46456          * written last.
46457          */
46458         uint8_t valid;
46459 } __rte_packed;
46460
46461 /***********************
46462  * hwrm_cfa_pair_alloc *
46463  ***********************/
46464
46465
46466 /* hwrm_cfa_pair_alloc_input (size:576b/72B) */
46467 struct hwrm_cfa_pair_alloc_input {
46468         /* The HWRM command request type. */
46469         uint16_t        req_type;
46470         /*
46471          * The completion ring to send the completion event on. This should
46472          * be the NQ ID returned from the `nq_alloc` HWRM command.
46473          */
46474         uint16_t        cmpl_ring;
46475         /*
46476          * The sequence ID is used by the driver for tracking multiple
46477          * commands. This ID is treated as opaque data by the firmware and
46478          * the value is returned in the `hwrm_resp_hdr` upon completion.
46479          */
46480         uint16_t        seq_id;
46481         /*
46482          * The target ID of the command:
46483          * * 0x0-0xFFF8 - The function ID
46484          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46485          * * 0xFFFD - Reserved for user-space HWRM interface
46486          * * 0xFFFF - HWRM
46487          */
46488         uint16_t        target_id;
46489         /*
46490          * A physical address pointer pointing to a host buffer that the
46491          * command's response data will be written. This can be either a host
46492          * physical address (HPA) or a guest physical address (GPA) and must
46493          * point to a physically contiguous block of memory.
46494          */
46495         uint64_t        resp_addr;
46496         /*
46497          * Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair,
46498          *            5-rep2fn_mod, 6-rep2fn_modall, 7-rep2fn_truflow).
46499          */
46500         uint16_t        pair_mode;
46501         /* Pair between VF on local host with PF or VF on specified host. */
46502         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_VF2FN \
46503                 UINT32_C(0x0)
46504         /* Pair between REP on local host with PF or VF on specified host. */
46505         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN \
46506                 UINT32_C(0x1)
46507         /* Pair between REP on local host with REP on specified host. */
46508         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2REP \
46509                 UINT32_C(0x2)
46510         /* Pair for the proxy interface. */
46511         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_PROXY \
46512                 UINT32_C(0x3)
46513         /* Pair for the PF interface. */
46514         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_PFPAIR \
46515                 UINT32_C(0x4)
46516         /* Modify existing rep2fn pair and move pair to new PF. */
46517         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_MOD \
46518                 UINT32_C(0x5)
46519         /*
46520          * Modify existing rep2fn pairs paired with same PF and move pairs
46521          * to new PF.
46522          */
46523         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_MODALL \
46524                 UINT32_C(0x6)
46525         /*
46526          * Truflow pair between REP on local host with PF or VF on specified
46527          * host.
46528          */
46529         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_TRUFLOW \
46530                 UINT32_C(0x7)
46531         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_LAST \
46532                 HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_TRUFLOW
46533         /* Logical VF number (range: 0 -> MAX_VFS -1). */
46534         uint16_t        vf_a_id;
46535         /* Logical Host (0xff-local host). */
46536         uint8_t host_b_id;
46537         /* Logical PF (0xff-PF for command channel). */
46538         uint8_t pf_b_id;
46539         /* Logical VF number (range: 0 -> MAX_VFS -1). */
46540         uint16_t        vf_b_id;
46541         /* Loopback port (0xff-internal loopback), valid for mode-3. */
46542         uint8_t port_id;
46543         /* Priority used for encap of loopback packets valid for mode-3. */
46544         uint8_t pri;
46545         /* New PF for rep2fn modify, valid for mode 5. */
46546         uint16_t        new_pf_fid;
46547         uint32_t        enables;
46548         /*
46549          * This bit must be '1' for the q_ab field to be
46550          * configured.
46551          */
46552         #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_Q_AB_VALID      UINT32_C(0x1)
46553         /*
46554          * This bit must be '1' for the q_ba field to be
46555          * configured.
46556          */
46557         #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_Q_BA_VALID      UINT32_C(0x2)
46558         /*
46559          * This bit must be '1' for the fc_ab field to be
46560          * configured.
46561          */
46562         #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_FC_AB_VALID     UINT32_C(0x4)
46563         /*
46564          * This bit must be '1' for the fc_ba field to be
46565          * configured.
46566          */
46567         #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_FC_BA_VALID     UINT32_C(0x8)
46568         /* VF Pair name (32 byte string). */
46569         char    pair_name[32];
46570         /*
46571          * The q_ab value specifies the logical index of the TX/RX CoS
46572          * queue to be assigned for traffic in the A to B direction of
46573          * the interface pair. The default value is 0.
46574          */
46575         uint8_t q_ab;
46576         /*
46577          * The q_ba value specifies the logical index of the TX/RX CoS
46578          * queue to be assigned for traffic in the B to A direction of
46579          * the interface pair. The default value is 1.
46580          */
46581         uint8_t q_ba;
46582         /*
46583          * Specifies whether RX ring flow control is disabled (0) or enabled
46584          * (1) in the A to B direction. The default value is 0, meaning that
46585          * packets will be dropped when the B-side RX rings are full.
46586          */
46587         uint8_t fc_ab;
46588         /*
46589          * Specifies whether RX ring flow control is disabled (0) or enabled
46590          * (1) in the B to A direction. The default value is 1, meaning that
46591          * the RX CoS queue will be flow controlled when the A-side RX rings
46592          * are full.
46593          */
46594         uint8_t fc_ba;
46595         uint8_t unused_1[4];
46596 } __rte_packed;
46597
46598 /* hwrm_cfa_pair_alloc_output (size:192b/24B) */
46599 struct hwrm_cfa_pair_alloc_output {
46600         /* The specific error status for the command. */
46601         uint16_t        error_code;
46602         /* The HWRM command request type. */
46603         uint16_t        req_type;
46604         /* The sequence ID from the original command. */
46605         uint16_t        seq_id;
46606         /* The length of the response data in number of bytes. */
46607         uint16_t        resp_len;
46608         /* Only valid for modes 1 and 2. */
46609         uint16_t        rx_cfa_code_a;
46610         /* Only valid for modes 1 and 2. */
46611         uint16_t        tx_cfa_action_a;
46612         /* Only valid for mode 2. */
46613         uint16_t        rx_cfa_code_b;
46614         /* Only valid for mode 2. */
46615         uint16_t        tx_cfa_action_b;
46616         uint8_t unused_0[7];
46617         /*
46618          * This field is used in Output records to indicate that the output
46619          * is completely written to RAM. This field should be read as '1'
46620          * to indicate that the output has been completely written.
46621          * When writing a command completion or response to an internal
46622          * processor, the order of writes has to be such that this field is
46623          * written last.
46624          */
46625         uint8_t valid;
46626 } __rte_packed;
46627
46628 /**********************
46629  * hwrm_cfa_pair_free *
46630  **********************/
46631
46632
46633 /* hwrm_cfa_pair_free_input (size:448b/56B) */
46634 struct hwrm_cfa_pair_free_input {
46635         /* The HWRM command request type. */
46636         uint16_t        req_type;
46637         /*
46638          * The completion ring to send the completion event on. This should
46639          * be the NQ ID returned from the `nq_alloc` HWRM command.
46640          */
46641         uint16_t        cmpl_ring;
46642         /*
46643          * The sequence ID is used by the driver for tracking multiple
46644          * commands. This ID is treated as opaque data by the firmware and
46645          * the value is returned in the `hwrm_resp_hdr` upon completion.
46646          */
46647         uint16_t        seq_id;
46648         /*
46649          * The target ID of the command:
46650          * * 0x0-0xFFF8 - The function ID
46651          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46652          * * 0xFFFD - Reserved for user-space HWRM interface
46653          * * 0xFFFF - HWRM
46654          */
46655         uint16_t        target_id;
46656         /*
46657          * A physical address pointer pointing to a host buffer that the
46658          * command's response data will be written. This can be either a host
46659          * physical address (HPA) or a guest physical address (GPA) and must
46660          * point to a physically contiguous block of memory.
46661          */
46662         uint64_t        resp_addr;
46663         /* VF Pair name (32 byte string). */
46664         char    pair_name[32];
46665         /* Logical PF (0xff-PF for command channel). */
46666         uint8_t pf_b_id;
46667         uint8_t unused_0[3];
46668         /* Logical VF number (range: 0 -> MAX_VFS -1). */
46669         uint16_t        vf_id;
46670         /*
46671          * Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair,
46672          *            5-rep2fn_mod, 6-rep2fn_modall, 7-rep2fn_truflow).
46673          */
46674         uint16_t        pair_mode;
46675         /* Pair between VF on local host with PF or VF on specified host. */
46676         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_VF2FN          UINT32_C(0x0)
46677         /* Pair between REP on local host with PF or VF on specified host. */
46678         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN         UINT32_C(0x1)
46679         /* Pair between REP on local host with REP on specified host. */
46680         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2REP        UINT32_C(0x2)
46681         /* Pair for the proxy interface. */
46682         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_PROXY          UINT32_C(0x3)
46683         /* Pair for the PF interface. */
46684         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_PFPAIR         UINT32_C(0x4)
46685         /* Modify existing rep2fn pair and move pair to new PF. */
46686         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_MOD     UINT32_C(0x5)
46687         /*
46688          * Modify existing rep2fn pairs paired with same PF and move pairs
46689          * to new PF.
46690          */
46691         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_MODALL  UINT32_C(0x6)
46692         /*
46693          * Truflow pair between REP on local host with PF or VF on
46694          * specified host.
46695          */
46696         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_TRUFLOW UINT32_C(0x7)
46697         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_LAST \
46698                 HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_TRUFLOW
46699 } __rte_packed;
46700
46701 /* hwrm_cfa_pair_free_output (size:128b/16B) */
46702 struct hwrm_cfa_pair_free_output {
46703         /* The specific error status for the command. */
46704         uint16_t        error_code;
46705         /* The HWRM command request type. */
46706         uint16_t        req_type;
46707         /* The sequence ID from the original command. */
46708         uint16_t        seq_id;
46709         /* The length of the response data in number of bytes. */
46710         uint16_t        resp_len;
46711         uint8_t unused_0[7];
46712         /*
46713          * This field is used in Output records to indicate that the output
46714          * is completely written to RAM. This field should be read as '1'
46715          * to indicate that the output has been completely written.
46716          * When writing a command completion or response to an internal
46717          * processor, the order of writes has to be such that this field is
46718          * written last.
46719          */
46720         uint8_t valid;
46721 } __rte_packed;
46722
46723 /**********************
46724  * hwrm_cfa_pair_info *
46725  **********************/
46726
46727
46728 /* hwrm_cfa_pair_info_input (size:448b/56B) */
46729 struct hwrm_cfa_pair_info_input {
46730         /* The HWRM command request type. */
46731         uint16_t        req_type;
46732         /*
46733          * The completion ring to send the completion event on. This should
46734          * be the NQ ID returned from the `nq_alloc` HWRM command.
46735          */
46736         uint16_t        cmpl_ring;
46737         /*
46738          * The sequence ID is used by the driver for tracking multiple
46739          * commands. This ID is treated as opaque data by the firmware and
46740          * the value is returned in the `hwrm_resp_hdr` upon completion.
46741          */
46742         uint16_t        seq_id;
46743         /*
46744          * The target ID of the command:
46745          * * 0x0-0xFFF8 - The function ID
46746          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46747          * * 0xFFFD - Reserved for user-space HWRM interface
46748          * * 0xFFFF - HWRM
46749          */
46750         uint16_t        target_id;
46751         /*
46752          * A physical address pointer pointing to a host buffer that the
46753          * command's response data will be written. This can be either a host
46754          * physical address (HPA) or a guest physical address (GPA) and must
46755          * point to a physically contiguous block of memory.
46756          */
46757         uint64_t        resp_addr;
46758         uint32_t        flags;
46759         /* If this flag is set, lookup by name else lookup by index. */
46760         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE      UINT32_C(0x1)
46761         /* If this flag is set, lookup by PF id and VF id. */
46762         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE     UINT32_C(0x2)
46763         /* Pair table index. */
46764         uint16_t        pair_index;
46765         /* Pair pf index. */
46766         uint8_t pair_pfid;
46767         /* Pair vf index. */
46768         uint8_t pair_vfid;
46769         /* Pair name (32 byte string). */
46770         char    pair_name[32];
46771 } __rte_packed;
46772
46773 /* hwrm_cfa_pair_info_output (size:576b/72B) */
46774 struct hwrm_cfa_pair_info_output {
46775         /* The specific error status for the command. */
46776         uint16_t        error_code;
46777         /* The HWRM command request type. */
46778         uint16_t        req_type;
46779         /* The sequence ID from the original command. */
46780         uint16_t        seq_id;
46781         /* The length of the response data in number of bytes. */
46782         uint16_t        resp_len;
46783         /* Pair table index. */
46784         uint16_t        next_pair_index;
46785         /* Pair member a's fid. */
46786         uint16_t        a_fid;
46787         /* Logical host number. */
46788         uint8_t host_a_index;
46789         /* Logical PF number. */
46790         uint8_t pf_a_index;
46791         /* Pair member a's Linux logical VF number. */
46792         uint16_t        vf_a_index;
46793         /* Rx CFA code. */
46794         uint16_t        rx_cfa_code_a;
46795         /* Tx CFA action. */
46796         uint16_t        tx_cfa_action_a;
46797         /* Pair member b's fid. */
46798         uint16_t        b_fid;
46799         /* Logical host number. */
46800         uint8_t host_b_index;
46801         /* Logical PF number. */
46802         uint8_t pf_b_index;
46803         /* Pair member a's Linux logical VF number. */
46804         uint16_t        vf_b_index;
46805         /* Rx CFA code. */
46806         uint16_t        rx_cfa_code_b;
46807         /* Tx CFA action. */
46808         uint16_t        tx_cfa_action_b;
46809         /* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */
46810         uint8_t pair_mode;
46811         /* Pair between VF on local host with PF or VF on specified host. */
46812         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN   UINT32_C(0x0)
46813         /* Pair between REP on local host with PF or VF on specified host. */
46814         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN  UINT32_C(0x1)
46815         /* Pair between REP on local host with REP on specified host. */
46816         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
46817         /* Pair for the proxy interface. */
46818         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY   UINT32_C(0x3)
46819         /* Pair for the PF interface. */
46820         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR  UINT32_C(0x4)
46821         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST \
46822                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR
46823         /* Pair state. */
46824         uint8_t pair_state;
46825         /* Pair has been allocated */
46826         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
46827         /* Both pair members are active */
46828         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE    UINT32_C(0x2)
46829         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST \
46830                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
46831         /* Pair name (32 byte string). */
46832         char    pair_name[32];
46833         uint8_t unused_0[7];
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
46839          * processor, the order of writes has to be such that this field is
46840          * written last.
46841          */
46842         uint8_t valid;
46843 } __rte_packed;
46844
46845 /**********************
46846  * hwrm_cfa_vfr_alloc *
46847  **********************/
46848
46849
46850 /* hwrm_cfa_vfr_alloc_input (size:448b/56B) */
46851 struct hwrm_cfa_vfr_alloc_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         /* Logical VF number (range: 0 -> MAX_VFS -1). */
46881         uint16_t        vf_id;
46882         /*
46883          * This field is reserved for the future use.
46884          * It shall be set to 0.
46885          */
46886         uint16_t        reserved;
46887         uint8_t unused_0[4];
46888         /* VF Representor name (32 byte string). */
46889         char    vfr_name[32];
46890 } __rte_packed;
46891
46892 /* hwrm_cfa_vfr_alloc_output (size:128b/16B) */
46893 struct hwrm_cfa_vfr_alloc_output {
46894         /* The specific error status for the command. */
46895         uint16_t        error_code;
46896         /* The HWRM command request type. */
46897         uint16_t        req_type;
46898         /* The sequence ID from the original command. */
46899         uint16_t        seq_id;
46900         /* The length of the response data in number of bytes. */
46901         uint16_t        resp_len;
46902         /* Rx CFA code. */
46903         uint16_t        rx_cfa_code;
46904         /* Tx CFA action. */
46905         uint16_t        tx_cfa_action;
46906         uint8_t unused_0[3];
46907         /*
46908          * This field is used in Output records to indicate that the output
46909          * is completely written to RAM. This field should be read as '1'
46910          * to indicate that the output has been completely written.
46911          * When writing a command completion or response to an internal
46912          * processor, the order of writes has to be such that this field is
46913          * written last.
46914          */
46915         uint8_t valid;
46916 } __rte_packed;
46917
46918 /*********************
46919  * hwrm_cfa_vfr_free *
46920  *********************/
46921
46922
46923 /* hwrm_cfa_vfr_free_input (size:448b/56B) */
46924 struct hwrm_cfa_vfr_free_input {
46925         /* The HWRM command request type. */
46926         uint16_t        req_type;
46927         /*
46928          * The completion ring to send the completion event on. This should
46929          * be the NQ ID returned from the `nq_alloc` HWRM command.
46930          */
46931         uint16_t        cmpl_ring;
46932         /*
46933          * The sequence ID is used by the driver for tracking multiple
46934          * commands. This ID is treated as opaque data by the firmware and
46935          * the value is returned in the `hwrm_resp_hdr` upon completion.
46936          */
46937         uint16_t        seq_id;
46938         /*
46939          * The target ID of the command:
46940          * * 0x0-0xFFF8 - The function ID
46941          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46942          * * 0xFFFD - Reserved for user-space HWRM interface
46943          * * 0xFFFF - HWRM
46944          */
46945         uint16_t        target_id;
46946         /*
46947          * A physical address pointer pointing to a host buffer that the
46948          * command's response data will be written. This can be either a host
46949          * physical address (HPA) or a guest physical address (GPA) and must
46950          * point to a physically contiguous block of memory.
46951          */
46952         uint64_t        resp_addr;
46953         /* VF Representor name (32 byte string). */
46954         char    vfr_name[32];
46955         /* Logical VF number (range: 0 -> MAX_VFS -1). */
46956         uint16_t        vf_id;
46957         /*
46958          * This field is reserved for the future use.
46959          * It shall be set to 0.
46960          */
46961         uint16_t        reserved;
46962         uint8_t unused_0[4];
46963 } __rte_packed;
46964
46965 /* hwrm_cfa_vfr_free_output (size:128b/16B) */
46966 struct hwrm_cfa_vfr_free_output {
46967         /* The specific error status for the command. */
46968         uint16_t        error_code;
46969         /* The HWRM command request type. */
46970         uint16_t        req_type;
46971         /* The sequence ID from the original command. */
46972         uint16_t        seq_id;
46973         /* The length of the response data in number of bytes. */
46974         uint16_t        resp_len;
46975         uint8_t unused_0[7];
46976         /*
46977          * This field is used in Output records to indicate that the output
46978          * is completely written to RAM. This field should be read as '1'
46979          * to indicate that the output has been completely written.
46980          * When writing a command completion or response to an internal
46981          * processor, the order of writes has to be such that this field is
46982          * written last.
46983          */
46984         uint8_t valid;
46985 } __rte_packed;
46986
46987 /***************************************
46988  * hwrm_cfa_redirect_query_tunnel_type *
46989  ***************************************/
46990
46991
46992 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */
46993 struct hwrm_cfa_redirect_query_tunnel_type_input {
46994         /* The HWRM command request type. */
46995         uint16_t        req_type;
46996         /*
46997          * The completion ring to send the completion event on. This should
46998          * be the NQ ID returned from the `nq_alloc` HWRM command.
46999          */
47000         uint16_t        cmpl_ring;
47001         /*
47002          * The sequence ID is used by the driver for tracking multiple
47003          * commands. This ID is treated as opaque data by the firmware and
47004          * the value is returned in the `hwrm_resp_hdr` upon completion.
47005          */
47006         uint16_t        seq_id;
47007         /*
47008          * The target ID of the command:
47009          * * 0x0-0xFFF8 - The function ID
47010          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47011          * * 0xFFFD - Reserved for user-space HWRM interface
47012          * * 0xFFFF - HWRM
47013          */
47014         uint16_t        target_id;
47015         /*
47016          * A physical address pointer pointing to a host buffer that the
47017          * command's response data will be written. This can be either a host
47018          * physical address (HPA) or a guest physical address (GPA) and must
47019          * point to a physically contiguous block of memory.
47020          */
47021         uint64_t        resp_addr;
47022         /* The source function id. */
47023         uint16_t        src_fid;
47024         uint8_t unused_0[6];
47025 } __rte_packed;
47026
47027 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
47028 struct hwrm_cfa_redirect_query_tunnel_type_output {
47029         /* The specific error status for the command. */
47030         uint16_t        error_code;
47031         /* The HWRM command request type. */
47032         uint16_t        req_type;
47033         /* The sequence ID from the original command. */
47034         uint16_t        seq_id;
47035         /* The length of the response data in number of bytes. */
47036         uint16_t        resp_len;
47037         /* Tunnel Mask. */
47038         uint32_t        tunnel_mask;
47039         /* Non-tunnel */
47040         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL \
47041                 UINT32_C(0x1)
47042         /* Virtual eXtensible Local Area Network (VXLAN) */
47043         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN \
47044                 UINT32_C(0x2)
47045         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
47046         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE \
47047                 UINT32_C(0x4)
47048         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
47049         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE \
47050                 UINT32_C(0x8)
47051         /* IP in IP */
47052         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP \
47053                 UINT32_C(0x10)
47054         /* Generic Network Virtualization Encapsulation (Geneve) */
47055         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE \
47056                 UINT32_C(0x20)
47057         /* Multi-Protocol Label Switching (MPLS) */
47058         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS \
47059                 UINT32_C(0x40)
47060         /* Stateless Transport Tunnel (STT) */
47061         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT \
47062                 UINT32_C(0x80)
47063         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
47064         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE \
47065                 UINT32_C(0x100)
47066         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
47067         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4 \
47068                 UINT32_C(0x200)
47069         /*
47070          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
47071          * datagram payload
47072          */
47073         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1 \
47074                 UINT32_C(0x400)
47075         /* Any tunneled traffic */
47076         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL \
47077                 UINT32_C(0x800)
47078         /* Use fixed layer 2 ether type of 0xFFFF */
47079         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2_ETYPE \
47080                 UINT32_C(0x1000)
47081         /*
47082          * IPV6 over virtual eXtensible Local Area Network with GPE header
47083          * (IPV6oVXLANGPE)
47084          */
47085         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE_V6 \
47086                 UINT32_C(0x2000)
47087         uint8_t unused_0[3];
47088         /*
47089          * This field is used in Output records to indicate that the output
47090          * is completely written to RAM. This field should be read as '1'
47091          * to indicate that the output has been completely written.
47092          * When writing a command completion or response to an internal
47093          * processor, the order of writes has to be such that this field is
47094          * written last.
47095          */
47096         uint8_t valid;
47097 } __rte_packed;
47098
47099 /*************************
47100  * hwrm_cfa_ctx_mem_rgtr *
47101  *************************/
47102
47103
47104 /* hwrm_cfa_ctx_mem_rgtr_input (size:256b/32B) */
47105 struct hwrm_cfa_ctx_mem_rgtr_input {
47106         /* The HWRM command request type. */
47107         uint16_t        req_type;
47108         /*
47109          * The completion ring to send the completion event on. This should
47110          * be the NQ ID returned from the `nq_alloc` HWRM command.
47111          */
47112         uint16_t        cmpl_ring;
47113         /*
47114          * The sequence ID is used by the driver for tracking multiple
47115          * commands. This ID is treated as opaque data by the firmware and
47116          * the value is returned in the `hwrm_resp_hdr` upon completion.
47117          */
47118         uint16_t        seq_id;
47119         /*
47120          * The target ID of the command:
47121          * * 0x0-0xFFF8 - The function ID
47122          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47123          * * 0xFFFD - Reserved for user-space HWRM interface
47124          * * 0xFFFF - HWRM
47125          */
47126         uint16_t        target_id;
47127         /*
47128          * A physical address pointer pointing to a host buffer that the
47129          * command's response data will be written. This can be either a host
47130          * physical address (HPA) or a guest physical address (GPA) and must
47131          * point to a physically contiguous block of memory.
47132          */
47133         uint64_t        resp_addr;
47134         uint16_t        flags;
47135         /* Counter PBL indirect levels. */
47136         uint8_t page_level;
47137         /* PBL pointer is physical start address. */
47138         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
47139         /* PBL pointer points to PTE table. */
47140         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
47141         /*
47142          * PBL pointer points to PDE table with each entry pointing to PTE
47143          * tables.
47144          */
47145         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
47146         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LAST \
47147                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
47148         /* Page size. */
47149         uint8_t page_size;
47150         /* 4KB page size. */
47151         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
47152         /* 8KB page size. */
47153         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
47154         /* 64KB page size. */
47155         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
47156         /* 256KB page size. */
47157         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
47158         /* 1MB page size. */
47159         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
47160         /* 2MB page size. */
47161         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
47162         /* 4MB page size. */
47163         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
47164         /* 1GB page size. */
47165         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
47166         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_LAST \
47167                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G
47168         uint32_t        unused_0;
47169         /* Pointer to the PBL, or PDL depending on number of levels */
47170         uint64_t        page_dir;
47171 } __rte_packed;
47172
47173 /* hwrm_cfa_ctx_mem_rgtr_output (size:128b/16B) */
47174 struct hwrm_cfa_ctx_mem_rgtr_output {
47175         /* The specific error status for the command. */
47176         uint16_t        error_code;
47177         /* The HWRM command request type. */
47178         uint16_t        req_type;
47179         /* The sequence ID from the original command. */
47180         uint16_t        seq_id;
47181         /* The length of the response data in number of bytes. */
47182         uint16_t        resp_len;
47183         /*
47184          * Id/Handle to the recently register context memory. This handle is
47185          * passed to the CFA feature.
47186          */
47187         uint16_t        ctx_id;
47188         uint8_t unused_0[5];
47189         /*
47190          * This field is used in Output records to indicate that the output
47191          * is completely written to RAM. This field should be read as '1'
47192          * to indicate that the output has been completely written.
47193          * When writing a command completion or response to an internal
47194          * processor, the order of writes has to be such that this field is
47195          * written last.
47196          */
47197         uint8_t valid;
47198 } __rte_packed;
47199
47200 /***************************
47201  * hwrm_cfa_ctx_mem_unrgtr *
47202  ***************************/
47203
47204
47205 /* hwrm_cfa_ctx_mem_unrgtr_input (size:192b/24B) */
47206 struct hwrm_cfa_ctx_mem_unrgtr_input {
47207         /* The HWRM command request type. */
47208         uint16_t        req_type;
47209         /*
47210          * The completion ring to send the completion event on. This should
47211          * be the NQ ID returned from the `nq_alloc` HWRM command.
47212          */
47213         uint16_t        cmpl_ring;
47214         /*
47215          * The sequence ID is used by the driver for tracking multiple
47216          * commands. This ID is treated as opaque data by the firmware and
47217          * the value is returned in the `hwrm_resp_hdr` upon completion.
47218          */
47219         uint16_t        seq_id;
47220         /*
47221          * The target ID of the command:
47222          * * 0x0-0xFFF8 - The function ID
47223          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47224          * * 0xFFFD - Reserved for user-space HWRM interface
47225          * * 0xFFFF - HWRM
47226          */
47227         uint16_t        target_id;
47228         /*
47229          * A physical address pointer pointing to a host buffer that the
47230          * command's response data will be written. This can be either a host
47231          * physical address (HPA) or a guest physical address (GPA) and must
47232          * point to a physically contiguous block of memory.
47233          */
47234         uint64_t        resp_addr;
47235         /*
47236          * Id/Handle to the recently register context memory. This handle is
47237          * passed to the CFA feature.
47238          */
47239         uint16_t        ctx_id;
47240         uint8_t unused_0[6];
47241 } __rte_packed;
47242
47243 /* hwrm_cfa_ctx_mem_unrgtr_output (size:128b/16B) */
47244 struct hwrm_cfa_ctx_mem_unrgtr_output {
47245         /* The specific error status for the command. */
47246         uint16_t        error_code;
47247         /* The HWRM command request type. */
47248         uint16_t        req_type;
47249         /* The sequence ID from the original command. */
47250         uint16_t        seq_id;
47251         /* The length of the response data in number of bytes. */
47252         uint16_t        resp_len;
47253         uint8_t unused_0[7];
47254         /*
47255          * This field is used in Output records to indicate that the output
47256          * is completely written to RAM. This field should be read as '1'
47257          * to indicate that the output has been completely written.
47258          * When writing a command completion or response to an internal
47259          * processor, the order of writes has to be such that this field is
47260          * written last.
47261          */
47262         uint8_t valid;
47263 } __rte_packed;
47264
47265 /*************************
47266  * hwrm_cfa_ctx_mem_qctx *
47267  *************************/
47268
47269
47270 /* hwrm_cfa_ctx_mem_qctx_input (size:192b/24B) */
47271 struct hwrm_cfa_ctx_mem_qctx_input {
47272         /* The HWRM command request type. */
47273         uint16_t        req_type;
47274         /*
47275          * The completion ring to send the completion event on. This should
47276          * be the NQ ID returned from the `nq_alloc` HWRM command.
47277          */
47278         uint16_t        cmpl_ring;
47279         /*
47280          * The sequence ID is used by the driver for tracking multiple
47281          * commands. This ID is treated as opaque data by the firmware and
47282          * the value is returned in the `hwrm_resp_hdr` upon completion.
47283          */
47284         uint16_t        seq_id;
47285         /*
47286          * The target ID of the command:
47287          * * 0x0-0xFFF8 - The function ID
47288          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47289          * * 0xFFFD - Reserved for user-space HWRM interface
47290          * * 0xFFFF - HWRM
47291          */
47292         uint16_t        target_id;
47293         /*
47294          * A physical address pointer pointing to a host buffer that the
47295          * command's response data will be written. This can be either a host
47296          * physical address (HPA) or a guest physical address (GPA) and must
47297          * point to a physically contiguous block of memory.
47298          */
47299         uint64_t        resp_addr;
47300         /*
47301          * Id/Handle to the recently register context memory. This handle is
47302          * passed to the CFA feature.
47303          */
47304         uint16_t        ctx_id;
47305         uint8_t unused_0[6];
47306 } __rte_packed;
47307
47308 /* hwrm_cfa_ctx_mem_qctx_output (size:256b/32B) */
47309 struct hwrm_cfa_ctx_mem_qctx_output {
47310         /* The specific error status for the command. */
47311         uint16_t        error_code;
47312         /* The HWRM command request type. */
47313         uint16_t        req_type;
47314         /* The sequence ID from the original command. */
47315         uint16_t        seq_id;
47316         /* The length of the response data in number of bytes. */
47317         uint16_t        resp_len;
47318         uint16_t        flags;
47319         /* Counter PBL indirect levels. */
47320         uint8_t page_level;
47321         /* PBL pointer is physical start address. */
47322         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
47323         /* PBL pointer points to PTE table. */
47324         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
47325         /*
47326          * PBL pointer points to PDE table with each entry pointing to PTE
47327          * tables.
47328          */
47329         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
47330         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LAST \
47331                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2
47332         /* Page size. */
47333         uint8_t page_size;
47334         /* 4KB page size. */
47335         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
47336         /* 8KB page size. */
47337         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
47338         /* 64KB page size. */
47339         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
47340         /* 256KB page size. */
47341         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
47342         /* 1MB page size. */
47343         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
47344         /* 2MB page size. */
47345         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
47346         /* 4MB page size. */
47347         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
47348         /* 1GB page size. */
47349         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
47350         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_LAST \
47351                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G
47352         uint8_t unused_0[4];
47353         /* Pointer to the PBL, or PDL depending on number of levels */
47354         uint64_t        page_dir;
47355         uint8_t unused_1[7];
47356         /*
47357          * This field is used in Output records to indicate that the output
47358          * is completely written to RAM. This field should be read as '1'
47359          * to indicate that the output has been completely written.
47360          * When writing a command completion or response to an internal
47361          * processor, the order of writes has to be such that this field is
47362          * written last.
47363          */
47364         uint8_t valid;
47365 } __rte_packed;
47366
47367 /**************************
47368  * hwrm_cfa_ctx_mem_qcaps *
47369  **************************/
47370
47371
47372 /* hwrm_cfa_ctx_mem_qcaps_input (size:128b/16B) */
47373 struct hwrm_cfa_ctx_mem_qcaps_input {
47374         /* The HWRM command request type. */
47375         uint16_t        req_type;
47376         /*
47377          * The completion ring to send the completion event on. This should
47378          * be the NQ ID returned from the `nq_alloc` HWRM command.
47379          */
47380         uint16_t        cmpl_ring;
47381         /*
47382          * The sequence ID is used by the driver for tracking multiple
47383          * commands. This ID is treated as opaque data by the firmware and
47384          * the value is returned in the `hwrm_resp_hdr` upon completion.
47385          */
47386         uint16_t        seq_id;
47387         /*
47388          * The target ID of the command:
47389          * * 0x0-0xFFF8 - The function ID
47390          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47391          * * 0xFFFD - Reserved for user-space HWRM interface
47392          * * 0xFFFF - HWRM
47393          */
47394         uint16_t        target_id;
47395         /*
47396          * A physical address pointer pointing to a host buffer that the
47397          * command's response data will be written. This can be either a host
47398          * physical address (HPA) or a guest physical address (GPA) and must
47399          * point to a physically contiguous block of memory.
47400          */
47401         uint64_t        resp_addr;
47402 } __rte_packed;
47403
47404 /* hwrm_cfa_ctx_mem_qcaps_output (size:128b/16B) */
47405 struct hwrm_cfa_ctx_mem_qcaps_output {
47406         /* The specific error status for the command. */
47407         uint16_t        error_code;
47408         /* The HWRM command request type. */
47409         uint16_t        req_type;
47410         /* The sequence ID from the original command. */
47411         uint16_t        seq_id;
47412         /* The length of the response data in number of bytes. */
47413         uint16_t        resp_len;
47414         /*
47415          * Indicates the maximum number of context memory which can be
47416          * registered.
47417          */
47418         uint16_t        max_entries;
47419         uint8_t unused_0[5];
47420         /*
47421          * This field is used in Output records to indicate that the output
47422          * is completely written to RAM. This field should be read as '1'
47423          * to indicate that the output has been completely written.
47424          * When writing a command completion or response to an internal
47425          * processor, the order of writes has to be such that this field is
47426          * written last.
47427          */
47428         uint8_t valid;
47429 } __rte_packed;
47430
47431 /**************************
47432  * hwrm_cfa_counter_qcaps *
47433  **************************/
47434
47435
47436 /* hwrm_cfa_counter_qcaps_input (size:128b/16B) */
47437 struct hwrm_cfa_counter_qcaps_input {
47438         /* The HWRM command request type. */
47439         uint16_t        req_type;
47440         /*
47441          * The completion ring to send the completion event on. This should
47442          * be the NQ ID returned from the `nq_alloc` HWRM command.
47443          */
47444         uint16_t        cmpl_ring;
47445         /*
47446          * The sequence ID is used by the driver for tracking multiple
47447          * commands. This ID is treated as opaque data by the firmware and
47448          * the value is returned in the `hwrm_resp_hdr` upon completion.
47449          */
47450         uint16_t        seq_id;
47451         /*
47452          * The target ID of the command:
47453          * * 0x0-0xFFF8 - The function ID
47454          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47455          * * 0xFFFD - Reserved for user-space HWRM interface
47456          * * 0xFFFF - HWRM
47457          */
47458         uint16_t        target_id;
47459         /*
47460          * A physical address pointer pointing to a host buffer that the
47461          * command's response data will be written. This can be either a host
47462          * physical address (HPA) or a guest physical address (GPA) and must
47463          * point to a physically contiguous block of memory.
47464          */
47465         uint64_t        resp_addr;
47466 } __rte_packed;
47467
47468 /* hwrm_cfa_counter_qcaps_output (size:576b/72B) */
47469 struct hwrm_cfa_counter_qcaps_output {
47470         /* The specific error status for the command. */
47471         uint16_t        error_code;
47472         /* The HWRM command request type. */
47473         uint16_t        req_type;
47474         /* The sequence ID from the original command. */
47475         uint16_t        seq_id;
47476         /* The length of the response data in number of bytes. */
47477         uint16_t        resp_len;
47478         uint32_t        flags;
47479         /* Enumeration denoting the supported CFA counter format. */
47480         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT \
47481                 UINT32_C(0x1)
47482         /* CFA counter types are not supported. */
47483         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_NONE \
47484                 UINT32_C(0x0)
47485         /* 64-bit packet counters followed by 64-bit byte counters format. */
47486         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT \
47487                 UINT32_C(0x1)
47488         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_LAST \
47489                 HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT
47490         uint32_t        unused_0;
47491         /*
47492          * Minimum guaranteed number of flow counters supported for this
47493          * function, in RX direction.
47494          */
47495         uint32_t        min_rx_fc;
47496         /*
47497          * Maximum non-guaranteed number of flow counters supported for this
47498          * function, in RX direction.
47499          */
47500         uint32_t        max_rx_fc;
47501         /*
47502          * Minimum guaranteed number of flow counters supported for this
47503          * function, in TX direction.
47504          */
47505         uint32_t        min_tx_fc;
47506         /*
47507          * Maximum non-guaranteed number of flow counters supported for this
47508          * function, in TX direction.
47509          */
47510         uint32_t        max_tx_fc;
47511         /*
47512          * Minimum guaranteed number of extension flow counters supported for
47513          * this function, in RX direction.
47514          */
47515         uint32_t        min_rx_efc;
47516         /*
47517          * Maximum non-guaranteed number of extension flow counters supported
47518          * for this function, in RX direction.
47519          */
47520         uint32_t        max_rx_efc;
47521         /*
47522          * Minimum guaranteed number of extension flow counters supported for
47523          * this function, in TX direction.
47524          */
47525         uint32_t        min_tx_efc;
47526         /*
47527          * Maximum non-guaranteed number of extension flow counters supported
47528          * for this function, in TX direction.
47529          */
47530         uint32_t        max_tx_efc;
47531         /*
47532          * Minimum guaranteed number of meter drop counters supported for
47533          * this function, in RX direction.
47534          */
47535         uint32_t        min_rx_mdc;
47536         /*
47537          * Maximum non-guaranteed number of meter drop counters supported for
47538          * this function, in RX direction.
47539          */
47540         uint32_t        max_rx_mdc;
47541         /*
47542          * Minimum guaranteed number of meter drop counters supported for this
47543          * function, in TX direction.
47544          */
47545         uint32_t        min_tx_mdc;
47546         /*
47547          * Maximum non-guaranteed number of meter drop counters supported for
47548          * this function, in TX direction.
47549          */
47550         uint32_t        max_tx_mdc;
47551         /*
47552          * Maximum guaranteed number of flow counters which can be used during
47553          * flow alloc.
47554          */
47555         uint32_t        max_flow_alloc_fc;
47556         uint8_t unused_1[3];
47557         /*
47558          * This field is used in Output records to indicate that the output
47559          * is completely written to RAM. This field should be read as '1'
47560          * to indicate that the output has been completely written.
47561          * When writing a command completion or response to an internal
47562          * processor, the order of writes has to be such that this field is
47563          * written last.
47564          */
47565         uint8_t valid;
47566 } __rte_packed;
47567
47568 /************************
47569  * hwrm_cfa_counter_cfg *
47570  ************************/
47571
47572
47573 /* hwrm_cfa_counter_cfg_input (size:256b/32B) */
47574 struct hwrm_cfa_counter_cfg_input {
47575         /* The HWRM command request type. */
47576         uint16_t        req_type;
47577         /*
47578          * The completion ring to send the completion event on. This should
47579          * be the NQ ID returned from the `nq_alloc` HWRM command.
47580          */
47581         uint16_t        cmpl_ring;
47582         /*
47583          * The sequence ID is used by the driver for tracking multiple
47584          * commands. This ID is treated as opaque data by the firmware and
47585          * the value is returned in the `hwrm_resp_hdr` upon completion.
47586          */
47587         uint16_t        seq_id;
47588         /*
47589          * The target ID of the command:
47590          * * 0x0-0xFFF8 - The function ID
47591          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47592          * * 0xFFFD - Reserved for user-space HWRM interface
47593          * * 0xFFFF - HWRM
47594          */
47595         uint16_t        target_id;
47596         /*
47597          * A physical address pointer pointing to a host buffer that the
47598          * command's response data will be written. This can be either a host
47599          * physical address (HPA) or a guest physical address (GPA) and must
47600          * point to a physically contiguous block of memory.
47601          */
47602         uint64_t        resp_addr;
47603         uint16_t        flags;
47604         /* Enumeration denoting the configuration mode. */
47605         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE \
47606                 UINT32_C(0x1)
47607         /* Disable the configuration mode. */
47608         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_DISABLE \
47609                 UINT32_C(0x0)
47610         /* Enable the configuration mode. */
47611         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE \
47612                 UINT32_C(0x1)
47613         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_LAST \
47614                 HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE
47615         /* Enumeration denoting the RX, TX type of the resource. */
47616         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH \
47617                 UINT32_C(0x2)
47618         /* Tx path. */
47619         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_TX \
47620                 (UINT32_C(0x0) << 1)
47621         /* Rx path. */
47622         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX \
47623                 (UINT32_C(0x1) << 1)
47624         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_LAST \
47625                 HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX
47626         /* Enumeration denoting the data transfer mode. */
47627         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_MASK \
47628                 UINT32_C(0xc)
47629         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_SFT       2
47630         /* Push mode. */
47631         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PUSH \
47632                 (UINT32_C(0x0) << 2)
47633         /* Pull mode. */
47634         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL \
47635                 (UINT32_C(0x1) << 2)
47636         /* Pull on async update. */
47637         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC \
47638                 (UINT32_C(0x2) << 2)
47639         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_LAST \
47640                 HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC
47641         uint16_t        counter_type;
47642         /* Flow counters. */
47643         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_FC  UINT32_C(0x0)
47644         /* Extended flow counters. */
47645         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_EFC UINT32_C(0x1)
47646         /* Meter drop counters. */
47647         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC UINT32_C(0x2)
47648         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_LAST \
47649                 HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC
47650         /* Ctx memory handle to be used for the counter. */
47651         uint16_t        ctx_id;
47652         /* Counter update cadence hint (only in Push mode). */
47653         uint16_t        update_tmr_ms;
47654         /* Total number of entries. */
47655         uint32_t        num_entries;
47656         uint32_t        unused_0;
47657 } __rte_packed;
47658
47659 /* hwrm_cfa_counter_cfg_output (size:128b/16B) */
47660 struct hwrm_cfa_counter_cfg_output {
47661         /* The specific error status for the command. */
47662         uint16_t        error_code;
47663         /* The HWRM command request type. */
47664         uint16_t        req_type;
47665         /* The sequence ID from the original command. */
47666         uint16_t        seq_id;
47667         /* The length of the response data in number of bytes. */
47668         uint16_t        resp_len;
47669         uint8_t unused_0[7];
47670         /*
47671          * This field is used in Output records to indicate that the output
47672          * is completely written to RAM. This field should be read as '1'
47673          * to indicate that the output has been completely written.
47674          * When writing a command completion or response to an internal
47675          * processor, the order of writes has to be such that this field is
47676          * written last.
47677          */
47678         uint8_t valid;
47679 } __rte_packed;
47680
47681 /***************************
47682  * hwrm_cfa_counter_qstats *
47683  ***************************/
47684
47685
47686 /* hwrm_cfa_counter_qstats_input (size:320b/40B) */
47687 struct hwrm_cfa_counter_qstats_input {
47688         /* The HWRM command request type. */
47689         uint16_t        req_type;
47690         /*
47691          * The completion ring to send the completion event on. This should
47692          * be the NQ ID returned from the `nq_alloc` HWRM command.
47693          */
47694         uint16_t        cmpl_ring;
47695         /*
47696          * The sequence ID is used by the driver for tracking multiple
47697          * commands. This ID is treated as opaque data by the firmware and
47698          * the value is returned in the `hwrm_resp_hdr` upon completion.
47699          */
47700         uint16_t        seq_id;
47701         /*
47702          * The target ID of the command:
47703          * * 0x0-0xFFF8 - The function ID
47704          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47705          * * 0xFFFD - Reserved for user-space HWRM interface
47706          * * 0xFFFF - HWRM
47707          */
47708         uint16_t        target_id;
47709         /*
47710          * A physical address pointer pointing to a host buffer that the
47711          * command's response data will be written. This can be either a host
47712          * physical address (HPA) or a guest physical address (GPA) and must
47713          * point to a physically contiguous block of memory.
47714          */
47715         uint64_t        resp_addr;
47716         uint16_t        flags;
47717         /* Enumeration denoting the RX, TX type of the resource. */
47718         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH     UINT32_C(0x1)
47719         /* Tx path. */
47720         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
47721         /* Rx path. */
47722         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
47723         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_LAST \
47724                 HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX
47725         uint16_t        counter_type;
47726         uint16_t        input_flow_ctx_id;
47727         uint16_t        num_entries;
47728         uint16_t        delta_time_ms;
47729         uint16_t        meter_instance_id;
47730         uint16_t        mdc_ctx_id;
47731         uint8_t unused_0[2];
47732         uint64_t        expected_count;
47733 } __rte_packed;
47734
47735 /* hwrm_cfa_counter_qstats_output (size:128b/16B) */
47736 struct hwrm_cfa_counter_qstats_output {
47737         /* The specific error status for the command. */
47738         uint16_t        error_code;
47739         /* The HWRM command request type. */
47740         uint16_t        req_type;
47741         /* The sequence ID from the original command. */
47742         uint16_t        seq_id;
47743         /* The length of the response data in number of bytes. */
47744         uint16_t        resp_len;
47745         uint8_t unused_0[7];
47746         /*
47747          * This field is used in Output records to indicate that the output
47748          * is completely written to RAM. This field should be read as '1'
47749          * to indicate that the output has been completely written.
47750          * When writing a command completion or response to an internal
47751          * processor, the order of writes has to be such that this field is
47752          * written last.
47753          */
47754         uint8_t valid;
47755 } __rte_packed;
47756
47757 /**********************
47758  * hwrm_cfa_eem_qcaps *
47759  **********************/
47760
47761
47762 /* hwrm_cfa_eem_qcaps_input (size:192b/24B) */
47763 struct hwrm_cfa_eem_qcaps_input {
47764         /* The HWRM command request type. */
47765         uint16_t        req_type;
47766         /*
47767          * The completion ring to send the completion event on. This should
47768          * be the NQ ID returned from the `nq_alloc` HWRM command.
47769          */
47770         uint16_t        cmpl_ring;
47771         /*
47772          * The sequence ID is used by the driver for tracking multiple
47773          * commands. This ID is treated as opaque data by the firmware and
47774          * the value is returned in the `hwrm_resp_hdr` upon completion.
47775          */
47776         uint16_t        seq_id;
47777         /*
47778          * The target ID of the command:
47779          * * 0x0-0xFFF8 - The function ID
47780          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47781          * * 0xFFFD - Reserved for user-space HWRM interface
47782          * * 0xFFFF - HWRM
47783          */
47784         uint16_t        target_id;
47785         /*
47786          * A physical address pointer pointing to a host buffer that the
47787          * command's response data will be written. This can be either a host
47788          * physical address (HPA) or a guest physical address (GPA) and must
47789          * point to a physically contiguous block of memory.
47790          */
47791         uint64_t        resp_addr;
47792         uint32_t        flags;
47793         /*
47794          * When set to 1, indicates the configuration will apply to TX flows
47795          * which are to be offloaded.
47796          * Note if this bit is set then the path_rx bit can't be set.
47797          */
47798         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_TX \
47799                 UINT32_C(0x1)
47800         /*
47801          * When set to 1, indicates the configuration will apply to RX flows
47802          * which are to be offloaded.
47803          * Note if this bit is set then the path_tx bit can't be set.
47804          */
47805         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_RX \
47806                 UINT32_C(0x2)
47807         /* When set to 1, all offloaded flows will be sent to EEM. */
47808         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD \
47809                 UINT32_C(0x4)
47810         uint32_t        unused_0;
47811 } __rte_packed;
47812
47813 /* hwrm_cfa_eem_qcaps_output (size:320b/40B) */
47814 struct hwrm_cfa_eem_qcaps_output {
47815         /* The specific error status for the command. */
47816         uint16_t        error_code;
47817         /* The HWRM command request type. */
47818         uint16_t        req_type;
47819         /* The sequence ID from the original command. */
47820         uint16_t        seq_id;
47821         /* The length of the response data in number of bytes. */
47822         uint16_t        resp_len;
47823         uint32_t        flags;
47824         /*
47825          * When set to 1, indicates the configuration will apply to TX flows
47826          * which are to be offloaded.
47827          * Note if this bit is set then the path_rx bit can't be set.
47828          */
47829         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_TX \
47830                 UINT32_C(0x1)
47831         /*
47832          * When set to 1, indicates the configuration will apply to RX flows
47833          * which are to be offloaded.
47834          * Note if this bit is set then the path_tx bit can't be set.
47835          */
47836         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_RX \
47837                 UINT32_C(0x2)
47838         /*
47839          * When set to 1, indicates the FW supports the Centralized
47840          * Memory Model. The concept designates one entity for the
47841          * memory allocation while all others ‘subscribe’ to it.
47842          */
47843         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
47844                 UINT32_C(0x4)
47845         /*
47846          * When set to 1, indicates the FW supports the Detached
47847          * Centralized Memory Model. The memory is allocated and managed
47848          * as a separate entity. All PFs and VFs will be granted direct
47849          * or semi-direct access to the allocated memory while none of
47850          * which can interfere with the management of the memory.
47851          */
47852         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
47853                 UINT32_C(0x8)
47854         uint32_t        unused_0;
47855         uint32_t        supported;
47856         /*
47857          * If set to 1, then EEM KEY0 table is supported using crc32 hash.
47858          * If set to 0, EEM KEY0 table is not supported.
47859          */
47860         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE \
47861                 UINT32_C(0x1)
47862         /*
47863          * If set to 1, then EEM KEY1 table is supported using lookup3 hash.
47864          * If set to 0, EEM KEY1 table is not supported.
47865          */
47866         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE \
47867                 UINT32_C(0x2)
47868         /*
47869          * If set to 1, then EEM External Record table is supported.
47870          * If set to 0, EEM External Record table is not supported.
47871          * (This table includes action record, EFC pointers, encap pointers)
47872          */
47873         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE \
47874                 UINT32_C(0x4)
47875         /*
47876          * If set to 1, then EEM External Flow Counters table is supported.
47877          * If set to 0, EEM External Flow Counters table is not supported.
47878          */
47879         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE \
47880                 UINT32_C(0x8)
47881         /*
47882          * If set to 1, then FID table used for implicit flow flush is
47883          * supported.
47884          * If set to 0, then FID table used for implicit flow flush is
47885          * not supported.
47886          */
47887         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE \
47888                 UINT32_C(0x10)
47889         /*
47890          * The maximum number of entries supported by EEM. When configuring
47891          * the host memory, the number of numbers of entries that can
47892          * supported are:
47893          *     32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M, 128M
47894          *     entries.
47895          * Any value that are not these values, the FW will round down to the
47896          * closest support number of entries.
47897          */
47898         uint32_t        max_entries_supported;
47899         /* The entry size in bytes of each entry in the EEM KEY0/KEY1 tables. */
47900         uint16_t        key_entry_size;
47901         /* The entry size in bytes of each entry in the EEM RECORD tables. */
47902         uint16_t        record_entry_size;
47903         /* The entry size in bytes of each entry in the EEM EFC tables. */
47904         uint16_t        efc_entry_size;
47905         /* The FID size in bytes of each entry in the EEM FID tables. */
47906         uint16_t        fid_entry_size;
47907         uint8_t unused_1[7];
47908         /*
47909          * This field is used in Output records to indicate that the output
47910          * is completely written to RAM. This field should be read as '1'
47911          * to indicate that the output has been completely written.
47912          * When writing a command completion or response to an internal
47913          * processor, the order of writes has to be such that this field is
47914          * written last.
47915          */
47916         uint8_t valid;
47917 } __rte_packed;
47918
47919 /********************
47920  * hwrm_cfa_eem_cfg *
47921  ********************/
47922
47923
47924 /* hwrm_cfa_eem_cfg_input (size:384b/48B) */
47925 struct hwrm_cfa_eem_cfg_input {
47926         /* The HWRM command request type. */
47927         uint16_t        req_type;
47928         /*
47929          * The completion ring to send the completion event on. This should
47930          * be the NQ ID returned from the `nq_alloc` HWRM command.
47931          */
47932         uint16_t        cmpl_ring;
47933         /*
47934          * The sequence ID is used by the driver for tracking multiple
47935          * commands. This ID is treated as opaque data by the firmware and
47936          * the value is returned in the `hwrm_resp_hdr` upon completion.
47937          */
47938         uint16_t        seq_id;
47939         /*
47940          * The target ID of the command:
47941          * * 0x0-0xFFF8 - The function ID
47942          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47943          * * 0xFFFD - Reserved for user-space HWRM interface
47944          * * 0xFFFF - HWRM
47945          */
47946         uint16_t        target_id;
47947         /*
47948          * A physical address pointer pointing to a host buffer that the
47949          * command's response data will be written. This can be either a host
47950          * physical address (HPA) or a guest physical address (GPA) and must
47951          * point to a physically contiguous block of memory.
47952          */
47953         uint64_t        resp_addr;
47954         uint32_t        flags;
47955         /*
47956          * When set to 1, indicates the configuration will apply to TX flows
47957          * which are to be offloaded.
47958          * Note if this bit is set then the path_rx bit can't be set.
47959          */
47960         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_TX \
47961                 UINT32_C(0x1)
47962         /*
47963          * When set to 1, indicates the configuration will apply to RX flows
47964          * which are to be offloaded.
47965          * Note if this bit is set then the path_tx bit can't be set.
47966          */
47967         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_RX \
47968                 UINT32_C(0x2)
47969         /* When set to 1, all offloaded flows will be sent to EEM. */
47970         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD \
47971                 UINT32_C(0x4)
47972         /* When set to 1, secondary, 0 means primary. */
47973         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_SECONDARY_PF \
47974                 UINT32_C(0x8)
47975         /*
47976          * Group_id which used by Firmware to identify memory pools belonging
47977          * to certain group.
47978          */
47979         uint16_t        group_id;
47980         uint16_t        unused_0;
47981         /*
47982          * Configured EEM with the given number of entries. All the EEM tables
47983          * KEY0, KEY1, RECORD, EFC all have the same number of entries and all
47984          * tables will be configured using this value. Current minimum value
47985          * is 32k. Current maximum value is 128M.
47986          */
47987         uint32_t        num_entries;
47988         uint32_t        unused_1;
47989         /* Configured EEM with the given context if for KEY0 table. */
47990         uint16_t        key0_ctx_id;
47991         /* Configured EEM with the given context if for KEY1 table. */
47992         uint16_t        key1_ctx_id;
47993         /* Configured EEM with the given context if for RECORD table. */
47994         uint16_t        record_ctx_id;
47995         /* Configured EEM with the given context if for EFC table. */
47996         uint16_t        efc_ctx_id;
47997         /* Configured EEM with the given context if for EFC table. */
47998         uint16_t        fid_ctx_id;
47999         uint16_t        unused_2;
48000         uint32_t        unused_3;
48001 } __rte_packed;
48002
48003 /* hwrm_cfa_eem_cfg_output (size:128b/16B) */
48004 struct hwrm_cfa_eem_cfg_output {
48005         /* The specific error status for the command. */
48006         uint16_t        error_code;
48007         /* The HWRM command request type. */
48008         uint16_t        req_type;
48009         /* The sequence ID from the original command. */
48010         uint16_t        seq_id;
48011         /* The length of the response data in number of bytes. */
48012         uint16_t        resp_len;
48013         uint8_t unused_0[7];
48014         /*
48015          * This field is used in Output records to indicate that the output
48016          * is completely written to RAM. This field should be read as '1'
48017          * to indicate that the output has been completely written.
48018          * When writing a command completion or response to an internal
48019          * processor, the order of writes has to be such that this field is
48020          * written last.
48021          */
48022         uint8_t valid;
48023 } __rte_packed;
48024
48025 /*********************
48026  * hwrm_cfa_eem_qcfg *
48027  *********************/
48028
48029
48030 /* hwrm_cfa_eem_qcfg_input (size:192b/24B) */
48031 struct hwrm_cfa_eem_qcfg_input {
48032         /* The HWRM command request type. */
48033         uint16_t        req_type;
48034         /*
48035          * The completion ring to send the completion event on. This should
48036          * be the NQ ID returned from the `nq_alloc` HWRM command.
48037          */
48038         uint16_t        cmpl_ring;
48039         /*
48040          * The sequence ID is used by the driver for tracking multiple
48041          * commands. This ID is treated as opaque data by the firmware and
48042          * the value is returned in the `hwrm_resp_hdr` upon completion.
48043          */
48044         uint16_t        seq_id;
48045         /*
48046          * The target ID of the command:
48047          * * 0x0-0xFFF8 - The function ID
48048          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48049          * * 0xFFFD - Reserved for user-space HWRM interface
48050          * * 0xFFFF - HWRM
48051          */
48052         uint16_t        target_id;
48053         /*
48054          * A physical address pointer pointing to a host buffer that the
48055          * command's response data will be written. This can be either a host
48056          * physical address (HPA) or a guest physical address (GPA) and must
48057          * point to a physically contiguous block of memory.
48058          */
48059         uint64_t        resp_addr;
48060         uint32_t        flags;
48061         /* When set to 1, indicates the configuration is the TX flow. */
48062         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
48063         /* When set to 1, indicates the configuration is the RX flow. */
48064         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
48065         uint32_t        unused_0;
48066 } __rte_packed;
48067
48068 /* hwrm_cfa_eem_qcfg_output (size:256b/32B) */
48069 struct hwrm_cfa_eem_qcfg_output {
48070         /* The specific error status for the command. */
48071         uint16_t        error_code;
48072         /* The HWRM command request type. */
48073         uint16_t        req_type;
48074         /* The sequence ID from the original command. */
48075         uint16_t        seq_id;
48076         /* The length of the response data in number of bytes. */
48077         uint16_t        resp_len;
48078         uint32_t        flags;
48079         /* When set to 1, indicates the configuration is the TX flow. */
48080         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_TX \
48081                 UINT32_C(0x1)
48082         /* When set to 1, indicates the configuration is the RX flow. */
48083         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_RX \
48084                 UINT32_C(0x2)
48085         /* When set to 1, all offloaded flows will be sent to EEM. */
48086         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD \
48087                 UINT32_C(0x4)
48088         /* The number of entries the FW has configured for EEM. */
48089         uint32_t        num_entries;
48090         /* Configured EEM with the given context if for KEY0 table. */
48091         uint16_t        key0_ctx_id;
48092         /* Configured EEM with the given context if for KEY1 table. */
48093         uint16_t        key1_ctx_id;
48094         /* Configured EEM with the given context if for RECORD table. */
48095         uint16_t        record_ctx_id;
48096         /* Configured EEM with the given context if for EFC table. */
48097         uint16_t        efc_ctx_id;
48098         /* Configured EEM with the given context if for EFC table. */
48099         uint16_t        fid_ctx_id;
48100         uint8_t unused_2[5];
48101         /*
48102          * This field is used in Output records to indicate that the output
48103          * is completely written to RAM. This field should be read as '1'
48104          * to indicate that the output has been completely written.
48105          * When writing a command completion or response to an internal
48106          * processor, the order of writes has to be such that this field is
48107          * written last.
48108          */
48109         uint8_t valid;
48110 } __rte_packed;
48111
48112 /*******************
48113  * hwrm_cfa_eem_op *
48114  *******************/
48115
48116
48117 /* hwrm_cfa_eem_op_input (size:192b/24B) */
48118 struct hwrm_cfa_eem_op_input {
48119         /* The HWRM command request type. */
48120         uint16_t        req_type;
48121         /*
48122          * The completion ring to send the completion event on. This should
48123          * be the NQ ID returned from the `nq_alloc` HWRM command.
48124          */
48125         uint16_t        cmpl_ring;
48126         /*
48127          * The sequence ID is used by the driver for tracking multiple
48128          * commands. This ID is treated as opaque data by the firmware and
48129          * the value is returned in the `hwrm_resp_hdr` upon completion.
48130          */
48131         uint16_t        seq_id;
48132         /*
48133          * The target ID of the command:
48134          * * 0x0-0xFFF8 - The function ID
48135          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48136          * * 0xFFFD - Reserved for user-space HWRM interface
48137          * * 0xFFFF - HWRM
48138          */
48139         uint16_t        target_id;
48140         /*
48141          * A physical address pointer pointing to a host buffer that the
48142          * command's response data will be written. This can be either a host
48143          * physical address (HPA) or a guest physical address (GPA) and must
48144          * point to a physically contiguous block of memory.
48145          */
48146         uint64_t        resp_addr;
48147         uint32_t        flags;
48148         /*
48149          * When set to 1, indicates the host memory which is passed will be
48150          * used for the TX flow offload function specified in fid.
48151          * Note if this bit is set then the path_rx bit can't be set.
48152          */
48153         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
48154         /*
48155          * When set to 1, indicates the host memory which is passed will be
48156          * used for the RX flow offload function specified in fid.
48157          * Note if this bit is set then the path_tx bit can't be set.
48158          */
48159         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
48160         uint16_t        unused_0;
48161         /* The number of EEM key table entries to be configured. */
48162         uint16_t        op;
48163         /* This value is reserved and should not be used. */
48164         #define HWRM_CFA_EEM_OP_INPUT_OP_RESERVED    UINT32_C(0x0)
48165         /*
48166          * To properly stop EEM and ensure there are no DMA's, the caller
48167          * must disable EEM for the given PF, using this call. This will
48168          * safely disable EEM and ensure that all DMA'ed to the
48169          * keys/records/efc have been completed.
48170          */
48171         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_DISABLE UINT32_C(0x1)
48172         /*
48173          * Once the EEM host memory has been configured, EEM options have
48174          * been configured. Then the caller should enable EEM for the given
48175          * PF. Note once this call has been made, then the EEM mechanism
48176          * will be active and DMA's will occur as packets are processed.
48177          */
48178         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_ENABLE  UINT32_C(0x2)
48179         /*
48180          * Clear EEM settings for the given PF so that the register values
48181          * are reset back to there initial state.
48182          */
48183         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP UINT32_C(0x3)
48184         #define HWRM_CFA_EEM_OP_INPUT_OP_LAST \
48185                 HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP
48186 } __rte_packed;
48187
48188 /* hwrm_cfa_eem_op_output (size:128b/16B) */
48189 struct hwrm_cfa_eem_op_output {
48190         /* The specific error status for the command. */
48191         uint16_t        error_code;
48192         /* The HWRM command request type. */
48193         uint16_t        req_type;
48194         /* The sequence ID from the original command. */
48195         uint16_t        seq_id;
48196         /* The length of the response data in number of bytes. */
48197         uint16_t        resp_len;
48198         uint8_t unused_0[7];
48199         /*
48200          * This field is used in Output records to indicate that the output
48201          * is completely written to RAM. This field should be read as '1'
48202          * to indicate that the output has been completely written.
48203          * When writing a command completion or response to an internal
48204          * processor, the order of writes has to be such that this field is
48205          * written last.
48206          */
48207         uint8_t valid;
48208 } __rte_packed;
48209
48210 /********************************
48211  * hwrm_cfa_adv_flow_mgnt_qcaps *
48212  ********************************/
48213
48214
48215 /* hwrm_cfa_adv_flow_mgnt_qcaps_input (size:256b/32B) */
48216 struct hwrm_cfa_adv_flow_mgnt_qcaps_input {
48217         /* The HWRM command request type. */
48218         uint16_t        req_type;
48219         /*
48220          * The completion ring to send the completion event on. This should
48221          * be the NQ ID returned from the `nq_alloc` HWRM command.
48222          */
48223         uint16_t        cmpl_ring;
48224         /*
48225          * The sequence ID is used by the driver for tracking multiple
48226          * commands. This ID is treated as opaque data by the firmware and
48227          * the value is returned in the `hwrm_resp_hdr` upon completion.
48228          */
48229         uint16_t        seq_id;
48230         /*
48231          * The target ID of the command:
48232          * * 0x0-0xFFF8 - The function ID
48233          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48234          * * 0xFFFD - Reserved for user-space HWRM interface
48235          * * 0xFFFF - HWRM
48236          */
48237         uint16_t        target_id;
48238         /*
48239          * A physical address pointer pointing to a host buffer that the
48240          * command's response data will be written. This can be either a host
48241          * physical address (HPA) or a guest physical address (GPA) and must
48242          * point to a physically contiguous block of memory.
48243          */
48244         uint64_t        resp_addr;
48245         uint32_t        unused_0[4];
48246 } __rte_packed;
48247
48248 /* hwrm_cfa_adv_flow_mgnt_qcaps_output (size:128b/16B) */
48249 struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
48250         /* The specific error status for the command. */
48251         uint16_t        error_code;
48252         /* The HWRM command request type. */
48253         uint16_t        req_type;
48254         /* The sequence ID from the original command. */
48255         uint16_t        seq_id;
48256         /* The length of the response data in number of bytes. */
48257         uint16_t        resp_len;
48258         uint32_t        flags;
48259         /*
48260          * Value of 1 to indicate firmware support 16-bit flow handle.
48261          * Value of 0 to indicate firmware not support 16-bit flow handle.
48262          */
48263         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_16BIT_SUPPORTED \
48264                 UINT32_C(0x1)
48265         /*
48266          * Value of 1 to indicate firmware support 64-bit flow handle.
48267          * Value of 0 to indicate firmware not support 64-bit flow handle.
48268          */
48269         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_64BIT_SUPPORTED \
48270                 UINT32_C(0x2)
48271         /*
48272          * Value of 1 to indicate firmware support flow batch delete
48273          * operation through HWRM_CFA_FLOW_FLUSH command.
48274          * Value of 0 to indicate that the firmware does not support flow
48275          * batch delete operation.
48276          */
48277         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_BATCH_DELETE_SUPPORTED \
48278                 UINT32_C(0x4)
48279         /*
48280          * Value of 1 to indicate that the firmware support flow reset all
48281          * operation through HWRM_CFA_FLOW_FLUSH command.
48282          * Value of 0 indicates firmware does not support flow reset all
48283          * operation.
48284          */
48285         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_RESET_ALL_SUPPORTED \
48286                 UINT32_C(0x8)
48287         /*
48288          * Value of 1 to indicate that firmware supports use of FID as
48289          * dest_id in HWRM_CFA_NTUPLE_ALLOC/CFG commands.
48290          * Value of 0 indicates firmware does not support use of FID as
48291          * dest_id.
48292          */
48293         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_DEST_FUNC_SUPPORTED \
48294                 UINT32_C(0x10)
48295         /*
48296          * Value of 1 to indicate that firmware supports TX EEM flows.
48297          * Value of 0 indicates firmware does not support TX EEM flows.
48298          */
48299         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TX_EEM_FLOW_SUPPORTED \
48300                 UINT32_C(0x20)
48301         /*
48302          * Value of 1 to indicate that firmware supports RX EEM flows.
48303          * Value of 0 indicates firmware does not support RX EEM flows.
48304          */
48305         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RX_EEM_FLOW_SUPPORTED \
48306                 UINT32_C(0x40)
48307         /*
48308          * Value of 1 to indicate that firmware supports the dynamic
48309          * allocation of an on-chip flow counter which can be used for EEM
48310          * flows. Value of 0 indicates firmware does not support the dynamic
48311          * allocation of an on-chip flow counter.
48312          */
48313         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_COUNTER_ALLOC_SUPPORTED \
48314                 UINT32_C(0x80)
48315         /*
48316          * Value of 1 to indicate that firmware supports setting of
48317          * rfs_ring_tbl_idx in HWRM_CFA_NTUPLE_ALLOC command.
48318          * Value of 0 indicates firmware does not support rfs_ring_tbl_idx.
48319          */
48320         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_SUPPORTED \
48321                 UINT32_C(0x100)
48322         /*
48323          * Value of 1 to indicate that firmware supports untagged matching
48324          * criteria on HWRM_CFA_L2_FILTER_ALLOC command. Value of 0
48325          * indicates firmware does not support untagged matching.
48326          */
48327         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_UNTAGGED_VLAN_SUPPORTED \
48328                 UINT32_C(0x200)
48329         /*
48330          * Value of 1 to indicate that firmware supports XDP filter. Value
48331          * of 0 indicates firmware does not support XDP filter.
48332          */
48333         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_XDP_SUPPORTED \
48334                 UINT32_C(0x400)
48335         /*
48336          * Value of 1 to indicate that the firmware support L2 header source
48337          * fields matching criteria on HWRM_CFA_L2_FILTER_ALLOC command.
48338          * Value of 0 indicates firmware does not support L2 header source
48339          * fields matching.
48340          */
48341         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_HEADER_SOURCE_FIELDS_SUPPORTED \
48342                 UINT32_C(0x800)
48343         /*
48344          * If set to 1, firmware is capable of supporting ARP ethertype as
48345          * matching criteria for HWRM_CFA_NTUPLE_FILTER_ALLOC command on the
48346          * RX direction. By default, this flag should be 0 for older version
48347          * of firmware.
48348          */
48349         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ARP_SUPPORTED \
48350                 UINT32_C(0x1000)
48351         /*
48352          * Value of 1 to indicate that firmware supports setting of
48353          * rfs_ring_tbl_idx in dst_id field of the HWRM_CFA_NTUPLE_ALLOC
48354          * command. Value of 0 indicates firmware does not support
48355          * rfs_ring_tbl_idx in dst_id field.
48356          */
48357         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_V2_SUPPORTED \
48358                 UINT32_C(0x2000)
48359         /*
48360          * If set to 1, firmware is capable of supporting IPv4/IPv6 as
48361          * ethertype in HWRM_CFA_NTUPLE_FILTER_ALLOC command on the RX
48362          * direction. By default, this flag should be 0 for older version
48363          * of firmware.
48364          */
48365         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ETHERTYPE_IP_SUPPORTED \
48366                 UINT32_C(0x4000)
48367         /*
48368          * When this bit is '1', it indicates that core firmware is
48369          * capable of TruFlow. Driver can restrict sending HWRM CFA_FLOW_XXX
48370          * and CFA_ENCAP_XXX, CFA_DECAP_XXX commands.
48371          */
48372         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TRUFLOW_CAPABLE \
48373                 UINT32_C(0x8000)
48374         /*
48375          * If set to 1, firmware is capable of supporting L2/ROCE as
48376          * traffic type in flags field of HWRM_CFA_L2_FILTER_ALLOC command.
48377          * By default, this flag should be 0 for older version of firmware.
48378          */
48379         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_FILTER_TRAFFIC_TYPE_L2_ROCE_SUPPORTED \
48380                 UINT32_C(0x10000)
48381         /*
48382          * If set to 1, firmware is capable of HW LAG. This bit is only
48383          * advertised if the calling function is a PAXC function.
48384          */
48385         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_LAG_SUPPORTED \
48386                 UINT32_C(0x20000)
48387         /*
48388          * If set to 1, firmware is capable installing ntuple rules without
48389          * additional classification on the L2 Context.
48390          */
48391         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_NO_L2CTX_SUPPORTED \
48392                 UINT32_C(0x40000)
48393         uint8_t unused_0[3];
48394         /*
48395          * This field is used in Output records to indicate that the output
48396          * is completely written to RAM. This field should be read as '1'
48397          * to indicate that the output has been completely written.
48398          * When writing a command completion or response to an internal
48399          * processor, the order of writes has to be such that this field is
48400          * written last.
48401          */
48402         uint8_t valid;
48403 } __rte_packed;
48404
48405 /******************
48406  * hwrm_cfa_tflib *
48407  ******************/
48408
48409
48410 /* hwrm_cfa_tflib_input (size:1024b/128B) */
48411 struct hwrm_cfa_tflib_input {
48412         /* The HWRM command request type. */
48413         uint16_t        req_type;
48414         /*
48415          * The completion ring to send the completion event on. This should
48416          * be the NQ ID returned from the `nq_alloc` HWRM command.
48417          */
48418         uint16_t        cmpl_ring;
48419         /*
48420          * The sequence ID is used by the driver for tracking multiple
48421          * commands. This ID is treated as opaque data by the firmware and
48422          * the value is returned in the `hwrm_resp_hdr` upon completion.
48423          */
48424         uint16_t        seq_id;
48425         /*
48426          * The target ID of the command:
48427          * * 0x0-0xFFF8 - The function ID
48428          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48429          * * 0xFFFD - Reserved for user-space HWRM interface
48430          * * 0xFFFF - HWRM
48431          */
48432         uint16_t        target_id;
48433         /*
48434          * A physical address pointer pointing to a host buffer that the
48435          * command's response data will be written. This can be either a host
48436          * physical address (HPA) or a guest physical address (GPA) and must
48437          * point to a physically contiguous block of memory.
48438          */
48439         uint64_t        resp_addr;
48440         /* TFLIB message type. */
48441         uint16_t        tf_type;
48442         /* TFLIB message subtype. */
48443         uint16_t        tf_subtype;
48444         /* unused. */
48445         uint8_t unused0[4];
48446         /* TFLIB request data. */
48447         uint32_t        tf_req[26];
48448 } __rte_packed;
48449
48450 /* hwrm_cfa_tflib_output (size:5632b/704B) */
48451 struct hwrm_cfa_tflib_output {
48452         /* The specific error status for the command. */
48453         uint16_t        error_code;
48454         /* The HWRM command request type. */
48455         uint16_t        req_type;
48456         /* The sequence ID from the original command. */
48457         uint16_t        seq_id;
48458         /* The length of the response data in number of bytes. */
48459         uint16_t        resp_len;
48460         /* TFLIB message type. */
48461         uint16_t        tf_type;
48462         /* TFLIB message subtype. */
48463         uint16_t        tf_subtype;
48464         /* TFLIB response code */
48465         uint32_t        tf_resp_code;
48466         /* TFLIB response data. */
48467         uint32_t        tf_resp[170];
48468         /* unused. */
48469         uint8_t unused1[7];
48470         /*
48471          * This field is used in Output records to indicate that the output
48472          * is completely written to RAM. This field should be read as '1'
48473          * to indicate that the output has been completely written.
48474          * When writing a command completion or response to an internal
48475          * processor, the order of writes has to be such that this field is
48476          * written last.
48477          */
48478         uint8_t valid;
48479 } __rte_packed;
48480
48481 /**********************************
48482  * hwrm_cfa_lag_group_member_rgtr *
48483  **********************************/
48484
48485
48486 /* hwrm_cfa_lag_group_member_rgtr_input (size:192b/24B) */
48487 struct hwrm_cfa_lag_group_member_rgtr_input {
48488         /* The HWRM command request type. */
48489         uint16_t        req_type;
48490         /*
48491          * The completion ring to send the completion event on. This should
48492          * be the NQ ID returned from the `nq_alloc` HWRM command.
48493          */
48494         uint16_t        cmpl_ring;
48495         /*
48496          * The sequence ID is used by the driver for tracking multiple
48497          * commands. This ID is treated as opaque data by the firmware and
48498          * the value is returned in the `hwrm_resp_hdr` upon completion.
48499          */
48500         uint16_t        seq_id;
48501         /*
48502          * The target ID of the command:
48503          * * 0x0-0xFFF8 - The function ID
48504          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48505          * * 0xFFFD - Reserved for user-space HWRM interface
48506          * * 0xFFFF - HWRM
48507          */
48508         uint16_t        target_id;
48509         /*
48510          * A physical address pointer pointing to a host buffer that the
48511          * command's response data will be written. This can be either a host
48512          * physical address (HPA) or a guest physical address (GPA) and must
48513          * point to a physically contiguous block of memory.
48514          */
48515         uint64_t        resp_addr;
48516         uint8_t mode;
48517         /*
48518          * Transmit only on the active port. Automatically failover
48519          * to backup port.
48520          */
48521         #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_ACTIVE_BACKUP \
48522                 UINT32_C(0x1)
48523         /*
48524          * Transmit based on packet header ntuple hash. Packet with only
48525          * layer 2 headers will hash using the destination MAC, source MAC
48526          * and Ethertype fields.  Packets with layer 3 (IP) headers will
48527          * hash using the destination MAC, source MAC, IP protocol/next
48528          * header, source IP address and destination IP address. Packets
48529          * with layer 4 (TCP/UDP) headers will hash using the destination
48530          * MAC, source MAC, IP protocol/next header, source IP address,
48531          * destination IP address, source port and destination port fields.
48532          */
48533         #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BALANCE_XOR \
48534                 UINT32_C(0x2)
48535         /* Transmit packets on all specified ports. */
48536         #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BROADCAST \
48537                 UINT32_C(0x3)
48538         #define HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_LAST \
48539                 HWRM_CFA_LAG_GROUP_MEMBER_RGTR_INPUT_MODE_BROADCAST
48540         /*
48541          * Supports up to 5 ports. bit0 = port 0, bit1 = port 1,
48542          * bit2 = port 2, bit3 = port 4, bit4 = loopback port
48543          */
48544         uint8_t port_bitmap;
48545         /* Specify the active port when active-backup mode is specified */
48546         uint8_t active_port;
48547         uint8_t unused_0[5];
48548 } __rte_packed;
48549
48550 /* hwrm_cfa_lag_group_member_rgtr_output (size:128b/16B) */
48551 struct hwrm_cfa_lag_group_member_rgtr_output {
48552         /* The specific error status for the command. */
48553         uint16_t        error_code;
48554         /* The HWRM command request type. */
48555         uint16_t        req_type;
48556         /* The sequence ID from the original command. */
48557         uint16_t        seq_id;
48558         /* The length of the response data in number of bytes. */
48559         uint16_t        resp_len;
48560         /* lag group ID configured for the function */
48561         uint16_t        lag_id;
48562         uint8_t unused_0[5];
48563         /*
48564          * This field is used in Output records to indicate that the output
48565          * is completely written to RAM. This field should be read as '1'
48566          * to indicate that the output has been completely written.
48567          * When writing a command completion or response to an internal
48568          * processor, the order of writes has to be such that this field is
48569          * written last.
48570          */
48571         uint8_t valid;
48572 } __rte_packed;
48573
48574 /************************************
48575  * hwrm_cfa_lag_group_member_unrgtr *
48576  ************************************/
48577
48578
48579 /* hwrm_cfa_lag_group_member_unrgtr_input (size:192b/24B) */
48580 struct hwrm_cfa_lag_group_member_unrgtr_input {
48581         /* The HWRM command request type. */
48582         uint16_t        req_type;
48583         /*
48584          * The completion ring to send the completion event on. This should
48585          * be the NQ ID returned from the `nq_alloc` HWRM command.
48586          */
48587         uint16_t        cmpl_ring;
48588         /*
48589          * The sequence ID is used by the driver for tracking multiple
48590          * commands. This ID is treated as opaque data by the firmware and
48591          * the value is returned in the `hwrm_resp_hdr` upon completion.
48592          */
48593         uint16_t        seq_id;
48594         /*
48595          * The target ID of the command:
48596          * * 0x0-0xFFF8 - The function ID
48597          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48598          * * 0xFFFD - Reserved for user-space HWRM interface
48599          * * 0xFFFF - HWRM
48600          */
48601         uint16_t        target_id;
48602         /*
48603          * A physical address pointer pointing to a host buffer that the
48604          * command's response data will be written. This can be either a host
48605          * physical address (HPA) or a guest physical address (GPA) and must
48606          * point to a physically contiguous block of memory.
48607          */
48608         uint64_t        resp_addr;
48609         /* lag group ID configured for the function */
48610         uint16_t        lag_id;
48611         uint8_t unused_0[6];
48612 } __rte_packed;
48613
48614 /* hwrm_cfa_lag_group_member_unrgtr_output (size:128b/16B) */
48615 struct hwrm_cfa_lag_group_member_unrgtr_output {
48616         /* The specific error status for the command. */
48617         uint16_t        error_code;
48618         /* The HWRM command request type. */
48619         uint16_t        req_type;
48620         /* The sequence ID from the original command. */
48621         uint16_t        seq_id;
48622         /* The length of the response data in number of bytes. */
48623         uint16_t        resp_len;
48624         uint8_t unused_0[7];
48625         /*
48626          * This field is used in Output records to indicate that the output
48627          * is completely written to RAM. This field should be read as '1'
48628          * to indicate that the output has been completely written.
48629          * When writing a command completion or response to an internal
48630          * processor, the order of writes has to be such that this field is
48631          * written last.
48632          */
48633         uint8_t valid;
48634 } __rte_packed;
48635
48636 /*****************************
48637  * hwrm_cfa_tls_filter_alloc *
48638  *****************************/
48639
48640
48641 /* hwrm_cfa_tls_filter_alloc_input (size:704b/88B) */
48642 struct hwrm_cfa_tls_filter_alloc_input {
48643         /* The HWRM command request type. */
48644         uint16_t        req_type;
48645         /*
48646          * The completion ring to send the completion event on. This should
48647          * be the NQ ID returned from the `nq_alloc` HWRM command.
48648          */
48649         uint16_t        cmpl_ring;
48650         /*
48651          * The sequence ID is used by the driver for tracking multiple
48652          * commands. This ID is treated as opaque data by the firmware and
48653          * the value is returned in the `hwrm_resp_hdr` upon completion.
48654          */
48655         uint16_t        seq_id;
48656         /*
48657          * The target ID of the command:
48658          * * 0x0-0xFFF8 - The function ID
48659          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48660          * * 0xFFFD - Reserved for user-space HWRM interface
48661          * * 0xFFFF - HWRM
48662          */
48663         uint16_t        target_id;
48664         /*
48665          * A physical address pointer pointing to a host buffer that the
48666          * command's response data will be written. This can be either a host
48667          * physical address (HPA) or a guest physical address (GPA) and must
48668          * point to a physically contiguous block of memory.
48669          */
48670         uint64_t        resp_addr;
48671         uint32_t        unused_0;
48672         uint32_t        enables;
48673         /*
48674          * This bit must be '1' for the l2_filter_id field to be
48675          * configured.
48676          */
48677         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
48678                 UINT32_C(0x1)
48679         /*
48680          * This bit must be '1' for the ethertype field to be
48681          * configured.
48682          */
48683         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
48684                 UINT32_C(0x2)
48685         /*
48686          * This bit must be '1' for the ipaddr_type field to be
48687          * configured.
48688          */
48689         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
48690                 UINT32_C(0x4)
48691         /*
48692          * This bit must be '1' for the src_ipaddr field to be
48693          * configured.
48694          */
48695         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
48696                 UINT32_C(0x8)
48697         /*
48698          * This bit must be '1' for the dst_ipaddr field to be
48699          * configured.
48700          */
48701         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
48702                 UINT32_C(0x10)
48703         /*
48704          * This bit must be '1' for the ip_protocol field to be
48705          * configured.
48706          */
48707         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
48708                 UINT32_C(0x20)
48709         /*
48710          * This bit must be '1' for the src_port field to be
48711          * configured.
48712          */
48713         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
48714                 UINT32_C(0x40)
48715         /*
48716          * This bit must be '1' for the dst_port field to be
48717          * configured.
48718          */
48719         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
48720                 UINT32_C(0x80)
48721         /*
48722          * This bit must be '1' for the kid field to be
48723          * configured.
48724          */
48725         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_KID \
48726                 UINT32_C(0x100)
48727         /*
48728          * This bit must be '1' for the dst_id field to be
48729          * configured.
48730          */
48731         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
48732                 UINT32_C(0x200)
48733         /*
48734          * This bit must be '1' for the mirror_vnic_id field to be
48735          * configured.
48736          */
48737         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
48738                 UINT32_C(0x400)
48739         /*
48740          * This value identifies a set of CFA data structures used for an L2
48741          * context.
48742          */
48743         uint64_t        l2_filter_id;
48744         uint8_t unused_1[6];
48745         /* This value indicates the ethertype in the Ethernet header. */
48746         uint16_t        ethertype;
48747         /*
48748          * This value indicates the type of IP address.
48749          * 4 - IPv4
48750          * 6 - IPv6
48751          * All others are invalid.
48752          */
48753         uint8_t ip_addr_type;
48754         /* invalid */
48755         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
48756                 UINT32_C(0x0)
48757         /* IPv4 */
48758         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
48759                 UINT32_C(0x4)
48760         /* IPv6 */
48761         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
48762                 UINT32_C(0x6)
48763         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
48764                 HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
48765         /*
48766          * The value of protocol filed in IP header.
48767          * Applies to UDP and TCP traffic.
48768          * 6 - TCP
48769          * 17 - UDP
48770          */
48771         uint8_t ip_protocol;
48772         /* invalid */
48773         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
48774                 UINT32_C(0x0)
48775         /* TCP */
48776         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
48777                 UINT32_C(0x6)
48778         /* UDP */
48779         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
48780                 UINT32_C(0x11)
48781         #define HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
48782                 HWRM_CFA_TLS_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
48783         /*
48784          * If set, this value shall represent the
48785          * Logical VNIC ID of the destination VNIC for the RX
48786          * path and network port id of the destination port for
48787          * the TX path.
48788          */
48789         uint16_t        dst_id;
48790         /*
48791          * Logical VNIC ID of the VNIC where traffic is
48792          * mirrored.
48793          */
48794         uint16_t        mirror_vnic_id;
48795         uint8_t unused_2[2];
48796         /*
48797          * The value of source IP address to be used in filtering.
48798          * For IPv4, first four bytes represent the IP address.
48799          */
48800         uint32_t        src_ipaddr[4];
48801         /*
48802          * The value of destination IP address to be used in filtering.
48803          * For IPv4, first four bytes represent the IP address.
48804          */
48805         uint32_t        dst_ipaddr[4];
48806         /*
48807          * The value of source port to be used in filtering.
48808          * Applies to UDP and TCP traffic.
48809          */
48810         uint16_t        src_port;
48811         /*
48812          * The value of destination port to be used in filtering.
48813          * Applies to UDP and TCP traffic.
48814          */
48815         uint16_t        dst_port;
48816         /*
48817          * The Key Context Identifier (KID) for use with KTLS.
48818          * KID is limited to 20-bits.
48819          */
48820         uint32_t        kid;
48821 } __rte_packed;
48822
48823 /* hwrm_cfa_tls_filter_alloc_output (size:192b/24B) */
48824 struct hwrm_cfa_tls_filter_alloc_output {
48825         /* The specific error status for the command. */
48826         uint16_t        error_code;
48827         /* The HWRM command request type. */
48828         uint16_t        req_type;
48829         /* The sequence ID from the original command. */
48830         uint16_t        seq_id;
48831         /* The length of the response data in number of bytes. */
48832         uint16_t        resp_len;
48833         /* This value is an opaque id into CFA data structures. */
48834         uint64_t        tls_filter_id;
48835         /*
48836          * The flow id value in bit 0-29 is the actual ID of the flow
48837          * associated with this filter and it shall be used to match
48838          * and associate the flow identifier returned in completion
48839          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
48840          * shall indicate no valid flow id.
48841          */
48842         uint32_t        flow_id;
48843         /* Indicate the flow id value. */
48844         #define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
48845                 UINT32_C(0x3fffffff)
48846         #define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
48847         /* Indicate type of the flow. */
48848         #define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
48849                 UINT32_C(0x40000000)
48850         /*
48851          * If this bit set to 0, then it indicates that the flow is
48852          * internal flow.
48853          */
48854         #define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
48855                 (UINT32_C(0x0) << 30)
48856         /*
48857          * If this bit is set to 1, then it indicates that the flow is
48858          * external flow.
48859          */
48860         #define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
48861                 (UINT32_C(0x1) << 30)
48862         #define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
48863                 HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
48864         /* Indicate the flow direction. */
48865         #define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
48866                 UINT32_C(0x80000000)
48867         /* If this bit set to 0, then it indicates rx flow. */
48868         #define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
48869                 (UINT32_C(0x0) << 31)
48870         /* If this bit is set to 1, then it indicates that tx flow. */
48871         #define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
48872                 (UINT32_C(0x1) << 31)
48873         #define HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
48874                 HWRM_CFA_TLS_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
48875         uint8_t unused_0[3];
48876         /*
48877          * This field is used in Output records to indicate that the output
48878          * is completely written to RAM. This field should be read as '1'
48879          * to indicate that the output has been completely written.
48880          * When writing a command completion or response to an internal
48881          * processor, the order of writes has to be such that this field is
48882          * written last.
48883          */
48884         uint8_t valid;
48885 } __rte_packed;
48886
48887 /****************************
48888  * hwrm_cfa_tls_filter_free *
48889  ****************************/
48890
48891
48892 /* hwrm_cfa_tls_filter_free_input (size:192b/24B) */
48893 struct hwrm_cfa_tls_filter_free_input {
48894         /* The HWRM command request type. */
48895         uint16_t        req_type;
48896         /*
48897          * The completion ring to send the completion event on. This should
48898          * be the NQ ID returned from the `nq_alloc` HWRM command.
48899          */
48900         uint16_t        cmpl_ring;
48901         /*
48902          * The sequence ID is used by the driver for tracking multiple
48903          * commands. This ID is treated as opaque data by the firmware and
48904          * the value is returned in the `hwrm_resp_hdr` upon completion.
48905          */
48906         uint16_t        seq_id;
48907         /*
48908          * The target ID of the command:
48909          * * 0x0-0xFFF8 - The function ID
48910          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48911          * * 0xFFFD - Reserved for user-space HWRM interface
48912          * * 0xFFFF - HWRM
48913          */
48914         uint16_t        target_id;
48915         /*
48916          * A physical address pointer pointing to a host buffer that the
48917          * command's response data will be written. This can be either a host
48918          * physical address (HPA) or a guest physical address (GPA) and must
48919          * point to a physically contiguous block of memory.
48920          */
48921         uint64_t        resp_addr;
48922         /* This value is an opaque id into CFA data structures. */
48923         uint64_t        tls_filter_id;
48924 } __rte_packed;
48925
48926 /* hwrm_cfa_tls_filter_free_output (size:128b/16B) */
48927 struct hwrm_cfa_tls_filter_free_output {
48928         /* The specific error status for the command. */
48929         uint16_t        error_code;
48930         /* The HWRM command request type. */
48931         uint16_t        req_type;
48932         /* The sequence ID from the original command. */
48933         uint16_t        seq_id;
48934         /* The length of the response data in number of bytes. */
48935         uint16_t        resp_len;
48936         uint8_t unused_0[7];
48937         /*
48938          * This field is used in Output records to indicate that the output
48939          * is completely written to RAM. This field should be read as '1'
48940          * to indicate that the output has been completely written.
48941          * When writing a command completion or response to an internal
48942          * processor, the order of writes has to be such that this field is
48943          * written last.
48944          */
48945         uint8_t valid;
48946 } __rte_packed;
48947
48948 /***********
48949  * hwrm_tf *
48950  ***********/
48951
48952
48953 /* hwrm_tf_input (size:1024b/128B) */
48954 struct hwrm_tf_input {
48955         /* The HWRM command request type. */
48956         uint16_t        req_type;
48957         /*
48958          * The completion ring to send the completion event on. This should
48959          * be the NQ ID returned from the `nq_alloc` HWRM command.
48960          */
48961         uint16_t        cmpl_ring;
48962         /*
48963          * The sequence ID is used by the driver for tracking multiple
48964          * commands. This ID is treated as opaque data by the firmware and
48965          * the value is returned in the `hwrm_resp_hdr` upon completion.
48966          */
48967         uint16_t        seq_id;
48968         /*
48969          * The target ID of the command:
48970          * * 0x0-0xFFF8 - The function ID
48971          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48972          * * 0xFFFD - Reserved for user-space HWRM interface
48973          * * 0xFFFF - HWRM
48974          */
48975         uint16_t        target_id;
48976         /*
48977          * A physical address pointer pointing to a host buffer that the
48978          * command's response data will be written. This can be either a host
48979          * physical address (HPA) or a guest physical address (GPA) and must
48980          * point to a physically contiguous block of memory.
48981          */
48982         uint64_t        resp_addr;
48983         /* TF message type. */
48984         uint16_t        type;
48985         /* TF message subtype. */
48986         uint16_t        subtype;
48987         /* unused. */
48988         uint8_t unused0[4];
48989         /* TF request data. */
48990         uint32_t        req[26];
48991 } __rte_packed;
48992
48993 /* hwrm_tf_output (size:5632b/704B) */
48994 struct hwrm_tf_output {
48995         /* The specific error status for the command. */
48996         uint16_t        error_code;
48997         /* The HWRM command request type. */
48998         uint16_t        req_type;
48999         /* The sequence ID from the original command. */
49000         uint16_t        seq_id;
49001         /* The length of the response data in number of bytes. */
49002         uint16_t        resp_len;
49003         /* TF message type. */
49004         uint16_t        type;
49005         /* TF message subtype. */
49006         uint16_t        subtype;
49007         /* TF response code */
49008         uint32_t        resp_code;
49009         /* TF response data. */
49010         uint32_t        resp[170];
49011         /* unused. */
49012         uint8_t unused1[7];
49013         /*
49014          * This field is used in Output records to indicate that the
49015          * output is completely written to RAM. This field should be
49016          * read as '1' to indicate that the output has been
49017          * completely written.  When writing a command completion or
49018          * response to an internal processor, the order of writes has
49019          * to be such that this field is written last.
49020          */
49021         uint8_t valid;
49022 } __rte_packed;
49023
49024 /***********************
49025  * hwrm_tf_version_get *
49026  ***********************/
49027
49028
49029 /* hwrm_tf_version_get_input (size:128b/16B) */
49030 struct hwrm_tf_version_get_input {
49031         /* The HWRM command request type. */
49032         uint16_t        req_type;
49033         /*
49034          * The completion ring to send the completion event on. This should
49035          * be the NQ ID returned from the `nq_alloc` HWRM command.
49036          */
49037         uint16_t        cmpl_ring;
49038         /*
49039          * The sequence ID is used by the driver for tracking multiple
49040          * commands. This ID is treated as opaque data by the firmware and
49041          * the value is returned in the `hwrm_resp_hdr` upon completion.
49042          */
49043         uint16_t        seq_id;
49044         /*
49045          * The target ID of the command:
49046          * * 0x0-0xFFF8 - The function ID
49047          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49048          * * 0xFFFD - Reserved for user-space HWRM interface
49049          * * 0xFFFF - HWRM
49050          */
49051         uint16_t        target_id;
49052         /*
49053          * A physical address pointer pointing to a host buffer that the
49054          * command's response data will be written. This can be either a host
49055          * physical address (HPA) or a guest physical address (GPA) and must
49056          * point to a physically contiguous block of memory.
49057          */
49058         uint64_t        resp_addr;
49059 } __rte_packed;
49060
49061 /* hwrm_tf_version_get_output (size:256b/32B) */
49062 struct hwrm_tf_version_get_output {
49063         /* The specific error status for the command. */
49064         uint16_t        error_code;
49065         /* The HWRM command request type. */
49066         uint16_t        req_type;
49067         /* The sequence ID from the original command. */
49068         uint16_t        seq_id;
49069         /* The length of the response data in number of bytes. */
49070         uint16_t        resp_len;
49071         /* Version Major number. */
49072         uint8_t major;
49073         /* Version Minor number. */
49074         uint8_t minor;
49075         /* Version Update number. */
49076         uint8_t update;
49077         /* unused. */
49078         uint8_t unused0[5];
49079         /*
49080          * This field is used to indicate device's capabilities and
49081          * configurations.
49082          */
49083         uint64_t        dev_caps_cfg;
49084         /* unused. */
49085         uint8_t unused1[7];
49086         /*
49087          * This field is used in Output records to indicate that the output
49088          * is completely written to RAM. This field should be read as '1'
49089          * to indicate that the output has been completely written.
49090          * When writing a command completion or response to an internal
49091          * processor, the order of writes has to be such that this field is
49092          * written last.
49093          */
49094         uint8_t valid;
49095 } __rte_packed;
49096
49097 /************************
49098  * hwrm_tf_session_open *
49099  ************************/
49100
49101
49102 /* hwrm_tf_session_open_input (size:640b/80B) */
49103 struct hwrm_tf_session_open_input {
49104         /* The HWRM command request type. */
49105         uint16_t        req_type;
49106         /*
49107          * The completion ring to send the completion event on. This should
49108          * be the NQ ID returned from the `nq_alloc` HWRM command.
49109          */
49110         uint16_t        cmpl_ring;
49111         /*
49112          * The sequence ID is used by the driver for tracking multiple
49113          * commands. This ID is treated as opaque data by the firmware and
49114          * the value is returned in the `hwrm_resp_hdr` upon completion.
49115          */
49116         uint16_t        seq_id;
49117         /*
49118          * The target ID of the command:
49119          * * 0x0-0xFFF8 - The function ID
49120          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49121          * * 0xFFFD - Reserved for user-space HWRM interface
49122          * * 0xFFFF - HWRM
49123          */
49124         uint16_t        target_id;
49125         /*
49126          * A physical address pointer pointing to a host buffer that the
49127          * command's response data will be written. This can be either a host
49128          * physical address (HPA) or a guest physical address (GPA) and must
49129          * point to a physically contiguous block of memory.
49130          */
49131         uint64_t        resp_addr;
49132         /* Name of the session. */
49133         uint8_t session_name[64];
49134 } __rte_packed;
49135
49136 /* hwrm_tf_session_open_output (size:192b/24B) */
49137 struct hwrm_tf_session_open_output {
49138         /* The specific error status for the command. */
49139         uint16_t        error_code;
49140         /* The HWRM command request type. */
49141         uint16_t        req_type;
49142         /* The sequence ID from the original command. */
49143         uint16_t        seq_id;
49144         /* The length of the response data in number of bytes. */
49145         uint16_t        resp_len;
49146         /*
49147          * Unique session identifier for the session created by the
49148          * firmware.
49149          */
49150         uint32_t        fw_session_id;
49151         /*
49152          * Unique session client identifier for the first client on
49153          * the newly created session.
49154          */
49155         uint32_t        fw_session_client_id;
49156         /* This field is used to return the status of fw session to host. */
49157         uint32_t        flags;
49158         /*
49159          * Indicates if the shared session has been created. Shared session
49160          * should be the first session created ever. Its fw_rm_client_id
49161          * should be 1. The AFM session's fw_rm_client_id is 0.
49162          */
49163         #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION \
49164                 UINT32_C(0x1)
49165         /*
49166          * If this bit set to 0, then it indicates the shared session
49167          * has been created by another session.
49168          */
49169         #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_NOT_CREATOR \
49170                 UINT32_C(0x0)
49171         /*
49172          * If this bit is set to 1, then it indicates the shared session
49173          * is created by this session.
49174          */
49175         #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR \
49176                 UINT32_C(0x1)
49177         #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_LAST \
49178                 HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR
49179         /* unused. */
49180         uint8_t unused1[3];
49181         /*
49182          * This field is used in Output records to indicate that the output
49183          * is completely written to RAM. This field should be read as '1'
49184          * to indicate that the output has been completely written.
49185          * When writing a command completion or response to an internal
49186          * processor, the order of writes has to be such that this field is
49187          * written last.
49188          */
49189         uint8_t valid;
49190 } __rte_packed;
49191
49192 /**************************
49193  * hwrm_tf_session_attach *
49194  **************************/
49195
49196
49197 /* hwrm_tf_session_attach_input (size:704b/88B) */
49198 struct hwrm_tf_session_attach_input {
49199         /* The HWRM command request type. */
49200         uint16_t        req_type;
49201         /*
49202          * The completion ring to send the completion event on. This should
49203          * be the NQ ID returned from the `nq_alloc` HWRM command.
49204          */
49205         uint16_t        cmpl_ring;
49206         /*
49207          * The sequence ID is used by the driver for tracking multiple
49208          * commands. This ID is treated as opaque data by the firmware and
49209          * the value is returned in the `hwrm_resp_hdr` upon completion.
49210          */
49211         uint16_t        seq_id;
49212         /*
49213          * The target ID of the command:
49214          * * 0x0-0xFFF8 - The function ID
49215          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49216          * * 0xFFFD - Reserved for user-space HWRM interface
49217          * * 0xFFFF - HWRM
49218          */
49219         uint16_t        target_id;
49220         /*
49221          * A physical address pointer pointing to a host buffer that the
49222          * command's response data will be written. This can be either a host
49223          * physical address (HPA) or a guest physical address (GPA) and must
49224          * point to a physically contiguous block of memory.
49225          */
49226         uint64_t        resp_addr;
49227         /*
49228          * Unique session identifier for the session that the attach
49229          * request want to attach to. This value originates from the
49230          * shared session memory that the attach request opened by
49231          * way of the 'attach name' that was passed in to the core
49232          * attach API.
49233          * The fw_session_id of the attach session includes PCIe bus
49234          * info to distinguish the PF and session info to identify
49235          * the associated TruFlow session.
49236          */
49237         uint32_t        attach_fw_session_id;
49238         /* unused. */
49239         uint32_t        unused0;
49240         /* Name of the session it self. */
49241         uint8_t session_name[64];
49242 } __rte_packed;
49243
49244 /* hwrm_tf_session_attach_output (size:128b/16B) */
49245 struct hwrm_tf_session_attach_output {
49246         /* The specific error status for the command. */
49247         uint16_t        error_code;
49248         /* The HWRM command request type. */
49249         uint16_t        req_type;
49250         /* The sequence ID from the original command. */
49251         uint16_t        seq_id;
49252         /* The length of the response data in number of bytes. */
49253         uint16_t        resp_len;
49254         /*
49255          * Unique session identifier for the session created by the
49256          * firmware. It includes PCIe bus info to distinguish the PF
49257          * and session info to identify the associated TruFlow
49258          * session. This fw_session_id is unique to the attach
49259          * request.
49260          */
49261         uint32_t        fw_session_id;
49262         /* unused. */
49263         uint8_t unused0[3];
49264         /*
49265          * This field is used in Output records to indicate that the output
49266          * is completely written to RAM. This field should be read as '1'
49267          * to indicate that the output has been completely written.
49268          * When writing a command completion or response to an internal
49269          * processor, the order of writes has to be such that this field is
49270          * written last.
49271          */
49272         uint8_t valid;
49273 } __rte_packed;
49274
49275 /****************************
49276  * hwrm_tf_session_register *
49277  ****************************/
49278
49279
49280 /* hwrm_tf_session_register_input (size:704b/88B) */
49281 struct hwrm_tf_session_register_input {
49282         /* The HWRM command request type. */
49283         uint16_t        req_type;
49284         /*
49285          * The completion ring to send the completion event on. This should
49286          * be the NQ ID returned from the `nq_alloc` HWRM command.
49287          */
49288         uint16_t        cmpl_ring;
49289         /*
49290          * The sequence ID is used by the driver for tracking multiple
49291          * commands. This ID is treated as opaque data by the firmware and
49292          * the value is returned in the `hwrm_resp_hdr` upon completion.
49293          */
49294         uint16_t        seq_id;
49295         /*
49296          * The target ID of the command:
49297          * * 0x0-0xFFF8 - The function ID
49298          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49299          * * 0xFFFD - Reserved for user-space HWRM interface
49300          * * 0xFFFF - HWRM
49301          */
49302         uint16_t        target_id;
49303         /*
49304          * A physical address pointer pointing to a host buffer that the
49305          * command's response data will be written. This can be either a host
49306          * physical address (HPA) or a guest physical address (GPA) and must
49307          * point to a physically contiguous block of memory.
49308          */
49309         uint64_t        resp_addr;
49310         /*
49311          * Unique session identifier for the session that the
49312          * register request want to create a new client on. This
49313          * value originates from the first open request.
49314          * The fw_session_id of the attach session includes PCIe bus
49315          * info to distinguish the PF and session info to identify
49316          * the associated TruFlow session.
49317          */
49318         uint32_t        fw_session_id;
49319         /* unused. */
49320         uint32_t        unused0;
49321         /* Name of the session client. */
49322         uint8_t session_client_name[64];
49323 } __rte_packed;
49324
49325 /* hwrm_tf_session_register_output (size:128b/16B) */
49326 struct hwrm_tf_session_register_output {
49327         /* The specific error status for the command. */
49328         uint16_t        error_code;
49329         /* The HWRM command request type. */
49330         uint16_t        req_type;
49331         /* The sequence ID from the original command. */
49332         uint16_t        seq_id;
49333         /* The length of the response data in number of bytes. */
49334         uint16_t        resp_len;
49335         /*
49336          * Unique session client identifier for the session created
49337          * by the firmware. It includes the session the client it
49338          * attached to and session client info.
49339          */
49340         uint32_t        fw_session_client_id;
49341         /* unused. */
49342         uint8_t unused0[3];
49343         /*
49344          * This field is used in Output records to indicate that the output
49345          * is completely written to RAM. This field should be read as '1'
49346          * to indicate that the output has been completely written.
49347          * When writing a command completion or response to an internal
49348          * processor, the order of writes has to be such that this field is
49349          * written last.
49350          */
49351         uint8_t valid;
49352 } __rte_packed;
49353
49354 /******************************
49355  * hwrm_tf_session_unregister *
49356  ******************************/
49357
49358
49359 /* hwrm_tf_session_unregister_input (size:192b/24B) */
49360 struct hwrm_tf_session_unregister_input {
49361         /* The HWRM command request type. */
49362         uint16_t        req_type;
49363         /*
49364          * The completion ring to send the completion event on. This should
49365          * be the NQ ID returned from the `nq_alloc` HWRM command.
49366          */
49367         uint16_t        cmpl_ring;
49368         /*
49369          * The sequence ID is used by the driver for tracking multiple
49370          * commands. This ID is treated as opaque data by the firmware and
49371          * the value is returned in the `hwrm_resp_hdr` upon completion.
49372          */
49373         uint16_t        seq_id;
49374         /*
49375          * The target ID of the command:
49376          * * 0x0-0xFFF8 - The function ID
49377          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49378          * * 0xFFFD - Reserved for user-space HWRM interface
49379          * * 0xFFFF - HWRM
49380          */
49381         uint16_t        target_id;
49382         /*
49383          * A physical address pointer pointing to a host buffer that the
49384          * command's response data will be written. This can be either a host
49385          * physical address (HPA) or a guest physical address (GPA) and must
49386          * point to a physically contiguous block of memory.
49387          */
49388         uint64_t        resp_addr;
49389         /*
49390          * Unique session identifier for the session that the
49391          * unregister request want to close a session client on.
49392          */
49393         uint32_t        fw_session_id;
49394         /*
49395          * Unique session client identifier for the session that the
49396          * unregister request want to close.
49397          */
49398         uint32_t        fw_session_client_id;
49399 } __rte_packed;
49400
49401 /* hwrm_tf_session_unregister_output (size:128b/16B) */
49402 struct hwrm_tf_session_unregister_output {
49403         /* The specific error status for the command. */
49404         uint16_t        error_code;
49405         /* The HWRM command request type. */
49406         uint16_t        req_type;
49407         /* The sequence ID from the original command. */
49408         uint16_t        seq_id;
49409         /* The length of the response data in number of bytes. */
49410         uint16_t        resp_len;
49411         /* unused. */
49412         uint8_t unused0[7];
49413         /*
49414          * This field is used in Output records to indicate that the output
49415          * is completely written to RAM. This field should be read as '1'
49416          * to indicate that the output has been completely written.
49417          * When writing a command completion or response to an internal
49418          * processor, the order of writes has to be such that this field is
49419          * written last.
49420          */
49421         uint8_t valid;
49422 } __rte_packed;
49423
49424 /*************************
49425  * hwrm_tf_session_close *
49426  *************************/
49427
49428
49429 /* hwrm_tf_session_close_input (size:192b/24B) */
49430 struct hwrm_tf_session_close_input {
49431         /* The HWRM command request type. */
49432         uint16_t        req_type;
49433         /*
49434          * The completion ring to send the completion event on. This should
49435          * be the NQ ID returned from the `nq_alloc` HWRM command.
49436          */
49437         uint16_t        cmpl_ring;
49438         /*
49439          * The sequence ID is used by the driver for tracking multiple
49440          * commands. This ID is treated as opaque data by the firmware and
49441          * the value is returned in the `hwrm_resp_hdr` upon completion.
49442          */
49443         uint16_t        seq_id;
49444         /*
49445          * The target ID of the command:
49446          * * 0x0-0xFFF8 - The function ID
49447          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49448          * * 0xFFFD - Reserved for user-space HWRM interface
49449          * * 0xFFFF - HWRM
49450          */
49451         uint16_t        target_id;
49452         /*
49453          * A physical address pointer pointing to a host buffer that the
49454          * command's response data will be written. This can be either a host
49455          * physical address (HPA) or a guest physical address (GPA) and must
49456          * point to a physically contiguous block of memory.
49457          */
49458         uint64_t        resp_addr;
49459         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49460         uint32_t        fw_session_id;
49461         /* unused. */
49462         uint8_t unused0[4];
49463 } __rte_packed;
49464
49465 /* hwrm_tf_session_close_output (size:128b/16B) */
49466 struct hwrm_tf_session_close_output {
49467         /* The specific error status for the command. */
49468         uint16_t        error_code;
49469         /* The HWRM command request type. */
49470         uint16_t        req_type;
49471         /* The sequence ID from the original command. */
49472         uint16_t        seq_id;
49473         /* The length of the response data in number of bytes. */
49474         uint16_t        resp_len;
49475         /* unused. */
49476         uint8_t unused0[7];
49477         /*
49478          * This field is used in Output records to indicate that the output
49479          * is completely written to RAM. This field should be read as '1'
49480          * to indicate that the output has been completely written.
49481          * When writing a command completion or response to an internal
49482          * processor, the order of writes has to be such that this field
49483          * is written last.
49484          */
49485         uint8_t valid;
49486 } __rte_packed;
49487
49488 /************************
49489  * hwrm_tf_session_qcfg *
49490  ************************/
49491
49492
49493 /* hwrm_tf_session_qcfg_input (size:192b/24B) */
49494 struct hwrm_tf_session_qcfg_input {
49495         /* The HWRM command request type. */
49496         uint16_t        req_type;
49497         /*
49498          * The completion ring to send the completion event on. This should
49499          * be the NQ ID returned from the `nq_alloc` HWRM command.
49500          */
49501         uint16_t        cmpl_ring;
49502         /*
49503          * The sequence ID is used by the driver for tracking multiple
49504          * commands. This ID is treated as opaque data by the firmware and
49505          * the value is returned in the `hwrm_resp_hdr` upon completion.
49506          */
49507         uint16_t        seq_id;
49508         /*
49509          * The target ID of the command:
49510          * * 0x0-0xFFF8 - The function ID
49511          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49512          * * 0xFFFD - Reserved for user-space HWRM interface
49513          * * 0xFFFF - HWRM
49514          */
49515         uint16_t        target_id;
49516         /*
49517          * A physical address pointer pointing to a host buffer that the
49518          * command's response data will be written. This can be either a host
49519          * physical address (HPA) or a guest physical address (GPA) and must
49520          * point to a physically contiguous block of memory.
49521          */
49522         uint64_t        resp_addr;
49523         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49524         uint32_t        fw_session_id;
49525         /* unused. */
49526         uint8_t unused0[4];
49527 } __rte_packed;
49528
49529 /* hwrm_tf_session_qcfg_output (size:128b/16B) */
49530 struct hwrm_tf_session_qcfg_output {
49531         /* The specific error status for the command. */
49532         uint16_t        error_code;
49533         /* The HWRM command request type. */
49534         uint16_t        req_type;
49535         /* The sequence ID from the original command. */
49536         uint16_t        seq_id;
49537         /* The length of the response data in number of bytes. */
49538         uint16_t        resp_len;
49539         /* RX action control settings flags. */
49540         uint8_t rx_act_flags;
49541         /*
49542          * A value of 1 in this field indicates that Global Flow ID
49543          * reporting into cfa_code and cfa_metadata is enabled.
49544          */
49545         #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_GFID_EN \
49546                 UINT32_C(0x1)
49547         /*
49548          * A value of 1 in this field indicates that both inner and outer
49549          * are stripped and inner tag is passed.
49550          * Enabled.
49551          */
49552         #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_VTAG_DLT_BOTH \
49553                 UINT32_C(0x2)
49554         /*
49555          * A value of 1 in this field indicates that the re-use of
49556          * existing tunnel L2 header SMAC is enabled for
49557          * Non-tunnel L2, L2-L3 and IP-IP tunnel.
49558          */
49559         #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_TECT_SMAC_OVR_RUTNSL2 \
49560                 UINT32_C(0x4)
49561         /* TX Action control settings flags. */
49562         uint8_t tx_act_flags;
49563         /* Disabled. */
49564         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_ABCR_VEB_EN \
49565                 UINT32_C(0x1)
49566         /*
49567          * When set to 1 any GRE tunnels will include the
49568          * optional Key field.
49569          */
49570         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_GRE_SET_K \
49571                 UINT32_C(0x2)
49572         /*
49573          * When set to 1, for GRE tunnels, the IPV6 Traffic Class (TC)
49574          * field of the outer header is inherited from the inner header
49575          * (if present) or the fixed value as taken from the encap
49576          * record.
49577          */
49578         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV6_TC_IH \
49579                 UINT32_C(0x4)
49580         /*
49581          * When set to 1, for GRE tunnels, the IPV4 Type Of Service (TOS)
49582          * field of the outer header is inherited from the inner header
49583          * (if present) or the fixed value as taken from the encap record.
49584          */
49585         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV4_TOS_IH \
49586                 UINT32_C(0x8)
49587         /* unused. */
49588         uint8_t unused0[5];
49589         /*
49590          * This field is used in Output records to indicate that the output
49591          * is completely written to RAM. This field should be read as '1'
49592          * to indicate that the output has been completely written.
49593          * When writing a command completion or response to an internal
49594          * processor, the order of writes has to be such that this field
49595          * is written last.
49596          */
49597         uint8_t valid;
49598 } __rte_packed;
49599
49600 /******************************
49601  * hwrm_tf_session_resc_qcaps *
49602  ******************************/
49603
49604
49605 /* hwrm_tf_session_resc_qcaps_input (size:256b/32B) */
49606 struct hwrm_tf_session_resc_qcaps_input {
49607         /* The HWRM command request type. */
49608         uint16_t        req_type;
49609         /*
49610          * The completion ring to send the completion event on. This should
49611          * be the NQ ID returned from the `nq_alloc` HWRM command.
49612          */
49613         uint16_t        cmpl_ring;
49614         /*
49615          * The sequence ID is used by the driver for tracking multiple
49616          * commands. This ID is treated as opaque data by the firmware and
49617          * the value is returned in the `hwrm_resp_hdr` upon completion.
49618          */
49619         uint16_t        seq_id;
49620         /*
49621          * The target ID of the command:
49622          * * 0x0-0xFFF8 - The function ID
49623          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49624          * * 0xFFFD - Reserved for user-space HWRM interface
49625          * * 0xFFFF - HWRM
49626          */
49627         uint16_t        target_id;
49628         /*
49629          * A physical address pointer pointing to a host buffer that the
49630          * command's response data will be written. This can be either a host
49631          * physical address (HPA) or a guest physical address (GPA) and must
49632          * point to a physically contiguous block of memory.
49633          */
49634         uint64_t        resp_addr;
49635         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49636         uint32_t        fw_session_id;
49637         /* Control flags. */
49638         uint16_t        flags;
49639         /* Indicates the flow direction. */
49640         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR     UINT32_C(0x1)
49641         /* If this bit set to 0, then it indicates rx flow. */
49642         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
49643         /* If this bit is set to 1, then it indicates tx flow. */
49644         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
49645         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_LAST \
49646                 HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX
49647         /*
49648          * Defines the size of the provided qcaps_addr array
49649          * buffer. The size should be set to the Resource Manager
49650          * provided max number of qcaps entries which is device
49651          * specific. Resource Manager gets the max size from HCAPI
49652          * RM.
49653          */
49654         uint16_t        qcaps_size;
49655         /*
49656          * This is the DMA address for the qcaps output data array
49657          * buffer. Array is of tf_rm_resc_req_entry type and is
49658          * device specific.
49659          */
49660         uint64_t        qcaps_addr;
49661 } __rte_packed;
49662
49663 /* hwrm_tf_session_resc_qcaps_output (size:192b/24B) */
49664 struct hwrm_tf_session_resc_qcaps_output {
49665         /* The specific error status for the command. */
49666         uint16_t        error_code;
49667         /* The HWRM command request type. */
49668         uint16_t        req_type;
49669         /* The sequence ID from the original command. */
49670         uint16_t        seq_id;
49671         /* The length of the response data in number of bytes. */
49672         uint16_t        resp_len;
49673         /* Control flags. */
49674         uint32_t        flags;
49675         /* Session reservation strategy. */
49676         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_MASK \
49677                 UINT32_C(0x3)
49678         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_SFT \
49679                 0
49680         /* Static partitioning. */
49681         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_STATIC \
49682                 UINT32_C(0x0)
49683         /* Strategy 1. */
49684         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_1 \
49685                 UINT32_C(0x1)
49686         /* Strategy 2. */
49687         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_2 \
49688                 UINT32_C(0x2)
49689         /* Strategy 3. */
49690         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3 \
49691                 UINT32_C(0x3)
49692         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_LAST \
49693                 HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3
49694         /*
49695          * Size of the returned qcaps_addr data array buffer. The
49696          * value cannot exceed the size defined by the input msg,
49697          * qcaps_size.
49698          */
49699         uint16_t        size;
49700         /*
49701          * SRAM profile number that sets the partition of SRAM memory
49702          * between TF and AFM within the 4 internal memory banks (Thor).
49703          */
49704         uint8_t sram_profile;
49705         /* unused. */
49706         uint8_t unused0;
49707         /* unused. */
49708         uint8_t unused1[7];
49709         /*
49710          * This field is used in Output records to indicate that the output
49711          * is completely written to RAM. This field should be read as '1'
49712          * to indicate that the output has been completely written.
49713          * When writing a command completion or response to an internal
49714          * processor, the order of writes has to be such that this field is
49715          * written last.
49716          */
49717         uint8_t valid;
49718 } __rte_packed;
49719
49720 /******************************
49721  * hwrm_tf_session_resc_alloc *
49722  ******************************/
49723
49724
49725 /* hwrm_tf_session_resc_alloc_input (size:320b/40B) */
49726 struct hwrm_tf_session_resc_alloc_input {
49727         /* The HWRM command request type. */
49728         uint16_t        req_type;
49729         /*
49730          * The completion ring to send the completion event on. This should
49731          * be the NQ ID returned from the `nq_alloc` HWRM command.
49732          */
49733         uint16_t        cmpl_ring;
49734         /*
49735          * The sequence ID is used by the driver for tracking multiple
49736          * commands. This ID is treated as opaque data by the firmware and
49737          * the value is returned in the `hwrm_resp_hdr` upon completion.
49738          */
49739         uint16_t        seq_id;
49740         /*
49741          * The target ID of the command:
49742          * * 0x0-0xFFF8 - The function ID
49743          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49744          * * 0xFFFD - Reserved for user-space HWRM interface
49745          * * 0xFFFF - HWRM
49746          */
49747         uint16_t        target_id;
49748         /*
49749          * A physical address pointer pointing to a host buffer that the
49750          * command's response data will be written. This can be either a host
49751          * physical address (HPA) or a guest physical address (GPA) and must
49752          * point to a physically contiguous block of memory.
49753          */
49754         uint64_t        resp_addr;
49755         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49756         uint32_t        fw_session_id;
49757         /* Control flags. */
49758         uint16_t        flags;
49759         /* Indicates the flow direction. */
49760         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR     UINT32_C(0x1)
49761         /* If this bit set to 0, then it indicates rx flow. */
49762         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
49763         /* If this bit is set to 1, then it indicates tx flow. */
49764         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
49765         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_LAST \
49766                 HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX
49767         /*
49768          * Defines the array size of the provided req_addr and
49769          * resv_addr array buffers. Should be set to the number of
49770          * request entries.
49771          */
49772         uint16_t        req_size;
49773         /*
49774          * This is the DMA address for the request input data array
49775          * buffer. Array is of tf_rm_resc_req_entry type. Size of the
49776          * array buffer is provided by the 'req_size' field in this
49777          * message.
49778          */
49779         uint64_t        req_addr;
49780         /*
49781          * This is the DMA address for the resc output data array
49782          * buffer. Array is of tf_rm_resc_entry type. Size of the array
49783          * buffer is provided by the 'req_size' field in this
49784          * message.
49785          */
49786         uint64_t        resc_addr;
49787 } __rte_packed;
49788
49789 /* hwrm_tf_session_resc_alloc_output (size:128b/16B) */
49790 struct hwrm_tf_session_resc_alloc_output {
49791         /* The specific error status for the command. */
49792         uint16_t        error_code;
49793         /* The HWRM command request type. */
49794         uint16_t        req_type;
49795         /* The sequence ID from the original command. */
49796         uint16_t        seq_id;
49797         /* The length of the response data in number of bytes. */
49798         uint16_t        resp_len;
49799         /*
49800          * Size of the returned tf_rm_resc_entry data array. The value
49801          * cannot exceed the req_size defined by the input msg. The data
49802          * array is returned using the resv_addr specified DMA
49803          * address also provided by the input msg.
49804          */
49805         uint16_t        size;
49806         /* unused. */
49807         uint8_t unused0[5];
49808         /*
49809          * This field is used in Output records to indicate that the output
49810          * is completely written to RAM. This field should be read as '1'
49811          * to indicate that the output has been completely written.
49812          * When writing a command completion or response to an internal
49813          * processor, the order of writes has to be such that this field is
49814          * written last.
49815          */
49816         uint8_t valid;
49817 } __rte_packed;
49818
49819 /*****************************
49820  * hwrm_tf_session_resc_free *
49821  *****************************/
49822
49823
49824 /* hwrm_tf_session_resc_free_input (size:256b/32B) */
49825 struct hwrm_tf_session_resc_free_input {
49826         /* The HWRM command request type. */
49827         uint16_t        req_type;
49828         /*
49829          * The completion ring to send the completion event on. This should
49830          * be the NQ ID returned from the `nq_alloc` HWRM command.
49831          */
49832         uint16_t        cmpl_ring;
49833         /*
49834          * The sequence ID is used by the driver for tracking multiple
49835          * commands. This ID is treated as opaque data by the firmware and
49836          * the value is returned in the `hwrm_resp_hdr` upon completion.
49837          */
49838         uint16_t        seq_id;
49839         /*
49840          * The target ID of the command:
49841          * * 0x0-0xFFF8 - The function ID
49842          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49843          * * 0xFFFD - Reserved for user-space HWRM interface
49844          * * 0xFFFF - HWRM
49845          */
49846         uint16_t        target_id;
49847         /*
49848          * A physical address pointer pointing to a host buffer that the
49849          * command's response data will be written. This can be either a host
49850          * physical address (HPA) or a guest physical address (GPA) and must
49851          * point to a physically contiguous block of memory.
49852          */
49853         uint64_t        resp_addr;
49854         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49855         uint32_t        fw_session_id;
49856         /* Control flags. */
49857         uint16_t        flags;
49858         /* Indicates the flow direction. */
49859         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR     UINT32_C(0x1)
49860         /* If this bit set to 0, then it indicates rx flow. */
49861         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
49862         /* If this bit is set to 1, then it indicates tx flow. */
49863         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
49864         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_LAST \
49865                 HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_TX
49866         /*
49867          * Defines the size, in bytes, of the provided free_addr
49868          * buffer.
49869          */
49870         uint16_t        free_size;
49871         /*
49872          * This is the DMA address for the free input data array
49873          * buffer.  Array is of tf_rm_resc_entry type. Size of the
49874          * buffer is provided by the 'free_size' field of this
49875          * message.
49876          */
49877         uint64_t        free_addr;
49878 } __rte_packed;
49879
49880 /* hwrm_tf_session_resc_free_output (size:128b/16B) */
49881 struct hwrm_tf_session_resc_free_output {
49882         /* The specific error status for the command. */
49883         uint16_t        error_code;
49884         /* The HWRM command request type. */
49885         uint16_t        req_type;
49886         /* The sequence ID from the original command. */
49887         uint16_t        seq_id;
49888         /* The length of the response data in number of bytes. */
49889         uint16_t        resp_len;
49890         /* unused. */
49891         uint8_t unused0[7];
49892         /*
49893          * This field is used in Output records to indicate that the output
49894          * is completely written to RAM. This field should be read as '1'
49895          * to indicate that the output has been completely written.
49896          * When writing a command completion or response to an internal
49897          * processor, the order of writes has to be such that this field is
49898          * written last.
49899          */
49900         uint8_t valid;
49901 } __rte_packed;
49902
49903 /******************************
49904  * hwrm_tf_session_resc_flush *
49905  ******************************/
49906
49907
49908 /* hwrm_tf_session_resc_flush_input (size:256b/32B) */
49909 struct hwrm_tf_session_resc_flush_input {
49910         /* The HWRM command request type. */
49911         uint16_t        req_type;
49912         /*
49913          * The completion ring to send the completion event on. This should
49914          * be the NQ ID returned from the `nq_alloc` HWRM command.
49915          */
49916         uint16_t        cmpl_ring;
49917         /*
49918          * The sequence ID is used by the driver for tracking multiple
49919          * commands. This ID is treated as opaque data by the firmware and
49920          * the value is returned in the `hwrm_resp_hdr` upon completion.
49921          */
49922         uint16_t        seq_id;
49923         /*
49924          * The target ID of the command:
49925          * * 0x0-0xFFF8 - The function ID
49926          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
49927          * * 0xFFFD - Reserved for user-space HWRM interface
49928          * * 0xFFFF - HWRM
49929          */
49930         uint16_t        target_id;
49931         /*
49932          * A physical address pointer pointing to a host buffer that the
49933          * command's response data will be written. This can be either a host
49934          * physical address (HPA) or a guest physical address (GPA) and must
49935          * point to a physically contiguous block of memory.
49936          */
49937         uint64_t        resp_addr;
49938         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
49939         uint32_t        fw_session_id;
49940         /* Control flags. */
49941         uint16_t        flags;
49942         /* Indicates the flow direction. */
49943         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR     UINT32_C(0x1)
49944         /* If this bit set to 0, then it indicates rx flow. */
49945         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
49946         /* If this bit is set to 1, then it indicates tx flow. */
49947         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
49948         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_LAST \
49949                 HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX
49950         /*
49951          * Defines the size, in bytes, of the provided flush_addr
49952          * buffer.
49953          */
49954         uint16_t        flush_size;
49955         /*
49956          * This is the DMA address for the flush input data array
49957          * buffer.  Array of tf_rm_resc_entry type. Size of the
49958          * buffer is provided by the 'flush_size' field in this
49959          * message.
49960          */
49961         uint64_t        flush_addr;
49962 } __rte_packed;
49963
49964 /* hwrm_tf_session_resc_flush_output (size:128b/16B) */
49965 struct hwrm_tf_session_resc_flush_output {
49966         /* The specific error status for the command. */
49967         uint16_t        error_code;
49968         /* The HWRM command request type. */
49969         uint16_t        req_type;
49970         /* The sequence ID from the original command. */
49971         uint16_t        seq_id;
49972         /* The length of the response data in number of bytes. */
49973         uint16_t        resp_len;
49974         /* unused. */
49975         uint8_t unused0[7];
49976         /*
49977          * This field is used in Output records to indicate that the output
49978          * is completely written to RAM. This field should be read as '1'
49979          * to indicate that the output has been completely written.
49980          * When writing a command completion or response to an internal
49981          * processor, the order of writes has to be such that this field is
49982          * written last.
49983          */
49984         uint8_t valid;
49985 } __rte_packed;
49986
49987 /*****************************
49988  * hwrm_tf_session_resc_info *
49989  *****************************/
49990
49991
49992 /* hwrm_tf_session_resc_info_input (size:320b/40B) */
49993 struct hwrm_tf_session_resc_info_input {
49994         /* The HWRM command request type. */
49995         uint16_t        req_type;
49996         /*
49997          * The completion ring to send the completion event on. This should
49998          * be the NQ ID returned from the `nq_alloc` HWRM command.
49999          */
50000         uint16_t        cmpl_ring;
50001         /*
50002          * The sequence ID is used by the driver for tracking multiple
50003          * commands. This ID is treated as opaque data by the firmware and
50004          * the value is returned in the `hwrm_resp_hdr` upon completion.
50005          */
50006         uint16_t        seq_id;
50007         /*
50008          * The target ID of the command:
50009          * * 0x0-0xFFF8 - The function ID
50010          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50011          * * 0xFFFD - Reserved for user-space HWRM interface
50012          * * 0xFFFF - HWRM
50013          */
50014         uint16_t        target_id;
50015         /*
50016          * A physical address pointer pointing to a host buffer that the
50017          * command's response data will be written. This can be either a host
50018          * physical address (HPA) or a guest physical address (GPA) and must
50019          * point to a physically contiguous block of memory.
50020          */
50021         uint64_t        resp_addr;
50022         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50023         uint32_t        fw_session_id;
50024         /* Control flags. */
50025         uint16_t        flags;
50026         /* Indicates the flow direction. */
50027         #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR     UINT32_C(0x1)
50028         /* If this bit set to 0, then it indicates rx flow. */
50029         #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
50030         /* If this bit is set to 1, then it indicates tx flow. */
50031         #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
50032         #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_LAST \
50033                 HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX
50034         /*
50035          * Defines the array size of the provided req_addr and
50036          * resv_addr array buffers. Should be set to the number of
50037          * request entries.
50038          */
50039         uint16_t        req_size;
50040         /*
50041          * This is the DMA address for the request input data array
50042          * buffer. Array is of tf_rm_resc_req_entry type. Size of the
50043          * array buffer is provided by the 'req_size' field in this
50044          * message.
50045          */
50046         uint64_t        req_addr;
50047         /*
50048          * This is the DMA address for the resc output data array
50049          * buffer. Array is of tf_rm_resc_entry type. Size of the array
50050          * buffer is provided by the 'req_size' field in this
50051          * message.
50052          */
50053         uint64_t        resc_addr;
50054 } __rte_packed;
50055
50056 /* hwrm_tf_session_resc_info_output (size:128b/16B) */
50057 struct hwrm_tf_session_resc_info_output {
50058         /* The specific error status for the command. */
50059         uint16_t        error_code;
50060         /* The HWRM command request type. */
50061         uint16_t        req_type;
50062         /* The sequence ID from the original command. */
50063         uint16_t        seq_id;
50064         /* The length of the response data in number of bytes. */
50065         uint16_t        resp_len;
50066         /*
50067          * Size of the returned tf_rm_resc_entry data array. The value
50068          * cannot exceed the req_size defined by the input msg. The data
50069          * array is returned using the resv_addr specified DMA
50070          * address also provided by the input msg.
50071          */
50072         uint16_t        size;
50073         /* unused. */
50074         uint8_t unused0[5];
50075         /*
50076          * This field is used in Output records to indicate that the output
50077          * is completely written to RAM. This field should be read as '1'
50078          * to indicate that the output has been completely written.
50079          * When writing a command completion or response to an internal
50080          * processor, the order of writes has to be such that this field is
50081          * written last.
50082          */
50083         uint8_t valid;
50084 } __rte_packed;
50085
50086 /* TruFlow RM capability of a resource. */
50087 /* tf_rm_resc_req_entry (size:64b/8B) */
50088 struct tf_rm_resc_req_entry {
50089         /* Type of the resource, defined globally in HCAPI RM. */
50090         uint32_t        type;
50091         /* Minimum value. */
50092         uint16_t        min;
50093         /* Maximum value. */
50094         uint16_t        max;
50095 } __rte_packed;
50096
50097 /* TruFlow RM reservation information. */
50098 /* tf_rm_resc_entry (size:64b/8B) */
50099 struct tf_rm_resc_entry {
50100         /* Type of the resource, defined globally in HCAPI RM. */
50101         uint32_t        type;
50102         /* Start offset. */
50103         uint16_t        start;
50104         /* Number of resources. */
50105         uint16_t        stride;
50106 } __rte_packed;
50107
50108 /************************
50109  * hwrm_tf_tbl_type_get *
50110  ************************/
50111
50112
50113 /* hwrm_tf_tbl_type_get_input (size:256b/32B) */
50114 struct hwrm_tf_tbl_type_get_input {
50115         /* The HWRM command request type. */
50116         uint16_t        req_type;
50117         /*
50118          * The completion ring to send the completion event on. This should
50119          * be the NQ ID returned from the `nq_alloc` HWRM command.
50120          */
50121         uint16_t        cmpl_ring;
50122         /*
50123          * The sequence ID is used by the driver for tracking multiple
50124          * commands. This ID is treated as opaque data by the firmware and
50125          * the value is returned in the `hwrm_resp_hdr` upon completion.
50126          */
50127         uint16_t        seq_id;
50128         /*
50129          * The target ID of the command:
50130          * * 0x0-0xFFF8 - The function ID
50131          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50132          * * 0xFFFD - Reserved for user-space HWRM interface
50133          * * 0xFFFF - HWRM
50134          */
50135         uint16_t        target_id;
50136         /*
50137          * A physical address pointer pointing to a host buffer that the
50138          * command's response data will be written. This can be either a host
50139          * physical address (HPA) or a guest physical address (GPA) and must
50140          * point to a physically contiguous block of memory.
50141          */
50142         uint64_t        resp_addr;
50143         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50144         uint32_t        fw_session_id;
50145         /* Control flags. */
50146         uint16_t        flags;
50147         /* Indicates the flow direction. */
50148         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR \
50149                 UINT32_C(0x1)
50150         /* If this bit set to 0, then it indicates rx flow. */
50151         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_RX \
50152                 UINT32_C(0x0)
50153         /* If this bit is set to 1, then it indicates tx flow. */
50154         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX \
50155                 UINT32_C(0x1)
50156         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_LAST \
50157                 HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX
50158         /*
50159          * When set use the special access register access to clear
50160          * the table entry on read.
50161          */
50162         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_CLEAR_ON_READ \
50163                 UINT32_C(0x2)
50164         /* unused. */
50165         uint8_t unused0[2];
50166         /*
50167          * Type of the resource, defined globally in the
50168          * hwrm_tf_resc_type enum.
50169          */
50170         uint32_t        type;
50171         /* Index of the type to retrieve. */
50172         uint32_t        index;
50173 } __rte_packed;
50174
50175 /* hwrm_tf_tbl_type_get_output (size:1216b/152B) */
50176 struct hwrm_tf_tbl_type_get_output {
50177         /* The specific error status for the command. */
50178         uint16_t        error_code;
50179         /* The HWRM command request type. */
50180         uint16_t        req_type;
50181         /* The sequence ID from the original command. */
50182         uint16_t        seq_id;
50183         /* The length of the response data in number of bytes. */
50184         uint16_t        resp_len;
50185         /* Response code. */
50186         uint32_t        resp_code;
50187         /* Response size. */
50188         uint16_t        size;
50189         /* unused */
50190         uint16_t        unused0;
50191         /* Response data. */
50192         uint8_t data[128];
50193         /* unused */
50194         uint8_t unused1[7];
50195         /*
50196          * This field is used in Output records to indicate that the output
50197          * is completely written to RAM. This field should be read as '1'
50198          * to indicate that the output has been completely written.
50199          * When writing a command completion or response to an internal
50200          * processor, the order of writes has to be such that this field
50201          * is written last.
50202          */
50203         uint8_t valid;
50204 } __rte_packed;
50205
50206 /************************
50207  * hwrm_tf_tbl_type_set *
50208  ************************/
50209
50210
50211 /* hwrm_tf_tbl_type_set_input (size:1024b/128B) */
50212 struct hwrm_tf_tbl_type_set_input {
50213         /* The HWRM command request type. */
50214         uint16_t        req_type;
50215         /*
50216          * The completion ring to send the completion event on. This should
50217          * be the NQ ID returned from the `nq_alloc` HWRM command.
50218          */
50219         uint16_t        cmpl_ring;
50220         /*
50221          * The sequence ID is used by the driver for tracking multiple
50222          * commands. This ID is treated as opaque data by the firmware and
50223          * the value is returned in the `hwrm_resp_hdr` upon completion.
50224          */
50225         uint16_t        seq_id;
50226         /*
50227          * The target ID of the command:
50228          * * 0x0-0xFFF8 - The function ID
50229          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50230          * * 0xFFFD - Reserved for user-space HWRM interface
50231          * * 0xFFFF - HWRM
50232          */
50233         uint16_t        target_id;
50234         /*
50235          * A physical address pointer pointing to a host buffer that the
50236          * command's response data will be written. This can be either a host
50237          * physical address (HPA) or a guest physical address (GPA) and must
50238          * point to a physically contiguous block of memory.
50239          */
50240         uint64_t        resp_addr;
50241         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50242         uint32_t        fw_session_id;
50243         /* Control flags. */
50244         uint16_t        flags;
50245         /* Indicates the flow direction. */
50246         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
50247         /* If this bit set to 0, then it indicates rx flow. */
50248         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
50249         /* If this bit is set to 1, then it indicates tx flow. */
50250         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
50251         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_LAST \
50252                 HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX
50253         /* unused. */
50254         uint8_t unused0[2];
50255         /*
50256          * Type of the resource, defined globally in the
50257          * hwrm_tf_resc_type enum.
50258          */
50259         uint32_t        type;
50260         /* Index of the type to retrieve. */
50261         uint32_t        index;
50262         /* Size of the data to set. */
50263         uint16_t        size;
50264         /* unused */
50265         uint8_t unused1[6];
50266         /* Data to be set. */
50267         uint8_t data[88];
50268 } __rte_packed;
50269
50270 /* hwrm_tf_tbl_type_set_output (size:128b/16B) */
50271 struct hwrm_tf_tbl_type_set_output {
50272         /* The specific error status for the command. */
50273         uint16_t        error_code;
50274         /* The HWRM command request type. */
50275         uint16_t        req_type;
50276         /* The sequence ID from the original command. */
50277         uint16_t        seq_id;
50278         /* The length of the response data in number of bytes. */
50279         uint16_t        resp_len;
50280         /* unused. */
50281         uint8_t unused0[7];
50282         /*
50283          * This field is used in Output records to indicate that the output
50284          * is completely written to RAM. This field should be read as '1'
50285          * to indicate that the output has been completely written.
50286          * When writing a command completion or response to an internal
50287          * processor, the order of writes has to be such that this field
50288          * is written last.
50289          */
50290         uint8_t valid;
50291 } __rte_packed;
50292
50293 /**************************
50294  * hwrm_tf_ctxt_mem_alloc *
50295  **************************/
50296
50297
50298 /* hwrm_tf_ctxt_mem_alloc_input (size:192b/24B) */
50299 struct hwrm_tf_ctxt_mem_alloc_input {
50300         /* The HWRM command request type. */
50301         uint16_t        req_type;
50302         /*
50303          * The completion ring to send the completion event on. This should
50304          * be the NQ ID returned from the `nq_alloc` HWRM command.
50305          */
50306         uint16_t        cmpl_ring;
50307         /*
50308          * The sequence ID is used by the driver for tracking multiple
50309          * commands. This ID is treated as opaque data by the firmware and
50310          * the value is returned in the `hwrm_resp_hdr` upon completion.
50311          */
50312         uint16_t        seq_id;
50313         /*
50314          * The target ID of the command:
50315          * * 0x0-0xFFF8 - The function ID
50316          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50317          * * 0xFFFD - Reserved for user-space HWRM interface
50318          * * 0xFFFF - HWRM
50319          */
50320         uint16_t        target_id;
50321         /*
50322          * A physical address pointer pointing to a host buffer that the
50323          * command's response data will be written. This can be either a host
50324          * physical address (HPA) or a guest physical address (GPA) and must
50325          * point to a physically contiguous block of memory.
50326          */
50327         uint64_t        resp_addr;
50328         /* Size in KB of memory to be allocated. */
50329         uint32_t        mem_size;
50330         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50331         uint32_t        fw_session_id;
50332 } __rte_packed;
50333
50334 /* hwrm_tf_ctxt_mem_alloc_output (size:192b/24B) */
50335 struct hwrm_tf_ctxt_mem_alloc_output {
50336         /* The specific error status for the command. */
50337         uint16_t        error_code;
50338         /* The HWRM command request type. */
50339         uint16_t        req_type;
50340         /* The sequence ID from the original command. */
50341         uint16_t        seq_id;
50342         /* The length of the response data in number of bytes. */
50343         uint16_t        resp_len;
50344         /* Pointer to the PBL, or PDL depending on number of levels */
50345         uint64_t        page_dir;
50346         /* Size of memory allocated. */
50347         uint32_t        mem_size;
50348         /* Counter PBL indirect levels. */
50349         uint8_t page_level;
50350         /* PBL pointer is physical start address. */
50351         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
50352         /* PBL pointer points to PTE table. */
50353         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
50354         /*
50355          * PBL pointer points to PDE table with each entry pointing
50356          * to PTE tables.
50357          */
50358         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
50359         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LAST \
50360                 HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_2
50361         /* Page size. */
50362         uint8_t page_size;
50363         /* 4KB page size. */
50364         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
50365         /* 8KB page size. */
50366         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
50367         /* 64KB page size. */
50368         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
50369         /* 128KB page size. */
50370         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_128K UINT32_C(0x5)
50371         /* 256KB page size. */
50372         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
50373         /* 512KB page size. */
50374         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_512K UINT32_C(0x7)
50375         /* 1MB page size. */
50376         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
50377         /* 2MB page size. */
50378         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
50379         /* 4MB page size. */
50380         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
50381         /* 8MB page size. */
50382         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_8M   UINT32_C(0xb)
50383         /* 1GB page size. */
50384         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
50385         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_LAST \
50386                 HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1G
50387         /* unused. */
50388         uint8_t unused0;
50389         /*
50390          * This field is used in Output records to indicate that the
50391          * output is completely written to RAM. This field should be
50392          * read as '1' to indicate that the output has been
50393          * completely written.  When writing a command completion or
50394          * response to an internal processor, the order of writes has
50395          * to be such that this field is written last.
50396          */
50397         uint8_t valid;
50398 } __rte_packed;
50399
50400 /*************************
50401  * hwrm_tf_ctxt_mem_free *
50402  *************************/
50403
50404
50405 /* hwrm_tf_ctxt_mem_free_input (size:320b/40B) */
50406 struct hwrm_tf_ctxt_mem_free_input {
50407         /* The HWRM command request type. */
50408         uint16_t        req_type;
50409         /*
50410          * The completion ring to send the completion event on. This should
50411          * be the NQ ID returned from the `nq_alloc` HWRM command.
50412          */
50413         uint16_t        cmpl_ring;
50414         /*
50415          * The sequence ID is used by the driver for tracking multiple
50416          * commands. This ID is treated as opaque data by the firmware and
50417          * the value is returned in the `hwrm_resp_hdr` upon completion.
50418          */
50419         uint16_t        seq_id;
50420         /*
50421          * The target ID of the command:
50422          * * 0x0-0xFFF8 - The function ID
50423          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50424          * * 0xFFFD - Reserved for user-space HWRM interface
50425          * * 0xFFFF - HWRM
50426          */
50427         uint16_t        target_id;
50428         /*
50429          * A physical address pointer pointing to a host buffer that the
50430          * command's response data will be written. This can be either a host
50431          * physical address (HPA) or a guest physical address (GPA) and must
50432          * point to a physically contiguous block of memory.
50433          */
50434         uint64_t        resp_addr;
50435         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50436         uint32_t        fw_session_id;
50437         /* Counter PBL indirect levels. */
50438         uint8_t page_level;
50439         /* PBL pointer is physical start address. */
50440         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
50441         /* PBL pointer points to PTE table. */
50442         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
50443         /*
50444          * PBL pointer points to PDE table with each entry pointing
50445          * to PTE tables.
50446          */
50447         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
50448         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LAST \
50449                 HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_2
50450         /* Page size. */
50451         uint8_t page_size;
50452         /* 4KB page size. */
50453         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
50454         /* 8KB page size. */
50455         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
50456         /* 64KB page size. */
50457         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
50458         /* 128KB page size. */
50459         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_128K UINT32_C(0x5)
50460         /* 256KB page size. */
50461         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
50462         /* 512KB page size. */
50463         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_512K UINT32_C(0x7)
50464         /* 1MB page size. */
50465         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
50466         /* 2MB page size. */
50467         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
50468         /* 4MB page size. */
50469         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
50470         /* 8MB page size. */
50471         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_8M   UINT32_C(0xb)
50472         /* 1GB page size. */
50473         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
50474         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_LAST \
50475                 HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1G
50476         /* unused. */
50477         uint8_t unused0[2];
50478         /* Pointer to the PBL, or PDL depending on number of levels */
50479         uint64_t        page_dir;
50480         /* Size of memory allocated. */
50481         uint32_t        mem_size;
50482         /* unused. */
50483         uint8_t unused1[4];
50484 } __rte_packed;
50485
50486 /* hwrm_tf_ctxt_mem_free_output (size:128b/16B) */
50487 struct hwrm_tf_ctxt_mem_free_output {
50488         /* The specific error status for the command. */
50489         uint16_t        error_code;
50490         /* The HWRM command request type. */
50491         uint16_t        req_type;
50492         /* The sequence ID from the original command. */
50493         uint16_t        seq_id;
50494         /* The length of the response data in number of bytes. */
50495         uint16_t        resp_len;
50496         /* unused. */
50497         uint8_t unused0[7];
50498         /*
50499          * This field is used in Output records to indicate that the
50500          * output is completely written to RAM. This field should be
50501          * read as '1' to indicate that the output has been
50502          * completely written.  When writing a command completion or
50503          * response to an internal processor, the order of writes has
50504          * to be such that this field is written last.
50505          */
50506         uint8_t valid;
50507 } __rte_packed;
50508
50509 /*************************
50510  * hwrm_tf_ctxt_mem_rgtr *
50511  *************************/
50512
50513
50514 /* hwrm_tf_ctxt_mem_rgtr_input (size:256b/32B) */
50515 struct hwrm_tf_ctxt_mem_rgtr_input {
50516         /* The HWRM command request type. */
50517         uint16_t        req_type;
50518         /*
50519          * The completion ring to send the completion event on. This should
50520          * be the NQ ID returned from the `nq_alloc` HWRM command.
50521          */
50522         uint16_t        cmpl_ring;
50523         /*
50524          * The sequence ID is used by the driver for tracking multiple
50525          * commands. This ID is treated as opaque data by the firmware and
50526          * the value is returned in the `hwrm_resp_hdr` upon completion.
50527          */
50528         uint16_t        seq_id;
50529         /*
50530          * The target ID of the command:
50531          * * 0x0-0xFFF8 - The function ID
50532          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50533          * * 0xFFFD - Reserved for user-space HWRM interface
50534          * * 0xFFFF - HWRM
50535          */
50536         uint16_t        target_id;
50537         /*
50538          * A physical address pointer pointing to a host buffer that the
50539          * command's response data will be written. This can be either a host
50540          * physical address (HPA) or a guest physical address (GPA) and must
50541          * point to a physically contiguous block of memory.
50542          */
50543         uint64_t        resp_addr;
50544         /* Control flags. */
50545         uint16_t        flags;
50546         /* Counter PBL indirect levels. */
50547         uint8_t page_level;
50548         /* PBL pointer is physical start address. */
50549         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
50550         /* PBL pointer points to PTE table. */
50551         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
50552         /*
50553          * PBL pointer points to PDE table with each entry pointing
50554          * to PTE tables.
50555          */
50556         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
50557         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LAST \
50558                 HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
50559         /* Page size. */
50560         uint8_t page_size;
50561         /* 4KB page size. */
50562         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
50563         /* 8KB page size. */
50564         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
50565         /* 64KB page size. */
50566         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
50567         /* 128KB page size. */
50568         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_128K UINT32_C(0x5)
50569         /* 256KB page size. */
50570         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
50571         /* 512KB page size. */
50572         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_512K UINT32_C(0x7)
50573         /* 1MB page size. */
50574         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
50575         /* 2MB page size. */
50576         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
50577         /* 4MB page size. */
50578         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
50579         /* 8MB page size. */
50580         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_8M   UINT32_C(0xb)
50581         /* 1GB page size. */
50582         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
50583         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_LAST \
50584                 HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1G
50585         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50586         uint32_t        fw_session_id;
50587         /* Pointer to the PBL, or PDL depending on number of levels */
50588         uint64_t        page_dir;
50589 } __rte_packed;
50590
50591 /* hwrm_tf_ctxt_mem_rgtr_output (size:128b/16B) */
50592 struct hwrm_tf_ctxt_mem_rgtr_output {
50593         /* The specific error status for the command. */
50594         uint16_t        error_code;
50595         /* The HWRM command request type. */
50596         uint16_t        req_type;
50597         /* The sequence ID from the original command. */
50598         uint16_t        seq_id;
50599         /* The length of the response data in number of bytes. */
50600         uint16_t        resp_len;
50601         /*
50602          * Id/Handle to the recently register context memory. This
50603          * handle is passed to the TF session.
50604          */
50605         uint16_t        ctx_id;
50606         /* unused. */
50607         uint8_t unused0[5];
50608         /*
50609          * This field is used in Output records to indicate that the
50610          * output is completely written to RAM. This field should be
50611          * read as '1' to indicate that the output has been
50612          * completely written.  When writing a command completion or
50613          * response to an internal processor, the order of writes has
50614          * to be such that this field is written last.
50615          */
50616         uint8_t valid;
50617 } __rte_packed;
50618
50619 /***************************
50620  * hwrm_tf_ctxt_mem_unrgtr *
50621  ***************************/
50622
50623
50624 /* hwrm_tf_ctxt_mem_unrgtr_input (size:192b/24B) */
50625 struct hwrm_tf_ctxt_mem_unrgtr_input {
50626         /* The HWRM command request type. */
50627         uint16_t        req_type;
50628         /*
50629          * The completion ring to send the completion event on. This should
50630          * be the NQ ID returned from the `nq_alloc` HWRM command.
50631          */
50632         uint16_t        cmpl_ring;
50633         /*
50634          * The sequence ID is used by the driver for tracking multiple
50635          * commands. This ID is treated as opaque data by the firmware and
50636          * the value is returned in the `hwrm_resp_hdr` upon completion.
50637          */
50638         uint16_t        seq_id;
50639         /*
50640          * The target ID of the command:
50641          * * 0x0-0xFFF8 - The function ID
50642          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50643          * * 0xFFFD - Reserved for user-space HWRM interface
50644          * * 0xFFFF - HWRM
50645          */
50646         uint16_t        target_id;
50647         /*
50648          * A physical address pointer pointing to a host buffer that the
50649          * command's response data will be written. This can be either a host
50650          * physical address (HPA) or a guest physical address (GPA) and must
50651          * point to a physically contiguous block of memory.
50652          */
50653         uint64_t        resp_addr;
50654         /*
50655          * Id/Handle to the recently register context memory. This
50656          * handle is passed to the TF session.
50657          */
50658         uint16_t        ctx_id;
50659         /* unused. */
50660         uint8_t unused0[2];
50661         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50662         uint32_t        fw_session_id;
50663 } __rte_packed;
50664
50665 /* hwrm_tf_ctxt_mem_unrgtr_output (size:128b/16B) */
50666 struct hwrm_tf_ctxt_mem_unrgtr_output {
50667         /* The specific error status for the command. */
50668         uint16_t        error_code;
50669         /* The HWRM command request type. */
50670         uint16_t        req_type;
50671         /* The sequence ID from the original command. */
50672         uint16_t        seq_id;
50673         /* The length of the response data in number of bytes. */
50674         uint16_t        resp_len;
50675         /* unused. */
50676         uint8_t unused0[7];
50677         /*
50678          * This field is used in Output records to indicate that the
50679          * output is completely written to RAM. This field should be
50680          * read as '1' to indicate that the output has been
50681          * completely written.  When writing a command completion or
50682          * response to an internal processor, the order of writes has
50683          * to be such that this field is written last.
50684          */
50685         uint8_t valid;
50686 } __rte_packed;
50687
50688 /************************
50689  * hwrm_tf_ext_em_qcaps *
50690  ************************/
50691
50692
50693 /* hwrm_tf_ext_em_qcaps_input (size:192b/24B) */
50694 struct hwrm_tf_ext_em_qcaps_input {
50695         /* The HWRM command request type. */
50696         uint16_t        req_type;
50697         /*
50698          * The completion ring to send the completion event on. This should
50699          * be the NQ ID returned from the `nq_alloc` HWRM command.
50700          */
50701         uint16_t        cmpl_ring;
50702         /*
50703          * The sequence ID is used by the driver for tracking multiple
50704          * commands. This ID is treated as opaque data by the firmware and
50705          * the value is returned in the `hwrm_resp_hdr` upon completion.
50706          */
50707         uint16_t        seq_id;
50708         /*
50709          * The target ID of the command:
50710          * * 0x0-0xFFF8 - The function ID
50711          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50712          * * 0xFFFD - Reserved for user-space HWRM interface
50713          * * 0xFFFF - HWRM
50714          */
50715         uint16_t        target_id;
50716         /*
50717          * A physical address pointer pointing to a host buffer that the
50718          * command's response data will be written. This can be either a host
50719          * physical address (HPA) or a guest physical address (GPA) and must
50720          * point to a physically contiguous block of memory.
50721          */
50722         uint64_t        resp_addr;
50723         /* Control flags. */
50724         uint32_t        flags;
50725         /* Indicates the flow direction. */
50726         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR \
50727                 UINT32_C(0x1)
50728         /* If this bit set to 0, then it indicates rx flow. */
50729         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_RX \
50730                 UINT32_C(0x0)
50731         /* If this bit is set to 1, then it indicates tx flow. */
50732         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_TX \
50733                 UINT32_C(0x1)
50734         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_LAST \
50735                 HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_TX
50736         /* When set to 1, all offloaded flows will be sent to EXT EM. */
50737         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD \
50738                 UINT32_C(0x2)
50739         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50740         uint32_t        fw_session_id;
50741 } __rte_packed;
50742
50743 /* hwrm_tf_ext_em_qcaps_output (size:384b/48B) */
50744 struct hwrm_tf_ext_em_qcaps_output {
50745         /* The specific error status for the command. */
50746         uint16_t        error_code;
50747         /* The HWRM command request type. */
50748         uint16_t        req_type;
50749         /* The sequence ID from the original command. */
50750         uint16_t        seq_id;
50751         /* The length of the response data in number of bytes. */
50752         uint16_t        resp_len;
50753         uint32_t        flags;
50754         /*
50755          * When set to 1, indicates the FW supports the Centralized
50756          * Memory Model. The concept designates one entity for the
50757          * memory allocation while all others ‘subscribe’ to it.
50758          */
50759         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
50760                 UINT32_C(0x1)
50761         /*
50762          * When set to 1, indicates the FW supports the Detached
50763          * Centralized Memory Model. The memory is allocated and managed
50764          * as a separate entity. All PFs and VFs will be granted direct
50765          * or semi-direct access to the allocated memory while none of
50766          * which can interfere with the management of the memory.
50767          */
50768         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
50769                 UINT32_C(0x2)
50770         /* When set to 1, indicates FW support for host based EEM memory. */
50771         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_HOST_MEMORY_SUPPORTED \
50772                 UINT32_C(0x4)
50773         /* When set to 1, indicates FW support for on-chip based EEM memory. */
50774         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_FW_MEMORY_SUPPORTED \
50775                 UINT32_C(0x8)
50776         /* unused. */
50777         uint32_t        unused0;
50778         /* Support flags. */
50779         uint32_t        supported;
50780         /*
50781          * If set to 1, then EXT EM KEY0 table is supported using
50782          * crc32 hash.
50783          * If set to 0, EXT EM KEY0 table is not supported.
50784          */
50785         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE \
50786                 UINT32_C(0x1)
50787         /*
50788          * If set to 1, then EXT EM KEY1 table is supported using
50789          * lookup3 hash.
50790          * If set to 0, EXT EM KEY1 table is not supported.
50791          */
50792         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE \
50793                 UINT32_C(0x2)
50794         /*
50795          * If set to 1, then EXT EM External Record table is supported.
50796          * If set to 0, EXT EM External Record table is not
50797          * supported.  (This table includes action record, EFC
50798          * pointers, encap pointers)
50799          */
50800         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE \
50801                 UINT32_C(0x4)
50802         /*
50803          * If set to 1, then EXT EM External Flow Counters table is
50804          * supported.
50805          * If set to 0, EXT EM External Flow Counters table is not
50806          * supported.
50807          */
50808         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE \
50809                 UINT32_C(0x8)
50810         /*
50811          * If set to 1, then FID table used for implicit flow flush
50812          * is supported.
50813          * If set to 0, then FID table used for implicit flow flush
50814          * is not supported.
50815          */
50816         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE \
50817                 UINT32_C(0x10)
50818         /*
50819          * If set to 1, then table scopes are supported.
50820          * If set to 0, then table scopes are not supported.
50821          */
50822         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_TBL_SCOPES \
50823                 UINT32_C(0x20)
50824         /*
50825          * The maximum number of entries supported by EXT EM. When
50826          * configuring the host memory the number of numbers of
50827          * entries that can supported are -
50828          *      32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M,
50829          *      128M entries.
50830          * Any value that are not these values, the FW will round
50831          * down to the closest support number of entries.
50832          */
50833         uint32_t        max_entries_supported;
50834         /*
50835          * The entry size in bytes of each entry in the EXT EM
50836          * KEY0/KEY1 tables.
50837          */
50838         uint16_t        key_entry_size;
50839         /*
50840          * The entry size in bytes of each entry in the EXT EM RECORD
50841          * tables.
50842          */
50843         uint16_t        record_entry_size;
50844         /* The entry size in bytes of each entry in the EXT EM EFC tables. */
50845         uint16_t        efc_entry_size;
50846         /* The FID size in bytes of each entry in the EXT EM FID tables. */
50847         uint16_t        fid_entry_size;
50848         /* Maximum number of ctxt mem allocations allowed. */
50849         uint32_t        max_ctxt_mem_allocs;
50850         /*
50851          * Maximum number of static buckets that can be assigned to lookup
50852          * table scopes.
50853          */
50854         uint32_t        max_static_buckets;
50855         /* unused. */
50856         uint8_t unused1[7];
50857         /*
50858          * This field is used in Output records to indicate that the
50859          * output is completely written to RAM. This field should be
50860          * read as '1' to indicate that the output has been
50861          * completely written.  When writing a command completion or
50862          * response to an internal processor, the order of writes has
50863          * to be such that this field is written last.
50864          */
50865         uint8_t valid;
50866 } __rte_packed;
50867
50868 /*********************
50869  * hwrm_tf_ext_em_op *
50870  *********************/
50871
50872
50873 /* hwrm_tf_ext_em_op_input (size:256b/32B) */
50874 struct hwrm_tf_ext_em_op_input {
50875         /* The HWRM command request type. */
50876         uint16_t        req_type;
50877         /*
50878          * The completion ring to send the completion event on. This should
50879          * be the NQ ID returned from the `nq_alloc` HWRM command.
50880          */
50881         uint16_t        cmpl_ring;
50882         /*
50883          * The sequence ID is used by the driver for tracking multiple
50884          * commands. This ID is treated as opaque data by the firmware and
50885          * the value is returned in the `hwrm_resp_hdr` upon completion.
50886          */
50887         uint16_t        seq_id;
50888         /*
50889          * The target ID of the command:
50890          * * 0x0-0xFFF8 - The function ID
50891          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50892          * * 0xFFFD - Reserved for user-space HWRM interface
50893          * * 0xFFFF - HWRM
50894          */
50895         uint16_t        target_id;
50896         /*
50897          * A physical address pointer pointing to a host buffer that the
50898          * command's response data will be written. This can be either a host
50899          * physical address (HPA) or a guest physical address (GPA) and must
50900          * point to a physically contiguous block of memory.
50901          */
50902         uint64_t        resp_addr;
50903         /* Control flags. */
50904         uint16_t        flags;
50905         /* Indicates the flow direction. */
50906         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR     UINT32_C(0x1)
50907         /* If this bit set to 0, then it indicates rx flow. */
50908         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
50909         /* If this bit is set to 1, then it indicates tx flow. */
50910         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
50911         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_LAST \
50912                 HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_TX
50913         /* unused. */
50914         uint16_t        unused0;
50915         /* The number of EXT EM key table entries to be configured. */
50916         uint16_t        op;
50917         /* This value is reserved and should not be used. */
50918         #define HWRM_TF_EXT_EM_OP_INPUT_OP_RESERVED       UINT32_C(0x0)
50919         /*
50920          * To properly stop EXT EM and ensure there are no DMA's,
50921          * the caller must disable EXT EM for the given PF, using
50922          * this call. This will safely disable EXT EM and ensure
50923          * that all DMA'ed to the keys/records/efc have been
50924          * completed.
50925          */
50926         #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_DISABLE UINT32_C(0x1)
50927         /*
50928          * Once the EXT EM host memory has been configured, EXT EM
50929          * options have been configured. Then the caller should
50930          * enable EXT EM for the given PF. Note once this call has
50931          * been made, then the EXT EM mechanism will be active and
50932          * DMA's will occur as packets are processed.
50933          */
50934         #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_ENABLE  UINT32_C(0x2)
50935         /*
50936          * Clear EXT EM settings for the given PF so that the
50937          * register values are reset back to their initial state.
50938          */
50939         #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_CLEANUP UINT32_C(0x3)
50940         #define HWRM_TF_EXT_EM_OP_INPUT_OP_LAST \
50941                 HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_CLEANUP
50942         /* unused. */
50943         uint16_t        unused1;
50944         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
50945         uint32_t        fw_session_id;
50946         /* unused. */
50947         uint32_t        unused2;
50948 } __rte_packed;
50949
50950 /* hwrm_tf_ext_em_op_output (size:128b/16B) */
50951 struct hwrm_tf_ext_em_op_output {
50952         /* The specific error status for the command. */
50953         uint16_t        error_code;
50954         /* The HWRM command request type. */
50955         uint16_t        req_type;
50956         /* The sequence ID from the original command. */
50957         uint16_t        seq_id;
50958         /* The length of the response data in number of bytes. */
50959         uint16_t        resp_len;
50960         /* unused. */
50961         uint8_t unused0[7];
50962         /*
50963          * This field is used in Output records to indicate that the
50964          * output is completely written to RAM. This field should be
50965          * read as '1' to indicate that the output has been
50966          * completely written.  When writing a command completion or
50967          * response to an internal processor, the order of writes has
50968          * to be such that this field is written last.
50969          */
50970         uint8_t valid;
50971 } __rte_packed;
50972
50973 /**********************
50974  * hwrm_tf_ext_em_cfg *
50975  **********************/
50976
50977
50978 /* hwrm_tf_ext_em_cfg_input (size:512b/64B) */
50979 struct hwrm_tf_ext_em_cfg_input {
50980         /* The HWRM command request type. */
50981         uint16_t        req_type;
50982         /*
50983          * The completion ring to send the completion event on. This should
50984          * be the NQ ID returned from the `nq_alloc` HWRM command.
50985          */
50986         uint16_t        cmpl_ring;
50987         /*
50988          * The sequence ID is used by the driver for tracking multiple
50989          * commands. This ID is treated as opaque data by the firmware and
50990          * the value is returned in the `hwrm_resp_hdr` upon completion.
50991          */
50992         uint16_t        seq_id;
50993         /*
50994          * The target ID of the command:
50995          * * 0x0-0xFFF8 - The function ID
50996          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
50997          * * 0xFFFD - Reserved for user-space HWRM interface
50998          * * 0xFFFF - HWRM
50999          */
51000         uint16_t        target_id;
51001         /*
51002          * A physical address pointer pointing to a host buffer that the
51003          * command's response data will be written. This can be either a host
51004          * physical address (HPA) or a guest physical address (GPA) and must
51005          * point to a physically contiguous block of memory.
51006          */
51007         uint64_t        resp_addr;
51008         /* Control flags. */
51009         uint32_t        flags;
51010         /* Indicates the flow direction. */
51011         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR \
51012                 UINT32_C(0x1)
51013         /* If this bit set to 0, then it indicates rx flow. */
51014         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_RX \
51015                 UINT32_C(0x0)
51016         /* If this bit is set to 1, then it indicates tx flow. */
51017         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_TX \
51018                 UINT32_C(0x1)
51019         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_LAST \
51020                 HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_TX
51021         /* When set to 1, all offloaded flows will be sent to EXT EM. */
51022         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD \
51023                 UINT32_C(0x2)
51024         /* When set to 1, secondary, 0 means primary. */
51025         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_SECONDARY_PF \
51026                 UINT32_C(0x4)
51027         /*
51028          * Group_id which used by Firmware to identify memory pools belonging
51029          * to certain group.
51030          */
51031         uint16_t        group_id;
51032         /*
51033          * Dynamically reconfigure EEM pending cache every 1/10th of second.
51034          * If set to 0 it will disable the EEM HW flush of the pending cache.
51035          */
51036         uint8_t flush_interval;
51037         /* unused. */
51038         uint8_t unused0;
51039         /*
51040          * Configured EXT EM with the given number of entries. All
51041          * the EXT EM tables KEY0, KEY1, RECORD, EFC all have the
51042          * same number of entries and all tables will be configured
51043          * using this value. Current minimum value is 32k. Current
51044          * maximum value is 128M.
51045          */
51046         uint32_t        num_entries;
51047         uint32_t        enables;
51048         /*
51049          * This bit must be '1' for the group_id field to be
51050          * configured.
51051          */
51052         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_GROUP_ID \
51053                 UINT32_C(0x1)
51054         /*
51055          * This bit must be '1' for the flush_interval field to be
51056          * configured.
51057          */
51058         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_FLUSH_INTERVAL \
51059                 UINT32_C(0x2)
51060         /*
51061          * This bit must be '1' for the num_entries field to be
51062          * configured.
51063          */
51064         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_NUM_ENTRIES \
51065                 UINT32_C(0x4)
51066         /*
51067          * This bit must be '1' for the key0_ctx_id field to be
51068          * configured.
51069          */
51070         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_KEY0_CTX_ID \
51071                 UINT32_C(0x8)
51072         /*
51073          * This bit must be '1' for the key1_ctx_id field to be
51074          * configured.
51075          */
51076         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_KEY1_CTX_ID \
51077                 UINT32_C(0x10)
51078         /*
51079          * This bit must be '1' for the record_ctx_id field to be
51080          * configured.
51081          */
51082         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_RECORD_CTX_ID \
51083                 UINT32_C(0x20)
51084         /*
51085          * This bit must be '1' for the efc_ctx_id field to be
51086          * configured.
51087          */
51088         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_EFC_CTX_ID \
51089                 UINT32_C(0x40)
51090         /*
51091          * This bit must be '1' for the fid_ctx_id field to be
51092          * configured.
51093          */
51094         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_FID_CTX_ID \
51095                 UINT32_C(0x80)
51096         /*
51097          * This bit must be '1' for the action_ctx_id field to be
51098          * configured.
51099          */
51100         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_ACTION_CTX_ID \
51101                 UINT32_C(0x100)
51102         /*
51103          * This bit must be '1' for the action_tbl_scope field to be
51104          * configured.
51105          */
51106         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_ACTION_TBL_SCOPE \
51107                 UINT32_C(0x200)
51108         /*
51109          * This bit must be '1' for the lkup_ctx_id field to be
51110          * configured.
51111          */
51112         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_CTX_ID \
51113                 UINT32_C(0x400)
51114         /*
51115          * This bit must be '1' for the lkup_tbl_scope field to be
51116          * configured.
51117          */
51118         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_TBL_SCOPE \
51119                 UINT32_C(0x800)
51120         /*
51121          * This bit must be '1' for the lkup_static_buckets field to be
51122          * configured.
51123          */
51124         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_STATIC_BUCKETS \
51125                 UINT32_C(0x1000)
51126         /* Configured EXT EM with the given context if for KEY0 table. */
51127         uint16_t        key0_ctx_id;
51128         /* Configured EXT EM with the given context if for KEY1 table. */
51129         uint16_t        key1_ctx_id;
51130         /* Configured EXT EM with the given context if for RECORD table. */
51131         uint16_t        record_ctx_id;
51132         /* Configured EXT EM with the given context if for EFC table. */
51133         uint16_t        efc_ctx_id;
51134         /* Configured EXT EM with the given context if for EFC table. */
51135         uint16_t        fid_ctx_id;
51136         /* Context id of action table scope. */
51137         uint16_t        action_ctx_id;
51138         /* Table scope id used for action record entries. */
51139         uint16_t        action_tbl_scope;
51140         /* Context id of lookup table scope. */
51141         uint16_t        lkup_ctx_id;
51142         /* Table scope id used for EM lookup entries. */
51143         uint16_t        lkup_tbl_scope;
51144         /* unused. */
51145         uint16_t        unused1;
51146         /*
51147          * Number of 32B static buckets to be allocated at the beginning
51148          * of table scope.
51149          */
51150         uint32_t        lkup_static_buckets;
51151         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51152         uint32_t        fw_session_id;
51153         /* unused. */
51154         uint32_t        unused2;
51155 } __rte_packed;
51156
51157 /* hwrm_tf_ext_em_cfg_output (size:128b/16B) */
51158 struct hwrm_tf_ext_em_cfg_output {
51159         /* The specific error status for the command. */
51160         uint16_t        error_code;
51161         /* The HWRM command request type. */
51162         uint16_t        req_type;
51163         /* The sequence ID from the original command. */
51164         uint16_t        seq_id;
51165         /* The length of the response data in number of bytes. */
51166         uint16_t        resp_len;
51167         /* unused. */
51168         uint8_t unused0[7];
51169         /*
51170          * This field is used in Output records to indicate that the
51171          * output is completely written to RAM. This field should be
51172          * read as '1' to indicate that the output has been
51173          * completely written.  When writing a command completion or
51174          * response to an internal processor, the order of writes has
51175          * to be such that this field is written last.
51176          */
51177         uint8_t valid;
51178 } __rte_packed;
51179
51180 /***********************
51181  * hwrm_tf_ext_em_qcfg *
51182  ***********************/
51183
51184
51185 /* hwrm_tf_ext_em_qcfg_input (size:192b/24B) */
51186 struct hwrm_tf_ext_em_qcfg_input {
51187         /* The HWRM command request type. */
51188         uint16_t        req_type;
51189         /*
51190          * The completion ring to send the completion event on. This should
51191          * be the NQ ID returned from the `nq_alloc` HWRM command.
51192          */
51193         uint16_t        cmpl_ring;
51194         /*
51195          * The sequence ID is used by the driver for tracking multiple
51196          * commands. This ID is treated as opaque data by the firmware and
51197          * the value is returned in the `hwrm_resp_hdr` upon completion.
51198          */
51199         uint16_t        seq_id;
51200         /*
51201          * The target ID of the command:
51202          * * 0x0-0xFFF8 - The function ID
51203          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51204          * * 0xFFFD - Reserved for user-space HWRM interface
51205          * * 0xFFFF - HWRM
51206          */
51207         uint16_t        target_id;
51208         /*
51209          * A physical address pointer pointing to a host buffer that the
51210          * command's response data will be written. This can be either a host
51211          * physical address (HPA) or a guest physical address (GPA) and must
51212          * point to a physically contiguous block of memory.
51213          */
51214         uint64_t        resp_addr;
51215         /* Control flags. */
51216         uint32_t        flags;
51217         /* Indicates the flow direction. */
51218         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR     UINT32_C(0x1)
51219         /* If this bit set to 0, then it indicates rx flow. */
51220         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
51221         /* If this bit is set to 1, then it indicates tx flow. */
51222         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
51223         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_LAST \
51224                 HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_TX
51225         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51226         uint32_t        fw_session_id;
51227 } __rte_packed;
51228
51229 /* hwrm_tf_ext_em_qcfg_output (size:448b/56B) */
51230 struct hwrm_tf_ext_em_qcfg_output {
51231         /* The specific error status for the command. */
51232         uint16_t        error_code;
51233         /* The HWRM command request type. */
51234         uint16_t        req_type;
51235         /* The sequence ID from the original command. */
51236         uint16_t        seq_id;
51237         /* The length of the response data in number of bytes. */
51238         uint16_t        resp_len;
51239         /* Control flags. */
51240         uint32_t        flags;
51241         /* Indicates the flow direction. */
51242         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR \
51243                 UINT32_C(0x1)
51244         /* If this bit set to 0, then it indicates rx flow. */
51245         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_RX \
51246                 UINT32_C(0x0)
51247         /* If this bit is set to 1, then it indicates tx flow. */
51248         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_TX \
51249                 UINT32_C(0x1)
51250         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_LAST \
51251                 HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_TX
51252         /* When set to 1, all offloaded flows will be sent to EXT EM. */
51253         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD \
51254                 UINT32_C(0x2)
51255         /* The number of entries the FW has configured for EXT EM. */
51256         uint32_t        num_entries;
51257         /* Configured EXT EM with the given context if for KEY0 table. */
51258         uint16_t        key0_ctx_id;
51259         /* Configured EXT EM with the given context if for KEY1 table. */
51260         uint16_t        key1_ctx_id;
51261         /* Configured EXT EM with the given context if for RECORD table. */
51262         uint16_t        record_ctx_id;
51263         /* Configured EXT EM with the given context if for EFC table. */
51264         uint16_t        efc_ctx_id;
51265         /* Configured EXT EM with the given context if for EFC table. */
51266         uint16_t        fid_ctx_id;
51267         /* unused. */
51268         uint16_t        unused0;
51269         uint32_t        supported;
51270         /* This bit must be '1' for the group_id field is set. */
51271         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_GROUP_ID \
51272                 UINT32_C(0x1)
51273         /* This bit must be '1' for the flush_interval field is set. */
51274         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_FLUSH_INTERVAL \
51275                 UINT32_C(0x2)
51276         /* This bit must be '1' for the num_entries field is set. */
51277         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_NUM_ENTRIES \
51278                 UINT32_C(0x4)
51279         /* This bit must be '1' for the key0_ctx_id field is set. */
51280         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_KEY0_CTX_ID \
51281                 UINT32_C(0x8)
51282         /* This bit must be '1' for the key1_ctx_id field is set. */
51283         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_KEY1_CTX_ID \
51284                 UINT32_C(0x10)
51285         /* This bit must be '1' for the record_ctx_id field is set. */
51286         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_RECORD_CTX_ID \
51287                 UINT32_C(0x20)
51288         /* This bit must be '1' for the efc_ctx_id field is set. */
51289         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_EFC_CTX_ID \
51290                 UINT32_C(0x40)
51291         /* This bit must be '1' for the fid_ctx_id field is set. */
51292         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_FID_CTX_ID \
51293                 UINT32_C(0x80)
51294         /* This bit must be '1' for the action_ctx_id field is set. */
51295         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_ACTION_CTX_ID \
51296                 UINT32_C(0x100)
51297         /* This bit must be '1' for the action_tbl_scope field is set. */
51298         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_ACTION_TBL_SCOPE \
51299                 UINT32_C(0x200)
51300         /* This bit must be '1' for the lkup_ctx_id field is set. */
51301         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_CTX_ID \
51302                 UINT32_C(0x400)
51303         /* This bit must be '1' for the lkup_tbl_scope field is set. */
51304         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_TBL_SCOPE \
51305                 UINT32_C(0x800)
51306         /* This bit must be '1' for the lkup_static_buckets field is set. */
51307         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_STATIC_BUCKETS \
51308                 UINT32_C(0x1000)
51309         /*
51310          * Group id is used by firmware to identify memory pools belonging
51311          * to certain group.
51312          */
51313         uint16_t        group_id;
51314         /* EEM pending cache flush interval in 1/10th of second. */
51315         uint8_t flush_interval;
51316         /* unused. */
51317         uint8_t unused1;
51318         /* Context id of action table scope. */
51319         uint16_t        action_ctx_id;
51320         /* Table scope id used for action record entries. */
51321         uint16_t        action_tbl_scope;
51322         /* Context id of lookup table scope. */
51323         uint16_t        lkup_ctx_id;
51324         /* Table scope id used for EM lookup entries. */
51325         uint16_t        lkup_tbl_scope;
51326         /*
51327          * Number of 32B static buckets to be allocated at the beginning
51328          * of table scope.
51329          */
51330         uint32_t        lkup_static_buckets;
51331         /* unused. */
51332         uint8_t unused2[7];
51333         /*
51334          * This field is used in Output records to indicate that the
51335          * output is completely written to RAM. This field should be
51336          * read as '1' to indicate that the output has been
51337          * completely written.  When writing a command completion or
51338          * response to an internal processor, the order of writes has
51339          * to be such that this field is written last.
51340          */
51341         uint8_t valid;
51342 } __rte_packed;
51343
51344 /*********************
51345  * hwrm_tf_em_insert *
51346  *********************/
51347
51348
51349 /* hwrm_tf_em_insert_input (size:832b/104B) */
51350 struct hwrm_tf_em_insert_input {
51351         /* The HWRM command request type. */
51352         uint16_t        req_type;
51353         /*
51354          * The completion ring to send the completion event on. This should
51355          * be the NQ ID returned from the `nq_alloc` HWRM command.
51356          */
51357         uint16_t        cmpl_ring;
51358         /*
51359          * The sequence ID is used by the driver for tracking multiple
51360          * commands. This ID is treated as opaque data by the firmware and
51361          * the value is returned in the `hwrm_resp_hdr` upon completion.
51362          */
51363         uint16_t        seq_id;
51364         /*
51365          * The target ID of the command:
51366          * * 0x0-0xFFF8 - The function ID
51367          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51368          * * 0xFFFD - Reserved for user-space HWRM interface
51369          * * 0xFFFF - HWRM
51370          */
51371         uint16_t        target_id;
51372         /*
51373          * A physical address pointer pointing to a host buffer that the
51374          * command's response data will be written. This can be either a host
51375          * physical address (HPA) or a guest physical address (GPA) and must
51376          * point to a physically contiguous block of memory.
51377          */
51378         uint64_t        resp_addr;
51379         /* Firmware Session Id. */
51380         uint32_t        fw_session_id;
51381         /* Control Flags. */
51382         uint16_t        flags;
51383         /* Indicates the flow direction. */
51384         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR     UINT32_C(0x1)
51385         /* If this bit set to 0, then it indicates rx flow. */
51386         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
51387         /* If this bit is set to 1, then it indicates tx flow. */
51388         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
51389         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_LAST \
51390                 HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX
51391         /* Reported match strength. */
51392         uint16_t        strength;
51393         /* Index to action. */
51394         uint32_t        action_ptr;
51395         /* Index of EM record. */
51396         uint32_t        em_record_idx;
51397         /* EM Key value. */
51398         uint64_t        em_key[8];
51399         /* Number of bits in em_key. */
51400         uint16_t        em_key_bitlen;
51401         /* unused. */
51402         uint16_t        unused0[3];
51403 } __rte_packed;
51404
51405 /* hwrm_tf_em_insert_output (size:128b/16B) */
51406 struct hwrm_tf_em_insert_output {
51407         /* The specific error status for the command. */
51408         uint16_t        error_code;
51409         /* The HWRM command request type. */
51410         uint16_t        req_type;
51411         /* The sequence ID from the original command. */
51412         uint16_t        seq_id;
51413         /* The length of the response data in number of bytes. */
51414         uint16_t        resp_len;
51415         /* EM record pointer index. */
51416         uint16_t        rptr_index;
51417         /* EM record offset 0~3. */
51418         uint8_t rptr_entry;
51419         /* Number of word entries consumed by the key. */
51420         uint8_t num_of_entries;
51421         /* unused. */
51422         uint32_t        unused0;
51423 } __rte_packed;
51424
51425 /**************************
51426  * hwrm_tf_em_hash_insert *
51427  **************************/
51428
51429
51430 /* hwrm_tf_em_hash_insert_input (size:1024b/128B) */
51431 struct hwrm_tf_em_hash_insert_input {
51432         /* The HWRM command request type. */
51433         uint16_t        req_type;
51434         /*
51435          * The completion ring to send the completion event on. This should
51436          * be the NQ ID returned from the `nq_alloc` HWRM command.
51437          */
51438         uint16_t        cmpl_ring;
51439         /*
51440          * The sequence ID is used by the driver for tracking multiple
51441          * commands. This ID is treated as opaque data by the firmware and
51442          * the value is returned in the `hwrm_resp_hdr` upon completion.
51443          */
51444         uint16_t        seq_id;
51445         /*
51446          * The target ID of the command:
51447          * * 0x0-0xFFF8 - The function ID
51448          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51449          * * 0xFFFD - Reserved for user-space HWRM interface
51450          * * 0xFFFF - HWRM
51451          */
51452         uint16_t        target_id;
51453         /*
51454          * A physical address pointer pointing to a host buffer that the
51455          * command's response data will be written. This can be either a host
51456          * physical address (HPA) or a guest physical address (GPA) and must
51457          * point to a physically contiguous block of memory.
51458          */
51459         uint64_t        resp_addr;
51460         /* Firmware Session Id. */
51461         uint32_t        fw_session_id;
51462         /* Control Flags. */
51463         uint16_t        flags;
51464         /* Indicates the flow direction. */
51465         #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR     UINT32_C(0x1)
51466         /* If this bit set to 0, then it indicates rx flow. */
51467         #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
51468         /* If this bit is set to 1, then it indicates tx flow. */
51469         #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
51470         #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_LAST \
51471                 HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_TX
51472         /* Number of bits in the EM record. */
51473         uint16_t        em_record_size_bits;
51474         /* CRC32 hash of key. */
51475         uint32_t        key0_hash;
51476         /* Lookup3 hash of key. */
51477         uint32_t        key1_hash;
51478         /* Index of EM record. */
51479         uint32_t        em_record_idx;
51480         /* Unused. */
51481         uint32_t        unused0;
51482         /* EM record. */
51483         uint64_t        em_record[11];
51484 } __rte_packed;
51485
51486 /* hwrm_tf_em_hash_insert_output (size:128b/16B) */
51487 struct hwrm_tf_em_hash_insert_output {
51488         /* The specific error status for the command. */
51489         uint16_t        error_code;
51490         /* The HWRM command request type. */
51491         uint16_t        req_type;
51492         /* The sequence ID from the original command. */
51493         uint16_t        seq_id;
51494         /* The length of the response data in number of bytes. */
51495         uint16_t        resp_len;
51496         /* EM record pointer index. */
51497         uint16_t        rptr_index;
51498         /* EM record offset 0~3. */
51499         uint8_t rptr_entry;
51500         /* Number of word entries consumed by the key. */
51501         uint8_t num_of_entries;
51502         /* unused. */
51503         uint32_t        unused0;
51504 } __rte_packed;
51505
51506 /*********************
51507  * hwrm_tf_em_delete *
51508  *********************/
51509
51510
51511 /* hwrm_tf_em_delete_input (size:832b/104B) */
51512 struct hwrm_tf_em_delete_input {
51513         /* The HWRM command request type. */
51514         uint16_t        req_type;
51515         /*
51516          * The completion ring to send the completion event on. This should
51517          * be the NQ ID returned from the `nq_alloc` HWRM command.
51518          */
51519         uint16_t        cmpl_ring;
51520         /*
51521          * The sequence ID is used by the driver for tracking multiple
51522          * commands. This ID is treated as opaque data by the firmware and
51523          * the value is returned in the `hwrm_resp_hdr` upon completion.
51524          */
51525         uint16_t        seq_id;
51526         /*
51527          * The target ID of the command:
51528          * * 0x0-0xFFF8 - The function ID
51529          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51530          * * 0xFFFD - Reserved for user-space HWRM interface
51531          * * 0xFFFF - HWRM
51532          */
51533         uint16_t        target_id;
51534         /*
51535          * A physical address pointer pointing to a host buffer that the
51536          * command's response data will be written. This can be either a host
51537          * physical address (HPA) or a guest physical address (GPA) and must
51538          * point to a physically contiguous block of memory.
51539          */
51540         uint64_t        resp_addr;
51541         /* Session Id. */
51542         uint32_t        fw_session_id;
51543         /* Control flags. */
51544         uint16_t        flags;
51545         /* Indicates the flow direction. */
51546         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR     UINT32_C(0x1)
51547         /* If this bit set to 0, then it indicates rx flow. */
51548         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
51549         /* If this bit is set to 1, then it indicates tx flow. */
51550         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
51551         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_LAST \
51552                 HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX
51553         /* Unused0 */
51554         uint16_t        unused0;
51555         /* EM internal flow handle. */
51556         uint64_t        flow_handle;
51557         /* EM Key value */
51558         uint64_t        em_key[8];
51559         /* Number of bits in em_key. */
51560         uint16_t        em_key_bitlen;
51561         /* unused. */
51562         uint16_t        unused1[3];
51563 } __rte_packed;
51564
51565 /* hwrm_tf_em_delete_output (size:128b/16B) */
51566 struct hwrm_tf_em_delete_output {
51567         /* The specific error status for the command. */
51568         uint16_t        error_code;
51569         /* The HWRM command request type. */
51570         uint16_t        req_type;
51571         /* The sequence ID from the original command. */
51572         uint16_t        seq_id;
51573         /* The length of the response data in number of bytes. */
51574         uint16_t        resp_len;
51575         /* Original stack allocation index. */
51576         uint16_t        em_index;
51577         /* unused. */
51578         uint16_t        unused0[3];
51579 } __rte_packed;
51580
51581 /*******************
51582  * hwrm_tf_em_move *
51583  *******************/
51584
51585
51586 /* hwrm_tf_em_move_input (size:320b/40B) */
51587 struct hwrm_tf_em_move_input {
51588         /* The HWRM command request type. */
51589         uint16_t        req_type;
51590         /*
51591          * The completion ring to send the completion event on. This should
51592          * be the NQ ID returned from the `nq_alloc` HWRM command.
51593          */
51594         uint16_t        cmpl_ring;
51595         /*
51596          * The sequence ID is used by the driver for tracking multiple
51597          * commands. This ID is treated as opaque data by the firmware and
51598          * the value is returned in the `hwrm_resp_hdr` upon completion.
51599          */
51600         uint16_t        seq_id;
51601         /*
51602          * The target ID of the command:
51603          * * 0x0-0xFFF8 - The function ID
51604          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51605          * * 0xFFFD - Reserved for user-space HWRM interface
51606          * * 0xFFFF - HWRM
51607          */
51608         uint16_t        target_id;
51609         /*
51610          * A physical address pointer pointing to a host buffer that the
51611          * command's response data will be written. This can be either a host
51612          * physical address (HPA) or a guest physical address (GPA) and must
51613          * point to a physically contiguous block of memory.
51614          */
51615         uint64_t        resp_addr;
51616         /* Session Id. */
51617         uint32_t        fw_session_id;
51618         /* Control flags. */
51619         uint16_t        flags;
51620         /* Indicates the flow direction. */
51621         #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR     UINT32_C(0x1)
51622         /* If this bit set to 0, then it indicates rx flow. */
51623         #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
51624         /* If this bit is set to 1, then it indicates tx flow. */
51625         #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
51626         #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_LAST \
51627                 HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX
51628         /* Number of EM entry blocks */
51629         uint16_t        num_blocks;
51630         /* New index for entry */
51631         uint32_t        new_index;
51632         /* Unused */
51633         uint32_t        unused0;
51634         /* EM internal flow handle. */
51635         uint64_t        flow_handle;
51636 } __rte_packed;
51637
51638 /* hwrm_tf_em_move_output (size:128b/16B) */
51639 struct hwrm_tf_em_move_output {
51640         /* The specific error status for the command. */
51641         uint16_t        error_code;
51642         /* The HWRM command request type. */
51643         uint16_t        req_type;
51644         /* The sequence ID from the original command. */
51645         uint16_t        seq_id;
51646         /* The length of the response data in number of bytes. */
51647         uint16_t        resp_len;
51648         /* Index of old entry. */
51649         uint16_t        em_index;
51650         /* unused. */
51651         uint16_t        unused0[3];
51652 } __rte_packed;
51653
51654 /********************
51655  * hwrm_tf_tcam_set *
51656  ********************/
51657
51658
51659 /* hwrm_tf_tcam_set_input (size:1024b/128B) */
51660 struct hwrm_tf_tcam_set_input {
51661         /* The HWRM command request type. */
51662         uint16_t        req_type;
51663         /*
51664          * The completion ring to send the completion event on. This should
51665          * be the NQ ID returned from the `nq_alloc` HWRM command.
51666          */
51667         uint16_t        cmpl_ring;
51668         /*
51669          * The sequence ID is used by the driver for tracking multiple
51670          * commands. This ID is treated as opaque data by the firmware and
51671          * the value is returned in the `hwrm_resp_hdr` upon completion.
51672          */
51673         uint16_t        seq_id;
51674         /*
51675          * The target ID of the command:
51676          * * 0x0-0xFFF8 - The function ID
51677          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51678          * * 0xFFFD - Reserved for user-space HWRM interface
51679          * * 0xFFFF - HWRM
51680          */
51681         uint16_t        target_id;
51682         /*
51683          * A physical address pointer pointing to a host buffer that the
51684          * command's response data will be written. This can be either a host
51685          * physical address (HPA) or a guest physical address (GPA) and must
51686          * point to a physically contiguous block of memory.
51687          */
51688         uint64_t        resp_addr;
51689         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51690         uint32_t        fw_session_id;
51691         /* Control flags. */
51692         uint32_t        flags;
51693         /* Indicates the flow direction. */
51694         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
51695         /* If this bit set to 0, then it indicates rx flow. */
51696         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
51697         /* If this bit is set to 1, then it indicates tx flow. */
51698         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
51699         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_LAST \
51700                 HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX
51701         /*
51702          * Indicate device data is being sent via DMA, the device
51703          * data is packing does not change.
51704          */
51705         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA     UINT32_C(0x2)
51706         /*
51707          * TCAM type of the resource, defined globally in the
51708          * hwrm_tf_resc_type enum.
51709          */
51710         uint32_t        type;
51711         /* Index of TCAM entry. */
51712         uint16_t        idx;
51713         /* Number of bytes in the TCAM key. */
51714         uint8_t key_size;
51715         /* Number of bytes in the TCAM result. */
51716         uint8_t result_size;
51717         /*
51718          * Offset from which the mask bytes start in the device data
51719          * array, key offset is always 0.
51720          */
51721         uint8_t mask_offset;
51722         /* Offset from which the result bytes start in the device data array. */
51723         uint8_t result_offset;
51724         /* unused. */
51725         uint8_t unused0[6];
51726         /*
51727          * TCAM key located at offset 0, mask located at mask_offset
51728          * and result at result_offset for the device.
51729          */
51730         uint8_t dev_data[88];
51731 } __rte_packed;
51732
51733 /* hwrm_tf_tcam_set_output (size:128b/16B) */
51734 struct hwrm_tf_tcam_set_output {
51735         /* The specific error status for the command. */
51736         uint16_t        error_code;
51737         /* The HWRM command request type. */
51738         uint16_t        req_type;
51739         /* The sequence ID from the original command. */
51740         uint16_t        seq_id;
51741         /* The length of the response data in number of bytes. */
51742         uint16_t        resp_len;
51743         /* unused. */
51744         uint8_t unused0[7];
51745         /*
51746          * This field is used in Output records to indicate that the
51747          * output is completely written to RAM. This field should be
51748          * read as '1' to indicate that the output has been
51749          * completely written.  When writing a command completion or
51750          * response to an internal processor, the order of writes has
51751          * to be such that this field is written last.
51752          */
51753         uint8_t valid;
51754 } __rte_packed;
51755
51756 /********************
51757  * hwrm_tf_tcam_get *
51758  ********************/
51759
51760
51761 /* hwrm_tf_tcam_get_input (size:256b/32B) */
51762 struct hwrm_tf_tcam_get_input {
51763         /* The HWRM command request type. */
51764         uint16_t        req_type;
51765         /*
51766          * The completion ring to send the completion event on. This should
51767          * be the NQ ID returned from the `nq_alloc` HWRM command.
51768          */
51769         uint16_t        cmpl_ring;
51770         /*
51771          * The sequence ID is used by the driver for tracking multiple
51772          * commands. This ID is treated as opaque data by the firmware and
51773          * the value is returned in the `hwrm_resp_hdr` upon completion.
51774          */
51775         uint16_t        seq_id;
51776         /*
51777          * The target ID of the command:
51778          * * 0x0-0xFFF8 - The function ID
51779          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51780          * * 0xFFFD - Reserved for user-space HWRM interface
51781          * * 0xFFFF - HWRM
51782          */
51783         uint16_t        target_id;
51784         /*
51785          * A physical address pointer pointing to a host buffer that the
51786          * command's response data will be written. This can be either a host
51787          * physical address (HPA) or a guest physical address (GPA) and must
51788          * point to a physically contiguous block of memory.
51789          */
51790         uint64_t        resp_addr;
51791         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51792         uint32_t        fw_session_id;
51793         /* Control flags. */
51794         uint32_t        flags;
51795         /* Indicates the flow direction. */
51796         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
51797         /* If this bit set to 0, then it indicates rx flow. */
51798         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
51799         /* If this bit is set to 1, then it indicates tx flow. */
51800         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
51801         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_LAST \
51802                 HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX
51803         /*
51804          * TCAM type of the resource, defined globally in the
51805          * hwrm_tf_resc_type enum.
51806          */
51807         uint32_t        type;
51808         /* Index of a TCAM entry. */
51809         uint16_t        idx;
51810         /* unused. */
51811         uint16_t        unused0;
51812 } __rte_packed;
51813
51814 /* hwrm_tf_tcam_get_output (size:2368b/296B) */
51815 struct hwrm_tf_tcam_get_output {
51816         /* The specific error status for the command. */
51817         uint16_t        error_code;
51818         /* The HWRM command request type. */
51819         uint16_t        req_type;
51820         /* The sequence ID from the original command. */
51821         uint16_t        seq_id;
51822         /* The length of the response data in number of bytes. */
51823         uint16_t        resp_len;
51824         /* Number of bytes in the TCAM key. */
51825         uint8_t key_size;
51826         /* Number of bytes in the TCAM entry. */
51827         uint8_t result_size;
51828         /* Offset from which the mask bytes start in the device data array. */
51829         uint8_t mask_offset;
51830         /* Offset from which the result bytes start in the device data array. */
51831         uint8_t result_offset;
51832         /* unused. */
51833         uint8_t unused0[4];
51834         /*
51835          * TCAM key located at offset 0, mask located at mask_offset
51836          * and result at result_offset for the device.
51837          */
51838         uint8_t dev_data[272];
51839         /* unused. */
51840         uint8_t unused1[7];
51841         /*
51842          * This field is used in Output records to indicate that the
51843          * output is completely written to RAM. This field should be
51844          * read as '1' to indicate that the output has been
51845          * completely written.  When writing a command completion or
51846          * response to an internal processor, the order of writes has
51847          * to be such that this field is written last.
51848          */
51849         uint8_t valid;
51850 } __rte_packed;
51851
51852 /*********************
51853  * hwrm_tf_tcam_move *
51854  *********************/
51855
51856
51857 /* hwrm_tf_tcam_move_input (size:1024b/128B) */
51858 struct hwrm_tf_tcam_move_input {
51859         /* The HWRM command request type. */
51860         uint16_t        req_type;
51861         /*
51862          * The completion ring to send the completion event on. This should
51863          * be the NQ ID returned from the `nq_alloc` HWRM command.
51864          */
51865         uint16_t        cmpl_ring;
51866         /*
51867          * The sequence ID is used by the driver for tracking multiple
51868          * commands. This ID is treated as opaque data by the firmware and
51869          * the value is returned in the `hwrm_resp_hdr` upon completion.
51870          */
51871         uint16_t        seq_id;
51872         /*
51873          * The target ID of the command:
51874          * * 0x0-0xFFF8 - The function ID
51875          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51876          * * 0xFFFD - Reserved for user-space HWRM interface
51877          * * 0xFFFF - HWRM
51878          */
51879         uint16_t        target_id;
51880         /*
51881          * A physical address pointer pointing to a host buffer that the
51882          * command's response data will be written. This can be either a host
51883          * physical address (HPA) or a guest physical address (GPA) and must
51884          * point to a physically contiguous block of memory.
51885          */
51886         uint64_t        resp_addr;
51887         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51888         uint32_t        fw_session_id;
51889         /* Control flags. */
51890         uint32_t        flags;
51891         /* Indicates the flow direction. */
51892         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR     UINT32_C(0x1)
51893         /* If this bit set to 0, then it indicates rx flow. */
51894         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
51895         /* If this bit is set to 1, then it indicates tx flow. */
51896         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
51897         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_LAST \
51898                 HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX
51899         /*
51900          * TCAM type of the resource, defined globally in the
51901          * hwrm_tf_resc_type enum.
51902          */
51903         uint32_t        type;
51904         /* Number of TCAM index pairs to be swapped for the device. */
51905         uint16_t        count;
51906         /* unused. */
51907         uint16_t        unused0;
51908         /* TCAM index pairs to be swapped for the device. */
51909         uint16_t        idx_pairs[48];
51910 } __rte_packed;
51911
51912 /* hwrm_tf_tcam_move_output (size:128b/16B) */
51913 struct hwrm_tf_tcam_move_output {
51914         /* The specific error status for the command. */
51915         uint16_t        error_code;
51916         /* The HWRM command request type. */
51917         uint16_t        req_type;
51918         /* The sequence ID from the original command. */
51919         uint16_t        seq_id;
51920         /* The length of the response data in number of bytes. */
51921         uint16_t        resp_len;
51922         /* unused. */
51923         uint8_t unused0[7];
51924         /*
51925          * This field is used in Output records to indicate that the
51926          * output is completely written to RAM. This field should be
51927          * read as '1' to indicate that the output has been
51928          * completely written.  When writing a command completion or
51929          * response to an internal processor, the order of writes has
51930          * to be such that this field is written last.
51931          */
51932         uint8_t valid;
51933 } __rte_packed;
51934
51935 /*********************
51936  * hwrm_tf_tcam_free *
51937  *********************/
51938
51939
51940 /* hwrm_tf_tcam_free_input (size:1024b/128B) */
51941 struct hwrm_tf_tcam_free_input {
51942         /* The HWRM command request type. */
51943         uint16_t        req_type;
51944         /*
51945          * The completion ring to send the completion event on. This should
51946          * be the NQ ID returned from the `nq_alloc` HWRM command.
51947          */
51948         uint16_t        cmpl_ring;
51949         /*
51950          * The sequence ID is used by the driver for tracking multiple
51951          * commands. This ID is treated as opaque data by the firmware and
51952          * the value is returned in the `hwrm_resp_hdr` upon completion.
51953          */
51954         uint16_t        seq_id;
51955         /*
51956          * The target ID of the command:
51957          * * 0x0-0xFFF8 - The function ID
51958          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
51959          * * 0xFFFD - Reserved for user-space HWRM interface
51960          * * 0xFFFF - HWRM
51961          */
51962         uint16_t        target_id;
51963         /*
51964          * A physical address pointer pointing to a host buffer that the
51965          * command's response data will be written. This can be either a host
51966          * physical address (HPA) or a guest physical address (GPA) and must
51967          * point to a physically contiguous block of memory.
51968          */
51969         uint64_t        resp_addr;
51970         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
51971         uint32_t        fw_session_id;
51972         /* Control flags. */
51973         uint32_t        flags;
51974         /* Indicates the flow direction. */
51975         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR     UINT32_C(0x1)
51976         /* If this bit set to 0, then it indicates rx flow. */
51977         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
51978         /* If this bit is set to 1, then it indicates tx flow. */
51979         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
51980         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_LAST \
51981                 HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX
51982         /*
51983          * TCAM type of the resource, defined globally in the
51984          * hwrm_tf_resc_type enum.
51985          */
51986         uint32_t        type;
51987         /* Number of TCAM index to be deleted for the device. */
51988         uint16_t        count;
51989         /* unused. */
51990         uint16_t        unused0;
51991         /* TCAM index list to be deleted for the device. */
51992         uint16_t        idx_list[48];
51993 } __rte_packed;
51994
51995 /* hwrm_tf_tcam_free_output (size:128b/16B) */
51996 struct hwrm_tf_tcam_free_output {
51997         /* The specific error status for the command. */
51998         uint16_t        error_code;
51999         /* The HWRM command request type. */
52000         uint16_t        req_type;
52001         /* The sequence ID from the original command. */
52002         uint16_t        seq_id;
52003         /* The length of the response data in number of bytes. */
52004         uint16_t        resp_len;
52005         /* unused. */
52006         uint8_t unused0[7];
52007         /*
52008          * This field is used in Output records to indicate that the
52009          * output is completely written to RAM. This field should be
52010          * read as '1' to indicate that the output has been
52011          * completely written.  When writing a command completion or
52012          * response to an internal processor, the order of writes has
52013          * to be such that this field is written last.
52014          */
52015         uint8_t valid;
52016 } __rte_packed;
52017
52018 /**************************
52019  * hwrm_tf_global_cfg_set *
52020  **************************/
52021
52022
52023 /* hwrm_tf_global_cfg_set_input (size:448b/56B) */
52024 struct hwrm_tf_global_cfg_set_input {
52025         /* The HWRM command request type. */
52026         uint16_t        req_type;
52027         /*
52028          * The completion ring to send the completion event on. This should
52029          * be the NQ ID returned from the `nq_alloc` HWRM command.
52030          */
52031         uint16_t        cmpl_ring;
52032         /*
52033          * The sequence ID is used by the driver for tracking multiple
52034          * commands. This ID is treated as opaque data by the firmware and
52035          * the value is returned in the `hwrm_resp_hdr` upon completion.
52036          */
52037         uint16_t        seq_id;
52038         /*
52039          * The target ID of the command:
52040          * * 0x0-0xFFF8 - The function ID
52041          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52042          * * 0xFFFD - Reserved for user-space HWRM interface
52043          * * 0xFFFF - HWRM
52044          */
52045         uint16_t        target_id;
52046         /*
52047          * A physical address pointer pointing to a host buffer that the
52048          * command's response data will be written. This can be either a host
52049          * physical address (HPA) or a guest physical address (GPA) and must
52050          * point to a physically contiguous block of memory.
52051          */
52052         uint64_t        resp_addr;
52053         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
52054         uint32_t        fw_session_id;
52055         /* Control flags. */
52056         uint32_t        flags;
52057         /* Indicates the flow direction. */
52058         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
52059         /* If this bit set to 0, then it indicates rx flow. */
52060         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
52061         /* If this bit is set to 1, then it indicates tx flow. */
52062         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
52063         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_LAST \
52064                 HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX
52065         /* Global Cfg type */
52066         uint32_t        type;
52067         /* Offset of the type */
52068         uint32_t        offset;
52069         /* Size of the data to set in bytes */
52070         uint16_t        size;
52071         /* unused. */
52072         uint8_t unused0[6];
52073         /* Data to set */
52074         uint8_t data[8];
52075         /* Mask of data to set, 0 indicates no mask */
52076         uint8_t mask[8];
52077 } __rte_packed;
52078
52079 /* hwrm_tf_global_cfg_set_output (size:128b/16B) */
52080 struct hwrm_tf_global_cfg_set_output {
52081         /* The specific error status for the command. */
52082         uint16_t        error_code;
52083         /* The HWRM command request type. */
52084         uint16_t        req_type;
52085         /* The sequence ID from the original command. */
52086         uint16_t        seq_id;
52087         /* The length of the response data in number of bytes. */
52088         uint16_t        resp_len;
52089         /* unused. */
52090         uint8_t unused0[7];
52091         /*
52092          * This field is used in Output records to indicate that the
52093          * output is completely written to RAM. This field should be
52094          * read as '1' to indicate that the output has been
52095          * completely written.  When writing a command completion or
52096          * response to an internal processor, the order of writes has
52097          * to be such that this field is written last.
52098          */
52099         uint8_t valid;
52100 } __rte_packed;
52101
52102 /**************************
52103  * hwrm_tf_global_cfg_get *
52104  **************************/
52105
52106
52107 /* hwrm_tf_global_cfg_get_input (size:320b/40B) */
52108 struct hwrm_tf_global_cfg_get_input {
52109         /* The HWRM command request type. */
52110         uint16_t        req_type;
52111         /*
52112          * The completion ring to send the completion event on. This should
52113          * be the NQ ID returned from the `nq_alloc` HWRM command.
52114          */
52115         uint16_t        cmpl_ring;
52116         /*
52117          * The sequence ID is used by the driver for tracking multiple
52118          * commands. This ID is treated as opaque data by the firmware and
52119          * the value is returned in the `hwrm_resp_hdr` upon completion.
52120          */
52121         uint16_t        seq_id;
52122         /*
52123          * The target ID of the command:
52124          * * 0x0-0xFFF8 - The function ID
52125          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52126          * * 0xFFFD - Reserved for user-space HWRM interface
52127          * * 0xFFFF - HWRM
52128          */
52129         uint16_t        target_id;
52130         /*
52131          * A physical address pointer pointing to a host buffer that the
52132          * command's response data will be written. This can be either a host
52133          * physical address (HPA) or a guest physical address (GPA) and must
52134          * point to a physically contiguous block of memory.
52135          */
52136         uint64_t        resp_addr;
52137         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
52138         uint32_t        fw_session_id;
52139         /* Control flags. */
52140         uint32_t        flags;
52141         /* Indicates the flow direction. */
52142         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
52143         /* If this bit set to 0, then it indicates rx flow. */
52144         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
52145         /* If this bit is set to 1, then it indicates tx flow. */
52146         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
52147         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_LAST \
52148                 HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX
52149         /* Global Cfg type */
52150         uint32_t        type;
52151         /* Offset of the type */
52152         uint32_t        offset;
52153         /* Size of the data to set in bytes */
52154         uint16_t        size;
52155         /* unused. */
52156         uint8_t unused0[6];
52157 } __rte_packed;
52158
52159 /* hwrm_tf_global_cfg_get_output (size:256b/32B) */
52160 struct hwrm_tf_global_cfg_get_output {
52161         /* The specific error status for the command. */
52162         uint16_t        error_code;
52163         /* The HWRM command request type. */
52164         uint16_t        req_type;
52165         /* The sequence ID from the original command. */
52166         uint16_t        seq_id;
52167         /* The length of the response data in number of bytes. */
52168         uint16_t        resp_len;
52169         /* Size of the data read in bytes */
52170         uint16_t        size;
52171         /* unused. */
52172         uint8_t unused0[6];
52173         /* Data to set */
52174         uint8_t data[16];
52175 } __rte_packed;
52176
52177 /**********************
52178  * hwrm_tf_if_tbl_get *
52179  **********************/
52180
52181
52182 /* hwrm_tf_if_tbl_get_input (size:256b/32B) */
52183 struct hwrm_tf_if_tbl_get_input {
52184         /* The HWRM command request type. */
52185         uint16_t        req_type;
52186         /*
52187          * The completion ring to send the completion event on. This should
52188          * be the NQ ID returned from the `nq_alloc` HWRM command.
52189          */
52190         uint16_t        cmpl_ring;
52191         /*
52192          * The sequence ID is used by the driver for tracking multiple
52193          * commands. This ID is treated as opaque data by the firmware and
52194          * the value is returned in the `hwrm_resp_hdr` upon completion.
52195          */
52196         uint16_t        seq_id;
52197         /*
52198          * The target ID of the command:
52199          * * 0x0-0xFFF8 - The function ID
52200          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52201          * * 0xFFFD - Reserved for user-space HWRM interface
52202          * * 0xFFFF - HWRM
52203          */
52204         uint16_t        target_id;
52205         /*
52206          * A physical address pointer pointing to a host buffer that the
52207          * command's response data will be written. This can be either a host
52208          * physical address (HPA) or a guest physical address (GPA) and must
52209          * point to a physically contiguous block of memory.
52210          */
52211         uint64_t        resp_addr;
52212         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
52213         uint32_t        fw_session_id;
52214         /* Control flags. */
52215         uint16_t        flags;
52216         /* Indicates the flow direction. */
52217         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
52218         /* If this bit set to 0, then it indicates rx flow. */
52219         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
52220         /* If this bit is set to 1, then it indicates tx flow. */
52221         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
52222         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_LAST \
52223                 HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX
52224         /* Size of the data to set. */
52225         uint16_t        size;
52226         /*
52227          * Type of the resource, defined globally in the
52228          * hwrm_tf_resc_type enum.
52229          */
52230         uint32_t        type;
52231         /* Index of the type to retrieve. */
52232         uint32_t        index;
52233 } __rte_packed;
52234
52235 /* hwrm_tf_if_tbl_get_output (size:1216b/152B) */
52236 struct hwrm_tf_if_tbl_get_output {
52237         /* The specific error status for the command. */
52238         uint16_t        error_code;
52239         /* The HWRM command request type. */
52240         uint16_t        req_type;
52241         /* The sequence ID from the original command. */
52242         uint16_t        seq_id;
52243         /* The length of the response data in number of bytes. */
52244         uint16_t        resp_len;
52245         /* Response code. */
52246         uint32_t        resp_code;
52247         /* Response size. */
52248         uint16_t        size;
52249         /* unused */
52250         uint16_t        unused0;
52251         /* Response data. */
52252         uint8_t data[128];
52253         /* unused */
52254         uint8_t unused1[7];
52255         /*
52256          * This field is used in Output records to indicate that the output
52257          * is completely written to RAM. This field should be read as '1'
52258          * to indicate that the output has been completely written.
52259          * When writing a command completion or response to an internal
52260          * processor, the order of writes has to be such that this field
52261          * is written last.
52262          */
52263         uint8_t valid;
52264 } __rte_packed;
52265
52266 /***************************
52267  * hwrm_tf_if_tbl_type_set *
52268  ***************************/
52269
52270
52271 /* hwrm_tf_if_tbl_set_input (size:1024b/128B) */
52272 struct hwrm_tf_if_tbl_set_input {
52273         /* The HWRM command request type. */
52274         uint16_t        req_type;
52275         /*
52276          * The completion ring to send the completion event on. This should
52277          * be the NQ ID returned from the `nq_alloc` HWRM command.
52278          */
52279         uint16_t        cmpl_ring;
52280         /*
52281          * The sequence ID is used by the driver for tracking multiple
52282          * commands. This ID is treated as opaque data by the firmware and
52283          * the value is returned in the `hwrm_resp_hdr` upon completion.
52284          */
52285         uint16_t        seq_id;
52286         /*
52287          * The target ID of the command:
52288          * * 0x0-0xFFF8 - The function ID
52289          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52290          * * 0xFFFD - Reserved for user-space HWRM interface
52291          * * 0xFFFF - HWRM
52292          */
52293         uint16_t        target_id;
52294         /*
52295          * A physical address pointer pointing to a host buffer that the
52296          * command's response data will be written. This can be either a host
52297          * physical address (HPA) or a guest physical address (GPA) and must
52298          * point to a physically contiguous block of memory.
52299          */
52300         uint64_t        resp_addr;
52301         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
52302         uint32_t        fw_session_id;
52303         /* Control flags. */
52304         uint16_t        flags;
52305         /* Indicates the flow direction. */
52306         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
52307         /* If this bit set to 0, then it indicates rx flow. */
52308         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
52309         /* If this bit is set to 1, then it indicates tx flow. */
52310         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
52311         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_LAST \
52312                 HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX
52313         /* unused. */
52314         uint8_t unused0[2];
52315         /*
52316          * Type of the resource, defined globally in the
52317          * hwrm_tf_resc_type enum.
52318          */
52319         uint32_t        type;
52320         /* Index of the type to set. */
52321         uint32_t        index;
52322         /* Size of the data to set. */
52323         uint16_t        size;
52324         /* unused */
52325         uint8_t unused1[6];
52326         /* Data to be set. */
52327         uint8_t data[88];
52328 } __rte_packed;
52329
52330 /* hwrm_tf_if_tbl_set_output (size:128b/16B) */
52331 struct hwrm_tf_if_tbl_set_output {
52332         /* The specific error status for the command. */
52333         uint16_t        error_code;
52334         /* The HWRM command request type. */
52335         uint16_t        req_type;
52336         /* The sequence ID from the original command. */
52337         uint16_t        seq_id;
52338         /* The length of the response data in number of bytes. */
52339         uint16_t        resp_len;
52340         /* unused. */
52341         uint8_t unused0[7];
52342         /*
52343          * This field is used in Output records to indicate that the output
52344          * is completely written to RAM. This field should be read as '1'
52345          * to indicate that the output has been completely written.
52346          * When writing a command completion or response to an internal
52347          * processor, the order of writes has to be such that this field
52348          * is written last.
52349          */
52350         uint8_t valid;
52351 } __rte_packed;
52352
52353 /*****************************
52354  * hwrm_tf_tbl_type_bulk_get *
52355  *****************************/
52356
52357
52358 /* hwrm_tf_tbl_type_bulk_get_input (size:384b/48B) */
52359 struct hwrm_tf_tbl_type_bulk_get_input {
52360         /* The HWRM command request type. */
52361         uint16_t        req_type;
52362         /*
52363          * The completion ring to send the completion event on. This should
52364          * be the NQ ID returned from the `nq_alloc` HWRM command.
52365          */
52366         uint16_t        cmpl_ring;
52367         /*
52368          * The sequence ID is used by the driver for tracking multiple
52369          * commands. This ID is treated as opaque data by the firmware and
52370          * the value is returned in the `hwrm_resp_hdr` upon completion.
52371          */
52372         uint16_t        seq_id;
52373         /*
52374          * The target ID of the command:
52375          * * 0x0-0xFFF8 - The function ID
52376          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52377          * * 0xFFFD - Reserved for user-space HWRM interface
52378          * * 0xFFFF - HWRM
52379          */
52380         uint16_t        target_id;
52381         /*
52382          * A physical address pointer pointing to a host buffer that the
52383          * command's response data will be written. This can be either a host
52384          * physical address (HPA) or a guest physical address (GPA) and must
52385          * point to a physically contiguous block of memory.
52386          */
52387         uint64_t        resp_addr;
52388         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
52389         uint32_t        fw_session_id;
52390         /* Control flags. */
52391         uint16_t        flags;
52392         /* Indicates the flow direction. */
52393         #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR \
52394                 UINT32_C(0x1)
52395         /* If this bit set to 0, then it indicates rx flow. */
52396         #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_RX \
52397                 UINT32_C(0x0)
52398         /* If this bit is set to 1, then it indicates tx flow. */
52399         #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX \
52400                 UINT32_C(0x1)
52401         #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_LAST \
52402                 HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX
52403         /*
52404          * When set use the special access register access to clear
52405          * the table entries on read.
52406          */
52407         #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_CLEAR_ON_READ \
52408                 UINT32_C(0x2)
52409         /* unused. */
52410         uint8_t unused0[2];
52411         /*
52412          * Type of the resource, defined globally in the
52413          * hwrm_tf_resc_type enum.
52414          */
52415         uint32_t        type;
52416         /* Starting index of the type to retrieve. */
52417         uint32_t        start_index;
52418         /* Number of entries to retrieve. */
52419         uint32_t        num_entries;
52420         /* Number of entries to retrieve. */
52421         uint32_t        unused1;
52422         /* Host memory where data will be stored. */
52423         uint64_t        host_addr;
52424 } __rte_packed;
52425
52426 /* hwrm_tf_tbl_type_bulk_get_output (size:128b/16B) */
52427 struct hwrm_tf_tbl_type_bulk_get_output {
52428         /* The specific error status for the command. */
52429         uint16_t        error_code;
52430         /* The HWRM command request type. */
52431         uint16_t        req_type;
52432         /* The sequence ID from the original command. */
52433         uint16_t        seq_id;
52434         /* The length of the response data in number of bytes. */
52435         uint16_t        resp_len;
52436         /* Response code. */
52437         uint32_t        resp_code;
52438         /* Response size. */
52439         uint16_t        size;
52440         /* unused */
52441         uint8_t unused0;
52442         /*
52443          * This field is used in Output records to indicate that the output
52444          * is completely written to RAM. This field should be read as '1'
52445          * to indicate that the output has been completely written.
52446          * When writing a command completion or response to an internal
52447          * processor, the order of writes has to be such that this field
52448          * is written last.
52449          */
52450         uint8_t valid;
52451 } __rte_packed;
52452
52453 /******************************
52454  * hwrm_tunnel_dst_port_query *
52455  ******************************/
52456
52457
52458 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
52459 struct hwrm_tunnel_dst_port_query_input {
52460         /* The HWRM command request type. */
52461         uint16_t        req_type;
52462         /*
52463          * The completion ring to send the completion event on. This should
52464          * be the NQ ID returned from the `nq_alloc` HWRM command.
52465          */
52466         uint16_t        cmpl_ring;
52467         /*
52468          * The sequence ID is used by the driver for tracking multiple
52469          * commands. This ID is treated as opaque data by the firmware and
52470          * the value is returned in the `hwrm_resp_hdr` upon completion.
52471          */
52472         uint16_t        seq_id;
52473         /*
52474          * The target ID of the command:
52475          * * 0x0-0xFFF8 - The function ID
52476          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52477          * * 0xFFFD - Reserved for user-space HWRM interface
52478          * * 0xFFFF - HWRM
52479          */
52480         uint16_t        target_id;
52481         /*
52482          * A physical address pointer pointing to a host buffer that the
52483          * command's response data will be written. This can be either a host
52484          * physical address (HPA) or a guest physical address (GPA) and must
52485          * point to a physically contiguous block of memory.
52486          */
52487         uint64_t        resp_addr;
52488         /* Tunnel Type. */
52489         uint8_t tunnel_type;
52490         /* Virtual eXtensible Local Area Network (VXLAN) */
52491         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
52492                 UINT32_C(0x1)
52493         /* Generic Network Virtualization Encapsulation (Geneve) */
52494         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
52495                 UINT32_C(0x5)
52496         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
52497         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 \
52498                 UINT32_C(0x9)
52499         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
52500         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 \
52501                 UINT32_C(0xa)
52502         /* Use fixed layer 2 ether type of 0xFFFF */
52503         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_L2_ETYPE \
52504                 UINT32_C(0xb)
52505         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
52506         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
52507                 UINT32_C(0xc)
52508         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST \
52509                 HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
52510         uint8_t unused_0[7];
52511 } __rte_packed;
52512
52513 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
52514 struct hwrm_tunnel_dst_port_query_output {
52515         /* The specific error status for the command. */
52516         uint16_t        error_code;
52517         /* The HWRM command request type. */
52518         uint16_t        req_type;
52519         /* The sequence ID from the original command. */
52520         uint16_t        seq_id;
52521         /* The length of the response data in number of bytes. */
52522         uint16_t        resp_len;
52523         /*
52524          * This field represents the identifier of L4 destination port
52525          * used for the given tunnel type. This field is valid for
52526          * specific tunnel types that use layer 4 (e.g. UDP)
52527          * transports for tunneling.
52528          */
52529         uint16_t        tunnel_dst_port_id;
52530         /*
52531          * This field represents the value of L4 destination port
52532          * identified by tunnel_dst_port_id. This field is valid for
52533          * specific tunnel types that use layer 4 (e.g. UDP)
52534          * transports for tunneling.
52535          * This field is in network byte order.
52536          *
52537          * A value of 0 means that the destination port is not
52538          * configured.
52539          */
52540         uint16_t        tunnel_dst_port_val;
52541         uint8_t unused_0[3];
52542         /*
52543          * This field is used in Output records to indicate that the output
52544          * is completely written to RAM.  This field should be read as '1'
52545          * to indicate that the output has been completely written.
52546          * When writing a command completion or response to an internal processor,
52547          * the order of writes has to be such that this field is written last.
52548          */
52549         uint8_t valid;
52550 } __rte_packed;
52551
52552 /******************************
52553  * hwrm_tunnel_dst_port_alloc *
52554  ******************************/
52555
52556
52557 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
52558 struct hwrm_tunnel_dst_port_alloc_input {
52559         /* The HWRM command request type. */
52560         uint16_t        req_type;
52561         /*
52562          * The completion ring to send the completion event on. This should
52563          * be the NQ ID returned from the `nq_alloc` HWRM command.
52564          */
52565         uint16_t        cmpl_ring;
52566         /*
52567          * The sequence ID is used by the driver for tracking multiple
52568          * commands. This ID is treated as opaque data by the firmware and
52569          * the value is returned in the `hwrm_resp_hdr` upon completion.
52570          */
52571         uint16_t        seq_id;
52572         /*
52573          * The target ID of the command:
52574          * * 0x0-0xFFF8 - The function ID
52575          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52576          * * 0xFFFD - Reserved for user-space HWRM interface
52577          * * 0xFFFF - HWRM
52578          */
52579         uint16_t        target_id;
52580         /*
52581          * A physical address pointer pointing to a host buffer that the
52582          * command's response data will be written. This can be either a host
52583          * physical address (HPA) or a guest physical address (GPA) and must
52584          * point to a physically contiguous block of memory.
52585          */
52586         uint64_t        resp_addr;
52587         /* Tunnel Type. */
52588         uint8_t tunnel_type;
52589         /* Virtual eXtensible Local Area Network (VXLAN) */
52590         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
52591                 UINT32_C(0x1)
52592         /* Generic Network Virtualization Encapsulation (Geneve) */
52593         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
52594                 UINT32_C(0x5)
52595         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
52596         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
52597                 UINT32_C(0x9)
52598         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
52599         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
52600                 UINT32_C(0xa)
52601         /* Use fixed layer 2 ether type of 0xFFFF */
52602         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
52603                 UINT32_C(0xb)
52604         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
52605         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
52606                 UINT32_C(0xc)
52607         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST \
52608                 HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
52609         uint8_t unused_0;
52610         /*
52611          * This field represents the value of L4 destination port used
52612          * for the given tunnel type. This field is valid for
52613          * specific tunnel types that use layer 4 (e.g. UDP)
52614          * transports for tunneling.
52615          *
52616          * This field is in network byte order.
52617          *
52618          * A value of 0 shall fail the command.
52619          */
52620         uint16_t        tunnel_dst_port_val;
52621         uint8_t unused_1[4];
52622 } __rte_packed;
52623
52624 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
52625 struct hwrm_tunnel_dst_port_alloc_output {
52626         /* The specific error status for the command. */
52627         uint16_t        error_code;
52628         /* The HWRM command request type. */
52629         uint16_t        req_type;
52630         /* The sequence ID from the original command. */
52631         uint16_t        seq_id;
52632         /* The length of the response data in number of bytes. */
52633         uint16_t        resp_len;
52634         /*
52635          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
52636          * types that has l4 destination port parameters.
52637          */
52638         uint16_t        tunnel_dst_port_id;
52639         uint8_t unused_0[5];
52640         /*
52641          * This field is used in Output records to indicate that the output
52642          * is completely written to RAM.  This field should be read as '1'
52643          * to indicate that the output has been completely written.
52644          * When writing a command completion or response to an internal processor,
52645          * the order of writes has to be such that this field is written last.
52646          */
52647         uint8_t valid;
52648 } __rte_packed;
52649
52650 /*****************************
52651  * hwrm_tunnel_dst_port_free *
52652  *****************************/
52653
52654
52655 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
52656 struct hwrm_tunnel_dst_port_free_input {
52657         /* The HWRM command request type. */
52658         uint16_t        req_type;
52659         /*
52660          * The completion ring to send the completion event on. This should
52661          * be the NQ ID returned from the `nq_alloc` HWRM command.
52662          */
52663         uint16_t        cmpl_ring;
52664         /*
52665          * The sequence ID is used by the driver for tracking multiple
52666          * commands. This ID is treated as opaque data by the firmware and
52667          * the value is returned in the `hwrm_resp_hdr` upon completion.
52668          */
52669         uint16_t        seq_id;
52670         /*
52671          * The target ID of the command:
52672          * * 0x0-0xFFF8 - The function ID
52673          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52674          * * 0xFFFD - Reserved for user-space HWRM interface
52675          * * 0xFFFF - HWRM
52676          */
52677         uint16_t        target_id;
52678         /*
52679          * A physical address pointer pointing to a host buffer that the
52680          * command's response data will be written. This can be either a host
52681          * physical address (HPA) or a guest physical address (GPA) and must
52682          * point to a physically contiguous block of memory.
52683          */
52684         uint64_t        resp_addr;
52685         /* Tunnel Type. */
52686         uint8_t tunnel_type;
52687         /* Virtual eXtensible Local Area Network (VXLAN) */
52688         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN \
52689                 UINT32_C(0x1)
52690         /* Generic Network Virtualization Encapsulation (Geneve) */
52691         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE \
52692                 UINT32_C(0x5)
52693         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
52694         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
52695                 UINT32_C(0x9)
52696         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
52697         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
52698                 UINT32_C(0xa)
52699         /* Use fixed layer 2 ether type of 0xFFFF */
52700         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
52701                 UINT32_C(0xb)
52702         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
52703         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
52704                 UINT32_C(0xc)
52705         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST \
52706                 HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
52707         uint8_t unused_0;
52708         /*
52709          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
52710          * types that has l4 destination port parameters.
52711          */
52712         uint16_t        tunnel_dst_port_id;
52713         uint8_t unused_1[4];
52714 } __rte_packed;
52715
52716 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
52717 struct hwrm_tunnel_dst_port_free_output {
52718         /* The specific error status for the command. */
52719         uint16_t        error_code;
52720         /* The HWRM command request type. */
52721         uint16_t        req_type;
52722         /* The sequence ID from the original command. */
52723         uint16_t        seq_id;
52724         /* The length of the response data in number of bytes. */
52725         uint16_t        resp_len;
52726         uint8_t unused_1[7];
52727         /*
52728          * This field is used in Output records to indicate that the output
52729          * is completely written to RAM.  This field should be read as '1'
52730          * to indicate that the output has been completely written.
52731          * When writing a command completion or response to an internal processor,
52732          * the order of writes has to be such that this field is written last.
52733          */
52734         uint8_t valid;
52735 } __rte_packed;
52736
52737 /* Periodic statistics context DMA to host. */
52738 /* ctx_hw_stats (size:1280b/160B) */
52739 struct ctx_hw_stats {
52740         /* Number of received unicast packets */
52741         uint64_t        rx_ucast_pkts;
52742         /* Number of received multicast packets */
52743         uint64_t        rx_mcast_pkts;
52744         /* Number of received broadcast packets */
52745         uint64_t        rx_bcast_pkts;
52746         /* Number of discarded packets on receive path */
52747         uint64_t        rx_discard_pkts;
52748         /* Number of packets on receive path with error */
52749         uint64_t        rx_error_pkts;
52750         /* Number of received bytes for unicast traffic */
52751         uint64_t        rx_ucast_bytes;
52752         /* Number of received bytes for multicast traffic */
52753         uint64_t        rx_mcast_bytes;
52754         /* Number of received bytes for broadcast traffic */
52755         uint64_t        rx_bcast_bytes;
52756         /* Number of transmitted unicast packets */
52757         uint64_t        tx_ucast_pkts;
52758         /* Number of transmitted multicast packets */
52759         uint64_t        tx_mcast_pkts;
52760         /* Number of transmitted broadcast packets */
52761         uint64_t        tx_bcast_pkts;
52762         /* Number of packets on transmit path with error */
52763         uint64_t        tx_error_pkts;
52764         /* Number of discarded packets on transmit path */
52765         uint64_t        tx_discard_pkts;
52766         /* Number of transmitted bytes for unicast traffic */
52767         uint64_t        tx_ucast_bytes;
52768         /* Number of transmitted bytes for multicast traffic */
52769         uint64_t        tx_mcast_bytes;
52770         /* Number of transmitted bytes for broadcast traffic */
52771         uint64_t        tx_bcast_bytes;
52772         /* Number of TPA packets */
52773         uint64_t        tpa_pkts;
52774         /* Number of TPA bytes */
52775         uint64_t        tpa_bytes;
52776         /* Number of TPA events */
52777         uint64_t        tpa_events;
52778         /* Number of TPA aborts */
52779         uint64_t        tpa_aborts;
52780 } __rte_packed;
52781
52782 /*
52783  * Extended periodic statistics context DMA to host. On cards that
52784  * support TPA v2, additional TPA related stats exist and can be retrieved
52785  * by DMA of ctx_hw_stats_ext, rather than legacy ctx_hw_stats structure.
52786  */
52787 /* ctx_hw_stats_ext (size:1408b/176B) */
52788 struct ctx_hw_stats_ext {
52789         /* Number of received unicast packets */
52790         uint64_t        rx_ucast_pkts;
52791         /* Number of received multicast packets */
52792         uint64_t        rx_mcast_pkts;
52793         /* Number of received broadcast packets */
52794         uint64_t        rx_bcast_pkts;
52795         /* Number of discarded packets on receive path */
52796         uint64_t        rx_discard_pkts;
52797         /* Number of packets on receive path with error */
52798         uint64_t        rx_error_pkts;
52799         /* Number of received bytes for unicast traffic */
52800         uint64_t        rx_ucast_bytes;
52801         /* Number of received bytes for multicast traffic */
52802         uint64_t        rx_mcast_bytes;
52803         /* Number of received bytes for broadcast traffic */
52804         uint64_t        rx_bcast_bytes;
52805         /* Number of transmitted unicast packets */
52806         uint64_t        tx_ucast_pkts;
52807         /* Number of transmitted multicast packets */
52808         uint64_t        tx_mcast_pkts;
52809         /* Number of transmitted broadcast packets */
52810         uint64_t        tx_bcast_pkts;
52811         /* Number of packets on transmit path with error */
52812         uint64_t        tx_error_pkts;
52813         /* Number of discarded packets on transmit path */
52814         uint64_t        tx_discard_pkts;
52815         /* Number of transmitted bytes for unicast traffic */
52816         uint64_t        tx_ucast_bytes;
52817         /* Number of transmitted bytes for multicast traffic */
52818         uint64_t        tx_mcast_bytes;
52819         /* Number of transmitted bytes for broadcast traffic */
52820         uint64_t        tx_bcast_bytes;
52821         /* Number of TPA eligible packets */
52822         uint64_t        rx_tpa_eligible_pkt;
52823         /* Number of TPA eligible bytes */
52824         uint64_t        rx_tpa_eligible_bytes;
52825         /* Number of TPA packets */
52826         uint64_t        rx_tpa_pkt;
52827         /* Number of TPA bytes */
52828         uint64_t        rx_tpa_bytes;
52829         /* Number of TPA errors */
52830         uint64_t        rx_tpa_errors;
52831         /* Number of TPA events */
52832         uint64_t        rx_tpa_events;
52833 } __rte_packed;
52834
52835 /* Periodic Engine statistics context DMA to host. */
52836 /* ctx_eng_stats (size:512b/64B) */
52837 struct ctx_eng_stats {
52838         /*
52839          * Count of data bytes into the Engine.
52840          * This includes any user supplied prefix,
52841          * but does not include any predefined
52842          * prefix data.
52843          */
52844         uint64_t        eng_bytes_in;
52845         /* Count of data bytes out of the Engine. */
52846         uint64_t        eng_bytes_out;
52847         /*
52848          * Count, in 4-byte (dword) units, of bytes
52849          * that are input as auxiliary data.
52850          * This includes the aux_cmd data.
52851          */
52852         uint64_t        aux_bytes_in;
52853         /*
52854          * Count, in 4-byte (dword) units, of bytes
52855          * that are output as auxiliary data.
52856          * This count is the buffer space for aux_data
52857          * output provided in the RQE, not the actual
52858          * aux_data written
52859          */
52860         uint64_t        aux_bytes_out;
52861         /* Count of number of commands executed. */
52862         uint64_t        commands;
52863         /*
52864          * Count of number of error commands.
52865          * These are the commands with a
52866          * non-zero status value.
52867          */
52868         uint64_t        error_commands;
52869         /*
52870          * Compression/Encryption Engine usage,
52871          * the unit is count of clock cycles
52872          */
52873         uint64_t        cce_engine_usage;
52874         /*
52875          * De-Compression/De-cryption Engine usage,
52876          * the unit is count of clock cycles
52877          */
52878         uint64_t        cdd_engine_usage;
52879 } __rte_packed;
52880
52881 /***********************
52882  * hwrm_stat_ctx_alloc *
52883  ***********************/
52884
52885
52886 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */
52887 struct hwrm_stat_ctx_alloc_input {
52888         /* The HWRM command request type. */
52889         uint16_t        req_type;
52890         /*
52891          * The completion ring to send the completion event on. This should
52892          * be the NQ ID returned from the `nq_alloc` HWRM command.
52893          */
52894         uint16_t        cmpl_ring;
52895         /*
52896          * The sequence ID is used by the driver for tracking multiple
52897          * commands. This ID is treated as opaque data by the firmware and
52898          * the value is returned in the `hwrm_resp_hdr` upon completion.
52899          */
52900         uint16_t        seq_id;
52901         /*
52902          * The target ID of the command:
52903          * * 0x0-0xFFF8 - The function ID
52904          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
52905          * * 0xFFFD - Reserved for user-space HWRM interface
52906          * * 0xFFFF - HWRM
52907          */
52908         uint16_t        target_id;
52909         /*
52910          * A physical address pointer pointing to a host buffer that the
52911          * command's response data will be written. This can be either a host
52912          * physical address (HPA) or a guest physical address (GPA) and must
52913          * point to a physically contiguous block of memory.
52914          */
52915         uint64_t        resp_addr;
52916         /*
52917          * This is the address for statistic block.
52918          * > For new versions of the chip, this address should be 128B
52919          * > aligned.
52920          */
52921         uint64_t        stats_dma_addr;
52922         /*
52923          * The statistic block update period in ms.
52924          * e.g. 250ms, 500ms, 750ms, 1000ms.
52925          * If update_period_ms is 0, then the stats update
52926          * shall be never done and the DMA address shall not be used.
52927          * In this case, the stat block can only be read by
52928          * hwrm_stat_ctx_query command.
52929          * On Ethernet/L2 based devices:
52930          *   if tpa v2 supported (hwrm_vnic_qcaps[max_aggs_supported]>0),
52931          *       ctx_hw_stats_ext is used for DMA,
52932          *   else
52933          *       ctx_hw_stats is used for DMA.
52934          */
52935         uint32_t        update_period_ms;
52936         /*
52937          * This field is used to specify statistics context specific
52938          * configuration flags.
52939          */
52940         uint8_t stat_ctx_flags;
52941         /*
52942          * When this bit is set to '1', the statistics context shall be
52943          * allocated for RoCE traffic only. In this case, traffic other
52944          * than offloaded RoCE traffic shall not be included in this
52945          * statistic context.
52946          * When this bit is set to '0', the statistics context shall be
52947          * used for network traffic or engine traffic.
52948          */
52949         #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE     UINT32_C(0x1)
52950         uint8_t unused_0;
52951         /*
52952          * This is the size of the structure (ctx_hw_stats or
52953          * ctx_hw_stats_ext) that the driver has allocated to be used
52954          * for the periodic DMA updates.
52955          */
52956         uint16_t        stats_dma_length;
52957 } __rte_packed;
52958
52959 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
52960 struct hwrm_stat_ctx_alloc_output {
52961         /* The specific error status for the command. */
52962         uint16_t        error_code;
52963         /* The HWRM command request type. */
52964         uint16_t        req_type;
52965         /* The sequence ID from the original command. */
52966         uint16_t        seq_id;
52967         /* The length of the response data in number of bytes. */
52968         uint16_t        resp_len;
52969         /* This is the statistics context ID value. */
52970         uint32_t        stat_ctx_id;
52971         uint8_t unused_0[3];
52972         /*
52973          * This field is used in Output records to indicate that the output
52974          * is completely written to RAM.  This field should be read as '1'
52975          * to indicate that the output has been completely written.
52976          * When writing a command completion or response to an internal processor,
52977          * the order of writes has to be such that this field is written last.
52978          */
52979         uint8_t valid;
52980 } __rte_packed;
52981
52982 /**********************
52983  * hwrm_stat_ctx_free *
52984  **********************/
52985
52986
52987 /* hwrm_stat_ctx_free_input (size:192b/24B) */
52988 struct hwrm_stat_ctx_free_input {
52989         /* The HWRM command request type. */
52990         uint16_t        req_type;
52991         /*
52992          * The completion ring to send the completion event on. This should
52993          * be the NQ ID returned from the `nq_alloc` HWRM command.
52994          */
52995         uint16_t        cmpl_ring;
52996         /*
52997          * The sequence ID is used by the driver for tracking multiple
52998          * commands. This ID is treated as opaque data by the firmware and
52999          * the value is returned in the `hwrm_resp_hdr` upon completion.
53000          */
53001         uint16_t        seq_id;
53002         /*
53003          * The target ID of the command:
53004          * * 0x0-0xFFF8 - The function ID
53005          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53006          * * 0xFFFD - Reserved for user-space HWRM interface
53007          * * 0xFFFF - HWRM
53008          */
53009         uint16_t        target_id;
53010         /*
53011          * A physical address pointer pointing to a host buffer that the
53012          * command's response data will be written. This can be either a host
53013          * physical address (HPA) or a guest physical address (GPA) and must
53014          * point to a physically contiguous block of memory.
53015          */
53016         uint64_t        resp_addr;
53017         /* ID of the statistics context that is being queried. */
53018         uint32_t        stat_ctx_id;
53019         uint8_t unused_0[4];
53020 } __rte_packed;
53021
53022 /* hwrm_stat_ctx_free_output (size:128b/16B) */
53023 struct hwrm_stat_ctx_free_output {
53024         /* The specific error status for the command. */
53025         uint16_t        error_code;
53026         /* The HWRM command request type. */
53027         uint16_t        req_type;
53028         /* The sequence ID from the original command. */
53029         uint16_t        seq_id;
53030         /* The length of the response data in number of bytes. */
53031         uint16_t        resp_len;
53032         /* This is the statistics context ID value. */
53033         uint32_t        stat_ctx_id;
53034         uint8_t unused_0[3];
53035         /*
53036          * This field is used in Output records to indicate that the output
53037          * is completely written to RAM.  This field should be read as '1'
53038          * to indicate that the output has been completely written.
53039          * When writing a command completion or response to an internal processor,
53040          * the order of writes has to be such that this field is written last.
53041          */
53042         uint8_t valid;
53043 } __rte_packed;
53044
53045 /***********************
53046  * hwrm_stat_ctx_query *
53047  ***********************/
53048
53049
53050 /* hwrm_stat_ctx_query_input (size:192b/24B) */
53051 struct hwrm_stat_ctx_query_input {
53052         /* The HWRM command request type. */
53053         uint16_t        req_type;
53054         /*
53055          * The completion ring to send the completion event on. This should
53056          * be the NQ ID returned from the `nq_alloc` HWRM command.
53057          */
53058         uint16_t        cmpl_ring;
53059         /*
53060          * The sequence ID is used by the driver for tracking multiple
53061          * commands. This ID is treated as opaque data by the firmware and
53062          * the value is returned in the `hwrm_resp_hdr` upon completion.
53063          */
53064         uint16_t        seq_id;
53065         /*
53066          * The target ID of the command:
53067          * * 0x0-0xFFF8 - The function ID
53068          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53069          * * 0xFFFD - Reserved for user-space HWRM interface
53070          * * 0xFFFF - HWRM
53071          */
53072         uint16_t        target_id;
53073         /*
53074          * A physical address pointer pointing to a host buffer that the
53075          * command's response data will be written. This can be either a host
53076          * physical address (HPA) or a guest physical address (GPA) and must
53077          * point to a physically contiguous block of memory.
53078          */
53079         uint64_t        resp_addr;
53080         /* ID of the statistics context that is being queried. */
53081         uint32_t        stat_ctx_id;
53082         uint8_t flags;
53083         /*
53084          * This bit is set to 1 when request is for a counter mask,
53085          * representing the width of each of the stats counters, rather
53086          * than counters themselves.
53087          */
53088         #define HWRM_STAT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK     UINT32_C(0x1)
53089         uint8_t unused_0[3];
53090 } __rte_packed;
53091
53092 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
53093 struct hwrm_stat_ctx_query_output {
53094         /* The specific error status for the command. */
53095         uint16_t        error_code;
53096         /* The HWRM command request type. */
53097         uint16_t        req_type;
53098         /* The sequence ID from the original command. */
53099         uint16_t        seq_id;
53100         /* The length of the response data in number of bytes. */
53101         uint16_t        resp_len;
53102         /* Number of transmitted unicast packets */
53103         uint64_t        tx_ucast_pkts;
53104         /* Number of transmitted multicast packets */
53105         uint64_t        tx_mcast_pkts;
53106         /* Number of transmitted broadcast packets */
53107         uint64_t        tx_bcast_pkts;
53108         /* Number of packets discarded in transmit path */
53109         uint64_t        tx_discard_pkts;
53110         /* Number of packets in transmit path with error */
53111         uint64_t        tx_error_pkts;
53112         /* Number of transmitted bytes for unicast traffic */
53113         uint64_t        tx_ucast_bytes;
53114         /* Number of transmitted bytes for multicast traffic */
53115         uint64_t        tx_mcast_bytes;
53116         /* Number of transmitted bytes for broadcast traffic */
53117         uint64_t        tx_bcast_bytes;
53118         /* Number of received unicast packets */
53119         uint64_t        rx_ucast_pkts;
53120         /* Number of received multicast packets */
53121         uint64_t        rx_mcast_pkts;
53122         /* Number of received broadcast packets */
53123         uint64_t        rx_bcast_pkts;
53124         /* Number of packets discarded in receive path */
53125         uint64_t        rx_discard_pkts;
53126         /* Number of packets in receive path with errors */
53127         uint64_t        rx_error_pkts;
53128         /* Number of received bytes for unicast traffic */
53129         uint64_t        rx_ucast_bytes;
53130         /* Number of received bytes for multicast traffic */
53131         uint64_t        rx_mcast_bytes;
53132         /* Number of received bytes for broadcast traffic */
53133         uint64_t        rx_bcast_bytes;
53134         /* Number of aggregated unicast packets */
53135         uint64_t        rx_agg_pkts;
53136         /* Number of aggregated unicast bytes */
53137         uint64_t        rx_agg_bytes;
53138         /* Number of aggregation events */
53139         uint64_t        rx_agg_events;
53140         /* Number of aborted aggregations */
53141         uint64_t        rx_agg_aborts;
53142         uint8_t unused_0[7];
53143         /*
53144          * This field is used in Output records to indicate that the output
53145          * is completely written to RAM.  This field should be read as '1'
53146          * to indicate that the output has been completely written.
53147          * When writing a command completion or response to an internal processor,
53148          * the order of writes has to be such that this field is written last.
53149          */
53150         uint8_t valid;
53151 } __rte_packed;
53152
53153 /***************************
53154  * hwrm_stat_ext_ctx_query *
53155  ***************************/
53156
53157
53158 /* hwrm_stat_ext_ctx_query_input (size:192b/24B) */
53159 struct hwrm_stat_ext_ctx_query_input {
53160         /* The HWRM command request type. */
53161         uint16_t        req_type;
53162         /*
53163          * The completion ring to send the completion event on. This should
53164          * be the NQ ID returned from the `nq_alloc` HWRM command.
53165          */
53166         uint16_t        cmpl_ring;
53167         /*
53168          * The sequence ID is used by the driver for tracking multiple
53169          * commands. This ID is treated as opaque data by the firmware and
53170          * the value is returned in the `hwrm_resp_hdr` upon completion.
53171          */
53172         uint16_t        seq_id;
53173         /*
53174          * The target ID of the command:
53175          * * 0x0-0xFFF8 - The function ID
53176          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53177          * * 0xFFFD - Reserved for user-space HWRM interface
53178          * * 0xFFFF - HWRM
53179          */
53180         uint16_t        target_id;
53181         /*
53182          * A physical address pointer pointing to a host buffer that the
53183          * command's response data will be written. This can be either a host
53184          * physical address (HPA) or a guest physical address (GPA) and must
53185          * point to a physically contiguous block of memory.
53186          */
53187         uint64_t        resp_addr;
53188         /* ID of the extended statistics context that is being queried. */
53189         uint32_t        stat_ctx_id;
53190         uint8_t flags;
53191         /*
53192          * This bit is set to 1 when request is for a counter mask,
53193          * representing the width of each of the stats counters, rather
53194          * than counters themselves.
53195          */
53196         #define HWRM_STAT_EXT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK \
53197                 UINT32_C(0x1)
53198         uint8_t unused_0[3];
53199 } __rte_packed;
53200
53201 /* hwrm_stat_ext_ctx_query_output (size:1536b/192B) */
53202 struct hwrm_stat_ext_ctx_query_output {
53203         /* The specific error status for the command. */
53204         uint16_t        error_code;
53205         /* The HWRM command request type. */
53206         uint16_t        req_type;
53207         /* The sequence ID from the original command. */
53208         uint16_t        seq_id;
53209         /* The length of the response data in number of bytes. */
53210         uint16_t        resp_len;
53211         /* Number of received unicast packets */
53212         uint64_t        rx_ucast_pkts;
53213         /* Number of received multicast packets */
53214         uint64_t        rx_mcast_pkts;
53215         /* Number of received broadcast packets */
53216         uint64_t        rx_bcast_pkts;
53217         /* Number of discarded packets on receive path */
53218         uint64_t        rx_discard_pkts;
53219         /* Number of packets on receive path with error */
53220         uint64_t        rx_error_pkts;
53221         /* Number of received bytes for unicast traffic */
53222         uint64_t        rx_ucast_bytes;
53223         /* Number of received bytes for multicast traffic */
53224         uint64_t        rx_mcast_bytes;
53225         /* Number of received bytes for broadcast traffic */
53226         uint64_t        rx_bcast_bytes;
53227         /* Number of transmitted unicast packets */
53228         uint64_t        tx_ucast_pkts;
53229         /* Number of transmitted multicast packets */
53230         uint64_t        tx_mcast_pkts;
53231         /* Number of transmitted broadcast packets */
53232         uint64_t        tx_bcast_pkts;
53233         /* Number of packets on transmit path with error */
53234         uint64_t        tx_error_pkts;
53235         /* Number of discarded packets on transmit path */
53236         uint64_t        tx_discard_pkts;
53237         /* Number of transmitted bytes for unicast traffic */
53238         uint64_t        tx_ucast_bytes;
53239         /* Number of transmitted bytes for multicast traffic */
53240         uint64_t        tx_mcast_bytes;
53241         /* Number of transmitted bytes for broadcast traffic */
53242         uint64_t        tx_bcast_bytes;
53243         /* Number of TPA eligible packets */
53244         uint64_t        rx_tpa_eligible_pkt;
53245         /* Number of TPA eligible bytes */
53246         uint64_t        rx_tpa_eligible_bytes;
53247         /* Number of TPA packets */
53248         uint64_t        rx_tpa_pkt;
53249         /* Number of TPA bytes */
53250         uint64_t        rx_tpa_bytes;
53251         /* Number of TPA errors */
53252         uint64_t        rx_tpa_errors;
53253         /* Number of TPA events */
53254         uint64_t        rx_tpa_events;
53255         uint8_t unused_0[7];
53256         /*
53257          * This field is used in Output records to indicate that the output
53258          * is completely written to RAM.  This field should be read as '1'
53259          * to indicate that the output has been completely written.
53260          * When writing a command completion or response to an internal processor,
53261          * the order of writes has to be such that this field is written last.
53262          */
53263         uint8_t valid;
53264 } __rte_packed;
53265
53266 /***************************
53267  * hwrm_stat_ctx_eng_query *
53268  ***************************/
53269
53270
53271 /* hwrm_stat_ctx_eng_query_input (size:192b/24B) */
53272 struct hwrm_stat_ctx_eng_query_input {
53273         /* The HWRM command request type. */
53274         uint16_t        req_type;
53275         /*
53276          * The completion ring to send the completion event on. This should
53277          * be the NQ ID returned from the `nq_alloc` HWRM command.
53278          */
53279         uint16_t        cmpl_ring;
53280         /*
53281          * The sequence ID is used by the driver for tracking multiple
53282          * commands. This ID is treated as opaque data by the firmware and
53283          * the value is returned in the `hwrm_resp_hdr` upon completion.
53284          */
53285         uint16_t        seq_id;
53286         /*
53287          * The target ID of the command:
53288          * * 0x0-0xFFF8 - The function ID
53289          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53290          * * 0xFFFD - Reserved for user-space HWRM interface
53291          * * 0xFFFF - HWRM
53292          */
53293         uint16_t        target_id;
53294         /*
53295          * A physical address pointer pointing to a host buffer that the
53296          * command's response data will be written. This can be either a host
53297          * physical address (HPA) or a guest physical address (GPA) and must
53298          * point to a physically contiguous block of memory.
53299          */
53300         uint64_t        resp_addr;
53301         /* ID of the statistics context that is being queried. */
53302         uint32_t        stat_ctx_id;
53303         uint8_t unused_0[4];
53304 } __rte_packed;
53305
53306 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
53307 struct hwrm_stat_ctx_eng_query_output {
53308         /* The specific error status for the command. */
53309         uint16_t        error_code;
53310         /* The HWRM command request type. */
53311         uint16_t        req_type;
53312         /* The sequence ID from the original command. */
53313         uint16_t        seq_id;
53314         /* The length of the response data in number of bytes. */
53315         uint16_t        resp_len;
53316         /*
53317          * Count of data bytes into the Engine.
53318          * This includes any user supplied prefix,
53319          * but does not include any predefined
53320          * prefix data.
53321          */
53322         uint64_t        eng_bytes_in;
53323         /* Count of data bytes out of the Engine. */
53324         uint64_t        eng_bytes_out;
53325         /*
53326          * Count, in 4-byte (dword) units, of bytes
53327          * that are input as auxiliary data.
53328          * This includes the aux_cmd data.
53329          */
53330         uint64_t        aux_bytes_in;
53331         /*
53332          * Count, in 4-byte (dword) units, of bytes
53333          * that are output as auxiliary data.
53334          * This count is the buffer space for aux_data
53335          * output provided in the RQE, not the actual
53336          * aux_data written
53337          */
53338         uint64_t        aux_bytes_out;
53339         /* Count of number of commands executed. */
53340         uint64_t        commands;
53341         /*
53342          * Count of number of error commands.
53343          * These are the commands with a
53344          * non-zero status value.
53345          */
53346         uint64_t        error_commands;
53347         /*
53348          * Compression/Encryption Engine usage,
53349          * the unit is count of clock cycles
53350          */
53351         uint64_t        cce_engine_usage;
53352         /*
53353          * De-Compression/De-cryption Engine usage,
53354          * the unit is count of clock cycles
53355          */
53356         uint64_t        cdd_engine_usage;
53357         uint8_t unused_0[7];
53358         /*
53359          * This field is used in Output records to indicate that the output
53360          * is completely written to RAM.  This field should be read as '1'
53361          * to indicate that the output has been completely written.
53362          * When writing a command completion or response to an internal processor,
53363          * the order of writes has to be such that this field is written last.
53364          */
53365         uint8_t valid;
53366 } __rte_packed;
53367
53368 /***************************
53369  * hwrm_stat_ctx_clr_stats *
53370  ***************************/
53371
53372
53373 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
53374 struct hwrm_stat_ctx_clr_stats_input {
53375         /* The HWRM command request type. */
53376         uint16_t        req_type;
53377         /*
53378          * The completion ring to send the completion event on. This should
53379          * be the NQ ID returned from the `nq_alloc` HWRM command.
53380          */
53381         uint16_t        cmpl_ring;
53382         /*
53383          * The sequence ID is used by the driver for tracking multiple
53384          * commands. This ID is treated as opaque data by the firmware and
53385          * the value is returned in the `hwrm_resp_hdr` upon completion.
53386          */
53387         uint16_t        seq_id;
53388         /*
53389          * The target ID of the command:
53390          * * 0x0-0xFFF8 - The function ID
53391          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53392          * * 0xFFFD - Reserved for user-space HWRM interface
53393          * * 0xFFFF - HWRM
53394          */
53395         uint16_t        target_id;
53396         /*
53397          * A physical address pointer pointing to a host buffer that the
53398          * command's response data will be written. This can be either a host
53399          * physical address (HPA) or a guest physical address (GPA) and must
53400          * point to a physically contiguous block of memory.
53401          */
53402         uint64_t        resp_addr;
53403         /* ID of the statistics context that is being queried. */
53404         uint32_t        stat_ctx_id;
53405         uint8_t unused_0[4];
53406 } __rte_packed;
53407
53408 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
53409 struct hwrm_stat_ctx_clr_stats_output {
53410         /* The specific error status for the command. */
53411         uint16_t        error_code;
53412         /* The HWRM command request type. */
53413         uint16_t        req_type;
53414         /* The sequence ID from the original command. */
53415         uint16_t        seq_id;
53416         /* The length of the response data in number of bytes. */
53417         uint16_t        resp_len;
53418         uint8_t unused_0[7];
53419         /*
53420          * This field is used in Output records to indicate that the output
53421          * is completely written to RAM.  This field should be read as '1'
53422          * to indicate that the output has been completely written.
53423          * When writing a command completion or response to an internal processor,
53424          * the order of writes has to be such that this field is written last.
53425          */
53426         uint8_t valid;
53427 } __rte_packed;
53428
53429 /********************
53430  * hwrm_pcie_qstats *
53431  ********************/
53432
53433
53434 /* hwrm_pcie_qstats_input (size:256b/32B) */
53435 struct hwrm_pcie_qstats_input {
53436         /* The HWRM command request type. */
53437         uint16_t        req_type;
53438         /*
53439          * The completion ring to send the completion event on. This should
53440          * be the NQ ID returned from the `nq_alloc` HWRM command.
53441          */
53442         uint16_t        cmpl_ring;
53443         /*
53444          * The sequence ID is used by the driver for tracking multiple
53445          * commands. This ID is treated as opaque data by the firmware and
53446          * the value is returned in the `hwrm_resp_hdr` upon completion.
53447          */
53448         uint16_t        seq_id;
53449         /*
53450          * The target ID of the command:
53451          * * 0x0-0xFFF8 - The function ID
53452          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53453          * * 0xFFFD - Reserved for user-space HWRM interface
53454          * * 0xFFFF - HWRM
53455          */
53456         uint16_t        target_id;
53457         /*
53458          * A physical address pointer pointing to a host buffer that the
53459          * command's response data will be written. This can be either a host
53460          * physical address (HPA) or a guest physical address (GPA) and must
53461          * point to a physically contiguous block of memory.
53462          */
53463         uint64_t        resp_addr;
53464         /*
53465          * The size of PCIe statistics block in bytes.
53466          * Firmware will DMA the PCIe statistics to
53467          * the host with this field size in the response.
53468          */
53469         uint16_t        pcie_stat_size;
53470         uint8_t unused_0[6];
53471         /*
53472          * This is the host address where
53473          * PCIe statistics will be stored
53474          */
53475         uint64_t        pcie_stat_host_addr;
53476 } __rte_packed;
53477
53478 /* hwrm_pcie_qstats_output (size:128b/16B) */
53479 struct hwrm_pcie_qstats_output {
53480         /* The specific error status for the command. */
53481         uint16_t        error_code;
53482         /* The HWRM command request type. */
53483         uint16_t        req_type;
53484         /* The sequence ID from the original command. */
53485         uint16_t        seq_id;
53486         /* The length of the response data in number of bytes. */
53487         uint16_t        resp_len;
53488         /* The size of PCIe statistics block in bytes. */
53489         uint16_t        pcie_stat_size;
53490         uint8_t unused_0[5];
53491         /*
53492          * This field is used in Output records to indicate that the output
53493          * is completely written to RAM.  This field should be read as '1'
53494          * to indicate that the output has been completely written.
53495          * When writing a command completion or response to an internal processor,
53496          * the order of writes has to be such that this field is written last.
53497          */
53498         uint8_t valid;
53499 } __rte_packed;
53500
53501 /* PCIe Statistics Formats */
53502 /* pcie_ctx_hw_stats (size:768b/96B) */
53503 struct pcie_ctx_hw_stats {
53504         /* Number of physical layer receiver errors */
53505         uint64_t        pcie_pl_signal_integrity;
53506         /* Number of DLLP CRC errors detected by Data Link Layer */
53507         uint64_t        pcie_dl_signal_integrity;
53508         /*
53509          * Number of TLP LCRC and sequence number errors detected
53510          * by Data Link Layer
53511          */
53512         uint64_t        pcie_tl_signal_integrity;
53513         /* Number of times LTSSM entered Recovery state */
53514         uint64_t        pcie_link_integrity;
53515         /* Report number of TLP bits that have been transmitted in Mbps */
53516         uint64_t        pcie_tx_traffic_rate;
53517         /* Report number of TLP bits that have been received in Mbps */
53518         uint64_t        pcie_rx_traffic_rate;
53519         /* Number of DLLP bytes that have been transmitted */
53520         uint64_t        pcie_tx_dllp_statistics;
53521         /* Number of DLLP bytes that have been received */
53522         uint64_t        pcie_rx_dllp_statistics;
53523         /*
53524          * Number of times spent in each phase of gen3
53525          * equalization
53526          */
53527         uint64_t        pcie_equalization_time;
53528         /* Records the last 16 transitions of the LTSSM */
53529         uint32_t        pcie_ltssm_histogram[4];
53530         /*
53531          * Record the last 8 reasons on why LTSSM transitioned
53532          * to Recovery
53533          */
53534         uint64_t        pcie_recovery_histogram;
53535 } __rte_packed;
53536
53537 /**********************
53538  * hwrm_exec_fwd_resp *
53539  **********************/
53540
53541
53542 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
53543 struct hwrm_exec_fwd_resp_input {
53544         /* The HWRM command request type. */
53545         uint16_t        req_type;
53546         /*
53547          * The completion ring to send the completion event on. This should
53548          * be the NQ ID returned from the `nq_alloc` HWRM command.
53549          */
53550         uint16_t        cmpl_ring;
53551         /*
53552          * The sequence ID is used by the driver for tracking multiple
53553          * commands. This ID is treated as opaque data by the firmware and
53554          * the value is returned in the `hwrm_resp_hdr` upon completion.
53555          */
53556         uint16_t        seq_id;
53557         /*
53558          * The target ID of the command:
53559          * * 0x0-0xFFF8 - The function ID
53560          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53561          * * 0xFFFD - Reserved for user-space HWRM interface
53562          * * 0xFFFF - HWRM
53563          */
53564         uint16_t        target_id;
53565         /*
53566          * A physical address pointer pointing to a host buffer that the
53567          * command's response data will be written. This can be either a host
53568          * physical address (HPA) or a guest physical address (GPA) and must
53569          * point to a physically contiguous block of memory.
53570          */
53571         uint64_t        resp_addr;
53572         /*
53573          * This is an encapsulated request. This request should
53574          * be executed by the HWRM and the response should be
53575          * provided in the response buffer inside the encapsulated
53576          * request.
53577          */
53578         uint32_t        encap_request[26];
53579         /*
53580          * This value indicates the target id of the response to
53581          * the encapsulated request.
53582          * 0x0 - 0xFFF8 - Used for function ids
53583          * 0xFFF8 - 0xFFFE - Reserved for internal processors
53584          * 0xFFFF - HWRM
53585          */
53586         uint16_t        encap_resp_target_id;
53587         uint8_t unused_0[6];
53588 } __rte_packed;
53589
53590 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
53591 struct hwrm_exec_fwd_resp_output {
53592         /* The specific error status for the command. */
53593         uint16_t        error_code;
53594         /* The HWRM command request type. */
53595         uint16_t        req_type;
53596         /* The sequence ID from the original command. */
53597         uint16_t        seq_id;
53598         /* The length of the response data in number of bytes. */
53599         uint16_t        resp_len;
53600         uint8_t unused_0[7];
53601         /*
53602          * This field is used in Output records to indicate that the output
53603          * is completely written to RAM.  This field should be read as '1'
53604          * to indicate that the output has been completely written.
53605          * When writing a command completion or response to an internal processor,
53606          * the order of writes has to be such that this field is written last.
53607          */
53608         uint8_t valid;
53609 } __rte_packed;
53610
53611 /************************
53612  * hwrm_reject_fwd_resp *
53613  ************************/
53614
53615
53616 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
53617 struct hwrm_reject_fwd_resp_input {
53618         /* The HWRM command request type. */
53619         uint16_t        req_type;
53620         /*
53621          * The completion ring to send the completion event on. This should
53622          * be the NQ ID returned from the `nq_alloc` HWRM command.
53623          */
53624         uint16_t        cmpl_ring;
53625         /*
53626          * The sequence ID is used by the driver for tracking multiple
53627          * commands. This ID is treated as opaque data by the firmware and
53628          * the value is returned in the `hwrm_resp_hdr` upon completion.
53629          */
53630         uint16_t        seq_id;
53631         /*
53632          * The target ID of the command:
53633          * * 0x0-0xFFF8 - The function ID
53634          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53635          * * 0xFFFD - Reserved for user-space HWRM interface
53636          * * 0xFFFF - HWRM
53637          */
53638         uint16_t        target_id;
53639         /*
53640          * A physical address pointer pointing to a host buffer that the
53641          * command's response data will be written. This can be either a host
53642          * physical address (HPA) or a guest physical address (GPA) and must
53643          * point to a physically contiguous block of memory.
53644          */
53645         uint64_t        resp_addr;
53646         /*
53647          * This is an encapsulated request. This request should
53648          * be rejected by the HWRM and the error response should be
53649          * provided in the response buffer inside the encapsulated
53650          * request.
53651          */
53652         uint32_t        encap_request[26];
53653         /*
53654          * This value indicates the target id of the response to
53655          * the encapsulated request.
53656          * 0x0 - 0xFFF8 - Used for function ids
53657          * 0xFFF8 - 0xFFFE - Reserved for internal processors
53658          * 0xFFFF - HWRM
53659          */
53660         uint16_t        encap_resp_target_id;
53661         uint8_t unused_0[6];
53662 } __rte_packed;
53663
53664 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
53665 struct hwrm_reject_fwd_resp_output {
53666         /* The specific error status for the command. */
53667         uint16_t        error_code;
53668         /* The HWRM command request type. */
53669         uint16_t        req_type;
53670         /* The sequence ID from the original command. */
53671         uint16_t        seq_id;
53672         /* The length of the response data in number of bytes. */
53673         uint16_t        resp_len;
53674         uint8_t unused_0[7];
53675         /*
53676          * This field is used in Output records to indicate that the output
53677          * is completely written to RAM.  This field should be read as '1'
53678          * to indicate that the output has been completely written.
53679          * When writing a command completion or response to an internal processor,
53680          * the order of writes has to be such that this field is written last.
53681          */
53682         uint8_t valid;
53683 } __rte_packed;
53684
53685 /*****************
53686  * hwrm_fwd_resp *
53687  *****************/
53688
53689
53690 /* hwrm_fwd_resp_input (size:1024b/128B) */
53691 struct hwrm_fwd_resp_input {
53692         /* The HWRM command request type. */
53693         uint16_t        req_type;
53694         /*
53695          * The completion ring to send the completion event on. This should
53696          * be the NQ ID returned from the `nq_alloc` HWRM command.
53697          */
53698         uint16_t        cmpl_ring;
53699         /*
53700          * The sequence ID is used by the driver for tracking multiple
53701          * commands. This ID is treated as opaque data by the firmware and
53702          * the value is returned in the `hwrm_resp_hdr` upon completion.
53703          */
53704         uint16_t        seq_id;
53705         /*
53706          * The target ID of the command:
53707          * * 0x0-0xFFF8 - The function ID
53708          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53709          * * 0xFFFD - Reserved for user-space HWRM interface
53710          * * 0xFFFF - HWRM
53711          */
53712         uint16_t        target_id;
53713         /*
53714          * A physical address pointer pointing to a host buffer that the
53715          * command's response data will be written. This can be either a host
53716          * physical address (HPA) or a guest physical address (GPA) and must
53717          * point to a physically contiguous block of memory.
53718          */
53719         uint64_t        resp_addr;
53720         /*
53721          * This value indicates the target id of the encapsulated
53722          * response.
53723          * 0x0 - 0xFFF8 - Used for function ids
53724          * 0xFFF8 - 0xFFFE - Reserved for internal processors
53725          * 0xFFFF - HWRM
53726          */
53727         uint16_t        encap_resp_target_id;
53728         /*
53729          * This value indicates the completion ring the encapsulated
53730          * response will be optionally completed on.  If the value is
53731          * -1, then no CR completion shall be generated for the
53732          * encapsulated response. Any other value must be a
53733          * valid CR ring_id value. If a valid encap_resp_cmpl_ring
53734          * is provided, then a CR completion shall be generated for
53735          * the encapsulated response.
53736          */
53737         uint16_t        encap_resp_cmpl_ring;
53738         /* This field indicates the length of encapsulated response. */
53739         uint16_t        encap_resp_len;
53740         uint8_t unused_0;
53741         uint8_t unused_1;
53742         /*
53743          * This is the host address where the encapsulated response
53744          * will be written.
53745          * This area must be 16B aligned and must be cleared to zero
53746          * before the original request is made.
53747          */
53748         uint64_t        encap_resp_addr;
53749         /* This is an encapsulated response. */
53750         uint32_t        encap_resp[24];
53751 } __rte_packed;
53752
53753 /* hwrm_fwd_resp_output (size:128b/16B) */
53754 struct hwrm_fwd_resp_output {
53755         /* The specific error status for the command. */
53756         uint16_t        error_code;
53757         /* The HWRM command request type. */
53758         uint16_t        req_type;
53759         /* The sequence ID from the original command. */
53760         uint16_t        seq_id;
53761         /* The length of the response data in number of bytes. */
53762         uint16_t        resp_len;
53763         uint8_t unused_0[7];
53764         /*
53765          * This field is used in Output records to indicate that the output
53766          * is completely written to RAM.  This field should be read as '1'
53767          * to indicate that the output has been completely written.
53768          * When writing a command completion or response to an internal processor,
53769          * the order of writes has to be such that this field is written last.
53770          */
53771         uint8_t valid;
53772 } __rte_packed;
53773
53774 /*****************************
53775  * hwrm_fwd_async_event_cmpl *
53776  *****************************/
53777
53778
53779 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */
53780 struct hwrm_fwd_async_event_cmpl_input {
53781         /* The HWRM command request type. */
53782         uint16_t        req_type;
53783         /*
53784          * The completion ring to send the completion event on. This should
53785          * be the NQ ID returned from the `nq_alloc` HWRM command.
53786          */
53787         uint16_t        cmpl_ring;
53788         /*
53789          * The sequence ID is used by the driver for tracking multiple
53790          * commands. This ID is treated as opaque data by the firmware and
53791          * the value is returned in the `hwrm_resp_hdr` upon completion.
53792          */
53793         uint16_t        seq_id;
53794         /*
53795          * The target ID of the command:
53796          * * 0x0-0xFFF8 - The function ID
53797          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53798          * * 0xFFFD - Reserved for user-space HWRM interface
53799          * * 0xFFFF - HWRM
53800          */
53801         uint16_t        target_id;
53802         /*
53803          * A physical address pointer pointing to a host buffer that the
53804          * command's response data will be written. This can be either a host
53805          * physical address (HPA) or a guest physical address (GPA) and must
53806          * point to a physically contiguous block of memory.
53807          */
53808         uint64_t        resp_addr;
53809         /*
53810          * This value indicates the target id of the encapsulated
53811          * asynchronous event.
53812          * 0x0 - 0xFFF8 - Used for function ids
53813          * 0xFFF8 - 0xFFFE - Reserved for internal processors
53814          * 0xFFFF - Broadcast to all children VFs (only applicable when
53815          * a PF is the requester)
53816          */
53817         uint16_t        encap_async_event_target_id;
53818         uint8_t unused_0[6];
53819         /* This is an encapsulated asynchronous event completion. */
53820         uint32_t        encap_async_event_cmpl[4];
53821 } __rte_packed;
53822
53823 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
53824 struct hwrm_fwd_async_event_cmpl_output {
53825         /* The specific error status for the command. */
53826         uint16_t        error_code;
53827         /* The HWRM command request type. */
53828         uint16_t        req_type;
53829         /* The sequence ID from the original command. */
53830         uint16_t        seq_id;
53831         /* The length of the response data in number of bytes. */
53832         uint16_t        resp_len;
53833         uint8_t unused_0[7];
53834         /*
53835          * This field is used in Output records to indicate that the output
53836          * is completely written to RAM.  This field should be read as '1'
53837          * to indicate that the output has been completely written.
53838          * When writing a command completion or response to an internal processor,
53839          * the order of writes has to be such that this field is written last.
53840          */
53841         uint8_t valid;
53842 } __rte_packed;
53843
53844 /**************************
53845  * hwrm_nvm_raw_write_blk *
53846  **************************/
53847
53848
53849 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */
53850 struct hwrm_nvm_raw_write_blk_input {
53851         /* The HWRM command request type. */
53852         uint16_t        req_type;
53853         /*
53854          * The completion ring to send the completion event on. This should
53855          * be the NQ ID returned from the `nq_alloc` HWRM command.
53856          */
53857         uint16_t        cmpl_ring;
53858         /*
53859          * The sequence ID is used by the driver for tracking multiple
53860          * commands. This ID is treated as opaque data by the firmware and
53861          * the value is returned in the `hwrm_resp_hdr` upon completion.
53862          */
53863         uint16_t        seq_id;
53864         /*
53865          * The target ID of the command:
53866          * * 0x0-0xFFF8 - The function ID
53867          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53868          * * 0xFFFD - Reserved for user-space HWRM interface
53869          * * 0xFFFF - HWRM
53870          */
53871         uint16_t        target_id;
53872         /*
53873          * A physical address pointer pointing to a host buffer that the
53874          * command's response data will be written. This can be either a host
53875          * physical address (HPA) or a guest physical address (GPA) and must
53876          * point to a physically contiguous block of memory.
53877          */
53878         uint64_t        resp_addr;
53879         /*
53880          * 64-bit Host Source Address.
53881          * This is the location of the source data to be written.
53882          */
53883         uint64_t        host_src_addr;
53884         /*
53885          * 32-bit Destination Address.
53886          * This is the NVRAM byte-offset where the source data will be written to.
53887          */
53888         uint32_t        dest_addr;
53889         /* Length of data to be written, in bytes. */
53890         uint32_t        len;
53891 } __rte_packed;
53892
53893 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
53894 struct hwrm_nvm_raw_write_blk_output {
53895         /* The specific error status for the command. */
53896         uint16_t        error_code;
53897         /* The HWRM command request type. */
53898         uint16_t        req_type;
53899         /* The sequence ID from the original command. */
53900         uint16_t        seq_id;
53901         /* The length of the response data in number of bytes. */
53902         uint16_t        resp_len;
53903         uint8_t unused_0[7];
53904         /*
53905          * This field is used in Output records to indicate that the output
53906          * is completely written to RAM.  This field should be read as '1'
53907          * to indicate that the output has been completely written.
53908          * When writing a command completion or response to an internal processor,
53909          * the order of writes has to be such that this field is written last.
53910          */
53911         uint8_t valid;
53912 } __rte_packed;
53913
53914 /*****************
53915  * hwrm_nvm_read *
53916  *****************/
53917
53918
53919 /* hwrm_nvm_read_input (size:320b/40B) */
53920 struct hwrm_nvm_read_input {
53921         /* The HWRM command request type. */
53922         uint16_t        req_type;
53923         /*
53924          * The completion ring to send the completion event on. This should
53925          * be the NQ ID returned from the `nq_alloc` HWRM command.
53926          */
53927         uint16_t        cmpl_ring;
53928         /*
53929          * The sequence ID is used by the driver for tracking multiple
53930          * commands. This ID is treated as opaque data by the firmware and
53931          * the value is returned in the `hwrm_resp_hdr` upon completion.
53932          */
53933         uint16_t        seq_id;
53934         /*
53935          * The target ID of the command:
53936          * * 0x0-0xFFF8 - The function ID
53937          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
53938          * * 0xFFFD - Reserved for user-space HWRM interface
53939          * * 0xFFFF - HWRM
53940          */
53941         uint16_t        target_id;
53942         /*
53943          * A physical address pointer pointing to a host buffer that the
53944          * command's response data will be written. This can be either a host
53945          * physical address (HPA) or a guest physical address (GPA) and must
53946          * point to a physically contiguous block of memory.
53947          */
53948         uint64_t        resp_addr;
53949         /*
53950          * 64-bit Host Destination Address.
53951          * This is the host address where the data will be written to.
53952          */
53953         uint64_t        host_dest_addr;
53954         /* The 0-based index of the directory entry. */
53955         uint16_t        dir_idx;
53956         uint8_t unused_0[2];
53957         /* The NVRAM byte-offset to read from. */
53958         uint32_t        offset;
53959         /* The length of the data to be read, in bytes. */
53960         uint32_t        len;
53961         uint8_t unused_1[4];
53962 } __rte_packed;
53963
53964 /* hwrm_nvm_read_output (size:128b/16B) */
53965 struct hwrm_nvm_read_output {
53966         /* The specific error status for the command. */
53967         uint16_t        error_code;
53968         /* The HWRM command request type. */
53969         uint16_t        req_type;
53970         /* The sequence ID from the original command. */
53971         uint16_t        seq_id;
53972         /* The length of the response data in number of bytes. */
53973         uint16_t        resp_len;
53974         uint8_t unused_0[7];
53975         /*
53976          * This field is used in Output records to indicate that the output
53977          * is completely written to RAM.  This field should be read as '1'
53978          * to indicate that the output has been completely written.
53979          * When writing a command completion or response to an internal processor,
53980          * the order of writes has to be such that this field is written last.
53981          */
53982         uint8_t valid;
53983 } __rte_packed;
53984
53985 /*********************
53986  * hwrm_nvm_raw_dump *
53987  *********************/
53988
53989
53990 /* hwrm_nvm_raw_dump_input (size:256b/32B) */
53991 struct hwrm_nvm_raw_dump_input {
53992         /* The HWRM command request type. */
53993         uint16_t        req_type;
53994         /*
53995          * The completion ring to send the completion event on. This should
53996          * be the NQ ID returned from the `nq_alloc` HWRM command.
53997          */
53998         uint16_t        cmpl_ring;
53999         /*
54000          * The sequence ID is used by the driver for tracking multiple
54001          * commands. This ID is treated as opaque data by the firmware and
54002          * the value is returned in the `hwrm_resp_hdr` upon completion.
54003          */
54004         uint16_t        seq_id;
54005         /*
54006          * The target ID of the command:
54007          * * 0x0-0xFFF8 - The function ID
54008          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54009          * * 0xFFFD - Reserved for user-space HWRM interface
54010          * * 0xFFFF - HWRM
54011          */
54012         uint16_t        target_id;
54013         /*
54014          * A physical address pointer pointing to a host buffer that the
54015          * command's response data will be written. This can be either a host
54016          * physical address (HPA) or a guest physical address (GPA) and must
54017          * point to a physically contiguous block of memory.
54018          */
54019         uint64_t        resp_addr;
54020         /*
54021          * 64-bit Host Destination Address.
54022          * This is the host address where the data will be written to.
54023          */
54024         uint64_t        host_dest_addr;
54025         /* 32-bit NVRAM byte-offset to read from. */
54026         uint32_t        offset;
54027         /* Total length of NVRAM contents to be read, in bytes. */
54028         uint32_t        len;
54029 } __rte_packed;
54030
54031 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
54032 struct hwrm_nvm_raw_dump_output {
54033         /* The specific error status for the command. */
54034         uint16_t        error_code;
54035         /* The HWRM command request type. */
54036         uint16_t        req_type;
54037         /* The sequence ID from the original command. */
54038         uint16_t        seq_id;
54039         /* The length of the response data in number of bytes. */
54040         uint16_t        resp_len;
54041         uint8_t unused_0[7];
54042         /*
54043          * This field is used in Output records to indicate that the output
54044          * is completely written to RAM.  This field should be read as '1'
54045          * to indicate that the output has been completely written.
54046          * When writing a command completion or response to an internal processor,
54047          * the order of writes has to be such that this field is written last.
54048          */
54049         uint8_t valid;
54050 } __rte_packed;
54051
54052 /****************************
54053  * hwrm_nvm_get_dir_entries *
54054  ****************************/
54055
54056
54057 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
54058 struct hwrm_nvm_get_dir_entries_input {
54059         /* The HWRM command request type. */
54060         uint16_t        req_type;
54061         /*
54062          * The completion ring to send the completion event on. This should
54063          * be the NQ ID returned from the `nq_alloc` HWRM command.
54064          */
54065         uint16_t        cmpl_ring;
54066         /*
54067          * The sequence ID is used by the driver for tracking multiple
54068          * commands. This ID is treated as opaque data by the firmware and
54069          * the value is returned in the `hwrm_resp_hdr` upon completion.
54070          */
54071         uint16_t        seq_id;
54072         /*
54073          * The target ID of the command:
54074          * * 0x0-0xFFF8 - The function ID
54075          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54076          * * 0xFFFD - Reserved for user-space HWRM interface
54077          * * 0xFFFF - HWRM
54078          */
54079         uint16_t        target_id;
54080         /*
54081          * A physical address pointer pointing to a host buffer that the
54082          * command's response data will be written. This can be either a host
54083          * physical address (HPA) or a guest physical address (GPA) and must
54084          * point to a physically contiguous block of memory.
54085          */
54086         uint64_t        resp_addr;
54087         /*
54088          * 64-bit Host Destination Address.
54089          * This is the host address where the directory will be written.
54090          */
54091         uint64_t        host_dest_addr;
54092 } __rte_packed;
54093
54094 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
54095 struct hwrm_nvm_get_dir_entries_output {
54096         /* The specific error status for the command. */
54097         uint16_t        error_code;
54098         /* The HWRM command request type. */
54099         uint16_t        req_type;
54100         /* The sequence ID from the original command. */
54101         uint16_t        seq_id;
54102         /* The length of the response data in number of bytes. */
54103         uint16_t        resp_len;
54104         uint8_t unused_0[7];
54105         /*
54106          * This field is used in Output records to indicate that the output
54107          * is completely written to RAM.  This field should be read as '1'
54108          * to indicate that the output has been completely written.
54109          * When writing a command completion or response to an internal processor,
54110          * the order of writes has to be such that this field is written last.
54111          */
54112         uint8_t valid;
54113 } __rte_packed;
54114
54115 /*************************
54116  * hwrm_nvm_get_dir_info *
54117  *************************/
54118
54119
54120 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
54121 struct hwrm_nvm_get_dir_info_input {
54122         /* The HWRM command request type. */
54123         uint16_t        req_type;
54124         /*
54125          * The completion ring to send the completion event on. This should
54126          * be the NQ ID returned from the `nq_alloc` HWRM command.
54127          */
54128         uint16_t        cmpl_ring;
54129         /*
54130          * The sequence ID is used by the driver for tracking multiple
54131          * commands. This ID is treated as opaque data by the firmware and
54132          * the value is returned in the `hwrm_resp_hdr` upon completion.
54133          */
54134         uint16_t        seq_id;
54135         /*
54136          * The target ID of the command:
54137          * * 0x0-0xFFF8 - The function ID
54138          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54139          * * 0xFFFD - Reserved for user-space HWRM interface
54140          * * 0xFFFF - HWRM
54141          */
54142         uint16_t        target_id;
54143         /*
54144          * A physical address pointer pointing to a host buffer that the
54145          * command's response data will be written. This can be either a host
54146          * physical address (HPA) or a guest physical address (GPA) and must
54147          * point to a physically contiguous block of memory.
54148          */
54149         uint64_t        resp_addr;
54150 } __rte_packed;
54151
54152 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
54153 struct hwrm_nvm_get_dir_info_output {
54154         /* The specific error status for the command. */
54155         uint16_t        error_code;
54156         /* The HWRM command request type. */
54157         uint16_t        req_type;
54158         /* The sequence ID from the original command. */
54159         uint16_t        seq_id;
54160         /* The length of the response data in number of bytes. */
54161         uint16_t        resp_len;
54162         /* Number of directory entries in the directory. */
54163         uint32_t        entries;
54164         /* Size of each directory entry, in bytes. */
54165         uint32_t        entry_length;
54166         uint8_t unused_0[7];
54167         /*
54168          * This field is used in Output records to indicate that the output
54169          * is completely written to RAM.  This field should be read as '1'
54170          * to indicate that the output has been completely written.
54171          * When writing a command completion or response to an internal processor,
54172          * the order of writes has to be such that this field is written last.
54173          */
54174         uint8_t valid;
54175 } __rte_packed;
54176
54177 /******************
54178  * hwrm_nvm_write *
54179  ******************/
54180
54181
54182 /* hwrm_nvm_write_input (size:448b/56B) */
54183 struct hwrm_nvm_write_input {
54184         /* The HWRM command request type. */
54185         uint16_t        req_type;
54186         /*
54187          * The completion ring to send the completion event on. This should
54188          * be the NQ ID returned from the `nq_alloc` HWRM command.
54189          */
54190         uint16_t        cmpl_ring;
54191         /*
54192          * The sequence ID is used by the driver for tracking multiple
54193          * commands. This ID is treated as opaque data by the firmware and
54194          * the value is returned in the `hwrm_resp_hdr` upon completion.
54195          */
54196         uint16_t        seq_id;
54197         /*
54198          * The target ID of the command:
54199          * * 0x0-0xFFF8 - The function ID
54200          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54201          * * 0xFFFD - Reserved for user-space HWRM interface
54202          * * 0xFFFF - HWRM
54203          */
54204         uint16_t        target_id;
54205         /*
54206          * A physical address pointer pointing to a host buffer that the
54207          * command's response data will be written. This can be either a host
54208          * physical address (HPA) or a guest physical address (GPA) and must
54209          * point to a physically contiguous block of memory.
54210          */
54211         uint64_t        resp_addr;
54212         /*
54213          * 64-bit Host Source Address.
54214          * This is where the source data is.
54215          */
54216         uint64_t        host_src_addr;
54217         /*
54218          * The Directory Entry Type (valid values are defined in the
54219          * bnxnvm_directory_type enum defined in the file bnxnvm_defs.h).
54220          */
54221         uint16_t        dir_type;
54222         /*
54223          * Directory ordinal.
54224          * The 0-based instance of the combined Directory Entry Type and Extension.
54225          */
54226         uint16_t        dir_ordinal;
54227         /*
54228          * The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file
54229          * bnxnvm_defs.h).
54230          */
54231         uint16_t        dir_ext;
54232         /*
54233          * Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file
54234          * bnxnvm_defs.h).
54235          */
54236         uint16_t        dir_attr;
54237         /*
54238          * Length of data to write, in bytes. May be less than or equal to the
54239          * allocated size for the directory entry.
54240          * The data length stored in the directory entry will be updated to
54241          * reflect this value once the write is complete.
54242          */
54243         uint32_t        dir_data_length;
54244         /* Option. */
54245         uint16_t        option;
54246         uint16_t        flags;
54247         /*
54248          * When this bit is '1', the original active image
54249          * will not be removed. TBD: what purpose is this?
54250          */
54251         #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG \
54252                 UINT32_C(0x1)
54253         /*
54254          * This flag indicates the sender wants to modify a continuous
54255          * NVRAM area using a batch of this HWRM requests. The
54256          * offset of a request must be continuous to the end of previous
54257          * request's. Firmware does not update the directory entry until
54258          * receiving the last request, which is indicated by the batch_last
54259          * flag. This flag is set usually when a sender does not have a
54260          * block of memory that is big enough to hold the entire NVRAM
54261          * data for send at one time.
54262          */
54263         #define HWRM_NVM_WRITE_INPUT_FLAGS_BATCH_MODE \
54264                 UINT32_C(0x2)
54265         /*
54266          * This flag can be used only when the batch_mode flag is set. It
54267          * indicates this request is the last of batch requests.
54268          */
54269         #define HWRM_NVM_WRITE_INPUT_FLAGS_BATCH_LAST \
54270                 UINT32_C(0x4)
54271         /*
54272          * The requested length of the allocated NVM for the item, in bytes.
54273          * This value may be greater than or equal to the specified data
54274          * length (dir_data_length).
54275          * If this value is less than the specified data length, it will be ignored.
54276          * The response will contain the actual allocated item length,
54277          * which may be greater than the requested item length.
54278          * The purpose for allocating more than the required number of bytes
54279          * for an item's data is to pre-allocate extra storage (padding) to
54280          * accommodate the potential future growth of an item (e.g. upgraded
54281          * firmware with a size increase, log growth, expanded configuration data).
54282          */
54283         uint32_t        dir_item_length;
54284         /*
54285          * 32-bit offset of data blob from where data is being written.
54286          * Only valid for batch mode. For non-batch writes 'dont care'.
54287          */
54288         uint32_t        offset;
54289         /*
54290          * Length of data to be written.Should be non-zero.
54291          * Only valid for batch mode. For non-batch writes 'dont care'.
54292          */
54293         uint32_t        len;
54294         uint32_t        unused_0;
54295 } __rte_packed;
54296
54297 /* hwrm_nvm_write_output (size:128b/16B) */
54298 struct hwrm_nvm_write_output {
54299         /* The specific error status for the command. */
54300         uint16_t        error_code;
54301         /* The HWRM command request type. */
54302         uint16_t        req_type;
54303         /* The sequence ID from the original command. */
54304         uint16_t        seq_id;
54305         /* The length of the response data in number of bytes. */
54306         uint16_t        resp_len;
54307         /*
54308          * Length of the allocated NVM for the item, in bytes. The value may be
54309          * greater than or equal to the specified data length or the requested
54310          * item length.
54311          * The actual item length used when creating a new directory entry will
54312          * be a multiple of an NVM block size.
54313          */
54314         uint32_t        dir_item_length;
54315         /* The directory index of the created or modified item. */
54316         uint16_t        dir_idx;
54317         uint8_t unused_0;
54318         /*
54319          * This field is used in Output records to indicate that the output
54320          * is completely written to RAM.  This field should be read as '1'
54321          * to indicate that the output has been completely written.
54322          * When writing a command completion or response to an internal processor,
54323          * the order of writes has to be such that this field is written last.
54324          */
54325         uint8_t valid;
54326 } __rte_packed;
54327
54328 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
54329 struct hwrm_nvm_write_cmd_err {
54330         /*
54331          * command specific error codes that goes to
54332          * the cmd_err field in Common HWRM Error Response.
54333          */
54334         uint8_t code;
54335         /* Unknown error */
54336         #define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
54337         /* Unable to complete operation due to fragmentation */
54338         #define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
54339         /* nvm is completely full. */
54340         #define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
54341         #define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST \
54342                 HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
54343         uint8_t unused_0[7];
54344 } __rte_packed;
54345
54346 /*******************
54347  * hwrm_nvm_modify *
54348  *******************/
54349
54350
54351 /* hwrm_nvm_modify_input (size:320b/40B) */
54352 struct hwrm_nvm_modify_input {
54353         /* The HWRM command request type. */
54354         uint16_t        req_type;
54355         /*
54356          * The completion ring to send the completion event on. This should
54357          * be the NQ ID returned from the `nq_alloc` HWRM command.
54358          */
54359         uint16_t        cmpl_ring;
54360         /*
54361          * The sequence ID is used by the driver for tracking multiple
54362          * commands. This ID is treated as opaque data by the firmware and
54363          * the value is returned in the `hwrm_resp_hdr` upon completion.
54364          */
54365         uint16_t        seq_id;
54366         /*
54367          * The target ID of the command:
54368          * * 0x0-0xFFF8 - The function ID
54369          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54370          * * 0xFFFD - Reserved for user-space HWRM interface
54371          * * 0xFFFF - HWRM
54372          */
54373         uint16_t        target_id;
54374         /*
54375          * A physical address pointer pointing to a host buffer that the
54376          * command's response data will be written. This can be either a host
54377          * physical address (HPA) or a guest physical address (GPA) and must
54378          * point to a physically contiguous block of memory.
54379          */
54380         uint64_t        resp_addr;
54381         /*
54382          * 64-bit Host Source Address.
54383          * This is where the modified data is.
54384          */
54385         uint64_t        host_src_addr;
54386         /* 16-bit directory entry index. */
54387         uint16_t        dir_idx;
54388         uint16_t        flags;
54389         /*
54390          * This flag indicates the sender wants to modify a continuous NVRAM
54391          * area using a batch of this HWRM requests. The offset of a request
54392          * must be continuous to the end of previous request's. Firmware does
54393          * not update the directory entry until receiving the last request,
54394          * which is indicated by the batch_last flag.
54395          * This flag is set usually when a sender does not have a block of
54396          * memory that is big enough to hold the entire NVRAM data for send
54397          * at one time.
54398          */
54399         #define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_MODE     UINT32_C(0x1)
54400         /*
54401          * This flag can be used only when the batch_mode flag is set.
54402          * It indicates this request is the last of batch requests.
54403          */
54404         #define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_LAST     UINT32_C(0x2)
54405         /* 32-bit NVRAM byte-offset to modify content from. */
54406         uint32_t        offset;
54407         /*
54408          * Length of data to be modified, in bytes. The length shall
54409          * be non-zero.
54410          */
54411         uint32_t        len;
54412         uint8_t unused_1[4];
54413 } __rte_packed;
54414
54415 /* hwrm_nvm_modify_output (size:128b/16B) */
54416 struct hwrm_nvm_modify_output {
54417         /* The specific error status for the command. */
54418         uint16_t        error_code;
54419         /* The HWRM command request type. */
54420         uint16_t        req_type;
54421         /* The sequence ID from the original command. */
54422         uint16_t        seq_id;
54423         /* The length of the response data in number of bytes. */
54424         uint16_t        resp_len;
54425         uint8_t unused_0[7];
54426         /*
54427          * This field is used in Output records to indicate that the output
54428          * is completely written to RAM.  This field should be read as '1'
54429          * to indicate that the output has been completely written.
54430          * When writing a command completion or response to an internal processor,
54431          * the order of writes has to be such that this field is written last.
54432          */
54433         uint8_t valid;
54434 } __rte_packed;
54435
54436 /***************************
54437  * hwrm_nvm_find_dir_entry *
54438  ***************************/
54439
54440
54441 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
54442 struct hwrm_nvm_find_dir_entry_input {
54443         /* The HWRM command request type. */
54444         uint16_t        req_type;
54445         /*
54446          * The completion ring to send the completion event on. This should
54447          * be the NQ ID returned from the `nq_alloc` HWRM command.
54448          */
54449         uint16_t        cmpl_ring;
54450         /*
54451          * The sequence ID is used by the driver for tracking multiple
54452          * commands. This ID is treated as opaque data by the firmware and
54453          * the value is returned in the `hwrm_resp_hdr` upon completion.
54454          */
54455         uint16_t        seq_id;
54456         /*
54457          * The target ID of the command:
54458          * * 0x0-0xFFF8 - The function ID
54459          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54460          * * 0xFFFD - Reserved for user-space HWRM interface
54461          * * 0xFFFF - HWRM
54462          */
54463         uint16_t        target_id;
54464         /*
54465          * A physical address pointer pointing to a host buffer that the
54466          * command's response data will be written. This can be either a host
54467          * physical address (HPA) or a guest physical address (GPA) and must
54468          * point to a physically contiguous block of memory.
54469          */
54470         uint64_t        resp_addr;
54471         uint32_t        enables;
54472         /*
54473          * This bit must be '1' for the dir_idx_valid field to be
54474          * configured.
54475          */
54476         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID \
54477                 UINT32_C(0x1)
54478         /* Directory Entry Index */
54479         uint16_t        dir_idx;
54480         /* Directory Entry (Image) Type */
54481         uint16_t        dir_type;
54482         /*
54483          * Directory ordinal.
54484          * The instance of this Directory Type
54485          */
54486         uint16_t        dir_ordinal;
54487         /* The Directory Entry Extension flags. */
54488         uint16_t        dir_ext;
54489         /* This value indicates the search option using dir_ordinal. */
54490         uint8_t opt_ordinal;
54491         /* This value indicates the search option using dir_ordinal. */
54492         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
54493         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
54494         /* Equal to specified ordinal value. */
54495         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ    UINT32_C(0x0)
54496         /* Greater than or equal to specified ordinal value */
54497         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE    UINT32_C(0x1)
54498         /* Greater than specified ordinal value */
54499         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT    UINT32_C(0x2)
54500         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST \
54501                 HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
54502         uint8_t unused_0[3];
54503 } __rte_packed;
54504
54505 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
54506 struct hwrm_nvm_find_dir_entry_output {
54507         /* The specific error status for the command. */
54508         uint16_t        error_code;
54509         /* The HWRM command request type. */
54510         uint16_t        req_type;
54511         /* The sequence ID from the original command. */
54512         uint16_t        seq_id;
54513         /* The length of the response data in number of bytes. */
54514         uint16_t        resp_len;
54515         /* Allocated NVRAM for this directory entry, in bytes. */
54516         uint32_t        dir_item_length;
54517         /* Size of the stored data for this directory entry, in bytes. */
54518         uint32_t        dir_data_length;
54519         /*
54520          * Firmware version.
54521          * Only valid if the directory entry is for embedded firmware stored
54522          * in APE_BIN Format.
54523          */
54524         uint32_t        fw_ver;
54525         /* Directory ordinal. */
54526         uint16_t        dir_ordinal;
54527         /* Directory Entry Index */
54528         uint16_t        dir_idx;
54529         uint8_t unused_0[7];
54530         /*
54531          * This field is used in Output records to indicate that the output
54532          * is completely written to RAM.  This field should be read as '1'
54533          * to indicate that the output has been completely written.
54534          * When writing a command completion or response to an internal processor,
54535          * the order of writes has to be such that this field is written last.
54536          */
54537         uint8_t valid;
54538 } __rte_packed;
54539
54540 /****************************
54541  * hwrm_nvm_erase_dir_entry *
54542  ****************************/
54543
54544
54545 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
54546 struct hwrm_nvm_erase_dir_entry_input {
54547         /* The HWRM command request type. */
54548         uint16_t        req_type;
54549         /*
54550          * The completion ring to send the completion event on. This should
54551          * be the NQ ID returned from the `nq_alloc` HWRM command.
54552          */
54553         uint16_t        cmpl_ring;
54554         /*
54555          * The sequence ID is used by the driver for tracking multiple
54556          * commands. This ID is treated as opaque data by the firmware and
54557          * the value is returned in the `hwrm_resp_hdr` upon completion.
54558          */
54559         uint16_t        seq_id;
54560         /*
54561          * The target ID of the command:
54562          * * 0x0-0xFFF8 - The function ID
54563          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54564          * * 0xFFFD - Reserved for user-space HWRM interface
54565          * * 0xFFFF - HWRM
54566          */
54567         uint16_t        target_id;
54568         /*
54569          * A physical address pointer pointing to a host buffer that the
54570          * command's response data will be written. This can be either a host
54571          * physical address (HPA) or a guest physical address (GPA) and must
54572          * point to a physically contiguous block of memory.
54573          */
54574         uint64_t        resp_addr;
54575         /* Directory Entry Index */
54576         uint16_t        dir_idx;
54577         uint8_t unused_0[6];
54578 } __rte_packed;
54579
54580 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
54581 struct hwrm_nvm_erase_dir_entry_output {
54582         /* The specific error status for the command. */
54583         uint16_t        error_code;
54584         /* The HWRM command request type. */
54585         uint16_t        req_type;
54586         /* The sequence ID from the original command. */
54587         uint16_t        seq_id;
54588         /* The length of the response data in number of bytes. */
54589         uint16_t        resp_len;
54590         uint8_t unused_0[7];
54591         /*
54592          * This field is used in Output records to indicate that the output
54593          * is completely written to RAM.  This field should be read as '1'
54594          * to indicate that the output has been completely written.
54595          * When writing a command completion or response to an internal processor,
54596          * the order of writes has to be such that this field is written last.
54597          */
54598         uint8_t valid;
54599 } __rte_packed;
54600
54601 /*************************
54602  * hwrm_nvm_get_dev_info *
54603  *************************/
54604
54605
54606 /* hwrm_nvm_get_dev_info_input (size:128b/16B) */
54607 struct hwrm_nvm_get_dev_info_input {
54608         /* The HWRM command request type. */
54609         uint16_t        req_type;
54610         /*
54611          * The completion ring to send the completion event on. This should
54612          * be the NQ ID returned from the `nq_alloc` HWRM command.
54613          */
54614         uint16_t        cmpl_ring;
54615         /*
54616          * The sequence ID is used by the driver for tracking multiple
54617          * commands. This ID is treated as opaque data by the firmware and
54618          * the value is returned in the `hwrm_resp_hdr` upon completion.
54619          */
54620         uint16_t        seq_id;
54621         /*
54622          * The target ID of the command:
54623          * * 0x0-0xFFF8 - The function ID
54624          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54625          * * 0xFFFD - Reserved for user-space HWRM interface
54626          * * 0xFFFF - HWRM
54627          */
54628         uint16_t        target_id;
54629         /*
54630          * A physical address pointer pointing to a host buffer that the
54631          * command's response data will be written. This can be either a host
54632          * physical address (HPA) or a guest physical address (GPA) and must
54633          * point to a physically contiguous block of memory.
54634          */
54635         uint64_t        resp_addr;
54636 } __rte_packed;
54637
54638 /* hwrm_nvm_get_dev_info_output (size:640b/80B) */
54639 struct hwrm_nvm_get_dev_info_output {
54640         /* The specific error status for the command. */
54641         uint16_t        error_code;
54642         /* The HWRM command request type. */
54643         uint16_t        req_type;
54644         /* The sequence ID from the original command. */
54645         uint16_t        seq_id;
54646         /* The length of the response data in number of bytes. */
54647         uint16_t        resp_len;
54648         /* Manufacturer ID. */
54649         uint16_t        manufacturer_id;
54650         /* Device ID. */
54651         uint16_t        device_id;
54652         /* Sector size of the NVRAM device. */
54653         uint32_t        sector_size;
54654         /* Total size, in bytes of the NVRAM device. */
54655         uint32_t        nvram_size;
54656         uint32_t        reserved_size;
54657         /*
54658          * Available size that can be used, in bytes.  Available size is the
54659          * NVRAM size take away the used size and reserved size.
54660          */
54661         uint32_t        available_size;
54662         /* This field represents the major version of NVM cfg */
54663         uint8_t nvm_cfg_ver_maj;
54664         /* This field represents the minor version of NVM cfg */
54665         uint8_t nvm_cfg_ver_min;
54666         /* This field represents the update version of NVM cfg */
54667         uint8_t nvm_cfg_ver_upd;
54668         uint8_t flags;
54669         /*
54670          * If set to 1, firmware will provide various firmware version
54671          * information stored in the flash.
54672          */
54673         #define HWRM_NVM_GET_DEV_INFO_OUTPUT_FLAGS_FW_VER_VALID \
54674                 UINT32_C(0x1)
54675         /*
54676          * This field represents the board package name stored in the flash.
54677          * (ASCII chars with NULL at the end).
54678          */
54679         char    pkg_name[16];
54680         /*
54681          * This field represents the major version of HWRM firmware, stored in
54682          * the flash.
54683          */
54684         uint16_t        hwrm_fw_major;
54685         /*
54686          * This field represents the minor version of HWRM firmware, stored in
54687          * the flash.
54688          */
54689         uint16_t        hwrm_fw_minor;
54690         /*
54691          * This field represents the build version of HWRM firmware, stored in
54692          * the flash.
54693          */
54694         uint16_t        hwrm_fw_build;
54695         /*
54696          * This field can be used to represent firmware branches or customer
54697          * specific releases tied to a specific (major, minor, build) version
54698          * of the HWRM firmware.
54699          */
54700         uint16_t        hwrm_fw_patch;
54701         /*
54702          * This field represents the major version of mgmt firmware, stored in
54703          * the flash.
54704          */
54705         uint16_t        mgmt_fw_major;
54706         /*
54707          * This field represents the minor version of mgmt firmware, stored in
54708          * the flash.
54709          */
54710         uint16_t        mgmt_fw_minor;
54711         /*
54712          * This field represents the build version of mgmt firmware, stored in
54713          * the flash.
54714          */
54715         uint16_t        mgmt_fw_build;
54716         /*
54717          * This field can be used to represent firmware branches or customer
54718          * specific releases tied to a specific (major, minor, build) version
54719          * of the mgmt firmware.
54720          */
54721         uint16_t        mgmt_fw_patch;
54722         /*
54723          * This field represents the major version of roce firmware, stored in
54724          * the flash.
54725          */
54726         uint16_t        roce_fw_major;
54727         /*
54728          * This field represents the minor version of roce firmware, stored in
54729          * the flash.
54730          */
54731         uint16_t        roce_fw_minor;
54732         /*
54733          * This field represents the build version of roce firmware, stored in
54734          * the flash.
54735          */
54736         uint16_t        roce_fw_build;
54737         /*
54738          * This field can be used to represent firmware branches or customer
54739          * specific releases tied to a specific (major, minor, build) version
54740          * of the roce firmware.
54741          */
54742         uint16_t        roce_fw_patch;
54743         uint8_t unused_0[7];
54744         /*
54745          * This field is used in Output records to indicate that the output
54746          * is completely written to RAM.  This field should be read as '1'
54747          * to indicate that the output has been completely written.
54748          * When writing a command completion or response to an internal processor,
54749          * the order of writes has to be such that this field is written last.
54750          */
54751         uint8_t valid;
54752 } __rte_packed;
54753
54754 /**************************
54755  * hwrm_nvm_mod_dir_entry *
54756  **************************/
54757
54758
54759 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */
54760 struct hwrm_nvm_mod_dir_entry_input {
54761         /* The HWRM command request type. */
54762         uint16_t        req_type;
54763         /*
54764          * The completion ring to send the completion event on. This should
54765          * be the NQ ID returned from the `nq_alloc` HWRM command.
54766          */
54767         uint16_t        cmpl_ring;
54768         /*
54769          * The sequence ID is used by the driver for tracking multiple
54770          * commands. This ID is treated as opaque data by the firmware and
54771          * the value is returned in the `hwrm_resp_hdr` upon completion.
54772          */
54773         uint16_t        seq_id;
54774         /*
54775          * The target ID of the command:
54776          * * 0x0-0xFFF8 - The function ID
54777          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54778          * * 0xFFFD - Reserved for user-space HWRM interface
54779          * * 0xFFFF - HWRM
54780          */
54781         uint16_t        target_id;
54782         /*
54783          * A physical address pointer pointing to a host buffer that the
54784          * command's response data will be written. This can be either a host
54785          * physical address (HPA) or a guest physical address (GPA) and must
54786          * point to a physically contiguous block of memory.
54787          */
54788         uint64_t        resp_addr;
54789         uint32_t        enables;
54790         /*
54791          * This bit must be '1' for the checksum field to be
54792          * configured.
54793          */
54794         #define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM     UINT32_C(0x1)
54795         /* Directory Entry Index */
54796         uint16_t        dir_idx;
54797         /*
54798          * Directory ordinal.
54799          * The (0-based) instance of this Directory Type.
54800          */
54801         uint16_t        dir_ordinal;
54802         /*
54803          * The Directory Entry Extension flags (see BNX_DIR_EXT_* for
54804          * extension flag definitions).
54805          */
54806         uint16_t        dir_ext;
54807         /*
54808          * Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute
54809          * flag definitions).
54810          */
54811         uint16_t        dir_attr;
54812         /*
54813          * If valid, then this field updates the checksum
54814          * value of the content in the directory entry.
54815          */
54816         uint32_t        checksum;
54817 } __rte_packed;
54818
54819 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
54820 struct hwrm_nvm_mod_dir_entry_output {
54821         /* The specific error status for the command. */
54822         uint16_t        error_code;
54823         /* The HWRM command request type. */
54824         uint16_t        req_type;
54825         /* The sequence ID from the original command. */
54826         uint16_t        seq_id;
54827         /* The length of the response data in number of bytes. */
54828         uint16_t        resp_len;
54829         uint8_t unused_0[7];
54830         /*
54831          * This field is used in Output records to indicate that the output
54832          * is completely written to RAM.  This field should be read as '1'
54833          * to indicate that the output has been completely written.
54834          * When writing a command completion or response to an internal processor,
54835          * the order of writes has to be such that this field is written last.
54836          */
54837         uint8_t valid;
54838 } __rte_packed;
54839
54840 /**************************
54841  * hwrm_nvm_verify_update *
54842  **************************/
54843
54844
54845 /* hwrm_nvm_verify_update_input (size:192b/24B) */
54846 struct hwrm_nvm_verify_update_input {
54847         /* The HWRM command request type. */
54848         uint16_t        req_type;
54849         /*
54850          * The completion ring to send the completion event on. This should
54851          * be the NQ ID returned from the `nq_alloc` HWRM command.
54852          */
54853         uint16_t        cmpl_ring;
54854         /*
54855          * The sequence ID is used by the driver for tracking multiple
54856          * commands. This ID is treated as opaque data by the firmware and
54857          * the value is returned in the `hwrm_resp_hdr` upon completion.
54858          */
54859         uint16_t        seq_id;
54860         /*
54861          * The target ID of the command:
54862          * * 0x0-0xFFF8 - The function ID
54863          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54864          * * 0xFFFD - Reserved for user-space HWRM interface
54865          * * 0xFFFF - HWRM
54866          */
54867         uint16_t        target_id;
54868         /*
54869          * A physical address pointer pointing to a host buffer that the
54870          * command's response data will be written. This can be either a host
54871          * physical address (HPA) or a guest physical address (GPA) and must
54872          * point to a physically contiguous block of memory.
54873          */
54874         uint64_t        resp_addr;
54875         /* Directory Entry Type, to be verified. */
54876         uint16_t        dir_type;
54877         /*
54878          * Directory ordinal.
54879          * The instance of the Directory Type to be verified.
54880          */
54881         uint16_t        dir_ordinal;
54882         /*
54883          * The Directory Entry Extension flags.
54884          * The "UPDATE" extension flag must be set in this value.
54885          * A corresponding directory entry with the same type and ordinal
54886          * values but *without*
54887          * the "UPDATE" extension flag must also exist. The other flags of
54888          * the extension must
54889          * be identical between the active and update entries.
54890          */
54891         uint16_t        dir_ext;
54892         uint8_t unused_0[2];
54893 } __rte_packed;
54894
54895 /* hwrm_nvm_verify_update_output (size:128b/16B) */
54896 struct hwrm_nvm_verify_update_output {
54897         /* The specific error status for the command. */
54898         uint16_t        error_code;
54899         /* The HWRM command request type. */
54900         uint16_t        req_type;
54901         /* The sequence ID from the original command. */
54902         uint16_t        seq_id;
54903         /* The length of the response data in number of bytes. */
54904         uint16_t        resp_len;
54905         uint8_t unused_0[7];
54906         /*
54907          * This field is used in Output records to indicate that the output
54908          * is completely written to RAM.  This field should be read as '1'
54909          * to indicate that the output has been completely written.
54910          * When writing a command completion or response to an internal processor,
54911          * the order of writes has to be such that this field is written last.
54912          */
54913         uint8_t valid;
54914 } __rte_packed;
54915
54916 /***************************
54917  * hwrm_nvm_install_update *
54918  ***************************/
54919
54920
54921 /* hwrm_nvm_install_update_input (size:192b/24B) */
54922 struct hwrm_nvm_install_update_input {
54923         /* The HWRM command request type. */
54924         uint16_t        req_type;
54925         /*
54926          * The completion ring to send the completion event on. This should
54927          * be the NQ ID returned from the `nq_alloc` HWRM command.
54928          */
54929         uint16_t        cmpl_ring;
54930         /*
54931          * The sequence ID is used by the driver for tracking multiple
54932          * commands. This ID is treated as opaque data by the firmware and
54933          * the value is returned in the `hwrm_resp_hdr` upon completion.
54934          */
54935         uint16_t        seq_id;
54936         /*
54937          * The target ID of the command:
54938          * * 0x0-0xFFF8 - The function ID
54939          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
54940          * * 0xFFFD - Reserved for user-space HWRM interface
54941          * * 0xFFFF - HWRM
54942          */
54943         uint16_t        target_id;
54944         /*
54945          * A physical address pointer pointing to a host buffer that the
54946          * command's response data will be written. This can be either a host
54947          * physical address (HPA) or a guest physical address (GPA) and must
54948          * point to a physically contiguous block of memory.
54949          */
54950         uint64_t        resp_addr;
54951         /*
54952          * Installation type. If the value 3 through 0xffff is used,
54953          * only packaged items with that type value will be installed and
54954          * conditional installation directives for those packaged items
54955          * will be over-ridden (i.e. 'create' or 'replace' will be treated
54956          * as 'install').
54957          */
54958         uint32_t        install_type;
54959         /*
54960          * Perform a normal package installation. Conditional installation
54961          * directives (e.g. 'create' and 'replace') of packaged items
54962          * will be followed.
54963          */
54964         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
54965         /*
54966          * Install all packaged items regardless of installation directive
54967          * (i.e. treat all packaged items as though they have an installation
54968          * directive of 'install').
54969          */
54970         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL \
54971                 UINT32_C(0xffffffff)
54972         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST \
54973                 HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL
54974         uint16_t        flags;
54975         /*
54976          * If set to 1, then securely erase all unused locations in
54977          * persistent storage.
54978          */
54979         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE \
54980                 UINT32_C(0x1)
54981         /*
54982          * If set to 1, then unspecified images, images not in the package
54983          * file, will be safely deleted.
54984          * When combined with erase_unused_space then unspecified images will
54985          * be securely erased.
54986          */
54987         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG \
54988                 UINT32_C(0x2)
54989         /*
54990          * If set to 1, FW will defragment the NVM if defragmentation is
54991          * required for the update.
54992          * Allow additional time for this command to complete if this bit is
54993          * set to 1.
54994          */
54995         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG \
54996                 UINT32_C(0x4)
54997         /*
54998          * If set to 1, FW will verify the package in the "UPDATE" NVM item
54999          * without installing it. This flag is for FW internal use only.
55000          * Users should not set this flag. The request will otherwise fail.
55001          */
55002         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_VERIFY_ONLY \
55003                 UINT32_C(0x8)
55004         uint8_t unused_0[2];
55005 } __rte_packed;
55006
55007 /* hwrm_nvm_install_update_output (size:192b/24B) */
55008 struct hwrm_nvm_install_update_output {
55009         /* The specific error status for the command. */
55010         uint16_t        error_code;
55011         /* The HWRM command request type. */
55012         uint16_t        req_type;
55013         /* The sequence ID from the original command. */
55014         uint16_t        seq_id;
55015         /* The length of the response data in number of bytes. */
55016         uint16_t        resp_len;
55017         /*
55018          * Bit-mask of successfully installed items.
55019          * Bit-0 corresponding to the first packaged item, Bit-1 for the second item, etc.
55020          * A value of 0 indicates that no items were successfully installed.
55021          */
55022         uint64_t        installed_items;
55023         /* result is 8 b corresponding to BCMRETVAL error codes */
55024         uint8_t result;
55025         /* There was no problem with the package installation. */
55026         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS \
55027                 UINT32_C(0x0)
55028         /* Generic failure */
55029         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_FAILURE \
55030                 UINT32_C(0xff)
55031         /* Allocation error malloc failure */
55032         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_MALLOC_FAILURE \
55033                 UINT32_C(0xfd)
55034         /* NVM install error due to invalid index */
55035         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_INDEX_PARAMETER \
55036                 UINT32_C(0xfb)
55037         /* NVM install error due to invalid type */
55038         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_TYPE_PARAMETER \
55039                 UINT32_C(0xf3)
55040         /* Invalid package due to invalid prerequisite */
55041         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_PREREQUISITE \
55042                 UINT32_C(0xf2)
55043         /* Invalid package due to invalid file header */
55044         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_FILE_HEADER \
55045                 UINT32_C(0xec)
55046         /* Invalid package due to invalid format */
55047         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_SIGNATURE \
55048                 UINT32_C(0xeb)
55049         /* Invalid package due to invalid property stream */
55050         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_PROP_STREAM \
55051                 UINT32_C(0xea)
55052         /* Invalid package due to invalid property length */
55053         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_PROP_LENGTH \
55054                 UINT32_C(0xe9)
55055         /* Invalid package due to invalid manifest */
55056         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_MANIFEST \
55057                 UINT32_C(0xe8)
55058         /* Invalid package due to invalid trailer */
55059         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_TRAILER \
55060                 UINT32_C(0xe7)
55061         /* Invalid package due to invalid checksum */
55062         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_CHECKSUM \
55063                 UINT32_C(0xe6)
55064         /* Invalid package due to invalid item checksum */
55065         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_ITEM_CHECKSUM \
55066                 UINT32_C(0xe5)
55067         /* Invalid package due to invalid length */
55068         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_DATA_LENGTH \
55069                 UINT32_C(0xe4)
55070         /* Invalid package due to invalid directive */
55071         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INVALID_DIRECTIVE \
55072                 UINT32_C(0xe1)
55073         /* Invalid device due to unsupported chip revision */
55074         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_CHIP_REV \
55075                 UINT32_C(0xce)
55076         /* Invalid device due to unsupported device ID */
55077         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_DEVICE_ID \
55078                 UINT32_C(0xcd)
55079         /* Invalid device due to unsupported subsystem vendor */
55080         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_SUBSYS_VENDOR \
55081                 UINT32_C(0xcc)
55082         /* Invalid device due to unsupported subsystem ID */
55083         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_SUBSYS_ID \
55084                 UINT32_C(0xcb)
55085         /* Invalid device due to unsupported product ID or customer ID */
55086         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_UNSUPPORTED_PLATFORM \
55087                 UINT32_C(0xc5)
55088         /* Invalid package due to duplicate item */
55089         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_DUPLICATE_ITEM \
55090                 UINT32_C(0xc4)
55091         /* Invalid package due to zero length item */
55092         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ZERO_LENGTH_ITEM \
55093                 UINT32_C(0xc3)
55094         /* NVM integrity error checksum */
55095         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INSTALL_CHECKSUM_ERROR \
55096                 UINT32_C(0xb9)
55097         /* NVM integrity error */
55098         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INSTALL_DATA_ERROR \
55099                 UINT32_C(0xb8)
55100         /* Authentication error */
55101         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_INSTALL_AUTHENTICATION_ERROR \
55102                 UINT32_C(0xb7)
55103         /* NVM install error item not found */
55104         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ITEM_NOT_FOUND \
55105                 UINT32_C(0xb0)
55106         /* NVM install error item locked */
55107         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ITEM_LOCKED \
55108                 UINT32_C(0xa7)
55109         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST \
55110                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_ITEM_LOCKED
55111         /* problem_item is 8 b */
55112         uint8_t problem_item;
55113         /* There was no problem with any packaged items. */
55114         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE \
55115                 UINT32_C(0x0)
55116         /* There was a problem with the NVM package itself. */
55117         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE \
55118                 UINT32_C(0xff)
55119         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST \
55120                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE
55121         /* reset_required is 8 b */
55122         uint8_t reset_required;
55123         /*
55124          * No reset is required for installed/updated firmware or
55125          * microcode to take effect.
55126          */
55127         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE \
55128                 UINT32_C(0x0)
55129         /*
55130          * A PCIe reset (e.g. system reboot) is
55131          * required for newly installed/updated firmware or
55132          * microcode to take effect.
55133          */
55134         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI \
55135                 UINT32_C(0x1)
55136         /*
55137          * A controller power reset (e.g. system power-cycle) is
55138          * required for newly installed/updated firmware or
55139          * microcode to take effect. Some newly installed/updated
55140          * firmware or microcode may still take effect upon the
55141          * next PCIe reset.
55142          */
55143         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER \
55144                 UINT32_C(0x2)
55145         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST \
55146                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER
55147         uint8_t unused_0[4];
55148         /*
55149          * This field is used in Output records to indicate that the output
55150          * is completely written to RAM.  This field should be read as '1'
55151          * to indicate that the output has been completely written.
55152          * When writing a command completion or response to an internal processor,
55153          * the order of writes has to be such that this field is written last.
55154          */
55155         uint8_t valid;
55156 } __rte_packed;
55157
55158 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
55159 struct hwrm_nvm_install_update_cmd_err {
55160         /*
55161          * command specific error codes that goes to
55162          * the cmd_err field in Common HWRM Error Response.
55163          */
55164         uint8_t code;
55165         /* Unknown error */
55166         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN \
55167                 UINT32_C(0x0)
55168         /* Unable to complete operation due to fragmentation */
55169         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR \
55170                 UINT32_C(0x1)
55171         /* nvm is completely full. */
55172         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE \
55173                 UINT32_C(0x2)
55174         /* Firmware update failed due to Anti-rollback. */
55175         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_ANTI_ROLLBACK \
55176                 UINT32_C(0x3)
55177         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST \
55178                 HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_ANTI_ROLLBACK
55179         uint8_t unused_0[7];
55180 } __rte_packed;
55181
55182 /******************
55183  * hwrm_nvm_flush *
55184  ******************/
55185
55186
55187 /* hwrm_nvm_flush_input (size:128b/16B) */
55188 struct hwrm_nvm_flush_input {
55189         /* The HWRM command request type. */
55190         uint16_t        req_type;
55191         /*
55192          * The completion ring to send the completion event on. This should
55193          * be the NQ ID returned from the `nq_alloc` HWRM command.
55194          */
55195         uint16_t        cmpl_ring;
55196         /*
55197          * The sequence ID is used by the driver for tracking multiple
55198          * commands. This ID is treated as opaque data by the firmware and
55199          * the value is returned in the `hwrm_resp_hdr` upon completion.
55200          */
55201         uint16_t        seq_id;
55202         /*
55203          * The target ID of the command:
55204          * * 0x0-0xFFF8 - The function ID
55205          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55206          * * 0xFFFD - Reserved for user-space HWRM interface
55207          * * 0xFFFF - HWRM
55208          */
55209         uint16_t        target_id;
55210         /*
55211          * A physical address pointer pointing to a host buffer that the
55212          * command's response data will be written. This can be either a host
55213          * physical address (HPA) or a guest physical address (GPA) and must
55214          * point to a physically contiguous block of memory.
55215          */
55216         uint64_t        resp_addr;
55217 } __rte_packed;
55218
55219 /* hwrm_nvm_flush_output (size:128b/16B) */
55220 struct hwrm_nvm_flush_output {
55221         /* The specific error status for the command. */
55222         uint16_t        error_code;
55223         /* The HWRM command request type. */
55224         uint16_t        req_type;
55225         /* The sequence ID from the original command. */
55226         uint16_t        seq_id;
55227         /* The length of the response data in number of bytes. */
55228         uint16_t        resp_len;
55229         uint8_t unused_0[7];
55230         /*
55231          * This field is used in Output records to indicate that the output
55232          * is completely written to RAM.  This field should be read as '1'
55233          * to indicate that the output has been completely written.
55234          * When writing a command completion or response to an internal processor,
55235          * the order of writes has to be such that this field is written last.
55236          */
55237         uint8_t valid;
55238 } __rte_packed;
55239
55240 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
55241 struct hwrm_nvm_flush_cmd_err {
55242         /*
55243          * command specific error codes that goes to
55244          * the cmd_err field in Common HWRM Error Response.
55245          */
55246         uint8_t code;
55247         /* Unknown error */
55248         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
55249         /* flush could not be performed */
55250         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL    UINT32_C(0x1)
55251         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST \
55252                 HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
55253         uint8_t unused_0[7];
55254 } __rte_packed;
55255
55256 /*************************
55257  * hwrm_nvm_get_variable *
55258  *************************/
55259
55260
55261 /* hwrm_nvm_get_variable_input (size:320b/40B) */
55262 struct hwrm_nvm_get_variable_input {
55263         /* The HWRM command request type. */
55264         uint16_t        req_type;
55265         /*
55266          * The completion ring to send the completion event on. This should
55267          * be the NQ ID returned from the `nq_alloc` HWRM command.
55268          */
55269         uint16_t        cmpl_ring;
55270         /*
55271          * The sequence ID is used by the driver for tracking multiple
55272          * commands. This ID is treated as opaque data by the firmware and
55273          * the value is returned in the `hwrm_resp_hdr` upon completion.
55274          */
55275         uint16_t        seq_id;
55276         /*
55277          * The target ID of the command:
55278          * * 0x0-0xFFF8 - The function ID
55279          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55280          * * 0xFFFD - Reserved for user-space HWRM interface
55281          * * 0xFFFF - HWRM
55282          */
55283         uint16_t        target_id;
55284         /*
55285          * A physical address pointer pointing to a host buffer that the
55286          * command's response data will be written. This can be either a host
55287          * physical address (HPA) or a guest physical address (GPA) and must
55288          * point to a physically contiguous block of memory.
55289          */
55290         uint64_t        resp_addr;
55291         /*
55292          * This is the host address where
55293          * nvm variable will be stored
55294          */
55295         uint64_t        dest_data_addr;
55296         /* size of data in bits */
55297         uint16_t        data_len;
55298         /* nvm cfg option number */
55299         uint16_t        option_num;
55300         /* reserved. */
55301         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
55302         /* reserved. */
55303         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
55304                 UINT32_C(0xffff)
55305         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST \
55306                 HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
55307         /*
55308          * Number of dimensions for this nvm configuration variable.
55309          * This value indicates how many of the indexN values to use.
55310          * A value of 0 means that none of the indexN values are valid.
55311          * A value of 1 requires at index0 is valued, a value of 2
55312          * requires that index0 and index1 are valid, and so forth
55313          */
55314         uint16_t        dimensions;
55315         /* index for the 1st dimensions */
55316         uint16_t        index_0;
55317         /* index for the 2nd dimensions */
55318         uint16_t        index_1;
55319         /* index for the 3rd dimensions */
55320         uint16_t        index_2;
55321         /* index for the 4th dimensions */
55322         uint16_t        index_3;
55323         uint8_t flags;
55324         /*
55325          * When this bit is set to 1, the factory default value will be returned,
55326          * 0 returns the operational value.
55327          */
55328         #define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT \
55329                 UINT32_C(0x1)
55330         uint8_t unused_0;
55331 } __rte_packed;
55332
55333 /* hwrm_nvm_get_variable_output (size:128b/16B) */
55334 struct hwrm_nvm_get_variable_output {
55335         /* The specific error status for the command. */
55336         uint16_t        error_code;
55337         /* The HWRM command request type. */
55338         uint16_t        req_type;
55339         /* The sequence ID from the original command. */
55340         uint16_t        seq_id;
55341         /* The length of the response data in number of bytes. */
55342         uint16_t        resp_len;
55343         /* size of data of the actual variable retrieved in bits */
55344         uint16_t        data_len;
55345         /*
55346          * option_num is the option number for the data retrieved. It is
55347          * possible in the future that the option number returned would be
55348          * different than requested. This condition could occur if an option is
55349          * deprecated and a new option id is defined with similar
55350          * characteristics, but has a slightly different definition. This
55351          * also makes it convenient for the caller to identify the variable
55352          * result with the option id from the response.
55353          */
55354         uint16_t        option_num;
55355         /* reserved. */
55356         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
55357         /* reserved. */
55358         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF \
55359                 UINT32_C(0xffff)
55360         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST \
55361                 HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF
55362         uint8_t unused_0[3];
55363         /*
55364          * This field is used in Output records to indicate that the output
55365          * is completely written to RAM.  This field should be read as '1'
55366          * to indicate that the output has been completely written.
55367          * When writing a command completion or response to an internal processor,
55368          * the order of writes has to be such that this field is written last.
55369          */
55370         uint8_t valid;
55371 } __rte_packed;
55372
55373 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
55374 struct hwrm_nvm_get_variable_cmd_err {
55375         /*
55376          * command specific error codes that goes to
55377          * the cmd_err field in Common HWRM Error Response.
55378          */
55379         uint8_t code;
55380         /* Unknown error */
55381         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
55382         /* variable does not exist */
55383         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
55384         /* configuration is corrupted and the variable cannot be saved */
55385         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
55386         /* length specified is too small */
55387         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3)
55388         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST \
55389                 HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
55390         uint8_t unused_0[7];
55391 } __rte_packed;
55392
55393 /*************************
55394  * hwrm_nvm_set_variable *
55395  *************************/
55396
55397
55398 /* hwrm_nvm_set_variable_input (size:320b/40B) */
55399 struct hwrm_nvm_set_variable_input {
55400         /* The HWRM command request type. */
55401         uint16_t        req_type;
55402         /*
55403          * The completion ring to send the completion event on. This should
55404          * be the NQ ID returned from the `nq_alloc` HWRM command.
55405          */
55406         uint16_t        cmpl_ring;
55407         /*
55408          * The sequence ID is used by the driver for tracking multiple
55409          * commands. This ID is treated as opaque data by the firmware and
55410          * the value is returned in the `hwrm_resp_hdr` upon completion.
55411          */
55412         uint16_t        seq_id;
55413         /*
55414          * The target ID of the command:
55415          * * 0x0-0xFFF8 - The function ID
55416          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55417          * * 0xFFFD - Reserved for user-space HWRM interface
55418          * * 0xFFFF - HWRM
55419          */
55420         uint16_t        target_id;
55421         /*
55422          * A physical address pointer pointing to a host buffer that the
55423          * command's response data will be written. This can be either a host
55424          * physical address (HPA) or a guest physical address (GPA) and must
55425          * point to a physically contiguous block of memory.
55426          */
55427         uint64_t        resp_addr;
55428         /*
55429          * This is the host address where
55430          * nvm variable will be copied from
55431          */
55432         uint64_t        src_data_addr;
55433         /* size of data in bits */
55434         uint16_t        data_len;
55435         /* nvm cfg option number */
55436         uint16_t        option_num;
55437         /* reserved. */
55438         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
55439         /* reserved. */
55440         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
55441                 UINT32_C(0xffff)
55442         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST \
55443                 HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
55444         /*
55445          * Number of dimensions for this nvm configuration variable.
55446          * This value indicates how many of the indexN values to use.
55447          * A value of 0 means that none of the indexN values are valid.
55448          * A value of 1 requires at index0 is valued, a value of 2
55449          * requires that index0 and index1 are valid, and so forth
55450          */
55451         uint16_t        dimensions;
55452         /* index for the 1st dimensions */
55453         uint16_t        index_0;
55454         /* index for the 2nd dimensions */
55455         uint16_t        index_1;
55456         /* index for the 3rd dimensions */
55457         uint16_t        index_2;
55458         /* index for the 4th dimensions */
55459         uint16_t        index_3;
55460         uint8_t flags;
55461         /*
55462          * When this bit is 1, flush internal cache after this write
55463          * operation (see hwrm_nvm_flush command.)
55464          */
55465         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH \
55466                 UINT32_C(0x1)
55467         /* encryption method */
55468         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK \
55469                 UINT32_C(0xe)
55470         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT           1
55471         /* No encryption. */
55472         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE \
55473                 (UINT32_C(0x0) << 1)
55474         /* one-way encryption. */
55475         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1 \
55476                 (UINT32_C(0x1) << 1)
55477         /* symmetric AES256 encryption. */
55478         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256 \
55479                 (UINT32_C(0x2) << 1)
55480         /* SHA1 digest appended to plaintext contents, for authentication */
55481         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH \
55482                 (UINT32_C(0x3) << 1)
55483         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST \
55484                 HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH
55485         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_MASK \
55486                 UINT32_C(0x70)
55487         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_SFT         4
55488         /* When this bit is 1, update the factory default region */
55489         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FACTORY_DEFAULT \
55490                 UINT32_C(0x80)
55491         uint8_t unused_0;
55492 } __rte_packed;
55493
55494 /* hwrm_nvm_set_variable_output (size:128b/16B) */
55495 struct hwrm_nvm_set_variable_output {
55496         /* The specific error status for the command. */
55497         uint16_t        error_code;
55498         /* The HWRM command request type. */
55499         uint16_t        req_type;
55500         /* The sequence ID from the original command. */
55501         uint16_t        seq_id;
55502         /* The length of the response data in number of bytes. */
55503         uint16_t        resp_len;
55504         uint8_t unused_0[7];
55505         /*
55506          * This field is used in Output records to indicate that the output
55507          * is completely written to RAM.  This field should be read as '1'
55508          * to indicate that the output has been completely written.
55509          * When writing a command completion or response to an internal processor,
55510          * the order of writes has to be such that this field is written last.
55511          */
55512         uint8_t valid;
55513 } __rte_packed;
55514
55515 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
55516 struct hwrm_nvm_set_variable_cmd_err {
55517         /*
55518          * command specific error codes that goes to
55519          * the cmd_err field in Common HWRM Error Response.
55520          */
55521         uint8_t code;
55522         /* Unknown error */
55523         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
55524         /* variable does not exist */
55525         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
55526         /* configuration is corrupted and the variable cannot be saved */
55527         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
55528         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST \
55529                 HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
55530         uint8_t unused_0[7];
55531 } __rte_packed;
55532
55533 /****************************
55534  * hwrm_nvm_validate_option *
55535  ****************************/
55536
55537
55538 /* hwrm_nvm_validate_option_input (size:320b/40B) */
55539 struct hwrm_nvm_validate_option_input {
55540         /* The HWRM command request type. */
55541         uint16_t        req_type;
55542         /*
55543          * The completion ring to send the completion event on. This should
55544          * be the NQ ID returned from the `nq_alloc` HWRM command.
55545          */
55546         uint16_t        cmpl_ring;
55547         /*
55548          * The sequence ID is used by the driver for tracking multiple
55549          * commands. This ID is treated as opaque data by the firmware and
55550          * the value is returned in the `hwrm_resp_hdr` upon completion.
55551          */
55552         uint16_t        seq_id;
55553         /*
55554          * The target ID of the command:
55555          * * 0x0-0xFFF8 - The function ID
55556          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55557          * * 0xFFFD - Reserved for user-space HWRM interface
55558          * * 0xFFFF - HWRM
55559          */
55560         uint16_t        target_id;
55561         /*
55562          * A physical address pointer pointing to a host buffer that the
55563          * command's response data will be written. This can be either a host
55564          * physical address (HPA) or a guest physical address (GPA) and must
55565          * point to a physically contiguous block of memory.
55566          */
55567         uint64_t        resp_addr;
55568         /*
55569          * This is the host address where
55570          * nvm variable will be copied from
55571          */
55572         uint64_t        src_data_addr;
55573         /* size of data in bits */
55574         uint16_t        data_len;
55575         /* nvm cfg option number */
55576         uint16_t        option_num;
55577         /* reserved. */
55578         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0 \
55579                 UINT32_C(0x0)
55580         /* reserved. */
55581         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF \
55582                 UINT32_C(0xffff)
55583         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST \
55584                 HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF
55585         /*
55586          * Number of dimensions for this nvm configuration variable.
55587          * This value indicates how many of the indexN values to use.
55588          * A value of 0 means that none of the indexN values are valid.
55589          * A value of 1 requires at index0 is valued, a value of 2
55590          * requires that index0 and index1 are valid, and so forth
55591          */
55592         uint16_t        dimensions;
55593         /* index for the 1st dimensions */
55594         uint16_t        index_0;
55595         /* index for the 2nd dimensions */
55596         uint16_t        index_1;
55597         /* index for the 3rd dimensions */
55598         uint16_t        index_2;
55599         /* index for the 4th dimensions */
55600         uint16_t        index_3;
55601         uint8_t unused_0[2];
55602 } __rte_packed;
55603
55604 /* hwrm_nvm_validate_option_output (size:128b/16B) */
55605 struct hwrm_nvm_validate_option_output {
55606         /* The specific error status for the command. */
55607         uint16_t        error_code;
55608         /* The HWRM command request type. */
55609         uint16_t        req_type;
55610         /* The sequence ID from the original command. */
55611         uint16_t        seq_id;
55612         /* The length of the response data in number of bytes. */
55613         uint16_t        resp_len;
55614         uint8_t result;
55615         /*
55616          * indicates that the value provided for the option is not matching
55617          * with the saved data.
55618          */
55619         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0)
55620         /*
55621          * indicates that the value provided for the option is matching the
55622          * saved data.
55623          */
55624         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH     UINT32_C(0x1)
55625         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST \
55626                 HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH
55627         uint8_t unused_0[6];
55628         /*
55629          * This field is used in Output records to indicate that the output
55630          * is completely written to RAM.  This field should be read as '1'
55631          * to indicate that the output has been completely written.
55632          * When writing a command completion or response to an internal processor,
55633          * the order of writes has to be such that this field is written last.
55634          */
55635         uint8_t valid;
55636 } __rte_packed;
55637
55638 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
55639 struct hwrm_nvm_validate_option_cmd_err {
55640         /*
55641          * command specific error codes that goes to
55642          * the cmd_err field in Common HWRM Error Response.
55643          */
55644         uint8_t code;
55645         /* Unknown error */
55646         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
55647         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST \
55648                 HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
55649         uint8_t unused_0[7];
55650 } __rte_packed;
55651
55652 /*******************
55653  * hwrm_nvm_defrag *
55654  *******************/
55655
55656
55657 /* hwrm_nvm_defrag_input (size:192b/24B) */
55658 struct hwrm_nvm_defrag_input {
55659         /* The HWRM command request type. */
55660         uint16_t        req_type;
55661         /*
55662          * The completion ring to send the completion event on. This should
55663          * be the NQ ID returned from the `nq_alloc` HWRM command.
55664          */
55665         uint16_t        cmpl_ring;
55666         /*
55667          * The sequence ID is used by the driver for tracking multiple
55668          * commands. This ID is treated as opaque data by the firmware and
55669          * the value is returned in the `hwrm_resp_hdr` upon completion.
55670          */
55671         uint16_t        seq_id;
55672         /*
55673          * The target ID of the command:
55674          * * 0x0-0xFFF8 - The function ID
55675          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55676          * * 0xFFFD - Reserved for user-space HWRM interface
55677          * * 0xFFFF - HWRM
55678          */
55679         uint16_t        target_id;
55680         /*
55681          * A physical address pointer pointing to a host buffer that the
55682          * command's response data will be written. This can be either a host
55683          * physical address (HPA) or a guest physical address (GPA) and must
55684          * point to a physically contiguous block of memory.
55685          */
55686         uint64_t        resp_addr;
55687         uint32_t        flags;
55688         /* This bit must be '1' to perform NVM defragmentation. */
55689         #define HWRM_NVM_DEFRAG_INPUT_FLAGS_DEFRAG     UINT32_C(0x1)
55690         uint8_t unused_0[4];
55691 } __rte_packed;
55692
55693 /* hwrm_nvm_defrag_output (size:128b/16B) */
55694 struct hwrm_nvm_defrag_output {
55695         /* The specific error status for the command. */
55696         uint16_t        error_code;
55697         /* The HWRM command request type. */
55698         uint16_t        req_type;
55699         /* The sequence ID from the original command. */
55700         uint16_t        seq_id;
55701         /* The length of the response data in number of bytes. */
55702         uint16_t        resp_len;
55703         uint8_t unused_0[7];
55704         /*
55705          * This field is used in Output records to indicate that the output
55706          * is completely written to RAM.  This field should be read as '1'
55707          * to indicate that the output has been completely written.
55708          * When writing a command completion or response to an internal processor,
55709          * the order of writes has to be such that this field is written last.
55710          */
55711         uint8_t valid;
55712 } __rte_packed;
55713
55714 /* hwrm_nvm_defrag_cmd_err (size:64b/8B) */
55715 struct hwrm_nvm_defrag_cmd_err {
55716         /*
55717          * command specific error codes that goes to
55718          * the cmd_err field in Common HWRM Error Response.
55719          */
55720         uint8_t code;
55721         /* Unknown error */
55722         #define HWRM_NVM_DEFRAG_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
55723         /* NVM defragmentation could not be performed */
55724         #define HWRM_NVM_DEFRAG_CMD_ERR_CODE_FAIL    UINT32_C(0x1)
55725         #define HWRM_NVM_DEFRAG_CMD_ERR_CODE_LAST \
55726                 HWRM_NVM_DEFRAG_CMD_ERR_CODE_FAIL
55727         uint8_t unused_0[7];
55728 } __rte_packed;
55729
55730 /****************
55731  * hwrm_oem_cmd *
55732  ****************/
55733
55734
55735 /* hwrm_oem_cmd_input (size:1024b/128B) */
55736 struct hwrm_oem_cmd_input {
55737         /* The HWRM command request type. */
55738         uint16_t        req_type;
55739         /*
55740          * The completion ring to send the completion event on. This should
55741          * be the NQ ID returned from the `nq_alloc` HWRM command.
55742          */
55743         uint16_t        cmpl_ring;
55744         /*
55745          * The sequence ID is used by the driver for tracking multiple
55746          * commands. This ID is treated as opaque data by the firmware and
55747          * the value is returned in the `hwrm_resp_hdr` upon completion.
55748          */
55749         uint16_t        seq_id;
55750         /*
55751          * The target ID of the command:
55752          * * 0x0-0xFFF8 - The function ID
55753          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55754          * * 0xFFFD - Reserved for user-space HWRM interface
55755          * * 0xFFFF - HWRM
55756          */
55757         uint16_t        target_id;
55758         /*
55759          * A physical address pointer pointing to a host buffer that the
55760          * command's response data will be written. This can be either a host
55761          * physical address (HPA) or a guest physical address (GPA) and must
55762          * point to a physically contiguous block of memory.
55763          */
55764         uint64_t        resp_addr;
55765         uint32_t        IANA;
55766         uint32_t        unused_0;
55767         /* This field contains the vendor specific command data. */
55768         uint32_t        oem_data[26];
55769 } __rte_packed;
55770
55771 /* hwrm_oem_cmd_output (size:768b/96B) */
55772 struct hwrm_oem_cmd_output {
55773         /* The specific error status for the command. */
55774         uint16_t        error_code;
55775         /* The HWRM command request type. */
55776         uint16_t        req_type;
55777         /* The sequence ID from the original command. */
55778         uint16_t        seq_id;
55779         /* The length of the response data in number of bytes. */
55780         uint16_t        resp_len;
55781         uint32_t        IANA;
55782         uint32_t        unused_0;
55783         /* This field contains the vendor specific response data. */
55784         uint32_t        oem_data[18];
55785         uint8_t unused_1[7];
55786         /*
55787          * This field is used in Output records to indicate that the output
55788          * is completely written to RAM.  This field should be read as '1'
55789          * to indicate that the output has been completely written.
55790          * When writing a command completion or response to an internal processor,
55791          * the order of writes has to be such that this field is written last.
55792          */
55793         uint8_t valid;
55794 } __rte_packed;
55795
55796 /*****************
55797  * hwrm_fw_reset *
55798  ******************/
55799
55800
55801 /* hwrm_fw_reset_input (size:192b/24B) */
55802 struct hwrm_fw_reset_input {
55803         /* The HWRM command request type. */
55804         uint16_t        req_type;
55805         /*
55806          * The completion ring to send the completion event on. This should
55807          * be the NQ ID returned from the `nq_alloc` HWRM command.
55808          */
55809         uint16_t        cmpl_ring;
55810         /*
55811          * The sequence ID is used by the driver for tracking multiple
55812          * commands. This ID is treated as opaque data by the firmware and
55813          * the value is returned in the `hwrm_resp_hdr` upon completion.
55814          */
55815         uint16_t        seq_id;
55816         /*
55817          * The target ID of the command:
55818          * * 0x0-0xFFF8 - The function ID
55819          * * 0xFFF8-0xFFFE - Reserved for internal processors
55820          * * 0xFFFF - HWRM
55821          */
55822         uint16_t        target_id;
55823         /*
55824          * A physical address pointer pointing to a host buffer that the
55825          * command's response data will be written. This can be either a host
55826          * physical address (HPA) or a guest physical address (GPA) and must
55827          * point to a physically contiguous block of memory.
55828          */
55829         uint64_t        resp_addr;
55830         /* Type of embedded processor. */
55831         uint8_t embedded_proc_type;
55832         /* Boot Processor */
55833         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_BOOT \
55834                 UINT32_C(0x0)
55835         /* Management Processor */
55836         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_MGMT \
55837                 UINT32_C(0x1)
55838         /* Network control processor */
55839         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_NETCTRL \
55840                 UINT32_C(0x2)
55841         /* RoCE control processor */
55842         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_ROCE \
55843                 UINT32_C(0x3)
55844         /*
55845          * Host (in multi-host environment): This is only valid if requester is IPC.
55846          * Reinit host hardware resources and PCIe.
55847          */
55848         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST \
55849                 UINT32_C(0x4)
55850         /*
55851          * AP processor complex (in multi-host environment).
55852          * Use host_idx to control which core is reset
55853          */
55854         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_AP \
55855                 UINT32_C(0x5)
55856         /* Reset all blocks of the chip (including all processors) */
55857         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_CHIP \
55858                 UINT32_C(0x6)
55859         /*
55860          * Host (in multi-host environment): This is only valid if requester is IPC.
55861          * Reinit host hardware resources.
55862          */
55863         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT \
55864                 UINT32_C(0x7)
55865         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_LAST \
55866                 HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT
55867         /* Type of self reset. */
55868         uint8_t selfrst_status;
55869         /* No Self Reset */
55870         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTNONE \
55871                 UINT32_C(0x0)
55872         /* Self Reset as soon as possible to do so safely */
55873         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP \
55874                 UINT32_C(0x1)
55875         /* Self Reset on PCIe Reset */
55876         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTPCIERST \
55877                 UINT32_C(0x2)
55878         /* Self Reset immediately after notification to all clients. */
55879         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
55880                 UINT32_C(0x3)
55881         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_LAST \
55882                 HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
55883         /*
55884          * Indicate which host is being reset. 0 means first host.
55885          * Only valid when embedded_proc_type is host in multihost
55886          * environment
55887          */
55888         uint8_t host_idx;
55889         uint8_t flags;
55890         /*
55891          * When this bit is '1', then the core firmware initiates
55892          * the reset only after graceful shut down of all registered instances.
55893          * If not, the device will continue with the existing firmware.
55894          */
55895         #define HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL     UINT32_C(0x1)
55896         uint8_t unused_0[4];
55897 } __rte_packed;
55898
55899 /* hwrm_fw_reset_output (size:128b/16B) */
55900 struct hwrm_fw_reset_output {
55901         /* The specific error status for the command. */
55902         uint16_t        error_code;
55903         /* The HWRM command request type. */
55904         uint16_t        req_type;
55905         /* The sequence ID from the original command. */
55906         uint16_t        seq_id;
55907         /* The length of the response data in number of bytes. */
55908         uint16_t        resp_len;
55909         /* Type of self reset. */
55910         uint8_t selfrst_status;
55911         /* No Self Reset */
55912         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTNONE \
55913                 UINT32_C(0x0)
55914         /* Self Reset as soon as possible to do so safely */
55915         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTASAP \
55916                 UINT32_C(0x1)
55917         /* Self Reset on PCIe Reset */
55918         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST \
55919                 UINT32_C(0x2)
55920         /* Self Reset immediately after notification to all clients. */
55921         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
55922                 UINT32_C(0x3)
55923         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_LAST \
55924                 HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
55925         uint8_t unused_0[6];
55926         /*
55927          * This field is used in Output records to indicate that the output
55928          * is completely written to RAM.  This field should be read as '1'
55929          * to indicate that the output has been completely written.
55930          * When writing a command completion or response to an internal processor,
55931          * the order of writes has to be such that this field is written last.
55932          */
55933         uint8_t valid;
55934 } __rte_packed;
55935
55936 /**********************
55937  * hwrm_port_ts_query *
55938  ***********************/
55939
55940
55941 /* hwrm_port_ts_query_input (size:192b/24B) */
55942 struct hwrm_port_ts_query_input {
55943         /* The HWRM command request type. */
55944         uint16_t        req_type;
55945         /*
55946          * The completion ring to send the completion event on. This should
55947          * be the NQ ID returned from the `nq_alloc` HWRM command.
55948          */
55949         uint16_t        cmpl_ring;
55950         /*
55951          * The sequence ID is used by the driver for tracking multiple
55952          * commands. This ID is treated as opaque data by the firmware and
55953          * the value is returned in the `hwrm_resp_hdr` upon completion.
55954          */
55955         uint16_t        seq_id;
55956         /*
55957          * The target ID of the command:
55958          * * 0x0-0xFFF8 - The function ID
55959          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
55960          * * 0xFFFD - Reserved for user-space HWRM interface
55961          * * 0xFFFF - HWRM
55962          */
55963         uint16_t        target_id;
55964         /*
55965          * A physical address pointer pointing to a host buffer that the
55966          * command's response data will be written. This can be either a host
55967          * physical address (HPA) or a guest physical address (GPA) and must
55968          * point to a physically contiguous block of memory.
55969          */
55970         uint64_t        resp_addr;
55971         uint32_t        flags;
55972         /*
55973          * Enumeration denoting the RX, TX type of the resource.
55974          * This enumeration is used for resources that are similar for both
55975          * TX and RX paths of the chip.
55976          */
55977         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH             0x1UL
55978         /* tx path */
55979         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_TX          0x0UL
55980         /* rx path */
55981         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX          0x1UL
55982         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_LAST        \
55983                 HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX
55984         /*
55985          * If set, the response includes the current value of the free
55986          * running timer.
55987          */
55988         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_CURRENT_TIME     0x2UL
55989         /* Port ID of port that is being queried. */
55990         uint16_t        port_id;
55991         uint8_t         unused_0[2];
55992 } __rte_packed;
55993
55994 /* hwrm_port_ts_query_output (size:192b/24B) */
55995 struct hwrm_port_ts_query_output {
55996         /* The specific error status for the command. */
55997         uint16_t        error_code;
55998         /* The HWRM command request type. */
55999         uint16_t        req_type;
56000         /* The sequence ID from the original command. */
56001         uint16_t        seq_id;
56002         /* The length of the response data in number of bytes. */
56003         uint16_t        resp_len;
56004         /*
56005          * Timestamp value of PTP message captured, or current value of
56006          * free running timer.
56007          */
56008         uint32_t        ptp_msg_ts[2];
56009         /* Sequence ID of the PTP message captured. */
56010         uint16_t        ptp_msg_seqid;
56011         uint8_t         unused_0[5];
56012         /*
56013          * This field is used in Output records to indicate that the output
56014          * is completely written to RAM.  This field should be read as '1'
56015          * to indicate that the output has been completely written.
56016          * When writing a command completion or response to an internal processor,
56017          * the order of writes has to be such that this field is written last.
56018          */
56019         uint8_t         valid;
56020 } __rte_packed;
56021
56022 /*
56023  * This structure is fixed at the beginning of the ChiMP SRAM (GRC
56024  * offset: 0x31001F0). Host software is expected to read from this
56025  * location for a defined signature. If it exists, the software can
56026  * assume the presence of this structure and the validity of the
56027  * FW_STATUS location in the next field.
56028  */
56029 /* hcomm_status (size:64b/8B) */
56030 struct hcomm_status {
56031         uint32_t        sig_ver;
56032         /*
56033          * This field defines the version of the structure. The latest
56034          * version value is 1.
56035          */
56036         #define HCOMM_STATUS_VER_MASK           UINT32_C(0xff)
56037         #define HCOMM_STATUS_VER_SFT            0
56038         #define HCOMM_STATUS_VER_LATEST         UINT32_C(0x1)
56039         #define HCOMM_STATUS_VER_LAST           HCOMM_STATUS_VER_LATEST
56040         /*
56041          * This field is to store the signature value to indicate the
56042          * presence of the structure.
56043          */
56044         #define HCOMM_STATUS_SIGNATURE_MASK     UINT32_C(0xffffff00)
56045         #define HCOMM_STATUS_SIGNATURE_SFT      8
56046         #define HCOMM_STATUS_SIGNATURE_VAL      (UINT32_C(0x484353) << 8)
56047         #define HCOMM_STATUS_SIGNATURE_LAST     HCOMM_STATUS_SIGNATURE_VAL
56048         uint32_t        fw_status_loc;
56049         #define HCOMM_STATUS_TRUE_ADDR_SPACE_MASK       UINT32_C(0x3)
56050         #define HCOMM_STATUS_TRUE_ADDR_SPACE_SFT        0
56051         /* PCIE configuration space */
56052         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
56053         /* GRC space */
56054         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_GRC       UINT32_C(0x1)
56055         /* BAR0 space */
56056         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR0      UINT32_C(0x2)
56057         /* BAR1 space */
56058         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1      UINT32_C(0x3)
56059         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_LAST      \
56060                 HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1
56061         /*
56062          * This offset where the fw_status register is located. The value
56063          * is generally 4-byte aligned.
56064          */
56065         #define HCOMM_STATUS_TRUE_OFFSET_MASK           UINT32_C(0xfffffffc)
56066         #define HCOMM_STATUS_TRUE_OFFSET_SFT            2
56067 } __rte_packed;
56068 /* This is the GRC offset where the hcomm_status struct resides. */
56069 #define HCOMM_STATUS_STRUCT_LOC         0x31001F0UL
56070
56071 /**************************
56072  * hwrm_port_phy_i2c_read *
56073  **************************/
56074
56075
56076 /* hwrm_port_phy_i2c_read_input (size:320b/40B) */
56077 struct hwrm_port_phy_i2c_read_input {
56078         /* The HWRM command request type. */
56079         uint16_t        req_type;
56080         /*
56081          * The completion ring to send the completion event on. This should
56082          * be the NQ ID returned from the `nq_alloc` HWRM command.
56083          */
56084         uint16_t        cmpl_ring;
56085         /*
56086          * The sequence ID is used by the driver for tracking multiple
56087          * commands. This ID is treated as opaque data by the firmware and
56088          * the value is returned in the `hwrm_resp_hdr` upon completion.
56089          */
56090         uint16_t        seq_id;
56091         /*
56092          * The target ID of the command:
56093          * * 0x0-0xFFF8 - The function ID
56094          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
56095          * * 0xFFFD - Reserved for user-space HWRM interface
56096          * * 0xFFFF - HWRM
56097          */
56098         uint16_t        target_id;
56099         /*
56100          * A physical address pointer pointing to a host buffer that the
56101          * command's response data will be written. This can be either a host
56102          * physical address (HPA) or a guest physical address (GPA) and must
56103          * point to a physically contiguous block of memory.
56104          */
56105         uint64_t        resp_addr;
56106         uint32_t        flags;
56107         uint32_t        enables;
56108         /*
56109          * This bit must be '1' for the page_offset field to be
56110          * configured.
56111          */
56112         #define HWRM_PORT_PHY_I2C_READ_INPUT_ENABLES_PAGE_OFFSET     0x1UL
56113         /* Port ID of port. */
56114         uint16_t        port_id;
56115         /* 8-bit I2C slave address. */
56116         uint8_t i2c_slave_addr;
56117         uint8_t unused_0;
56118         /* The page number that is being accessed over I2C. */
56119         uint16_t        page_number;
56120         /* Offset within the page that is being accessed over I2C. */
56121         uint16_t        page_offset;
56122         /*
56123          * Length of data to read, in bytes starting at the offset
56124          * specified above. If the offset is not specified, then
56125          * the data shall be read from the beginning of the page.
56126          */
56127         uint8_t data_length;
56128         uint8_t unused_1[7];
56129 } __rte_packed;
56130
56131 /* hwrm_port_phy_i2c_read_output (size:640b/80B) */
56132 struct hwrm_port_phy_i2c_read_output {
56133         /* The specific error status for the command. */
56134         uint16_t        error_code;
56135         /* The HWRM command request type. */
56136         uint16_t        req_type;
56137         /* The sequence ID from the original command. */
56138         uint16_t        seq_id;
56139         /* The length of the response data in number of bytes. */
56140         uint16_t        resp_len;
56141         /* Up to 64B of data. */
56142         uint32_t        data[16];
56143         uint8_t unused_0[7];
56144         /*
56145          * This field is used in Output records to indicate that the output
56146          * is completely written to RAM.  This field should be read as '1'
56147          * to indicate that the output has been completely written.
56148          * When writing a command completion or response to an internal processor,
56149          * the order of writes has to be such that this field is written last.
56150          */
56151         uint8_t valid;
56152 } __rte_packed;
56153 #endif /* _HSI_STRUCT_DEF_DPDK_H_ */