net/bnxt: cleanup logs in session handling paths
[dpdk.git] / drivers / net / bnxt / hsi_struct_def_dpdk.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2014-2021 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_CFA_L2_FILTER_ALLOC                  UINT32_C(0x90)
368         #define HWRM_CFA_L2_FILTER_FREE                   UINT32_C(0x91)
369         #define HWRM_CFA_L2_FILTER_CFG                    UINT32_C(0x92)
370         #define HWRM_CFA_L2_SET_RX_MASK                   UINT32_C(0x93)
371         #define HWRM_CFA_VLAN_ANTISPOOF_CFG               UINT32_C(0x94)
372         #define HWRM_CFA_TUNNEL_FILTER_ALLOC              UINT32_C(0x95)
373         #define HWRM_CFA_TUNNEL_FILTER_FREE               UINT32_C(0x96)
374         /* Experimental */
375         #define HWRM_CFA_ENCAP_RECORD_ALLOC               UINT32_C(0x97)
376         /* Experimental */
377         #define HWRM_CFA_ENCAP_RECORD_FREE                UINT32_C(0x98)
378         #define HWRM_CFA_NTUPLE_FILTER_ALLOC              UINT32_C(0x99)
379         #define HWRM_CFA_NTUPLE_FILTER_FREE               UINT32_C(0x9a)
380         #define HWRM_CFA_NTUPLE_FILTER_CFG                UINT32_C(0x9b)
381         /* Experimental */
382         #define HWRM_CFA_EM_FLOW_ALLOC                    UINT32_C(0x9c)
383         /* Experimental */
384         #define HWRM_CFA_EM_FLOW_FREE                     UINT32_C(0x9d)
385         /* Experimental */
386         #define HWRM_CFA_EM_FLOW_CFG                      UINT32_C(0x9e)
387         #define HWRM_TUNNEL_DST_PORT_QUERY                UINT32_C(0xa0)
388         #define HWRM_TUNNEL_DST_PORT_ALLOC                UINT32_C(0xa1)
389         #define HWRM_TUNNEL_DST_PORT_FREE                 UINT32_C(0xa2)
390         #define HWRM_STAT_CTX_ENG_QUERY                   UINT32_C(0xaf)
391         #define HWRM_STAT_CTX_ALLOC                       UINT32_C(0xb0)
392         #define HWRM_STAT_CTX_FREE                        UINT32_C(0xb1)
393         #define HWRM_STAT_CTX_QUERY                       UINT32_C(0xb2)
394         #define HWRM_STAT_CTX_CLR_STATS                   UINT32_C(0xb3)
395         #define HWRM_PORT_QSTATS_EXT                      UINT32_C(0xb4)
396         #define HWRM_PORT_PHY_MDIO_WRITE                  UINT32_C(0xb5)
397         #define HWRM_PORT_PHY_MDIO_READ                   UINT32_C(0xb6)
398         #define HWRM_PORT_PHY_MDIO_BUS_ACQUIRE            UINT32_C(0xb7)
399         #define HWRM_PORT_PHY_MDIO_BUS_RELEASE            UINT32_C(0xb8)
400         #define HWRM_PORT_QSTATS_EXT_PFC_WD               UINT32_C(0xb9)
401         /* Reserved. */
402         #define HWRM_RESERVED7                            UINT32_C(0xba)
403         #define HWRM_PORT_TX_FIR_CFG                      UINT32_C(0xbb)
404         #define HWRM_PORT_TX_FIR_QCFG                     UINT32_C(0xbc)
405         #define HWRM_PORT_ECN_QSTATS                      UINT32_C(0xbd)
406         #define HWRM_FW_LIVEPATCH_QUERY                   UINT32_C(0xbe)
407         #define HWRM_FW_LIVEPATCH                         UINT32_C(0xbf)
408         #define HWRM_FW_RESET                             UINT32_C(0xc0)
409         #define HWRM_FW_QSTATUS                           UINT32_C(0xc1)
410         #define HWRM_FW_HEALTH_CHECK                      UINT32_C(0xc2)
411         #define HWRM_FW_SYNC                              UINT32_C(0xc3)
412         #define HWRM_FW_STATE_QCAPS                       UINT32_C(0xc4)
413         #define HWRM_FW_STATE_QUIESCE                     UINT32_C(0xc5)
414         #define HWRM_FW_STATE_BACKUP                      UINT32_C(0xc6)
415         #define HWRM_FW_STATE_RESTORE                     UINT32_C(0xc7)
416         /* Experimental */
417         #define HWRM_FW_SET_TIME                          UINT32_C(0xc8)
418         /* Experimental */
419         #define HWRM_FW_GET_TIME                          UINT32_C(0xc9)
420         /* Experimental */
421         #define HWRM_FW_SET_STRUCTURED_DATA               UINT32_C(0xca)
422         /* Experimental */
423         #define HWRM_FW_GET_STRUCTURED_DATA               UINT32_C(0xcb)
424         /* Experimental */
425         #define HWRM_FW_IPC_MAILBOX                       UINT32_C(0xcc)
426         #define HWRM_FW_ECN_CFG                           UINT32_C(0xcd)
427         #define HWRM_FW_ECN_QCFG                          UINT32_C(0xce)
428         #define HWRM_FW_SECURE_CFG                        UINT32_C(0xcf)
429         #define HWRM_EXEC_FWD_RESP                        UINT32_C(0xd0)
430         #define HWRM_REJECT_FWD_RESP                      UINT32_C(0xd1)
431         #define HWRM_FWD_RESP                             UINT32_C(0xd2)
432         #define HWRM_FWD_ASYNC_EVENT_CMPL                 UINT32_C(0xd3)
433         #define HWRM_OEM_CMD                              UINT32_C(0xd4)
434         /* Tells the fw to run PRBS test on a given port and lane. */
435         #define HWRM_PORT_PRBS_TEST                       UINT32_C(0xd5)
436         #define HWRM_PORT_SFP_SIDEBAND_CFG                UINT32_C(0xd6)
437         #define HWRM_PORT_SFP_SIDEBAND_QCFG               UINT32_C(0xd7)
438         #define HWRM_FW_STATE_UNQUIESCE                   UINT32_C(0xd8)
439         /* Tells the fw to collect dsc dump on a given port and lane. */
440         #define HWRM_PORT_DSC_DUMP                        UINT32_C(0xd9)
441         #define HWRM_TEMP_MONITOR_QUERY                   UINT32_C(0xe0)
442         #define HWRM_REG_POWER_QUERY                      UINT32_C(0xe1)
443         #define HWRM_CORE_FREQUENCY_QUERY                 UINT32_C(0xe2)
444         #define HWRM_REG_POWER_HISTOGRAM                  UINT32_C(0xe3)
445         #define HWRM_WOL_FILTER_ALLOC                     UINT32_C(0xf0)
446         #define HWRM_WOL_FILTER_FREE                      UINT32_C(0xf1)
447         #define HWRM_WOL_FILTER_QCFG                      UINT32_C(0xf2)
448         #define HWRM_WOL_REASON_QCFG                      UINT32_C(0xf3)
449         /* Experimental */
450         #define HWRM_CFA_METER_QCAPS                      UINT32_C(0xf4)
451         /* Experimental */
452         #define HWRM_CFA_METER_PROFILE_ALLOC              UINT32_C(0xf5)
453         /* Experimental */
454         #define HWRM_CFA_METER_PROFILE_FREE               UINT32_C(0xf6)
455         /* Experimental */
456         #define HWRM_CFA_METER_PROFILE_CFG                UINT32_C(0xf7)
457         /* Experimental */
458         #define HWRM_CFA_METER_INSTANCE_ALLOC             UINT32_C(0xf8)
459         /* Experimental */
460         #define HWRM_CFA_METER_INSTANCE_FREE              UINT32_C(0xf9)
461         /* Experimental */
462         #define HWRM_CFA_METER_INSTANCE_CFG               UINT32_C(0xfa)
463         /* Experimental */
464         #define HWRM_CFA_VFR_ALLOC                        UINT32_C(0xfd)
465         /* Experimental */
466         #define HWRM_CFA_VFR_FREE                         UINT32_C(0xfe)
467         /* Experimental */
468         #define HWRM_CFA_VF_PAIR_ALLOC                    UINT32_C(0x100)
469         /* Experimental */
470         #define HWRM_CFA_VF_PAIR_FREE                     UINT32_C(0x101)
471         /* Experimental */
472         #define HWRM_CFA_VF_PAIR_INFO                     UINT32_C(0x102)
473         /* Experimental */
474         #define HWRM_CFA_FLOW_ALLOC                       UINT32_C(0x103)
475         /* Experimental */
476         #define HWRM_CFA_FLOW_FREE                        UINT32_C(0x104)
477         /* Experimental */
478         #define HWRM_CFA_FLOW_FLUSH                       UINT32_C(0x105)
479         /* Experimental */
480         #define HWRM_CFA_FLOW_STATS                       UINT32_C(0x106)
481         /* Experimental */
482         #define HWRM_CFA_FLOW_INFO                        UINT32_C(0x107)
483         /* Experimental */
484         #define HWRM_CFA_DECAP_FILTER_ALLOC               UINT32_C(0x108)
485         /* Experimental */
486         #define HWRM_CFA_DECAP_FILTER_FREE                UINT32_C(0x109)
487         #define HWRM_CFA_VLAN_ANTISPOOF_QCFG              UINT32_C(0x10a)
488         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC       UINT32_C(0x10b)
489         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE        UINT32_C(0x10c)
490         /* Experimental */
491         #define HWRM_CFA_PAIR_ALLOC                       UINT32_C(0x10d)
492         /* Experimental */
493         #define HWRM_CFA_PAIR_FREE                        UINT32_C(0x10e)
494         /* Experimental */
495         #define HWRM_CFA_PAIR_INFO                        UINT32_C(0x10f)
496         /* Experimental */
497         #define HWRM_FW_IPC_MSG                           UINT32_C(0x110)
498         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO        UINT32_C(0x111)
499         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE       UINT32_C(0x112)
500         /* Experimental */
501         #define HWRM_CFA_FLOW_AGING_TIMER_RESET           UINT32_C(0x113)
502         /* Experimental */
503         #define HWRM_CFA_FLOW_AGING_CFG                   UINT32_C(0x114)
504         /* Experimental */
505         #define HWRM_CFA_FLOW_AGING_QCFG                  UINT32_C(0x115)
506         /* Experimental */
507         #define HWRM_CFA_FLOW_AGING_QCAPS                 UINT32_C(0x116)
508         /* Experimental */
509         #define HWRM_CFA_CTX_MEM_RGTR                     UINT32_C(0x117)
510         /* Experimental */
511         #define HWRM_CFA_CTX_MEM_UNRGTR                   UINT32_C(0x118)
512         /* Experimental */
513         #define HWRM_CFA_CTX_MEM_QCTX                     UINT32_C(0x119)
514         /* Experimental */
515         #define HWRM_CFA_CTX_MEM_QCAPS                    UINT32_C(0x11a)
516         /* Experimental */
517         #define HWRM_CFA_COUNTER_QCAPS                    UINT32_C(0x11b)
518         /* Experimental */
519         #define HWRM_CFA_COUNTER_CFG                      UINT32_C(0x11c)
520         /* Experimental */
521         #define HWRM_CFA_COUNTER_QCFG                     UINT32_C(0x11d)
522         /* Experimental */
523         #define HWRM_CFA_COUNTER_QSTATS                   UINT32_C(0x11e)
524         /* Experimental */
525         #define HWRM_CFA_TCP_FLAG_PROCESS_QCFG            UINT32_C(0x11f)
526         /* Experimental */
527         #define HWRM_CFA_EEM_QCAPS                        UINT32_C(0x120)
528         /* Experimental */
529         #define HWRM_CFA_EEM_CFG                          UINT32_C(0x121)
530         /* Experimental */
531         #define HWRM_CFA_EEM_QCFG                         UINT32_C(0x122)
532         /* Experimental */
533         #define HWRM_CFA_EEM_OP                           UINT32_C(0x123)
534         /* Experimental */
535         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS              UINT32_C(0x124)
536         /* Experimental - DEPRECATED */
537         #define HWRM_CFA_TFLIB                            UINT32_C(0x125)
538         /* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */
539         #define HWRM_ENGINE_CKV_STATUS                    UINT32_C(0x12e)
540         /* Engine CKV - Add a new CKEK used to encrypt keys. */
541         #define HWRM_ENGINE_CKV_CKEK_ADD                  UINT32_C(0x12f)
542         /* Engine CKV - Delete a previously added CKEK. */
543         #define HWRM_ENGINE_CKV_CKEK_DELETE               UINT32_C(0x130)
544         /* Engine CKV - Add a new key to the key vault. */
545         #define HWRM_ENGINE_CKV_KEY_ADD                   UINT32_C(0x131)
546         /* Engine CKV - Delete a key from the key vault. */
547         #define HWRM_ENGINE_CKV_KEY_DELETE                UINT32_C(0x132)
548         /* Engine CKV - Delete all keys from the key vault. */
549         #define HWRM_ENGINE_CKV_FLUSH                     UINT32_C(0x133)
550         /* Engine CKV - Get random data. */
551         #define HWRM_ENGINE_CKV_RNG_GET                   UINT32_C(0x134)
552         /* Engine CKV - Generate and encrypt a new AES key. */
553         #define HWRM_ENGINE_CKV_KEY_GEN                   UINT32_C(0x135)
554         /* Engine CKV - Configure a label index with a label value. */
555         #define HWRM_ENGINE_CKV_KEY_LABEL_CFG             UINT32_C(0x136)
556         /* Engine CKV - Query a label */
557         #define HWRM_ENGINE_CKV_KEY_LABEL_QCFG            UINT32_C(0x137)
558         /* Engine - Query the available queue groups configuration. */
559         #define HWRM_ENGINE_QG_CONFIG_QUERY               UINT32_C(0x13c)
560         /* Engine - Query the queue groups assigned to a function. */
561         #define HWRM_ENGINE_QG_QUERY                      UINT32_C(0x13d)
562         /* Engine - Query the available queue group meter profile configuration. */
563         #define HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY UINT32_C(0x13e)
564         /* Engine - Query the configuration of a queue group meter profile. */
565         #define HWRM_ENGINE_QG_METER_PROFILE_QUERY        UINT32_C(0x13f)
566         /* Engine - Allocate a queue group meter profile. */
567         #define HWRM_ENGINE_QG_METER_PROFILE_ALLOC        UINT32_C(0x140)
568         /* Engine - Free a queue group meter profile. */
569         #define HWRM_ENGINE_QG_METER_PROFILE_FREE         UINT32_C(0x141)
570         /* Engine - Query the meters assigned to a queue group. */
571         #define HWRM_ENGINE_QG_METER_QUERY                UINT32_C(0x142)
572         /* Engine - Bind a queue group meter profile to a queue group. */
573         #define HWRM_ENGINE_QG_METER_BIND                 UINT32_C(0x143)
574         /* Engine - Unbind a queue group meter profile from a queue group. */
575         #define HWRM_ENGINE_QG_METER_UNBIND               UINT32_C(0x144)
576         /* Engine - Bind a queue group to a function. */
577         #define HWRM_ENGINE_QG_FUNC_BIND                  UINT32_C(0x145)
578         /* Engine - Query the scheduling group configuration. */
579         #define HWRM_ENGINE_SG_CONFIG_QUERY               UINT32_C(0x146)
580         /* Engine - Query the queue groups assigned to a scheduling group. */
581         #define HWRM_ENGINE_SG_QUERY                      UINT32_C(0x147)
582         /* Engine - Query the configuration of a scheduling group's meter profiles. */
583         #define HWRM_ENGINE_SG_METER_QUERY                UINT32_C(0x148)
584         /* Engine - Configure a scheduling group's meter profiles. */
585         #define HWRM_ENGINE_SG_METER_CONFIG               UINT32_C(0x149)
586         /* Engine - Bind a queue group to a scheduling group. */
587         #define HWRM_ENGINE_SG_QG_BIND                    UINT32_C(0x14a)
588         /* Engine - Unbind a queue group from its scheduling group. */
589         #define HWRM_ENGINE_QG_SG_UNBIND                  UINT32_C(0x14b)
590         /* Engine - Query the Engine configuration. */
591         #define HWRM_ENGINE_CONFIG_QUERY                  UINT32_C(0x154)
592         /* Engine - Configure the statistics accumulator for an Engine. */
593         #define HWRM_ENGINE_STATS_CONFIG                  UINT32_C(0x155)
594         /* Engine - Clear the statistics accumulator for an Engine. */
595         #define HWRM_ENGINE_STATS_CLEAR                   UINT32_C(0x156)
596         /* Engine - Query the statistics accumulator for an Engine. */
597         #define HWRM_ENGINE_STATS_QUERY                   UINT32_C(0x157)
598         /* Engine - Query statistics counters for continuous errors from all CDDIP Engines. */
599         #define HWRM_ENGINE_STATS_QUERY_CONTINUOUS_ERROR  UINT32_C(0x158)
600         /* Engine - Allocate an Engine RQ. */
601         #define HWRM_ENGINE_RQ_ALLOC                      UINT32_C(0x15e)
602         /* Engine - Free an Engine RQ. */
603         #define HWRM_ENGINE_RQ_FREE                       UINT32_C(0x15f)
604         /* Engine - Allocate an Engine CQ. */
605         #define HWRM_ENGINE_CQ_ALLOC                      UINT32_C(0x160)
606         /* Engine - Free an Engine CQ. */
607         #define HWRM_ENGINE_CQ_FREE                       UINT32_C(0x161)
608         /* Engine - Allocate an NQ. */
609         #define HWRM_ENGINE_NQ_ALLOC                      UINT32_C(0x162)
610         /* Engine - Free an NQ. */
611         #define HWRM_ENGINE_NQ_FREE                       UINT32_C(0x163)
612         /* Engine - Set the on-die RQE credit update location. */
613         #define HWRM_ENGINE_ON_DIE_RQE_CREDITS            UINT32_C(0x164)
614         /* Engine - Query the engine function configuration. */
615         #define HWRM_ENGINE_FUNC_QCFG                     UINT32_C(0x165)
616         /* Experimental */
617         #define HWRM_FUNC_RESOURCE_QCAPS                  UINT32_C(0x190)
618         /* Experimental */
619         #define HWRM_FUNC_VF_RESOURCE_CFG                 UINT32_C(0x191)
620         /* Experimental */
621         #define HWRM_FUNC_BACKING_STORE_QCAPS             UINT32_C(0x192)
622         /* Experimental */
623         #define HWRM_FUNC_BACKING_STORE_CFG               UINT32_C(0x193)
624         /* Experimental */
625         #define HWRM_FUNC_BACKING_STORE_QCFG              UINT32_C(0x194)
626         /* Configures the BW of any VF */
627         #define HWRM_FUNC_VF_BW_CFG                       UINT32_C(0x195)
628         /* Queries the BW of any VF */
629         #define HWRM_FUNC_VF_BW_QCFG                      UINT32_C(0x196)
630         /* Queries pf ids belong to specified host(s) */
631         #define HWRM_FUNC_HOST_PF_IDS_QUERY               UINT32_C(0x197)
632         /* Queries extended stats per function */
633         #define HWRM_FUNC_QSTATS_EXT                      UINT32_C(0x198)
634         /* Queries extended statistics context */
635         #define HWRM_STAT_EXT_CTX_QUERY                   UINT32_C(0x199)
636         /* Configure SoC packet DMA settings */
637         #define HWRM_FUNC_SPD_CFG                         UINT32_C(0x19a)
638         /* Query SoC packet DMA settings */
639         #define HWRM_FUNC_SPD_QCFG                        UINT32_C(0x19b)
640         /* Experimental */
641         #define HWRM_SELFTEST_QLIST                       UINT32_C(0x200)
642         /* Experimental */
643         #define HWRM_SELFTEST_EXEC                        UINT32_C(0x201)
644         /* Experimental */
645         #define HWRM_SELFTEST_IRQ                         UINT32_C(0x202)
646         /* Experimental */
647         #define HWRM_SELFTEST_RETRIEVE_SERDES_DATA        UINT32_C(0x203)
648         /* Experimental */
649         #define HWRM_PCIE_QSTATS                          UINT32_C(0x204)
650         /* Experimental */
651         #define HWRM_MFG_FRU_WRITE_CONTROL                UINT32_C(0x205)
652         /* Returns the current value of a free running counter from the device. */
653         #define HWRM_MFG_TIMERS_QUERY                     UINT32_C(0x206)
654         /* Experimental */
655         #define HWRM_MFG_OTP_CFG                          UINT32_C(0x207)
656         /* Experimental */
657         #define HWRM_MFG_OTP_QCFG                         UINT32_C(0x208)
658         /*
659          * Tells the fw to run the DMA read from the host and DMA write
660          * to the host test.
661          */
662         #define HWRM_MFG_HDMA_TEST                        UINT32_C(0x209)
663         /* Tells the fw to program the fru memory */
664         #define HWRM_MFG_FRU_EEPROM_WRITE                 UINT32_C(0x20a)
665         /* Tells the fw to read the fru memory */
666         #define HWRM_MFG_FRU_EEPROM_READ                  UINT32_C(0x20b)
667         /* Used to provision SoC software images */
668         #define HWRM_MFG_SOC_IMAGE                        UINT32_C(0x20c)
669         /* Retrieves the SoC status and image provisioning information */
670         #define HWRM_MFG_SOC_QSTATUS                      UINT32_C(0x20d)
671         /* Tells the fw to program the seeprom memory */
672         #define HWRM_MFG_PARAM_SEEPROM_SYNC               UINT32_C(0x20e)
673         /* Tells the fw to read the seeprom memory */
674         #define HWRM_MFG_PARAM_SEEPROM_READ               UINT32_C(0x20f)
675         /* Tells the fw to get the health of seeprom data */
676         #define HWRM_MFG_PARAM_SEEPROM_HEALTH             UINT32_C(0x210)
677         /* Experimental */
678         #define HWRM_TF                                   UINT32_C(0x2bc)
679         /* Experimental */
680         #define HWRM_TF_VERSION_GET                       UINT32_C(0x2bd)
681         /* Experimental */
682         #define HWRM_TF_SESSION_OPEN                      UINT32_C(0x2c6)
683         /* Experimental */
684         #define HWRM_TF_SESSION_ATTACH                    UINT32_C(0x2c7)
685         /* Experimental */
686         #define HWRM_TF_SESSION_REGISTER                  UINT32_C(0x2c8)
687         /* Experimental */
688         #define HWRM_TF_SESSION_UNREGISTER                UINT32_C(0x2c9)
689         /* Experimental */
690         #define HWRM_TF_SESSION_CLOSE                     UINT32_C(0x2ca)
691         /* Experimental */
692         #define HWRM_TF_SESSION_QCFG                      UINT32_C(0x2cb)
693         /* Experimental */
694         #define HWRM_TF_SESSION_RESC_QCAPS                UINT32_C(0x2cc)
695         /* Experimental */
696         #define HWRM_TF_SESSION_RESC_ALLOC                UINT32_C(0x2cd)
697         /* Experimental */
698         #define HWRM_TF_SESSION_RESC_FREE                 UINT32_C(0x2ce)
699         /* Experimental */
700         #define HWRM_TF_SESSION_RESC_FLUSH                UINT32_C(0x2cf)
701         /* Experimental */
702         #define HWRM_TF_SESSION_RESC_INFO                 UINT32_C(0x2d0)
703         /* Experimental */
704         #define HWRM_TF_TBL_TYPE_GET                      UINT32_C(0x2da)
705         /* Experimental */
706         #define HWRM_TF_TBL_TYPE_SET                      UINT32_C(0x2db)
707         /* Experimental */
708         #define HWRM_TF_TBL_TYPE_BULK_GET                 UINT32_C(0x2dc)
709         /* Experimental */
710         #define HWRM_TF_CTXT_MEM_ALLOC                    UINT32_C(0x2e2)
711         /* Experimental */
712         #define HWRM_TF_CTXT_MEM_FREE                     UINT32_C(0x2e3)
713         /* Experimental */
714         #define HWRM_TF_CTXT_MEM_RGTR                     UINT32_C(0x2e4)
715         /* Experimental */
716         #define HWRM_TF_CTXT_MEM_UNRGTR                   UINT32_C(0x2e5)
717         /* Experimental */
718         #define HWRM_TF_EXT_EM_QCAPS                      UINT32_C(0x2e6)
719         /* Experimental */
720         #define HWRM_TF_EXT_EM_OP                         UINT32_C(0x2e7)
721         /* Experimental */
722         #define HWRM_TF_EXT_EM_CFG                        UINT32_C(0x2e8)
723         /* Experimental */
724         #define HWRM_TF_EXT_EM_QCFG                       UINT32_C(0x2e9)
725         /* Experimental */
726         #define HWRM_TF_EM_INSERT                         UINT32_C(0x2ea)
727         /* Experimental */
728         #define HWRM_TF_EM_DELETE                         UINT32_C(0x2eb)
729         /* Experimental */
730         #define HWRM_TF_EM_HASH_INSERT                    UINT32_C(0x2ec)
731         /* Experimental */
732         #define HWRM_TF_EM_MOVE                           UINT32_C(0x2ed)
733         /* Experimental */
734         #define HWRM_TF_TCAM_SET                          UINT32_C(0x2f8)
735         /* Experimental */
736         #define HWRM_TF_TCAM_GET                          UINT32_C(0x2f9)
737         /* Experimental */
738         #define HWRM_TF_TCAM_MOVE                         UINT32_C(0x2fa)
739         /* Experimental */
740         #define HWRM_TF_TCAM_FREE                         UINT32_C(0x2fb)
741         /* Experimental */
742         #define HWRM_TF_GLOBAL_CFG_SET                    UINT32_C(0x2fc)
743         /* Experimental */
744         #define HWRM_TF_GLOBAL_CFG_GET                    UINT32_C(0x2fd)
745         /* Experimental */
746         #define HWRM_TF_IF_TBL_SET                        UINT32_C(0x2fe)
747         /* Experimental */
748         #define HWRM_TF_IF_TBL_GET                        UINT32_C(0x2ff)
749         /* Experimental */
750         #define HWRM_SV                                   UINT32_C(0x400)
751         /* Experimental */
752         #define HWRM_DBG_READ_DIRECT                      UINT32_C(0xff10)
753         /* Experimental */
754         #define HWRM_DBG_READ_INDIRECT                    UINT32_C(0xff11)
755         /* Experimental */
756         #define HWRM_DBG_WRITE_DIRECT                     UINT32_C(0xff12)
757         /* Experimental */
758         #define HWRM_DBG_WRITE_INDIRECT                   UINT32_C(0xff13)
759         #define HWRM_DBG_DUMP                             UINT32_C(0xff14)
760         /* Experimental */
761         #define HWRM_DBG_ERASE_NVM                        UINT32_C(0xff15)
762         /* Experimental */
763         #define HWRM_DBG_CFG                              UINT32_C(0xff16)
764         /* Experimental */
765         #define HWRM_DBG_COREDUMP_LIST                    UINT32_C(0xff17)
766         /* Experimental */
767         #define HWRM_DBG_COREDUMP_INITIATE                UINT32_C(0xff18)
768         /* Experimental */
769         #define HWRM_DBG_COREDUMP_RETRIEVE                UINT32_C(0xff19)
770         /* Experimental */
771         #define HWRM_DBG_FW_CLI                           UINT32_C(0xff1a)
772         /*  */
773         #define HWRM_DBG_I2C_CMD                          UINT32_C(0xff1b)
774         /*  */
775         #define HWRM_DBG_RING_INFO_GET                    UINT32_C(0xff1c)
776         /* Experimental */
777         #define HWRM_DBG_CRASHDUMP_HEADER                 UINT32_C(0xff1d)
778         /* Experimental */
779         #define HWRM_DBG_CRASHDUMP_ERASE                  UINT32_C(0xff1e)
780         /* Send driver debug information to firmware */
781         #define HWRM_DBG_DRV_TRACE                        UINT32_C(0xff1f)
782         /* Query debug capabilities of firmware */
783         #define HWRM_DBG_QCAPS                            UINT32_C(0xff20)
784         /* Retrieve debug settings of firmware */
785         #define HWRM_DBG_QCFG                             UINT32_C(0xff21)
786         /* Set destination parameters for crashdump medium */
787         #define HWRM_DBG_CRASHDUMP_MEDIUM_CFG             UINT32_C(0xff22)
788         #define HWRM_NVM_REQ_ARBITRATION                  UINT32_C(0xffed)
789         /* Experimental */
790         #define HWRM_NVM_FACTORY_DEFAULTS                 UINT32_C(0xffee)
791         #define HWRM_NVM_VALIDATE_OPTION                  UINT32_C(0xffef)
792         #define HWRM_NVM_FLUSH                            UINT32_C(0xfff0)
793         #define HWRM_NVM_GET_VARIABLE                     UINT32_C(0xfff1)
794         #define HWRM_NVM_SET_VARIABLE                     UINT32_C(0xfff2)
795         #define HWRM_NVM_INSTALL_UPDATE                   UINT32_C(0xfff3)
796         #define HWRM_NVM_MODIFY                           UINT32_C(0xfff4)
797         #define HWRM_NVM_VERIFY_UPDATE                    UINT32_C(0xfff5)
798         #define HWRM_NVM_GET_DEV_INFO                     UINT32_C(0xfff6)
799         #define HWRM_NVM_ERASE_DIR_ENTRY                  UINT32_C(0xfff7)
800         #define HWRM_NVM_MOD_DIR_ENTRY                    UINT32_C(0xfff8)
801         #define HWRM_NVM_FIND_DIR_ENTRY                   UINT32_C(0xfff9)
802         #define HWRM_NVM_GET_DIR_ENTRIES                  UINT32_C(0xfffa)
803         #define HWRM_NVM_GET_DIR_INFO                     UINT32_C(0xfffb)
804         #define HWRM_NVM_RAW_DUMP                         UINT32_C(0xfffc)
805         #define HWRM_NVM_READ                             UINT32_C(0xfffd)
806         #define HWRM_NVM_WRITE                            UINT32_C(0xfffe)
807         #define HWRM_NVM_RAW_WRITE_BLK                    UINT32_C(0xffff)
808         #define HWRM_LAST                                HWRM_NVM_RAW_WRITE_BLK
809         uint16_t        unused_0[3];
810 } __rte_packed;
811
812 /* Return Codes */
813 /* ret_codes (size:64b/8B) */
814 struct ret_codes {
815         uint16_t        error_code;
816         /* Request was successfully executed by the HWRM. */
817         #define HWRM_ERR_CODE_SUCCESS                      UINT32_C(0x0)
818         /* The HWRM failed to execute the request. */
819         #define HWRM_ERR_CODE_FAIL                         UINT32_C(0x1)
820         /*
821          * The request contains invalid argument(s) or input
822          * parameters.
823          */
824         #define HWRM_ERR_CODE_INVALID_PARAMS               UINT32_C(0x2)
825         /*
826          * The requester is not allowed to access the requested
827          * resource. This error code shall be provided in a
828          * response to a request to query or modify an existing
829          * resource that is not accessible by the requester.
830          */
831         #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED       UINT32_C(0x3)
832         /*
833          * The HWRM is unable to allocate the requested resource.
834          * This code only applies to requests for HWRM resource
835          * allocations.
836          */
837         #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR         UINT32_C(0x4)
838         /*
839          * Invalid combination of flags is specified in the
840          * request.
841          */
842         #define HWRM_ERR_CODE_INVALID_FLAGS                UINT32_C(0x5)
843         /*
844          * Invalid combination of enables fields is specified in
845          * the request.
846          */
847         #define HWRM_ERR_CODE_INVALID_ENABLES              UINT32_C(0x6)
848         /*
849          * Request contains a required TLV that is not supported by
850          * the installed version of firmware.
851          */
852         #define HWRM_ERR_CODE_UNSUPPORTED_TLV              UINT32_C(0x7)
853         /*
854          * No firmware buffer available to accept the request. Driver
855          * should retry the request.
856          */
857         #define HWRM_ERR_CODE_NO_BUFFER                    UINT32_C(0x8)
858         /*
859          * This error code is only reported by firmware when some
860          * sub-option of a supported HWRM command is unsupported.
861          */
862         #define HWRM_ERR_CODE_UNSUPPORTED_OPTION_ERR       UINT32_C(0x9)
863         /*
864          * This error code is only reported by firmware when the specific
865          * request is not able to process when the HOT reset in progress.
866          */
867         #define HWRM_ERR_CODE_HOT_RESET_PROGRESS           UINT32_C(0xa)
868         /*
869          * This error code is only reported by firmware when the registered
870          * driver instances are not capable of hot reset.
871          */
872         #define HWRM_ERR_CODE_HOT_RESET_FAIL               UINT32_C(0xb)
873         /*
874          * This error code is only reported by the firmware when during
875          * flow allocation when a request for a flow counter fails because
876          * the number of flow counters are exhausted.
877          */
878         #define HWRM_ERR_CODE_NO_FLOW_COUNTER_DURING_ALLOC UINT32_C(0xc)
879         /*
880          * This error code is only reported by firmware when the registered
881          * driver instances requested to offloaded a flow but was unable to because
882          * the requested key's hash collides with the installed keys.
883          */
884         #define HWRM_ERR_CODE_KEY_HASH_COLLISION           UINT32_C(0xd)
885         /*
886          * This error code is only reported by firmware when the registered
887          * driver instances requested to offloaded a flow but was unable to because
888          * the same key has already been installed.
889          */
890         #define HWRM_ERR_CODE_KEY_ALREADY_EXISTS           UINT32_C(0xe)
891         /*
892          * Generic HWRM execution error that represents an
893          * internal error.
894          */
895         #define HWRM_ERR_CODE_HWRM_ERROR                   UINT32_C(0xf)
896         /*
897          * Firmware is unable to service the request at the present time. Caller
898          * may try again later.
899          */
900         #define HWRM_ERR_CODE_BUSY                         UINT32_C(0x10)
901         /*
902          * This error code is reported by Firmware when an operation requested
903          * by the host is not allowed due to a secure lock violation.
904          */
905         #define HWRM_ERR_CODE_RESOURCE_LOCKED              UINT32_C(0x11)
906         /*
907          * This value indicates that the HWRM response is in TLV format and
908          * should be interpreted as one or more TLVs starting with the
909          * hwrm_resp_hdr TLV. This value is not an indication of any error
910          * by itself, just an indication that the response should be parsed
911          * as TLV and the actual error code will be in the hwrm_resp_hdr TLV.
912          */
913         #define HWRM_ERR_CODE_TLV_ENCAPSULATED_RESPONSE    UINT32_C(0x8000)
914         /* Unknown error */
915         #define HWRM_ERR_CODE_UNKNOWN_ERR                  UINT32_C(0xfffe)
916         /* Unsupported or invalid command */
917         #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED            UINT32_C(0xffff)
918         #define HWRM_ERR_CODE_LAST \
919                 HWRM_ERR_CODE_CMD_NOT_SUPPORTED
920         uint16_t        unused_0[3];
921 } __rte_packed;
922
923 /* Output */
924 /* hwrm_err_output (size:128b/16B) */
925 struct hwrm_err_output {
926         /*
927          * Pass/Fail or error type
928          *
929          * Note: receiver to verify the in parameters, and fail the call
930          * with an error when appropriate
931          */
932         uint16_t        error_code;
933         /* This field returns the type of original request. */
934         uint16_t        req_type;
935         /* This field provides original sequence number of the command. */
936         uint16_t        seq_id;
937         /*
938          * This field is the length of the response in bytes.  The
939          * last byte of the response is a valid flag that will read
940          * as '1' when the command has been completely written to
941          * memory.
942          */
943         uint16_t        resp_len;
944         /* debug info for this error response. */
945         uint32_t        opaque_0;
946         /* debug info for this error response. */
947         uint16_t        opaque_1;
948         /*
949          * In the case of an error response, command specific error
950          * code is returned in this field.
951          */
952         uint8_t cmd_err;
953         /*
954          * This field is used in Output records to indicate that the output
955          * is completely written to RAM.  This field should be read as '1'
956          * to indicate that the output has been completely written.
957          * When writing a command completion or response to an internal processor,
958          * the order of writes has to be such that this field is written last.
959          */
960         uint8_t valid;
961 } __rte_packed;
962 /*
963  * Following is the signature for HWRM message field that indicates not
964  * applicable (All F's). Need to cast it the size of the field if needed.
965  */
966 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
967 /* hwrm_func_buf_rgtr */
968 #define HWRM_MAX_REQ_LEN 128
969 /* hwrm_cfa_flow_info */
970 #define HWRM_MAX_RESP_LEN 704
971 /* 7 bit indirection table index. */
972 #define HW_HASH_INDEX_SIZE 0x80
973 #define HW_HASH_KEY_SIZE 40
974 /* valid key for HWRM response */
975 #define HWRM_RESP_VALID_KEY 1
976 /* Reserved for BONO processor */
977 #define HWRM_TARGET_ID_BONO 0xFFF8
978 /* Reserved for KONG processor */
979 #define HWRM_TARGET_ID_KONG 0xFFF9
980 /* Reserved for APE processor */
981 #define HWRM_TARGET_ID_APE 0xFFFA
982 /*
983  * This value will be used by tools for User-space HWRM Interface.
984  * When tool execute any HWRM command with this target_id, firmware
985  * will copy the response and/or data payload via register space instead
986  * of DMAing it.
987  */
988 #define HWRM_TARGET_ID_TOOLS 0xFFFD
989 #define HWRM_VERSION_MAJOR 1
990 #define HWRM_VERSION_MINOR 10
991 #define HWRM_VERSION_UPDATE 2
992 /* non-zero means beta version */
993 #define HWRM_VERSION_RSVD 22
994 #define HWRM_VERSION_STR "1.10.2.22"
995
996 /****************
997  * hwrm_ver_get *
998  ****************/
999
1000
1001 /* hwrm_ver_get_input (size:192b/24B) */
1002 struct hwrm_ver_get_input {
1003         /* The HWRM command request type. */
1004         uint16_t        req_type;
1005         /*
1006          * The completion ring to send the completion event on. This should
1007          * be the NQ ID returned from the `nq_alloc` HWRM command.
1008          */
1009         uint16_t        cmpl_ring;
1010         /*
1011          * The sequence ID is used by the driver for tracking multiple
1012          * commands. This ID is treated as opaque data by the firmware and
1013          * the value is returned in the `hwrm_resp_hdr` upon completion.
1014          */
1015         uint16_t        seq_id;
1016         /*
1017          * The target ID of the command:
1018          * * 0x0-0xFFF8 - The function ID
1019          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
1020          * * 0xFFFD - Reserved for user-space HWRM interface
1021          * * 0xFFFF - HWRM
1022          */
1023         uint16_t        target_id;
1024         /*
1025          * A physical address pointer pointing to a host buffer that the
1026          * command's response data will be written. This can be either a host
1027          * physical address (HPA) or a guest physical address (GPA) and must
1028          * point to a physically contiguous block of memory.
1029          */
1030         uint64_t        resp_addr;
1031         /*
1032          * This field represents the major version of HWRM interface
1033          * specification supported by the driver HWRM implementation.
1034          * The interface major version is intended to change only when
1035          * non backward compatible changes are made to the HWRM
1036          * interface specification.
1037          */
1038         uint8_t hwrm_intf_maj;
1039         /*
1040          * This field represents the minor version of HWRM interface
1041          * specification supported by the driver HWRM implementation.
1042          * A change in interface minor version is used to reflect
1043          * significant backward compatible modification to HWRM
1044          * interface specification.
1045          * This can be due to addition or removal of functionality.
1046          * HWRM interface specifications with the same major version
1047          * but different minor versions are compatible.
1048          */
1049         uint8_t hwrm_intf_min;
1050         /*
1051          * This field represents the update version of HWRM interface
1052          * specification supported by the driver HWRM implementation.
1053          * The interface update version is used to reflect minor
1054          * changes or bug fixes to a released HWRM interface
1055          * specification.
1056          */
1057         uint8_t hwrm_intf_upd;
1058         uint8_t unused_0[5];
1059 } __rte_packed;
1060
1061 /* hwrm_ver_get_output (size:1408b/176B) */
1062 struct hwrm_ver_get_output {
1063         /* The specific error status for the command. */
1064         uint16_t        error_code;
1065         /* The HWRM command request type. */
1066         uint16_t        req_type;
1067         /* The sequence ID from the original command. */
1068         uint16_t        seq_id;
1069         /* The length of the response data in number of bytes. */
1070         uint16_t        resp_len;
1071         /*
1072          * This field represents the major version of HWRM interface
1073          * specification supported by the HWRM implementation.
1074          * The interface major version is intended to change only when
1075          * non backward compatible changes are made to the HWRM
1076          * interface specification.
1077          * A HWRM implementation that is compliant with this
1078          * specification shall provide value of 1 in this field.
1079          */
1080         uint8_t hwrm_intf_maj_8b;
1081         /*
1082          * This field represents the minor version of HWRM interface
1083          * specification supported by the HWRM implementation.
1084          * A change in interface minor version is used to reflect
1085          * significant backward compatible modification to HWRM
1086          * interface specification.
1087          * This can be due to addition or removal of functionality.
1088          * HWRM interface specifications with the same major version
1089          * but different minor versions are compatible.
1090          * A HWRM implementation that is compliant with this
1091          * specification shall provide value of 2 in this field.
1092          */
1093         uint8_t hwrm_intf_min_8b;
1094         /*
1095          * This field represents the update version of HWRM interface
1096          * specification supported by the HWRM implementation.
1097          * The interface update version is used to reflect minor
1098          * changes or bug fixes to a released HWRM interface
1099          * specification.
1100          * A HWRM implementation that is compliant with this
1101          * specification shall provide value of 2 in this field.
1102          */
1103         uint8_t hwrm_intf_upd_8b;
1104         uint8_t hwrm_intf_rsvd_8b;
1105         /*
1106          * This field represents the major version of HWRM firmware.
1107          * A change in firmware major version represents a major
1108          * firmware release.
1109          */
1110         uint8_t hwrm_fw_maj_8b;
1111         /*
1112          * This field represents the minor version of HWRM firmware.
1113          * A change in firmware minor version represents significant
1114          * firmware functionality changes.
1115          */
1116         uint8_t hwrm_fw_min_8b;
1117         /*
1118          * This field represents the build version of HWRM firmware.
1119          * A change in firmware build version represents bug fixes
1120          * to a released firmware.
1121          */
1122         uint8_t hwrm_fw_bld_8b;
1123         /*
1124          * This field is a reserved field. This field can be used to
1125          * represent firmware branches or customer specific releases
1126          * tied to a specific (major,minor,update) version of the
1127          * HWRM firmware.
1128          */
1129         uint8_t hwrm_fw_rsvd_8b;
1130         /*
1131          * This field represents the major version of mgmt firmware.
1132          * A change in major version represents a major release.
1133          */
1134         uint8_t mgmt_fw_maj_8b;
1135         /*
1136          * This field represents the minor version of mgmt firmware.
1137          * A change in minor version represents significant
1138          * functionality changes.
1139          */
1140         uint8_t mgmt_fw_min_8b;
1141         /*
1142          * This field represents the build version of mgmt firmware.
1143          * A change in update version represents bug fixes.
1144          */
1145         uint8_t mgmt_fw_bld_8b;
1146         /*
1147          * This field is a reserved field. This field can be used to
1148          * represent firmware branches or customer specific releases
1149          * tied to a specific (major,minor,update) version
1150          */
1151         uint8_t mgmt_fw_rsvd_8b;
1152         /*
1153          * This field represents the major version of network
1154          * control firmware.
1155          * A change in major version represents a major release.
1156          */
1157         uint8_t netctrl_fw_maj_8b;
1158         /*
1159          * This field represents the minor version of network
1160          * control firmware.
1161          * A change in minor version represents significant
1162          * functionality changes.
1163          */
1164         uint8_t netctrl_fw_min_8b;
1165         /*
1166          * This field represents the build version of network
1167          * control firmware.
1168          * A change in update version represents bug fixes.
1169          */
1170         uint8_t netctrl_fw_bld_8b;
1171         /*
1172          * This field is a reserved field. This field can be used to
1173          * represent firmware branches or customer specific releases
1174          * tied to a specific (major,minor,update) version
1175          */
1176         uint8_t netctrl_fw_rsvd_8b;
1177         /*
1178          * This field is used to indicate device's capabilities and
1179          * configurations.
1180          */
1181         uint32_t        dev_caps_cfg;
1182         /*
1183          * If set to 1, then secure firmware update behavior
1184          * is supported.
1185          * If set to 0, then secure firmware update behavior is
1186          * not supported.
1187          */
1188         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED \
1189                 UINT32_C(0x1)
1190         /*
1191          * If set to 1, then firmware based DCBX agent is supported.
1192          * If set to 0, then firmware based DCBX agent capability
1193          * is not supported on this device.
1194          */
1195         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED \
1196                 UINT32_C(0x2)
1197         /*
1198          * If set to 1, then HWRM short command format is supported.
1199          * If set to 0, then HWRM short command format is not supported.
1200          */
1201         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED \
1202                 UINT32_C(0x4)
1203         /*
1204          * If set to 1, then HWRM short command format is required.
1205          * If set to 0, then HWRM short command format is not required.
1206          */
1207         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED \
1208                 UINT32_C(0x8)
1209         /*
1210          * If set to 1, then the KONG host mailbox channel is supported.
1211          * If set to 0, then the KONG host mailbox channel is not supported.
1212          * By default, this flag should be 0 for older version of core firmware.
1213          */
1214         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_KONG_MB_CHNL_SUPPORTED \
1215                 UINT32_C(0x10)
1216         /*
1217          * If set to 1, then the 64bit flow handle is supported in addition to the
1218          * legacy 16bit flow handle. If set to 0, then the 64bit flow handle is not
1219          * supported. By default, this flag should be 0 for older version of core firmware.
1220          */
1221         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_HANDLE_64BIT_SUPPORTED \
1222                 UINT32_C(0x20)
1223         /*
1224          * If set to 1, then filter type can be provided in filter_alloc or filter_cfg
1225          * filter types like L2 for l2 traffic and ROCE for roce & l2 traffic.
1226          * If set to 0, then filter types not supported.
1227          * By default, this flag should be 0 for older version of core firmware.
1228          */
1229         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_L2_FILTER_TYPES_ROCE_OR_L2_SUPPORTED \
1230                 UINT32_C(0x40)
1231         /*
1232          * If set to 1, firmware is capable to support virtio vSwitch offload model.
1233          * If set to 0, firmware can't supported virtio vSwitch offload model.
1234          * By default, this flag should be 0 for older version of core firmware.
1235          */
1236         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_VIRTIO_VSWITCH_OFFLOAD_SUPPORTED \
1237                 UINT32_C(0x80)
1238         /*
1239          * If set to 1, firmware is capable to support trusted VF.
1240          * If set to 0, firmware is not capable to support trusted VF.
1241          * By default, this flag should be 0 for older version of core firmware.
1242          */
1243         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED \
1244                 UINT32_C(0x100)
1245         /*
1246          * If set to 1, firmware is capable to support flow aging.
1247          * If set to 0, firmware is not capable to support flow aging.
1248          * By default, this flag should be 0 for older version of core firmware.
1249          */
1250         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_AGING_SUPPORTED \
1251                 UINT32_C(0x200)
1252         /*
1253          * If set to 1, firmware is capable to support advanced flow counters like,
1254          * Meter drop counters and EEM counters.
1255          * If set to 0, firmware is not capable to support advanced flow counters.
1256          * By default, this flag should be 0 for older version of core firmware.
1257          */
1258         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_ADV_FLOW_COUNTERS_SUPPORTED \
1259                 UINT32_C(0x400)
1260         /*
1261          * If set to 1, the firmware is able to support the use of the CFA
1262          * Extended Exact Match(EEM) feature.
1263          * If set to 0, firmware is not capable to support the use of the
1264          * CFA EEM feature.
1265          * By default, this flag should be 0 for older version of core firmware.
1266          */
1267         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_EEM_SUPPORTED \
1268                 UINT32_C(0x800)
1269         /*
1270          * If set to 1, the firmware is able to support advance CFA flow management
1271          * features reported in the HWRM_CFA_FLOW_MGNT_QCAPS.
1272          * If set to 0, then the firmware doesn’t support the advance CFA flow management
1273          * features.
1274          * By default, this flag should be 0 for older version of core firmware.
1275          */
1276         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_ADV_FLOW_MGNT_SUPPORTED \
1277                 UINT32_C(0x1000)
1278         /*
1279          * Deprecated and replaced with cfa_truflow_supported.
1280          * If set to 1, the firmware is able to support TFLIB features.
1281          * If set to 0, then the firmware doesn’t support TFLIB features.
1282          * By default, this flag should be 0 for older version of core firmware.
1283          */
1284         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TFLIB_SUPPORTED \
1285                 UINT32_C(0x2000)
1286         /*
1287          * If set to 1, the firmware is able to support TruFlow features.
1288          * If set to 0, then the firmware doesn’t support TruFlow features.
1289          * By default, this flag should be 0 for older version of
1290          * core firmware.
1291          */
1292         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TRUFLOW_SUPPORTED \
1293                 UINT32_C(0x4000)
1294         /*
1295          * This field represents the major version of RoCE firmware.
1296          * A change in major version represents a major release.
1297          */
1298         uint8_t roce_fw_maj_8b;
1299         /*
1300          * This field represents the minor version of RoCE firmware.
1301          * A change in minor version represents significant
1302          * functionality changes.
1303          */
1304         uint8_t roce_fw_min_8b;
1305         /*
1306          * This field represents the build version of RoCE firmware.
1307          * A change in update version represents bug fixes.
1308          */
1309         uint8_t roce_fw_bld_8b;
1310         /*
1311          * This field is a reserved field. This field can be used to
1312          * represent firmware branches or customer specific releases
1313          * tied to a specific (major,minor,update) version
1314          */
1315         uint8_t roce_fw_rsvd_8b;
1316         /*
1317          * This field represents the name of HWRM FW (ASCII chars
1318          * with NULL at the end).
1319          */
1320         char    hwrm_fw_name[16];
1321         /*
1322          * This field represents the name of mgmt FW (ASCII chars
1323          * with NULL at the end).
1324          */
1325         char    mgmt_fw_name[16];
1326         /*
1327          * This field represents the name of network control
1328          * firmware (ASCII chars with NULL at the end).
1329          */
1330         char    netctrl_fw_name[16];
1331         /* This field represents the active board package name. */
1332         char    active_pkg_name[16];
1333         /*
1334          * This field represents the name of RoCE FW (ASCII chars
1335          * with NULL at the end).
1336          */
1337         char    roce_fw_name[16];
1338         /* This field returns the chip number. */
1339         uint16_t        chip_num;
1340         /* This field returns the revision of chip. */
1341         uint8_t chip_rev;
1342         /* This field returns the chip metal number. */
1343         uint8_t chip_metal;
1344         /* This field returns the bond id of the chip. */
1345         uint8_t chip_bond_id;
1346         /* This value indicates the type of platform used for chip implementation. */
1347         uint8_t chip_platform_type;
1348         /* ASIC */
1349         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC      UINT32_C(0x0)
1350         /* FPGA platform of the chip. */
1351         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA      UINT32_C(0x1)
1352         /* Palladium platform of the chip. */
1353         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
1354         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_LAST \
1355                 HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM
1356         /*
1357          * This field returns the maximum value of request window that
1358          * is supported by the HWRM. The request window is mapped
1359          * into device address space using MMIO.
1360          */
1361         uint16_t        max_req_win_len;
1362         /*
1363          * This field returns the maximum value of response buffer in
1364          * bytes.
1365          */
1366         uint16_t        max_resp_len;
1367         /*
1368          * This field returns the default request timeout value in
1369          * milliseconds.
1370          */
1371         uint16_t        def_req_timeout;
1372         /*
1373          * This field will indicate if any subsystems is not fully
1374          * initialized.
1375          */
1376         uint8_t flags;
1377         /*
1378          * If set to 1, it will indicate to host drivers that firmware is
1379          * not ready to start full blown HWRM commands. Host drivers should
1380          * re-try HWRM_VER_GET with some timeout period. The timeout period
1381          * can be selected up to 5 seconds. Host drivers should also check
1382          * for dev_not_rdy_backing_store to identify if flag is set due to
1383          * backing store not been available.
1384          * For Example, PCIe hot-plug:
1385          *     Hot plug timing is system dependent. It generally takes up to
1386          *     600 miliseconds for firmware to clear DEV_NOT_RDY flag.
1387          * If set to 0, device is ready to accept all HWRM commands.
1388          */
1389         #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY \
1390                 UINT32_C(0x1)
1391         /*
1392          * If set to 1, external version present.
1393          * If set to 0, external version not present.
1394          */
1395         #define HWRM_VER_GET_OUTPUT_FLAGS_EXT_VER_AVAIL \
1396                 UINT32_C(0x2)
1397         /*
1398          * Firmware sets this flag along with dev_not_rdy flag to indicate
1399          * host drivers that it has not completed resource initialization
1400          * required for data path operations. Host drivers should not send
1401          * any HWRM command that requires data path resources. Firmware will
1402          * fail those commands with HWRM_ERR_CODE_BUSY. Host drivers can retry
1403          * those commands once both the flags are cleared.
1404          * If this flag and dev_not_rdy flag are set to 0, device is ready
1405          * to accept all HWRM commands.
1406          */
1407         #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY_BACKING_STORE \
1408                 UINT32_C(0x4)
1409         uint8_t unused_0[2];
1410         /*
1411          * For backward compatibility this field must be set to 1.
1412          * Older drivers might look for this field to be 1 before
1413          * processing the message.
1414          */
1415         uint8_t always_1;
1416         /*
1417          * This field represents the major version of HWRM interface
1418          * specification supported by the HWRM implementation.
1419          * The interface major version is intended to change only when
1420          * non backward compatible changes are made to the HWRM
1421          * interface specification. A HWRM implementation that is
1422          * compliant with this specification shall provide value of 1
1423          * in this field.
1424          */
1425         uint16_t        hwrm_intf_major;
1426         /*
1427          * This field represents the minor version of HWRM interface
1428          * specification supported by the HWRM implementation.
1429          * A change in interface minor version is used to reflect
1430          * significant backward compatible modification to HWRM
1431          * interface specification. This can be due to addition or
1432          * removal of functionality. HWRM interface specifications
1433          * with the same major version but different minor versions are
1434          * compatible. A HWRM implementation that is compliant with
1435          * this specification shall provide value of 2 in this field.
1436          */
1437         uint16_t        hwrm_intf_minor;
1438         /*
1439          * This field represents the update version of HWRM interface
1440          * specification supported by the HWRM implementation. The
1441          * interface update version is used to reflect minor changes or
1442          * bug fixes to a released HWRM interface specification.
1443          * A HWRM implementation that is compliant with this
1444          * specification shall provide value of 2 in this field.
1445          */
1446         uint16_t        hwrm_intf_build;
1447         /*
1448          * This field represents the patch version of HWRM interface
1449          * specification supported by the HWRM implementation.
1450          */
1451         uint16_t        hwrm_intf_patch;
1452         /*
1453          * This field represents the major version of HWRM firmware.
1454          * A change in firmware major version represents a major
1455          * firmware release.
1456          */
1457         uint16_t        hwrm_fw_major;
1458         /*
1459          * This field represents the minor version of HWRM firmware.
1460          * A change in firmware minor version represents significant
1461          * firmware functionality changes.
1462          */
1463         uint16_t        hwrm_fw_minor;
1464         /*
1465          * This field represents the build version of HWRM firmware.
1466          * A change in firmware build version represents bug fixes to
1467          * a released firmware.
1468          */
1469         uint16_t        hwrm_fw_build;
1470         /*
1471          * This field is a reserved field.
1472          * This field can be used to represent firmware branches or customer
1473          * specific releases tied to a specific (major,minor,update) version
1474          * of the HWRM firmware.
1475          */
1476         uint16_t        hwrm_fw_patch;
1477         /*
1478          * This field represents the major version of mgmt firmware.
1479          * A change in major version represents a major release.
1480          */
1481         uint16_t        mgmt_fw_major;
1482         /*
1483          * This field represents the minor version of HWRM firmware.
1484          * A change in firmware minor version represents significant
1485          * firmware functionality changes.
1486          */
1487         uint16_t        mgmt_fw_minor;
1488         /*
1489          * This field represents the build version of mgmt firmware.
1490          * A change in update version represents bug fixes.
1491          */
1492         uint16_t        mgmt_fw_build;
1493         /*
1494          * This field is a reserved field. This field can be used to
1495          * represent firmware branches or customer specific releases
1496          * tied to a specific (major,minor,update) version.
1497          */
1498         uint16_t        mgmt_fw_patch;
1499         /*
1500          * This field represents the major version of network control
1501          * firmware. A change in major version represents
1502          * a major release.
1503          */
1504         uint16_t        netctrl_fw_major;
1505         /*
1506          * This field represents the minor version of network control
1507          * firmware. A change in minor version represents significant
1508          * functionality changes.
1509          */
1510         uint16_t        netctrl_fw_minor;
1511         /*
1512          * This field represents the build version of network control
1513          * firmware. A change in update version represents bug fixes.
1514          */
1515         uint16_t        netctrl_fw_build;
1516         /*
1517          * This field is a reserved field. This field can be used to
1518          * represent firmware branches or customer specific releases
1519          * tied to a specific (major,minor,update) version
1520          */
1521         uint16_t        netctrl_fw_patch;
1522         /*
1523          * This field represents the major version of RoCE firmware.
1524          * A change in major version represents a major release.
1525          */
1526         uint16_t        roce_fw_major;
1527         /*
1528          * This field represents the minor version of RoCE firmware.
1529          * A change in minor version represents significant
1530          * functionality changes.
1531          */
1532         uint16_t        roce_fw_minor;
1533         /*
1534          * This field represents the build version of RoCE firmware.
1535          * A change in update version represents bug fixes.
1536          */
1537         uint16_t        roce_fw_build;
1538         /*
1539          * This field is a reserved field. This field can be used to
1540          * represent firmware branches or customer specific releases
1541          * tied to a specific (major,minor,update) version
1542          */
1543         uint16_t        roce_fw_patch;
1544         /*
1545          * This field returns the maximum extended request length acceptable
1546          * by the device which allows requests greater than mailbox size when
1547          * used with the short cmd request format.
1548          */
1549         uint16_t        max_ext_req_len;
1550         uint8_t unused_1[5];
1551         /*
1552          * This field is used in Output records to indicate that the output
1553          * is completely written to RAM.  This field should be read as '1'
1554          * to indicate that the output has been completely written.
1555          * When writing a command completion or response to an internal processor,
1556          * the order of writes has to be such that this field is written last.
1557          */
1558         uint8_t valid;
1559 } __rte_packed;
1560
1561 /* cfa_bds_read_cmd_data_msg (size:128b/16B) */
1562 struct cfa_bds_read_cmd_data_msg {
1563         /* This value selects the format for the mid-path command for the CFA. */
1564         uint8_t opcode;
1565         /*
1566          * This is read command. From 32 to 128B can be read from a table
1567          * using this command.
1568          */
1569         #define CFA_BDS_READ_CMD_DATA_MSG_OPCODE_READ UINT32_C(0x0)
1570         #define CFA_BDS_READ_CMD_DATA_MSG_OPCODE_LAST \
1571                 CFA_BDS_READ_CMD_DATA_MSG_OPCODE_READ
1572         /* This value selects the table type to be acted upon. */
1573         uint8_t table_type;
1574         /* This value selects the table type to be acted upon. */
1575         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
1576         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_SFT   0
1577         /* This command acts on the action table of the specified scope. */
1578         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
1579         /* This command acts on the exact match table of the specified scope. */
1580         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_EM      UINT32_C(0x1)
1581         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_LAST \
1582                 CFA_BDS_READ_CMD_DATA_MSG_TABLE_TYPE_EM
1583         /* This value selects which table scope will be accessed. */
1584         uint8_t table_scope;
1585         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1586         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1587         /*
1588          * This value identifies the number of 32B units will be accessed. A
1589          * value of zero is invalid. Maximum value is 4.
1590          */
1591         uint8_t data_size;
1592         #define CFA_BDS_READ_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1593         #define CFA_BDS_READ_CMD_DATA_MSG_DATA_SIZE_SFT 0
1594         /* This is the 32B index into the selected table to access. */
1595         uint32_t        table_index;
1596         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
1597         #define CFA_BDS_READ_CMD_DATA_MSG_TABLE_INDEX_SFT 0
1598         /*
1599          * This is the 64b host address where you want the data returned to. The
1600          * data will be written to the same function as the one that owns the SQ
1601          * this command is read from. The bottom two bits of this value must be
1602          * zero. The size of the write is controlled by the data_size field.
1603          */
1604         uint64_t        host_address;
1605 } __rte_packed;
1606
1607 /* cfa_bds_write_cmd_data_msg (size:1152b/144B) */
1608 struct cfa_bds_write_cmd_data_msg {
1609         /* This value selects the format for the mid-path command for the CFA. */
1610         uint8_t opcode;
1611         /*
1612          * This is write command. From 32 to 128B can be written to a table
1613          * using this command.
1614          */
1615         #define CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_WRITE UINT32_C(0x1)
1616         #define CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_LAST \
1617                 CFA_BDS_WRITE_CMD_DATA_MSG_OPCODE_WRITE
1618         /* This value selects the table type to be acted upon. */
1619         uint8_t write_thru_table_type;
1620         /* This value selects the table type to be acted upon. */
1621         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
1622         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_SFT   0
1623         /* This command acts on the action table of the specified scope. */
1624         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
1625         /* This command acts on the exact match table of the specified scope. */
1626         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_EM      UINT32_C(0x1)
1627         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_LAST \
1628                 CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_TYPE_EM
1629         /*
1630          * Indicates write-through control. Indicates write-through when set,
1631          * or write back when cleared.
1632          */
1633         #define CFA_BDS_WRITE_CMD_DATA_MSG_WRITE_THRU       UINT32_C(0x10)
1634         /* This value selects which table scope will be accessed. */
1635         uint8_t table_scope;
1636         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1637         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1638         /*
1639          * This value identifies the number of 32B units will be accessed. A
1640          * value of zero is invalid. Maximum value is 4.
1641          */
1642         uint8_t data_size;
1643         #define CFA_BDS_WRITE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1644         #define CFA_BDS_WRITE_CMD_DATA_MSG_DATA_SIZE_SFT 0
1645         /* This is the 32B index into the selected table to access. */
1646         uint32_t        table_index;
1647         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
1648         #define CFA_BDS_WRITE_CMD_DATA_MSG_TABLE_INDEX_SFT 0
1649         uint32_t        unused0;
1650         uint32_t        unused1;
1651         /*
1652          * This is the data to be written. Data length is determined by the
1653          * data_size field. The bd_cnt in the encapsulating BD must also be set
1654          * correctly to ensure that the BD is processed correctly and the full
1655          * WRITE_CMD message is extracted from the BD.
1656          */
1657         uint32_t        dta[32];
1658 } __rte_packed;
1659
1660 /* cfa_bds_read_clr_cmd_data_msg (size:256b/32B) */
1661 struct cfa_bds_read_clr_cmd_data_msg {
1662         /* This value selects the format for the mid-path command for the CFA. */
1663         uint8_t opcode;
1664         /*
1665          * This is read-clear command. 32B can be read from a table and
1666          * a 16b mask can be used to clear specific 16b units after the
1667          * read as an atomic operation.
1668          */
1669         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_READ_CLR UINT32_C(0x2)
1670         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_LAST \
1671                 CFA_BDS_READ_CLR_CMD_DATA_MSG_OPCODE_READ_CLR
1672         /* This value selects the table type to be acted upon. */
1673         uint8_t table_type;
1674         /* This value selects the table type to be acted upon. */
1675         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
1676         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_SFT   0
1677         /* This command acts on the action table of the specified scope. */
1678         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_ACTION  UINT32_C(0x0)
1679         /* This command acts on the exact match table of the specified scope. */
1680         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_EM      UINT32_C(0x1)
1681         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_LAST \
1682                 CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_TYPE_EM
1683         /* This value selects which table scope will be accessed. */
1684         uint8_t table_scope;
1685         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1686         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1687         /*
1688          * This value identifies the number of 32B units will be accessed.
1689          * Always set the value to 1.
1690          */
1691         uint8_t data_size;
1692         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1693         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_DATA_SIZE_SFT 0
1694         /* This is the 32B index into the selected table to access. */
1695         uint32_t        table_index;
1696         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_INDEX_MASK \
1697                 UINT32_C(0x3ffffff)
1698         #define CFA_BDS_READ_CLR_CMD_DATA_MSG_TABLE_INDEX_SFT 0
1699         /*
1700          * This is the 64b host address where you want the data returned to. The
1701          * data will be written to the same function as the one that owns the SQ
1702          * this command is read from. The bottom two bits of this value must be
1703          * zero. The size of the write is controlled by the data_size field.
1704          */
1705         uint64_t        host_address;
1706         /*
1707          * This is active high clear mask for the 32B of data that this command
1708          * can read. Bit 0 of the field will clear bits 15:0 of the first word
1709          * of data read when set to '1'.
1710          */
1711         uint16_t        clear_mask;
1712         uint16_t        unused0[3];
1713         uint16_t        unused1[4];
1714 } __rte_packed;
1715
1716 /* cfa_bds_em_insert_cmd_data_msg (size:1152b/144B) */
1717 struct cfa_bds_em_insert_cmd_data_msg {
1718         /* This value selects the format for the mid-path command for the CFA. */
1719         uint8_t opcode;
1720         /*
1721          * An exact match table insert will be attempted into the table.
1722          * If there is a free location in the bucket, the payload will
1723          * be written to the bucket.
1724          */
1725         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_EM_INSERT UINT32_C(0x3)
1726         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_LAST \
1727                 CFA_BDS_EM_INSERT_CMD_DATA_MSG_OPCODE_EM_INSERT
1728         /*
1729          * Indicates write-through control. Indicates write-through when set,
1730          * or write back when cleared.
1731          */
1732         uint8_t write_thru;
1733         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_UNUSED_MASK    UINT32_C(0xf)
1734         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_UNUSED_SFT     0
1735         /*
1736          * Indicates write-through control. Indicates write-through when set,
1737          * or write back when cleared.
1738          */
1739         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_WRITE_THRU     UINT32_C(0x10)
1740         /* This value selects which table scope will be accessed. */
1741         uint8_t table_scope;
1742         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1743         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1744         /*
1745          * This value identifies the number of 32B units will be accessed. A
1746          * value of zero is invalid. Maximum value is 4.
1747          */
1748         uint8_t data_size;
1749         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1750         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_DATA_SIZE_SFT 0
1751         /* This is the 32B index into the selected table to access. */
1752         uint32_t        table_index;
1753         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_INDEX_MASK \
1754                 UINT32_C(0x3ffffff)
1755         #define CFA_BDS_EM_INSERT_CMD_DATA_MSG_TABLE_INDEX_SFT 0
1756         /*
1757          * This is the 64b host address where you want the data returned to. The
1758          * data will be written to the same function as the one that owns the SQ
1759          */
1760         uint64_t        host_address;
1761         /*
1762          * This is the Exact Match Lookup Record. Data length is determined by
1763          * the data_size field. The bd_cnt in the encapsulating BD must also be
1764          */
1765         uint32_t        dta[32];
1766 } __rte_packed;
1767
1768 /* cfa_bds_em_delete_cmd_data_msg (size:256b/32B) */
1769 struct cfa_bds_em_delete_cmd_data_msg {
1770         /* This value selects the format for the mid-path command for the CFA. */
1771         uint8_t opcode;
1772         /* An exact match table delete will be attempted. */
1773         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_EM_DELETE UINT32_C(0x4)
1774         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_LAST \
1775                 CFA_BDS_EM_DELETE_CMD_DATA_MSG_OPCODE_EM_DELETE
1776         /*
1777          * Indicates write-through control. Indicates write-through when set,
1778          * or write back when cleared.
1779          */
1780         uint8_t write_thru;
1781         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_UNUSED_MASK    UINT32_C(0xf)
1782         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_UNUSED_SFT     0
1783         /*
1784          * Indicates write-through control. Indicates write-through when set,
1785          * or write back when cleared.
1786          */
1787         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_WRITE_THRU     UINT32_C(0x10)
1788         /* This value selects which table scope will be accessed. */
1789         uint8_t table_scope;
1790         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1791         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1792         /*
1793          * This value identifies the number of 32B units will be accessed. A
1794          * value of zero is invalid. Maximum value is 4.
1795          */
1796         uint8_t data_size;
1797         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1798         #define CFA_BDS_EM_DELETE_CMD_DATA_MSG_DATA_SIZE_SFT 0
1799         uint32_t        unused0;
1800         /*
1801          * This is the 64b host address where you want the data returned to. The
1802          * data will be written to the same function as the one that owns the SQ
1803          */
1804         uint64_t        host_address;
1805         /*
1806          * This is the Exact Match Lookup Record. Data length is determined by
1807          * the data_size field. The bd_cnt in the encapsulating BD must also be
1808          */
1809         uint64_t        dta;
1810         uint32_t        unused1[2];
1811 } __rte_packed;
1812
1813 /* cfa_bds_invalidate_cmd_data_msg (size:128b/16B) */
1814 struct cfa_bds_invalidate_cmd_data_msg {
1815         /* This value selects the format for the mid-path command for the CFA. */
1816         uint8_t opcode;
1817         /*
1818          * The specified table area will be invalidated. If it is needed.
1819          * again, it will be read from the backing store.
1820          */
1821         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_INVALIDATE UINT32_C(0x5)
1822         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_LAST \
1823                 CFA_BDS_INVALIDATE_CMD_DATA_MSG_OPCODE_INVALIDATE
1824         /* This value selects the table type to be acted upon. */
1825         uint8_t table_type;
1826         /* This value selects the table type to be acted upon. */
1827         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf)
1828         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_SFT   0
1829         /* This command acts on the action table of the specified scope. */
1830         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_ACTION \
1831                 UINT32_C(0x0)
1832         /* This command acts on the exact match table of the specified scope. */
1833         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_EM \
1834                 UINT32_C(0x1)
1835         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_LAST \
1836                 CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_TYPE_EM
1837         /* This value selects which table scope will be accessed. */
1838         uint8_t table_scope;
1839         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
1840         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1841         /* This value specifies the number of cache lines to invalidate. */
1842         uint8_t data_size;
1843         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1844         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_DATA_SIZE_SFT 0
1845         /* This is the 32B index into the selected table to access. */
1846         uint32_t        table_index;
1847         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_INDEX_MASK \
1848                 UINT32_C(0x3ffffff)
1849         #define CFA_BDS_INVALIDATE_CMD_DATA_MSG_TABLE_INDEX_SFT 0
1850         uint32_t        unused[2];
1851 } __rte_packed;
1852
1853 /* cfa_bds_event_collect_cmd_data_msg (size:128b/16B) */
1854 struct cfa_bds_event_collect_cmd_data_msg {
1855         /* This value selects the format for the mid-path command for the CFA. */
1856         uint8_t opcode;
1857         /* Reads notification messages from the Host Notification Queue. */
1858         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_EVENT_COLLECT \
1859                 UINT32_C(0x6)
1860         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_LAST \
1861                 CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_OPCODE_EVENT_COLLECT
1862         uint8_t unused0;
1863         /* This value selects which table scope will be accessed. */
1864         uint8_t table_scope;
1865         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_TABLE_SCOPE_MASK \
1866                 UINT32_C(0x1f)
1867         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_TABLE_SCOPE_SFT 0
1868         /*
1869          * This value identifies the number of 32B units will be accessed. A
1870          * value of zero is invalid. Maximum value is 4.
1871          */
1872         uint8_t data_size;
1873         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_DATA_SIZE_MASK UINT32_C(0x7)
1874         #define CFA_BDS_EVENT_COLLECT_CMD_DATA_MSG_DATA_SIZE_SFT 0
1875         uint32_t        unused1;
1876         /*
1877          * This is the 64b host address where you want the data returned to. The
1878          * data will be written to the same function as the one that owns the SQ
1879          */
1880         uint64_t        host_address;
1881 } __rte_packed;
1882
1883 /* ce_bds_add_data_msg (size:512b/64B) */
1884 struct ce_bds_add_data_msg {
1885         uint32_t        version_algorithm_kid_opcode;
1886         /*
1887          * This value selects the operation for the mid-path command for the
1888          * crypto blocks.
1889          */
1890         #define CE_BDS_ADD_DATA_MSG_OPCODE_MASK               UINT32_C(0xf)
1891         #define CE_BDS_ADD_DATA_MSG_OPCODE_SFT                0
1892         /*
1893          * This is the add command. Using this opcode, Host Driver can add
1894          * information required for kTLS processing. The information is
1895          * updated in the CFCK context.
1896          */
1897         #define CE_BDS_ADD_DATA_MSG_OPCODE_ADD                  UINT32_C(0x1)
1898         #define CE_BDS_ADD_DATA_MSG_OPCODE_LAST \
1899                 CE_BDS_ADD_DATA_MSG_OPCODE_ADD
1900         /*
1901          * This field is the Crypto Context ID. The KID is used to store
1902          * information used by the associated kTLS offloaded connection.
1903          */
1904         #define CE_BDS_ADD_DATA_MSG_KID_MASK \
1905                 UINT32_C(0xfffff0)
1906         #define CE_BDS_ADD_DATA_MSG_KID_SFT                   4
1907         /*
1908          * Currently only two algorithms are supported, AES_GCM_128 and
1909          * AES_GCM_256. Additional bits for future growth.
1910          */
1911         #define CE_BDS_ADD_DATA_MSG_ALGORITHM_MASK \
1912                 UINT32_C(0xf000000)
1913         #define CE_BDS_ADD_DATA_MSG_ALGORITHM_SFT             24
1914         /* AES_GCM_128 Algorithm */
1915         #define CE_BDS_ADD_DATA_MSG_ALGORITHM_AES_GCM_128 \
1916                 UINT32_C(0x1000000)
1917         /* AES_GCM_256 Algorithm */
1918         #define CE_BDS_ADD_DATA_MSG_ALGORITHM_AES_GCM_256 \
1919                 UINT32_C(0x2000000)
1920         /*
1921          * Version number of TLS connection. HW will provide registers that
1922          * converts the 4b encoded version number to 16b of actual version
1923          * number in the TLS Header. * Initialized --> By mid-path command *
1924          * Updated --> Never though another mid-path command will result in an
1925          * update.
1926          */
1927         #define CE_BDS_ADD_DATA_MSG_VERSION_MASK \
1928                 UINT32_C(0xf0000000)
1929         #define CE_BDS_ADD_DATA_MSG_VERSION_SFT               28
1930         /* TLS1.2 Version */
1931         #define CE_BDS_ADD_DATA_MSG__TLS1_2 \
1932                 (UINT32_C(0x0) << 28)
1933         /* TLS1.3 Version */
1934         #define CE_BDS_ADD_DATA_MSG__TLS1_3 \
1935                 (UINT32_C(0x1) << 28)
1936         #define CE_BDS_ADD_DATA_MSG__LAST \
1937                 CE_BDS_ADD_DATA_MSG__TLS1_3
1938         /*
1939          * Command Type in the TLS header. HW will provide registers that
1940          * converts the 3b encoded command type to 8b of actual command type in
1941          * the TLS Header. * Initialized --> By mid-path command * Updated -->
1942          * Never though another mid-path command will result in an update
1943          */
1944         uint8_t cmd_type;
1945         #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_MASK UINT32_C(0x7)
1946         #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_SFT 0
1947         /* Application */
1948         #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_APP   UINT32_C(0x0)
1949         #define CE_BDS_ADD_DATA_MSG_CMD_TYPE_LAST \
1950                 CE_BDS_ADD_DATA_MSG_CMD_TYPE_APP
1951         uint8_t unused0[3];
1952         /*
1953          * Salt is part of the nonce that is used as the Initial Vector (IV) in
1954          * AES-GCM cipher suites. These are exchanged as part of the handshake
1955          * process and is either the client_write_iv (when the client is
1956          * sending) or server_write_iv (when the server is sending). In
1957          * TLS1.2, 4B of Salt is concatenated with 8B of explicit_nonce to
1958          * generate the 12B of IV. In TLS1.3, 8B of TLS record sequence number
1959          * is zero padded to 12B and then xor'ed with the 4B of salt to generate
1960          * the 12B of IV. This value is initialized by this mid-path command.
1961          */
1962         uint32_t        salt;
1963         uint32_t        unused1;
1964         /*
1965          * This field keeps track of the TCP sequence number that is expected as
1966          * the first byte in the next TCP packet. This field is calculated by HW
1967          * using the output of the parser. The field is initialized as part of
1968          * the Mid-path BD download/update of a kTLS connection. For every TCP
1969          * packet processed, TCE HW will update the value to Current packet TCP
1970          * sequence number + Current packet TCP Payload Length.
1971          */
1972         uint32_t        pkt_tcp_seq_num;
1973         /*
1974          * This field maintains the TCP sequence number of the first byte in the
1975          * header of the active TLS record. This field is initialized as part of
1976          * the Mid-path BD download/update of a kTLS connection. For every
1977          * record that is processed, TCE HW copies the value from the
1978          * next_tls_header_tcp_seq_num field.
1979          */
1980         uint32_t        tls_header_tcp_seq_num;
1981         /*
1982          * This is sequence number for the TLS record in a particular session.
1983          * In TLS1.2, record sequence number is part of the Associated Data (AD)
1984          * in the AEAD algorithm. In TLS1.3, record sequence number is part of
1985          * the Initial Vector (IV). The field is initialized as part of the
1986          * mid-path BD download/update of a kTLS connection. TCE HW increments
1987          * the field after that for every record processed as it parses the TCP
1988          * packet.
1989          */
1990         uint32_t        record_seq_num[2];
1991         /*
1992          * Key used for encrypting or decrypting TLS records. The Key is
1993          * exchanged during the hand-shake protocol by the client-server and
1994          * provided to HW through this mid-path BD.
1995          */
1996         uint32_t        session_key[8];
1997 } __rte_packed;
1998
1999 /* ce_bds_delete_data_msg (size:64b/8B) */
2000 struct ce_bds_delete_data_msg {
2001         uint32_t        kid_opcode;
2002         /*
2003          * This value selects the operation for the mid-path command for the
2004          * crypto blocks.
2005          */
2006         #define CE_BDS_DELETE_DATA_MSG_OPCODE_MASK  UINT32_C(0xf)
2007         #define CE_BDS_DELETE_DATA_MSG_OPCODE_SFT   0
2008         /*
2009          * This is the delete command. Using this opcode, the host Driver
2010          * can remove a key context from the CFCK. If context is deleted
2011          * and packets with the same KID come through the pipeline, the
2012          * following actions are taken. For transmit packets, no crypto
2013          * operation will be performed, payload will be zero'ed out. For
2014          * receive packets, no crypto operation will be performed,
2015          * payload will be unmodified.
2016          */
2017         #define CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE  UINT32_C(0x2)
2018         #define CE_BDS_DELETE_DATA_MSG_OPCODE_LAST \
2019                 CE_BDS_DELETE_DATA_MSG_OPCODE_DELETE
2020         /*
2021          * This field is the Crypto Context ID. The KID is used to store
2022          * information used by the associated kTLS offloaded connection.
2023          */
2024         #define CE_BDS_DELETE_DATA_MSG_KID_MASK     UINT32_C(0xfffff0)
2025         #define CE_BDS_DELETE_DATA_MSG_KID_SFT      4
2026         uint32_t        unused0;
2027 } __rte_packed;
2028
2029 /* ce_bds_resync_resp_ack_msg (size:128b/16B) */
2030 struct ce_bds_resync_resp_ack_msg {
2031         uint32_t        resync_status_kid_opcode;
2032         /*
2033          * This value selects the operation for the mid-path command for the
2034          * crypto blocks.
2035          */
2036         #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_MASK       UINT32_C(0xf)
2037         #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_SFT        0
2038         /*
2039          * This command is used by the driver as a response to the resync
2040          * request sent by the crypto engine.
2041          */
2042         #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_RESYNC       UINT32_C(0x3)
2043         #define CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_LAST \
2044                 CE_BDS_RESYNC_RESP_ACK_MSG_OPCODE_RESYNC
2045         /*
2046          * This field is the Crypto Context ID. The KID is used to store
2047          * information used by the associated kTLS offloaded connection.
2048          */
2049         #define CE_BDS_RESYNC_RESP_ACK_MSG_KID_MASK          UINT32_C(0xfffff0)
2050         #define CE_BDS_RESYNC_RESP_ACK_MSG_KID_SFT           4
2051         /*
2052          * This field indicates if the resync request resulted in a success or
2053          * a failure.
2054          */
2055         #define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS \
2056                 UINT32_C(0x1000000)
2057         /*
2058          * An ACK indicates that the driver was able to find the TLS record
2059          * associated with TCP sequence number provided by the HW
2060          */
2061         #define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_ACK \
2062                 (UINT32_C(0x0) << 24)
2063         #define CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_LAST \
2064                 CE_BDS_RESYNC_RESP_ACK_MSG_RESYNC_STATUS_ACK
2065         /*
2066          * This field is the echo of the TCP sequence number provided in the
2067          * resync request by the HW. If HW sent multiple resync requests, it
2068          * only tracks the latest TCP sequence number. When the response from
2069          * the Driver doesn't match the latest request, HW will drop the resync
2070          * response.
2071          */
2072         uint32_t        resync_record_tcp_seq_num;
2073         /*
2074          * This field indicates the TLS record sequence number associated with
2075          * the resync request. HW will take this number and add the delta records
2076          * it has found since sending the resync request, update the context and
2077          * resume decrypting records.
2078          */
2079         uint32_t        resync_record_seq_num[2];
2080 } __rte_packed;
2081
2082 /* ce_bds_resync_resp_nack_msg (size:64b/8B) */
2083 struct ce_bds_resync_resp_nack_msg {
2084         uint32_t        resync_status_kid_opcode;
2085         /*
2086          * This value selects the operation for the mid-path command for the
2087          * crypto blocks.
2088          */
2089         #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_MASK       UINT32_C(0xf)
2090         #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_SFT        0
2091         /*
2092          * This command is used by the driver as a response to the resync
2093          * request sent by the crypto engine.
2094          */
2095         #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_RESYNC       UINT32_C(0x3)
2096         #define CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_LAST \
2097                 CE_BDS_RESYNC_RESP_NACK_MSG_OPCODE_RESYNC
2098         /*
2099          * This field is the Crypto Context ID. The KID is used to store
2100          * information used by the associated kTLS offloaded connection.
2101          */
2102         #define CE_BDS_RESYNC_RESP_NACK_MSG_KID_MASK \
2103                 UINT32_C(0xfffff0)
2104         #define CE_BDS_RESYNC_RESP_NACK_MSG_KID_SFT           4
2105         /*
2106          * This field indicates if the resync request resulted in a success or
2107          * a failure.
2108          */
2109         #define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS \
2110                 UINT32_C(0x1000000)
2111         /*
2112          * An NAK indicates that the driver wasn't able to find the TLS
2113          * record associated with TCP sequence number provided by the HW
2114          */
2115         #define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_NACK \
2116                 (UINT32_C(0x1) << 24)
2117         #define CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_LAST \
2118                 CE_BDS_RESYNC_RESP_NACK_MSG_RESYNC_STATUS_NACK
2119         /*
2120          * This field is the echo of the TCP sequence number provided in the
2121          * resync request by the HW. If HW sent multiple resync requests, it
2122          * only tracks the latest TCP sequence number. When the response from
2123          * the Driver doesn't match the latest request, HW will drop the resync
2124          * response.
2125          */
2126         uint32_t        resync_record_tcp_seq_num;
2127 } __rte_packed;
2128
2129 /* crypto_presync_bd_cmd (size:256b/32B) */
2130 struct crypto_presync_bd_cmd {
2131         uint8_t flags;
2132         /*
2133          * Typically, presync BDs are used for packet retransmissions. Source
2134          * port sends all the packets in order over the network to destination
2135          * port and packets get dropped in the network. The destination port
2136          * will request retranmission of dropped packets and source port driver
2137          * will send presync BD to setup the transmitter appropriately. It will
2138          * provide the start and end TCP sequence number of the data to be
2139          * transmitted. HW keeps two sets of context variable, one for in order
2140          * traffic and one for retransmission traffic. HW is designed to
2141          * transmit everything posted in the presync BD and return to in order
2142          * mode after that. No inorder context variables are updated in the
2143          * process. There is a special case where packets can be dropped
2144          * between the TCP stack and Device Driver (Berkeley Packet Filter for
2145          * ex) and HW still needs to transmit rest of the traffic. In this
2146          * mode, driver will send a presync BD as if it is a retransmission but
2147          * at the end of the transmission, the in order variables need to be
2148          * updated. This flag is used by driver to indicate that in order
2149          * variables needs to be updated at the end of completing the task
2150          * associated with the presync BD.
2151          */
2152         #define CRYPTO_PRESYNC_BD_CMD_FLAGS_UPDATE_IN_ORDER_VAR \
2153                 UINT32_C(0x1)
2154         uint8_t unused0;
2155         uint16_t        unused1;
2156         /*
2157          * This field maintains the TCP sequence number of the first byte in the
2158          * Header of the active TLS record. This field is set to 0 during
2159          * mid-path BD updates, but is set to correct value when a presync BD is
2160          * detected. For every record that is processed, the value from the
2161          * next_tls_header_tcp_seq_num field is copied.
2162          */
2163         uint32_t        header_tcp_seq_num;
2164         /*
2165          * When a retransmitted packet has a TLS authentication TAG present and
2166          * the data spans multiple TCP Packets, HW is required to read the entire
2167          * record to recalculate the TAG but only transmit what is required. This
2168          * field is the start TCP sequence number of the packet(s) that need to
2169          * be re-transmitted. This field is initialized to 0 during Mid-path BD
2170          * add command and initialized to value provided by the driver when
2171          * Pre-sync BD is detected. This field is never updated unless another
2172          * Pre-sync BD signaling a new retransmission is scheduled.
2173          */
2174         uint32_t        start_tcp_seq_num;
2175         /*
2176          * When a retransmitted packet has a TLS authentication TAG present and
2177          * the data spans multiple TCP Packets, HW is required to read the
2178          * entire record to recalculate the TAG but only transmit what is
2179          * required. This field is the end TCP sequence number of the packet(s)
2180          * that need to be re-transmitted. This field is initialized to 0 during
2181          * Mid-path BD add command and initialized to value provided by the
2182          * driver when Pre-sync BD is detected. This field is never updated
2183          * unless another Pre-sync BD signaling a new retransmission is
2184          * scheduled.
2185          */
2186         uint32_t        end_tcp_seq_num;
2187         /*
2188          * For TLS1.2, an explicit nonce is used as part of the IV (concatenated
2189          * with the SALT). For retans packets, this field is extracted from the
2190          * TLS record, field right after the TLS Header and stored in the
2191          * context. This field needs to be stored in context as TCP segmentation
2192          * could have split the field into multiple TCP packets. This value is
2193          * initialized to 0 when presync BD is detected by taking the value from
2194          * the first TLS header. When subsequent TLS Headers are detected, the
2195          * value is extracted from packet.
2196          */
2197         uint32_t        explicit_nonce[2];
2198         /*
2199          * This is sequence number for the TLS record in a particular session. In
2200          * TLS1.2, record sequence number is part of the Associated Data (AD) in
2201          * the AEAD algorithm. In TLS1.3, record sequence number is part of the
2202          * Initial Vector (IV). The field is initialized to 0 during Mid-path BD
2203          * download. Is initialized to correct value when a pre-sync BD is
2204          * detected. TCE HW increments the field after that for every record
2205          * processed as it parses the TCP packet. Subsequent pre-sync BDs
2206          * delivering more retransmission instruction will also update this
2207          * field.
2208          */
2209         uint32_t        record_seq_num[2];
2210 } __rte_packed;
2211
2212 /* bd_base (size:64b/8B) */
2213 struct bd_base {
2214         uint8_t type;
2215         /* This value identifies the type of buffer descriptor. */
2216         #define BD_BASE_TYPE_MASK             UINT32_C(0x3f)
2217         #define BD_BASE_TYPE_SFT              0
2218         /*
2219          * Indicates that this BD is 16B long and is used for
2220          * normal L2 packet transmission.
2221          */
2222         #define BD_BASE_TYPE_TX_BD_SHORT        UINT32_C(0x0)
2223         /*
2224          * Indicates that this BD is 1BB long and is an empty
2225          * TX BD. Not valid for use by the driver.
2226          */
2227         #define BD_BASE_TYPE_TX_BD_EMPTY        UINT32_C(0x1)
2228         /*
2229          * Indicates that this BD is 16B long and is an RX Producer
2230          * (i.e. empty) buffer descriptor.
2231          */
2232         #define BD_BASE_TYPE_RX_PROD_PKT        UINT32_C(0x4)
2233         /*
2234          * Indicates that this BD is 16B long and is an RX
2235          * Producer Buffer BD.
2236          */
2237         #define BD_BASE_TYPE_RX_PROD_BFR        UINT32_C(0x5)
2238         /*
2239          * Indicates that this BD is 16B long and is an
2240          * RX Producer Assembly Buffer Descriptor.
2241          */
2242         #define BD_BASE_TYPE_RX_PROD_AGG        UINT32_C(0x6)
2243         /*
2244          * Indicates that this BD is used to issue a command to one of
2245          * the mid-path destinations.
2246          */
2247         #define BD_BASE_TYPE_TX_BD_MP_CMD       UINT32_C(0x8)
2248         /*
2249          * Indicates that this BD is used to issue a cryptographic pre-
2250          * sync command through the fast path and destined for TCE.
2251          */
2252         #define BD_BASE_TYPE_TX_BD_PRESYNC_CMD  UINT32_C(0x9)
2253         /*
2254          * Indicates that this BD is 32B long and is used for
2255          * normal L2 packet transmission.
2256          */
2257         #define BD_BASE_TYPE_TX_BD_LONG         UINT32_C(0x10)
2258         /*
2259          * Indicates that this BD is 32B long and is used for
2260          * L2 packet transmission for small packets that require
2261          * low latency.
2262          */
2263         #define BD_BASE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
2264         #define BD_BASE_TYPE_LAST              BD_BASE_TYPE_TX_BD_LONG_INLINE
2265         uint8_t unused_1[7];
2266 } __rte_packed;
2267
2268 /* tx_bd_short (size:128b/16B) */
2269 struct tx_bd_short {
2270         /*
2271          * All bits in this field must be valid on the first BD of a packet.
2272          * Only the packet_end bit must be valid for the remaining BDs
2273          * of a packet.
2274          */
2275         uint16_t        flags_type;
2276         /* This value identifies the type of buffer descriptor. */
2277         #define TX_BD_SHORT_TYPE_MASK            UINT32_C(0x3f)
2278         #define TX_BD_SHORT_TYPE_SFT             0
2279         /*
2280          * Indicates that this BD is 16B long and is used for
2281          * normal L2 packet transmission.
2282          */
2283         #define TX_BD_SHORT_TYPE_TX_BD_SHORT       UINT32_C(0x0)
2284         #define TX_BD_SHORT_TYPE_LAST             TX_BD_SHORT_TYPE_TX_BD_SHORT
2285         /*
2286          * All bits in this field must be valid on the first BD of a packet.
2287          * Only the packet_end bit must be valid for the remaining BDs
2288          * of a packet.
2289          */
2290         #define TX_BD_SHORT_FLAGS_MASK           UINT32_C(0xffc0)
2291         #define TX_BD_SHORT_FLAGS_SFT            6
2292         /*
2293          * If set to 1, the packet ends with the data in the buffer
2294          * pointed to by this descriptor. This flag must be
2295          * valid on every BD.
2296          */
2297         #define TX_BD_SHORT_FLAGS_PACKET_END      UINT32_C(0x40)
2298         /*
2299          * If set to 1, the device will not generate a completion for
2300          * this transmit packet unless there is an error in it's
2301          * processing.
2302          * If this bit
2303          * is set to 0, then the packet will be completed normally.
2304          *
2305          * This bit must be valid only on the first BD of a packet.
2306          */
2307         #define TX_BD_SHORT_FLAGS_NO_CMPL         UINT32_C(0x80)
2308         /*
2309          * This value indicates how many 16B BD locations are consumed
2310          * in the ring by this packet.
2311          * A value of 1 indicates that this BD is the only BD (and that
2312          * it is a short BD). A value
2313          * of 3 indicates either 3 short BDs or 1 long BD and one short
2314          * BD in the packet. A value of 0 indicates
2315          * that there are 32 BD locations in the packet (the maximum).
2316          *
2317          * This field is valid only on the first BD of a packet.
2318          */
2319         #define TX_BD_SHORT_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
2320         #define TX_BD_SHORT_FLAGS_BD_CNT_SFT      8
2321         /*
2322          * This value is a hint for the length of the entire packet.
2323          * It is used by the chip to optimize internal processing.
2324          *
2325          * The packet will be dropped if the hint is too short.
2326          *
2327          * This field is valid only on the first BD of a packet.
2328          */
2329         #define TX_BD_SHORT_FLAGS_LHINT_MASK      UINT32_C(0x6000)
2330         #define TX_BD_SHORT_FLAGS_LHINT_SFT       13
2331         /* indicates packet length < 512B */
2332         #define TX_BD_SHORT_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
2333         /* indicates 512 <= packet length < 1KB */
2334         #define TX_BD_SHORT_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
2335         /* indicates 1KB <= packet length < 2KB */
2336         #define TX_BD_SHORT_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
2337         /* indicates packet length >= 2KB */
2338         #define TX_BD_SHORT_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
2339         #define TX_BD_SHORT_FLAGS_LHINT_LAST \
2340                 TX_BD_SHORT_FLAGS_LHINT_GTE2K
2341         /*
2342          * If set to 1, the device immediately updates the Send Consumer
2343          * Index after the buffer associated with this descriptor has
2344          * been transferred via DMA to NIC memory from host memory. An
2345          * interrupt may or may not be generated according to the state
2346          * of the interrupt avoidance mechanisms. If this bit
2347          * is set to 0, then the Consumer Index is only updated as soon
2348          * as one of the host interrupt coalescing conditions has been met.
2349          *
2350          * This bit must be valid on the first BD of a packet.
2351          */
2352         #define TX_BD_SHORT_FLAGS_COAL_NOW        UINT32_C(0x8000)
2353         /*
2354          * This is the length of the host physical buffer this BD describes
2355          * in bytes.
2356          *
2357          * This field must be valid on all BDs of a packet.
2358          */
2359         uint16_t        len;
2360         /*
2361          * The opaque data field is pass through to the completion and can be
2362          * used for any data that the driver wants to associate with the
2363          * transmit BD.
2364          *
2365          * This field must be valid on the first BD of a packet. If completion
2366          * coalescing is enabled on the TX ring, it is suggested that the driver
2367          * populate the opaque field to indicate the specific TX ring with which
2368          * the completion is associated, then utilize the opaque and sq_cons_idx
2369          * fields in the coalesced completion record to determine the specific
2370          * packets that are to be completed on that ring.
2371          */
2372         uint32_t        opaque;
2373         /*
2374          * This is the host physical address for the portion of the packet
2375          * described by this TX BD.
2376          *
2377          * This value must be valid on all BDs of a packet.
2378          */
2379         uint64_t        address;
2380 } __rte_packed;
2381
2382 /* tx_bd_long (size:128b/16B) */
2383 struct tx_bd_long {
2384         /* This value identifies the type of buffer descriptor. */
2385         uint16_t        flags_type;
2386         /*
2387          * This value indicates the type of buffer descriptor.
2388          * packet.
2389          */
2390         #define TX_BD_LONG_TYPE_MASK            UINT32_C(0x3f)
2391         #define TX_BD_LONG_TYPE_SFT             0
2392         /*
2393          * Indicates that this BD is 32B long and is used for
2394          * normal L2 packet transmission.
2395          */
2396         #define TX_BD_LONG_TYPE_TX_BD_LONG        UINT32_C(0x10)
2397         #define TX_BD_LONG_TYPE_LAST             TX_BD_LONG_TYPE_TX_BD_LONG
2398         /*
2399          * All bits in this field must be valid on the first BD of a packet.
2400          * Only the packet_end bit must be valid for the remaining BDs
2401          * of a packet.
2402          */
2403         #define TX_BD_LONG_FLAGS_MASK           UINT32_C(0xffc0)
2404         #define TX_BD_LONG_FLAGS_SFT            6
2405         /*
2406          * If set to 1, the packet ends with the data in the buffer
2407          * pointed to by this descriptor. This flag must be
2408          * valid on every BD.
2409          */
2410         #define TX_BD_LONG_FLAGS_PACKET_END      UINT32_C(0x40)
2411         /*
2412          * If set to 1, the device will not generate a completion for
2413          * this transmit packet unless there is an error in it's
2414          * processing.
2415          * If this bit
2416          * is set to 0, then the packet will be completed normally.
2417          *
2418          * This bit must be valid only on the first BD of a packet.
2419          */
2420         #define TX_BD_LONG_FLAGS_NO_CMPL         UINT32_C(0x80)
2421         /*
2422          * This value indicates how many 16B BD locations are consumed
2423          * in the ring by this packet.
2424          * A value of 1 indicates that this BD is the only BD (and that
2425          * it is a short BD). A value
2426          * of 3 indicates either 3 short BDs or 1 long BD and one short
2427          * BD in the packet. A value of 0 indicates
2428          * that there are 32 BD locations in the packet (the maximum).
2429          *
2430          * This field is valid only on the first BD of a packet.
2431          */
2432         #define TX_BD_LONG_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
2433         #define TX_BD_LONG_FLAGS_BD_CNT_SFT      8
2434         /*
2435          * This value is a hint for the length of the entire packet.
2436          * It is used by the chip to optimize internal processing.
2437          *
2438          * The packet will be dropped if the hint is too short.
2439          *
2440          * This field is valid only on the first BD of a packet.
2441          */
2442         #define TX_BD_LONG_FLAGS_LHINT_MASK      UINT32_C(0x6000)
2443         #define TX_BD_LONG_FLAGS_LHINT_SFT       13
2444         /* indicates packet length < 512B */
2445         #define TX_BD_LONG_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
2446         /* indicates 512 <= packet length < 1KB */
2447         #define TX_BD_LONG_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
2448         /* indicates 1KB <= packet length < 2KB */
2449         #define TX_BD_LONG_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
2450         /* indicates packet length >= 2KB */
2451         #define TX_BD_LONG_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
2452         #define TX_BD_LONG_FLAGS_LHINT_LAST       TX_BD_LONG_FLAGS_LHINT_GTE2K
2453         /*
2454          * If set to 1, the device immediately updates the Send Consumer
2455          * Index after the buffer associated with this descriptor has
2456          * been transferred via DMA to NIC memory from host memory. An
2457          * interrupt may or may not be generated according to the state
2458          * of the interrupt avoidance mechanisms. If this bit
2459          * is set to 0, then the Consumer Index is only updated as soon
2460          * as one of the host interrupt coalescing conditions has been met.
2461          *
2462          * This bit must be valid on the first BD of a packet.
2463          */
2464         #define TX_BD_LONG_FLAGS_COAL_NOW        UINT32_C(0x8000)
2465         /*
2466          * This is the length of the host physical buffer this BD describes
2467          * in bytes.
2468          *
2469          * This field must be valid on all BDs of a packet.
2470          */
2471         uint16_t        len;
2472         /*
2473          * The opaque data field is passed through to the completion and can be
2474          * used for any data that the driver wants to associate with the
2475          * transmit BD.
2476          *
2477          * This field must be valid on the first BD of a packet. If completion
2478          * coalescing is enabled on the TX ring, it is suggested that the driver
2479          * populate the opaque field to indicate the specific TX ring with which
2480          * the completion is associated, then utilize the opaque and sq_cons_idx
2481          * fields in the coalesced completion record to determine the specific
2482          * packets that are to be completed on that ring.
2483          */
2484         uint32_t        opaque;
2485         /*
2486          * This is the host physical address for the portion of the packet
2487          * described by this TX BD.
2488          *
2489          * This value must be valid on all BDs of a packet.
2490          */
2491         uint64_t        address;
2492 } __rte_packed;
2493
2494 /* Last 16 bytes of tx_bd_long. */
2495 /* tx_bd_long_hi (size:128b/16B) */
2496 struct tx_bd_long_hi {
2497         /*
2498          * All bits in this field must be valid on the first BD of a packet.
2499          * Their value on other BDs of the packet will be ignored.
2500          */
2501         uint16_t        lflags;
2502         /*
2503          * If set to 1, the controller replaces the TCP/UPD checksum
2504          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
2505          * checksum field of the encapsulated TCP/UDP packets with the
2506          * hardware calculated TCP/UDP checksum for the packet associated
2507          * with this descriptor. The flag is ignored if the LSO flag is set.
2508          *
2509          * This bit must be valid on the first BD of a packet.
2510          */
2511         #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
2512         /*
2513          * If set to 1, the controller replaces the IP checksum of the
2514          * normal packets, or the inner IP checksum of the encapsulated
2515          * packets with the hardware calculated IP checksum for the
2516          * packet associated with this descriptor.
2517          *
2518          * This bit must be valid on the first BD of a packet.
2519          */
2520         #define TX_BD_LONG_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
2521         /*
2522          * If set to 1, the controller will not append an Ethernet CRC
2523          * to the end of the frame.
2524          *
2525          * This bit must be valid on the first BD of a packet.
2526          *
2527          * Packet must be 64B or longer when this flag is set. It is not
2528          * useful to use this bit with any form of TX offload such as
2529          * CSO or LSO. The intent is that the packet from the host already
2530          * has a valid Ethernet CRC on the packet.
2531          */
2532         #define TX_BD_LONG_LFLAGS_NOCRC              UINT32_C(0x4)
2533         /*
2534          * If set to 1, the device will record the time at which the packet
2535          * was actually transmitted at the TX MAC for 2-step time sync.
2536          *
2537          * This bit must be valid on the first BD of a packet.
2538          */
2539         #define TX_BD_LONG_LFLAGS_STAMP              UINT32_C(0x8)
2540         /*
2541          * If set to 1, The controller replaces the tunnel IP checksum
2542          * field with hardware calculated IP checksum for the IP header
2543          * of the packet associated with this descriptor.
2544          *
2545          * For outer UDP checksum, global outer UDP checksum TE_NIC register
2546          * needs to be enabled. If the global outer UDP checksum TE_NIC register
2547          * bit is set, outer UDP checksum will be calculated for the following
2548          * cases:
2549          * 1. Packets with tcp_udp_chksum flag set to offload checksum for inner
2550          * packet AND the inner packet is TCP/UDP. If the inner packet is ICMP for
2551          * example (non-TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
2552          * checksum will not be calculated.
2553          * 2. Packets with lso flag set which implies inner TCP checksum calculation
2554          * as part of LSO operation.
2555          */
2556         #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
2557         /*
2558          * If set to 1, the device will treat this packet with LSO(Large
2559          * Send Offload) processing for both normal or encapsulated
2560          * packets, which is a form of TCP segmentation. When this bit
2561          * is 1, the hdr_size and mss fields must be valid. The driver
2562          * doesn't need to set ot_ip_chksum, t_ip_chksum, ip_chksum, and
2563          * tcp_udp_chksum flags since the controller will replace the
2564          * appropriate checksum fields for segmented packets.
2565          *
2566          * When this bit is 1, the hdr_size and mss fields must be valid.
2567          */
2568         #define TX_BD_LONG_LFLAGS_LSO                UINT32_C(0x20)
2569         /*
2570          * If set to zero when LSO is '1', then the IPID will be treated
2571          * as a 16b number and will be wrapped if it exceeds a value of
2572          * 0xffff.
2573          *
2574          * If set to one when LSO is '1', then the IPID will be treated
2575          * as a 15b number and will be wrapped if it exceeds a value 0f
2576          * 0x7fff.
2577          */
2578         #define TX_BD_LONG_LFLAGS_IPID_FMT           UINT32_C(0x40)
2579         /*
2580          * If set to zero when LSO is '1', then the IPID of the tunnel
2581          * IP header will not be modified during LSO operations.
2582          *
2583          * If set to one when LSO is '1', then the IPID of the tunnel
2584          * IP header will be incremented for each subsequent segment of an
2585          * LSO operation.
2586          *
2587          * The flag is ignored if the LSO packet is a normal (non-tunneled)
2588          * TCP packet.
2589          */
2590         #define TX_BD_LONG_LFLAGS_T_IPID             UINT32_C(0x80)
2591         /*
2592          * If set to '1', then the RoCE ICRC will be appended to the
2593          * packet. Packet must be a valid RoCE format packet.
2594          */
2595         #define TX_BD_LONG_LFLAGS_ROCE_CRC           UINT32_C(0x100)
2596         /*
2597          * If set to '1', then the FCoE CRC will be appended to the
2598          * packet. Packet must be a valid FCoE format packet.
2599          */
2600         #define TX_BD_LONG_LFLAGS_FCOE_CRC           UINT32_C(0x200)
2601         /*
2602          * If set to '1', then the timestamp from the BD is used. If cleared
2603          * to 0, then TWE provides the timestamp.
2604          */
2605         #define TX_BD_LONG_LFLAGS_BD_TS_EN           UINT32_C(0x400)
2606         /*
2607          * If set to '1', this operation will cause a trace capture in each
2608          * block it passes through.
2609          */
2610         #define TX_BD_LONG_LFLAGS_DEBUG_TRACE        UINT32_C(0x800)
2611         /*
2612          * If set to '1', the device will record the time at which the packet
2613          * was actually transmitted at the TX MAC for 1-step time sync. This
2614          * bit must be valid on the first BD of a packet.
2615          */
2616         #define TX_BD_LONG_LFLAGS_STAMP_1STEP        UINT32_C(0x1000)
2617         /*
2618          * If set to '1', the controller replaces the Outer-tunnel IP checksum
2619          * field with hardware calculated IP checksum for the IP header of the
2620          * packet associated with this descriptor. For outer UDP checksum, it
2621          * will be the following behavior for all cases independent of settings
2622          * of inner LSO and checksum offload BD flags. If outer UDP checksum
2623          * is 0, then do not update it. If outer UDP checksum is non zero, then
2624          * the hardware should compute and update it.
2625          */
2626         #define TX_BD_LONG_LFLAGS_OT_IP_CHKSUM       UINT32_C(0x2000)
2627         /*
2628          * If set to zero when LSO is '1', then the IPID of the Outer-tunnel IP
2629          * header will not be modified during LSO operations. If set to one
2630          * when LSO is '1', then the IPID of the Outer-tunnel IP header will be
2631          * incremented for each subsequent segment of an LSO operation. The
2632          * flag is ignored if the LSO packet is a normal (non-tunneled) TCP
2633          * packet.
2634          */
2635         #define TX_BD_LONG_LFLAGS_OT_IPID            UINT32_C(0x4000)
2636         /*
2637          * If set to '1', When set to 1, KTLS encryption will be enabled for
2638          * the packet.
2639          */
2640         #define TX_BD_LONG_LFLAGS_CRYPTO_EN          UINT32_C(0x8000)
2641         uint16_t        kid_or_ts_low_hdr_size;
2642         /*
2643          * When LSO is '1', this field must contain the offset of the
2644          * TCP payload from the beginning of the packet in as
2645          * 16b words. In case of encapsulated/tunneling packet, this field
2646          * contains the offset of the inner TCP payload from beginning of the
2647          * packet as 16-bit words.
2648          *
2649          * This value must be valid on the first BD of a packet.
2650          */
2651         #define TX_BD_LONG_HDR_SIZE_MASK     UINT32_C(0x1ff)
2652         #define TX_BD_LONG_HDR_SIZE_SFT      0
2653         /*
2654          * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit
2655          * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of the
2656          * 20-bit KID.
2657          */
2658         #define TX_BD_LONG_KID_OR_TS_LOW_MASK UINT32_C(0xfe00)
2659         #define TX_BD_LONG_KID_OR_TS_LOW_SFT 9
2660         uint32_t        kid_or_ts_high_mss;
2661         /*
2662          * This is the MSS value that will be used to do the LSO processing.
2663          * The value is the length in bytes of the TCP payload for each
2664          * segment generated by the LSO operation.
2665          *
2666          * This value must be valid on the first BD of a packet.
2667          */
2668         #define TX_BD_LONG_MSS_MASK           UINT32_C(0x7fff)
2669         #define TX_BD_LONG_MSS_SFT            0
2670         /*
2671          * If lflags.bd_ts_en is 1, this is the upper 17 bits of the 24-bit
2672          * timestamp. If lflags.crypto_en is 1, the least significant 13 bits
2673          * of this field contain the upper 13 bits of the 20-bit KID.
2674          */
2675         #define TX_BD_LONG_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000)
2676         #define TX_BD_LONG_KID_OR_TS_HIGH_SFT 15
2677         /*
2678          * This value selects bits 25:16 of the CFA action to perform on the
2679          * packet. See the cfa_action field for more information.
2680          */
2681         uint16_t        cfa_action_high;
2682         #define TX_BD_LONG_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
2683         #define TX_BD_LONG_CFA_ACTION_HIGH_SFT 0
2684         /*
2685          * This value selects a CFA action to perform on the packet.
2686          * Set this value to zero if no CFA action is desired.
2687          *
2688          * This value must be valid on the first BD of a packet.
2689          */
2690         uint16_t        cfa_action;
2691         /*
2692          * This value is action meta-data that defines CFA edit operations
2693          * that are done in addition to any action editing.
2694          */
2695         uint32_t        cfa_meta;
2696         /* When key=1, This is the VLAN tag VID value. */
2697         #define TX_BD_LONG_CFA_META_VLAN_VID_MASK        UINT32_C(0xfff)
2698         #define TX_BD_LONG_CFA_META_VLAN_VID_SFT         0
2699         /* When key=1, This is the VLAN tag DE value. */
2700         #define TX_BD_LONG_CFA_META_VLAN_DE              UINT32_C(0x1000)
2701         /* When key=1, This is the VLAN tag PRI value. */
2702         #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK        UINT32_C(0xe000)
2703         #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT         13
2704         /* When key=1, This is the VLAN tag TPID select value. */
2705         #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK       UINT32_C(0x70000)
2706         #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT        16
2707         /* 0x88a8 */
2708         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8 \
2709                 (UINT32_C(0x0) << 16)
2710         /* 0x8100 */
2711         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100 \
2712                 (UINT32_C(0x1) << 16)
2713         /* 0x9100 */
2714         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100 \
2715                 (UINT32_C(0x2) << 16)
2716         /* 0x9200 */
2717         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200 \
2718                 (UINT32_C(0x3) << 16)
2719         /* 0x9300 */
2720         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300 \
2721                 (UINT32_C(0x4) << 16)
2722         /* Value programmed in CFA VLANTPID register. */
2723         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG \
2724                 (UINT32_C(0x5) << 16)
2725         #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \
2726                 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
2727         /* When key=1, This is the VLAN tag TPID select value. */
2728         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK   UINT32_C(0xff80000)
2729         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT    19
2730         /*
2731          * This field identifies the type of edit to be performed
2732          * on the packet.
2733          *
2734          * This value must be valid on the first BD of a packet.
2735          */
2736         #define TX_BD_LONG_CFA_META_KEY_MASK             UINT32_C(0xf0000000)
2737         #define TX_BD_LONG_CFA_META_KEY_SFT              28
2738         /* No editing */
2739         #define TX_BD_LONG_CFA_META_KEY_NONE \
2740                 (UINT32_C(0x0) << 28)
2741         /*
2742          * - meta[17:16] - TPID select value (0 = 0x8100).
2743          * - meta[15:12] - PRI/DE value.
2744          * - meta[11:0] - VID value.
2745          */
2746         #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG \
2747                 (UINT32_C(0x1) << 28)
2748         /*
2749          * Provide metadata
2750          * - Wh+/SR - this option is not supported.
2751          * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta
2752          *   is set in the Lookup Table.
2753          * - SR2 - {4’d0, cfa_meta[27:0]} is used for metadata output if
2754          *   en_bd_meta is set in the Lookup Table.
2755          */
2756         #define TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER \
2757                 (UINT32_C(0x2) << 28)
2758         #define TX_BD_LONG_CFA_META_KEY_LAST \
2759                 TX_BD_LONG_CFA_META_KEY_METADATA_TRANSFER
2760 } __rte_packed;
2761
2762 /*
2763  * This structure is used to inform the NIC of packet data that needs to be
2764  * transmitted with additional processing that requires extra data such as
2765  * VLAN insertion plus attached inline data. This BD type may be used to
2766  * improve latency for small packets needing the additional extended features
2767  * supported by long BDs.
2768  */
2769 /* tx_bd_long_inline (size:256b/32B) */
2770 struct tx_bd_long_inline {
2771         uint16_t        flags_type;
2772         /* This value identifies the type of buffer descriptor. */
2773         #define TX_BD_LONG_INLINE_TYPE_MASK             UINT32_C(0x3f)
2774         #define TX_BD_LONG_INLINE_TYPE_SFT              0
2775         /*
2776          * This type of BD is 32B long and is used for inline L2 packet
2777          * transmission.
2778          */
2779         #define TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
2780         #define TX_BD_LONG_INLINE_TYPE_LAST \
2781                 TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE
2782         /*
2783          * All bits in this field may be set on the first BD of a packet.
2784          * Only the packet_end bit may be set in non-first BDs.
2785          */
2786         #define TX_BD_LONG_INLINE_FLAGS_MASK            UINT32_C(0xffc0)
2787         #define TX_BD_LONG_INLINE_FLAGS_SFT             6
2788         /*
2789          * If set to 1, the packet ends with the data in the buffer
2790          * pointed to by this descriptor. This flag must be
2791          * valid on every BD.
2792          */
2793         #define TX_BD_LONG_INLINE_FLAGS_PACKET_END       UINT32_C(0x40)
2794         /*
2795          * If set to 1, the device will not generate a completion for
2796          * this transmit packet unless there is an error in its processing.
2797          * If this bit is set to 0, then the packet will be completed
2798          * normally.
2799          *
2800          * This bit may be set only on the first BD of a packet.
2801          */
2802         #define TX_BD_LONG_INLINE_FLAGS_NO_CMPL          UINT32_C(0x80)
2803         /*
2804          * This value indicates how many 16B BD locations are consumed
2805          * in the ring by this packet, including the BD and inline
2806          * data.
2807          */
2808         #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_MASK      UINT32_C(0x1f00)
2809         #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_SFT       8
2810         /* This field is deprecated. */
2811         #define TX_BD_LONG_INLINE_FLAGS_LHINT_MASK       UINT32_C(0x6000)
2812         #define TX_BD_LONG_INLINE_FLAGS_LHINT_SFT        13
2813         /*
2814          * If set to 1, the device immediately updates the Send Consumer
2815          * Index after the buffer associated with this descriptor has
2816          * been transferred via DMA to NIC memory from host memory. An
2817          * interrupt may or may not be generated according to the state
2818          * of the interrupt avoidance mechanisms. If this bit
2819          * is set to 0, then the Consumer Index is only updated as soon
2820          * as one of the host interrupt coalescing conditions has been met.
2821          *
2822          * This bit must be valid on the first BD of a packet.
2823          */
2824         #define TX_BD_LONG_INLINE_FLAGS_COAL_NOW         UINT32_C(0x8000)
2825         /*
2826          * This is the length of the inline data, not including BD length, in
2827          * bytes.
2828          * The maximum value is 480.
2829          *
2830          * This field must be valid on all BDs of a packet.
2831          */
2832         uint16_t        len;
2833         /*
2834          * The opaque data field is passed through to the completion and can be
2835          * used for any data that the driver wants to associate with the transmit
2836          * BD. This field must be valid on the first BD of a packet. If
2837          * completion coalescing is enabled on the TX ring, it is suggested that
2838          * the driver populate the opaque field to indicate the specific TX ring
2839          * with which the completion is associated, then utilize the opaque and
2840          * sq_cons_idx fields in the coalesced completion record to determine
2841          * the specific packets that are to be completed on that ring.
2842          *
2843          * This field must be valid on the first BD of a packet.
2844          */
2845         uint32_t        opaque;
2846         uint64_t        unused1;
2847         /*
2848          * All bits in this field must be valid on the first BD of a packet.
2849          * Their value on other BDs of the packet is ignored.
2850          */
2851         uint16_t        lflags;
2852         /*
2853          * If set to 1, the controller replaces the TCP/UPD checksum
2854          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
2855          * checksum field of the encapsulated TCP/UDP packets with the
2856          * hardware calculated TCP/UDP checksum for the packet associated
2857          * with this descriptor. The flag is ignored if the LSO flag is set.
2858          */
2859         #define TX_BD_LONG_INLINE_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
2860         /*
2861          * If set to 1, the controller replaces the IP checksum of the
2862          * normal packets, or the inner IP checksum of the encapsulated
2863          * packets with the hardware calculated IP checksum for the
2864          * packet associated with this descriptor.
2865          */
2866         #define TX_BD_LONG_INLINE_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
2867         /*
2868          * If set to 1, the controller will not append an Ethernet CRC
2869          * to the end of the frame.
2870          *
2871          * Packet must be 64B or longer when this flag is set. It is not
2872          * useful to use this bit with any form of TX offload such as
2873          * CSO or LSO. The intent is that the packet from the host already
2874          * has a valid Ethernet CRC on the packet.
2875          */
2876         #define TX_BD_LONG_INLINE_LFLAGS_NOCRC              UINT32_C(0x4)
2877         /*
2878          * If set to 1, the device will record the time at which the packet
2879          * was actually transmitted at the TX MAC for 2-step time sync. This
2880          * bit must be valid on the first BD of a packet.
2881          */
2882         #define TX_BD_LONG_INLINE_LFLAGS_STAMP              UINT32_C(0x8)
2883         /*
2884          * If set to 1, the controller replaces the tunnel IP checksum
2885          * field with hardware calculated IP checksum for the IP header
2886          * of the packet associated with this descriptor. The hardware
2887          * updates an outer UDP checksum if it is non-zero.
2888          */
2889         #define TX_BD_LONG_INLINE_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
2890         /*
2891          * This bit must be 0 for BDs of this type. LSO is not supported with
2892          * inline BDs.
2893          */
2894         #define TX_BD_LONG_INLINE_LFLAGS_LSO                UINT32_C(0x20)
2895         /* Since LSO is not supported with inline BDs, this bit is not used. */
2896         #define TX_BD_LONG_INLINE_LFLAGS_IPID_FMT           UINT32_C(0x40)
2897         /* Since LSO is not supported with inline BDs, this bit is not used. */
2898         #define TX_BD_LONG_INLINE_LFLAGS_T_IPID             UINT32_C(0x80)
2899         /*
2900          * If set to '1', then the RoCE ICRC will be appended to the
2901          * packet. Packet must be a valid RoCE format packet.
2902          */
2903         #define TX_BD_LONG_INLINE_LFLAGS_ROCE_CRC           UINT32_C(0x100)
2904         /*
2905          * If set to '1', then the FCoE CRC will be appended to the
2906          * packet. Packet must be a valid FCoE format packet.
2907          */
2908         #define TX_BD_LONG_INLINE_LFLAGS_FCOE_CRC           UINT32_C(0x200)
2909         /*
2910          * If set to '1', then the timestamp from the BD is used. If cleared
2911          * to 0, then TWE provides the timestamp.
2912          */
2913         #define TX_BD_LONG_INLINE_LFLAGS_BD_TS_EN           UINT32_C(0x400)
2914         /*
2915          * If set to '1', this operation will cause a trace capture in each
2916          * block it passes through.
2917          */
2918         #define TX_BD_LONG_INLINE_LFLAGS_DEBUG_TRACE        UINT32_C(0x800)
2919         /*
2920          * If set to '1', the device will record the time at which the packet
2921          * was actually transmitted at the TX MAC for 1-step time sync. This
2922          * bit must be valid on the first BD of a packet.
2923          */
2924         #define TX_BD_LONG_INLINE_LFLAGS_STAMP_1STEP        UINT32_C(0x1000)
2925         /*
2926          * If set to '1', the controller replaces the Outer-tunnel IP checksum
2927          * field with hardware calculated IP checksum for the IP header of the
2928          * packet associated with this descriptor. For outer UDP checksum, it
2929          * will be the following behavior for all cases independent of settings
2930          * of inner LSO and checksum offload BD flags. If outer UDP checksum
2931          * is 0, then do not update it. If outer UDP checksum is non zero, then
2932          * the hardware should compute and update it.
2933          */
2934         #define TX_BD_LONG_INLINE_LFLAGS_OT_IP_CHKSUM       UINT32_C(0x2000)
2935         /*
2936          * If set to zero when LSO is '1', then the IPID of the Outer-tunnel IP
2937          * header will not be modified during LSO operations. If set to one
2938          * when LSO is '1', then the IPID of the Outer-tunnel IP header will be
2939          * incremented for each subsequent segment of an LSO operation. The
2940          * flag is ignored if the LSO packet is a normal (non-tunneled) TCP
2941          * packet.
2942          */
2943         #define TX_BD_LONG_INLINE_LFLAGS_OT_IPID            UINT32_C(0x4000)
2944         /*
2945          * If set to '1', When set to 1, KTLS encryption will be enabled for
2946          * the packet.
2947          */
2948         #define TX_BD_LONG_INLINE_LFLAGS_CRYPTO_EN          UINT32_C(0x8000)
2949         uint8_t unused2;
2950         uint8_t kid_or_ts_low;
2951         #define TX_BD_LONG_INLINE_UNUSED            UINT32_C(0x1)
2952         /*
2953          * If lflags.bd_ts_en is 1, this is the lower 7 bits of the 24-bit
2954          * timestamp. If lflags.crypto_en is 1, this is the lower 7 bits of
2955          * the 20-bit KID.
2956          */
2957         #define TX_BD_LONG_INLINE_KID_OR_TS_LOW_MASK UINT32_C(0xfe)
2958         #define TX_BD_LONG_INLINE_KID_OR_TS_LOW_SFT 1
2959         uint32_t        kid_or_ts_high;
2960         #define TX_BD_LONG_INLINE_UNUSED_MASK        UINT32_C(0x7fff)
2961         #define TX_BD_LONG_INLINE_UNUSED_SFT         0
2962         /*
2963          * If lflags.bd_ts_en is 1, this is the upper 17 bits of the 24-bit
2964          * timestamp. If lflags.crypto_en is 1, the least significant 13 bits
2965          * of this field contain the upper 13 bits of the 20-bit KID.
2966          */
2967         #define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_MASK UINT32_C(0xffff8000)
2968         #define TX_BD_LONG_INLINE_KID_OR_TS_HIGH_SFT 15
2969         /*
2970          * This value selects bits 25:16 of the CFA action to perform on the
2971          * packet. See the cfa_action field for more information.
2972          */
2973         uint16_t        cfa_action_high;
2974         #define TX_BD_LONG_INLINE_CFA_ACTION_HIGH_MASK UINT32_C(0x3ff)
2975         #define TX_BD_LONG_INLINE_CFA_ACTION_HIGH_SFT 0
2976         /*
2977          * This value selects a CFA action to perform on the packet.
2978          * Set this value to zero if no CFA action is desired.
2979          *
2980          * This value must be valid on the first BD of a packet.
2981          */
2982         uint16_t        cfa_action;
2983         /*
2984          * This value is action meta-data that defines CFA edit operations
2985          * that are done in addition to any action editing.
2986          */
2987         uint32_t        cfa_meta;
2988         /* When key = 1, this is the VLAN tag VID value. */
2989         #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_MASK        UINT32_C(0xfff)
2990         #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_SFT         0
2991         /* When key = 1, this is the VLAN tag DE value. */
2992         #define TX_BD_LONG_INLINE_CFA_META_VLAN_DE \
2993                 UINT32_C(0x1000)
2994         /* When key = 1, this is the VLAN tag PRI value. */
2995         #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_MASK \
2996                 UINT32_C(0xe000)
2997         #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_SFT         13
2998         /* When key = 1, this is the VLAN tag TPID select value. */
2999         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_MASK \
3000                 UINT32_C(0x70000)
3001         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_SFT        16
3002         /* 0x88a8 */
3003         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID88A8 \
3004                 (UINT32_C(0x0) << 16)
3005         /* 0x8100 */
3006         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID8100 \
3007                 (UINT32_C(0x1) << 16)
3008         /* 0x9100 */
3009         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9100 \
3010                 (UINT32_C(0x2) << 16)
3011         /* 0x9200 */
3012         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9200 \
3013                 (UINT32_C(0x3) << 16)
3014         /* 0x9300 */
3015         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9300 \
3016                 (UINT32_C(0x4) << 16)
3017         /* Value programmed in CFA VLANTPID register. */
3018         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG \
3019                 (UINT32_C(0x5) << 16)
3020         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_LAST \
3021                 TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG
3022         #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_MASK \
3023                 UINT32_C(0xff80000)
3024         #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_SFT    19
3025         /*
3026          * This field identifies the type of edit to be performed
3027          * on the packet.
3028          *
3029          * This value must be valid on the first BD of a packet.
3030          */
3031         #define TX_BD_LONG_INLINE_CFA_META_KEY_MASK \
3032                 UINT32_C(0xf0000000)
3033         #define TX_BD_LONG_INLINE_CFA_META_KEY_SFT              28
3034         /* No editing */
3035         #define TX_BD_LONG_INLINE_CFA_META_KEY_NONE \
3036                 (UINT32_C(0x0) << 28)
3037         /*
3038          * - meta[17:16] - TPID select value (0 = 0x8100).
3039          * - meta[15:12] - PRI/DE value.
3040          * - meta[11:0] - VID value.
3041          */
3042         #define TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG \
3043                 (UINT32_C(0x1) << 28)
3044         /*
3045          * Provide metadata
3046          * - Wh+/SR - this option is not supported.
3047          * - Thor - cfa_meta[15:0] is used for metadata output if en_bd_meta
3048          *   is set in the Lookup Table.
3049          * - SR2 - {4’d0, cfa_meta[27:0]} is used for metadata output if
3050          *   en_bd_meta is set in the Lookup Table.
3051          */
3052         #define TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER \
3053                 (UINT32_C(0x2) << 28)
3054         #define TX_BD_LONG_INLINE_CFA_META_KEY_LAST \
3055                 TX_BD_LONG_INLINE_CFA_META_KEY_METADATA_TRANSFER
3056 } __rte_packed;
3057
3058 /* tx_bd_empty (size:128b/16B) */
3059 struct tx_bd_empty {
3060         /* This value identifies the type of buffer descriptor. */
3061         uint8_t type;
3062         #define TX_BD_EMPTY_TYPE_MASK       UINT32_C(0x3f)
3063         #define TX_BD_EMPTY_TYPE_SFT        0
3064         /*
3065          * Indicates that this BD is 1BB long and is an empty
3066          * TX BD. Not valid for use by the driver.
3067          */
3068         #define TX_BD_EMPTY_TYPE_TX_BD_EMPTY  UINT32_C(0x1)
3069         #define TX_BD_EMPTY_TYPE_LAST        TX_BD_EMPTY_TYPE_TX_BD_EMPTY
3070         uint8_t unused_1[3];
3071         uint8_t unused_2;
3072         uint8_t unused_3[3];
3073         uint8_t unused_4[8];
3074 } __rte_packed;
3075
3076 /* tx_bd_mp_cmd (size:128b/16B) */
3077 struct tx_bd_mp_cmd {
3078         /* Unless otherwise stated, sub-fields of this field are always valid. */
3079         uint16_t        flags_type;
3080         /* This value identifies the type of buffer descriptor. */
3081         #define TX_BD_MP_CMD_TYPE_MASK        UINT32_C(0x3f)
3082         #define TX_BD_MP_CMD_TYPE_SFT         0
3083         /*
3084          * Indicates that this BD is used to issue a command to one of
3085          * the mid-path destinations.
3086          */
3087         #define TX_BD_MP_CMD_TYPE_TX_BD_MP_CMD  UINT32_C(0x8)
3088         #define TX_BD_MP_CMD_TYPE_LAST         TX_BD_MP_CMD_TYPE_TX_BD_MP_CMD
3089         #define TX_BD_MP_CMD_FLAGS_MASK       UINT32_C(0xffc0)
3090         #define TX_BD_MP_CMD_FLAGS_SFT        6
3091         /*  */
3092         #define TX_BD_MP_CMD_FLAGS_UNUSED_MASK UINT32_C(0xc0)
3093         #define TX_BD_MP_CMD_FLAGS_UNUSED_SFT  6
3094         /*
3095          * This value indicates the number of 16B BD locations (slots)
3096          * consumed in the ring by this mid-path command BD, including the
3097          * BD header and the command field.
3098          */
3099         #define TX_BD_MP_CMD_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
3100         #define TX_BD_MP_CMD_FLAGS_BD_CNT_SFT  8
3101         /*
3102          * This value defines the length of command field in bytes. The maximum
3103          * value shall be 496.
3104          */
3105         uint16_t        len;
3106         /*
3107          * The opaque data field is pass through to the completion and can be
3108          * used for any data that the driver wants to associate with this
3109          * Tx mid-path command.
3110          */
3111         uint32_t        opaque;
3112         uint64_t        unused1;
3113 } __rte_packed;
3114
3115 /* tx_bd_presync_cmd (size:128b/16B) */
3116 struct tx_bd_presync_cmd {
3117         /* Unless otherwise stated, sub-fields of this field are always valid. */
3118         uint16_t        flags_type;
3119         /* This value identifies the type of buffer descriptor. */
3120         #define TX_BD_PRESYNC_CMD_TYPE_MASK             UINT32_C(0x3f)
3121         #define TX_BD_PRESYNC_CMD_TYPE_SFT              0
3122         /*
3123          * Indicates that this BD is used to issue a cryptographic pre-
3124          * sync command through the fast path and destined for TCE.
3125          */
3126         #define TX_BD_PRESYNC_CMD_TYPE_TX_BD_PRESYNC_CMD  UINT32_C(0x9)
3127         #define TX_BD_PRESYNC_CMD_TYPE_LAST \
3128                 TX_BD_PRESYNC_CMD_TYPE_TX_BD_PRESYNC_CMD
3129         #define TX_BD_PRESYNC_CMD_FLAGS_MASK            UINT32_C(0xffc0)
3130         #define TX_BD_PRESYNC_CMD_FLAGS_SFT             6
3131         /*  */
3132         #define TX_BD_PRESYNC_CMD_FLAGS_UNUSED_MASK      UINT32_C(0xc0)
3133         #define TX_BD_PRESYNC_CMD_FLAGS_UNUSED_SFT       6
3134         /*
3135          * This value indicates the number of 16B BD locations (slots)
3136          * consumed in the ring by this pre-sync command BD, including the
3137          * BD header and the command field.
3138          */
3139         #define TX_BD_PRESYNC_CMD_FLAGS_BD_CNT_MASK      UINT32_C(0x1f00)
3140         #define TX_BD_PRESYNC_CMD_FLAGS_BD_CNT_SFT       8
3141         /*
3142          * This value defines the length of command field in bytes. The maximum
3143          * value shall be 496.
3144          */
3145         uint16_t        len;
3146         /*
3147          * The opaque data field is pass through to TCE and can be used for
3148          * debug.
3149          */
3150         uint32_t        opaque;
3151         /*
3152          * This field is the Crypto Context ID to which the retransmit packet is
3153          * applied. The KID references the context fields used by the
3154          * associated kTLS offloaded connection.
3155          */
3156         uint32_t        kid;
3157         /*
3158          * The KID value of all-ones is reserved for non-KTLS packets, which
3159          * only implies that this value must not be used when filling this
3160          * field for crypto packets.
3161          */
3162         #define TX_BD_PRESYNC_CMD_KID_VAL_MASK UINT32_C(0xfffff)
3163         #define TX_BD_PRESYNC_CMD_KID_VAL_SFT 0
3164         uint32_t        unused_1;
3165 } __rte_packed;
3166
3167 /* rx_prod_pkt_bd (size:128b/16B) */
3168 struct rx_prod_pkt_bd {
3169         /* This value identifies the type of buffer descriptor. */
3170         uint16_t        flags_type;
3171         /* This value identifies the type of buffer descriptor. */
3172         #define RX_PROD_PKT_BD_TYPE_MASK         UINT32_C(0x3f)
3173         #define RX_PROD_PKT_BD_TYPE_SFT          0
3174         /*
3175          * Indicates that this BD is 16B long and is an RX Producer
3176          * (i.e. empty) buffer descriptor.
3177          */
3178         #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT    UINT32_C(0x4)
3179         #define RX_PROD_PKT_BD_TYPE_LAST \
3180                 RX_PROD_PKT_BD_TYPE_RX_PROD_PKT
3181         #define RX_PROD_PKT_BD_FLAGS_MASK        UINT32_C(0xffc0)
3182         #define RX_PROD_PKT_BD_FLAGS_SFT         6
3183         /*
3184          * If set to 1, the packet will be placed at the address plus
3185          * 2B. The 2 Bytes of padding will be written as zero.
3186          */
3187         #define RX_PROD_PKT_BD_FLAGS_SOP_PAD      UINT32_C(0x40)
3188         /*
3189          * If set to 1, the packet write will be padded out to the
3190          * nearest cache-line with zero value padding.
3191          */
3192         #define RX_PROD_PKT_BD_FLAGS_EOP_PAD      UINT32_C(0x80)
3193         /*
3194          * This field has been deprecated. There can be no additional
3195          * BDs for this packet from this ring.
3196          *
3197          * Old definition:
3198          * This value is the number of additional buffers in the ring that
3199          * describe the buffer space to be consumed for this packet.
3200          * If the value is zero, then the packet must fit within the
3201          * space described by this BD. If this value is 1 or more, it
3202          * indicates how many additional "buffer" BDs are in the ring
3203          * immediately following this BD to be used for the same
3204          * network packet. Even if the packet to be placed does not need
3205          * all the additional buffers, they will be consumed anyway.
3206          */
3207         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
3208         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT  8
3209         /*
3210          * This is the length in Bytes of the host physical buffer where
3211          * data for the packet may be placed in host memory.
3212          */
3213         uint16_t        len;
3214         /*
3215          * The opaque data field is pass through to the completion and can be
3216          * used for any data that the driver wants to associate with this
3217          * receive buffer set.
3218          */
3219         uint32_t        opaque;
3220         /*
3221          * This is the host physical address where data for the packet may
3222          * be placed in host memory.
3223          */
3224         uint64_t        address;
3225 } __rte_packed;
3226
3227 /* rx_prod_bfr_bd (size:128b/16B) */
3228 struct rx_prod_bfr_bd {
3229         /* This value identifies the type of buffer descriptor. */
3230         uint16_t        flags_type;
3231         /* This value identifies the type of buffer descriptor. */
3232         #define RX_PROD_BFR_BD_TYPE_MASK       UINT32_C(0x3f)
3233         #define RX_PROD_BFR_BD_TYPE_SFT        0
3234         /*
3235          * Indicates that this BD is 16B long and is an RX
3236          * Producer Buffer BD.
3237          */
3238         #define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR  UINT32_C(0x5)
3239         #define RX_PROD_BFR_BD_TYPE_LAST        RX_PROD_BFR_BD_TYPE_RX_PROD_BFR
3240         #define RX_PROD_BFR_BD_FLAGS_MASK      UINT32_C(0xffc0)
3241         #define RX_PROD_BFR_BD_FLAGS_SFT       6
3242         /*
3243          * This is the length in Bytes of the host physical buffer where
3244          * data for the packet may be placed in host memory.
3245          */
3246         uint16_t        len;
3247         /* This field is not used. */
3248         uint32_t        opaque;
3249         /*
3250          * This is the host physical address where data for the packet may
3251          * be placed in host memory.
3252          */
3253         uint64_t        address;
3254 } __rte_packed;
3255
3256 /* rx_prod_agg_bd (size:128b/16B) */
3257 struct rx_prod_agg_bd {
3258         /* This value identifies the type of buffer descriptor. */
3259         uint16_t        flags_type;
3260         /* This value identifies the type of buffer descriptor. */
3261         #define RX_PROD_AGG_BD_TYPE_MASK         UINT32_C(0x3f)
3262         #define RX_PROD_AGG_BD_TYPE_SFT          0
3263         /*
3264          * Indicates that this BD is 16B long and is an
3265          * RX Producer Assembly Buffer Descriptor.
3266          */
3267         #define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG    UINT32_C(0x6)
3268         #define RX_PROD_AGG_BD_TYPE_LAST \
3269                 RX_PROD_AGG_BD_TYPE_RX_PROD_AGG
3270         #define RX_PROD_AGG_BD_FLAGS_MASK        UINT32_C(0xffc0)
3271         #define RX_PROD_AGG_BD_FLAGS_SFT         6
3272         /*
3273          * If set to 1, the packet write will be padded out to the
3274          * nearest cache-line with zero value padding.
3275          */
3276         #define RX_PROD_AGG_BD_FLAGS_EOP_PAD      UINT32_C(0x40)
3277         /*
3278          * This is the length in Bytes of the host physical buffer where
3279          * data for the packet may be placed in host memory.
3280          */
3281         uint16_t        len;
3282         /*
3283          * The opaque data field is pass through to the completion and can be
3284          * used for any data that the driver wants to associate with this
3285          * receive assembly buffer.
3286          */
3287         uint32_t        opaque;
3288         /*
3289          * This is the host physical address where data for the packet may
3290          * be placed in host memory.
3291          */
3292         uint64_t        address;
3293 } __rte_packed;
3294
3295 /* cfa_cmpls_cmp_data_msg (size:128b/16B) */
3296 struct cfa_cmpls_cmp_data_msg {
3297         uint32_t        mp_client_dma_length_opcode_status_type;
3298         /*
3299          * This field represents the Mid-Path client that generated the
3300          * completion.
3301          */
3302         #define CFA_CMPLS_CMP_DATA_MSG_TYPE_MASK                UINT32_C(0x3f)
3303         #define CFA_CMPLS_CMP_DATA_MSG_TYPE_SFT                 0
3304         /* Mid Path Short Completion with length = 16B. */
3305         #define CFA_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT \
3306                 UINT32_C(0x1e)
3307         #define CFA_CMPLS_CMP_DATA_MSG_TYPE_LAST \
3308                 CFA_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT
3309         /* This value indicates the status for the command. */
3310         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_MASK              UINT32_C(0x3c0)
3311         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_SFT               6
3312         /* Completed without error. */
3313         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_OK \
3314                 (UINT32_C(0x0) << 6)
3315         /* Indicates an unsupported CFA opcode in the command. */
3316         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_UNSPRT_ERR \
3317                 (UINT32_C(0x1) << 6)
3318         /*
3319          * Indicates a CFA command formatting error. This error can occur on
3320          * any of the supported CFA commands.
3321          */
3322         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_FMT_ERR \
3323                 (UINT32_C(0x2) << 6)
3324         /*
3325          * Indicates an SVIF-Table scope error. This error can occur on any
3326          * of the supported CFA commands.
3327          */
3328         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_SCOPE_ERR \
3329                 (UINT32_C(0x3) << 6)
3330         /*
3331          * Indicates that the table_index is either outside of the
3332          * table_scope range set by its EM_SIZE or, for EM Insert, it is in
3333          * the static bucket range. This error can occur on EM Insert
3334          * commands. It can also occur on Read, Read Clear, Write, and
3335          * Invalidate commands if the table_type is EM.
3336          */
3337         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_ADDR_ERR \
3338                 (UINT32_C(0x4) << 6)
3339         /*
3340          * Cache operation responded with an error. This error can occur on
3341          * Read, Read Clear, Write, EM Insert, and EM Delete commands.
3342          */
3343         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_CACHE_ERR \
3344                 (UINT32_C(0x5) << 6)
3345         /*
3346          * Indicates failure on EM Insert or EM Delete Command. Hash index
3347          * and hash msb are returned in table_index and hash_msb fields.
3348          * Dma_length is set to 1 if the bucket is also returned (as dma
3349          * data).
3350          */
3351         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_EM_FAIL \
3352                 (UINT32_C(0x6) << 6)
3353         /*
3354          * Indicates no notifications were available on an Event Collection
3355          * command.
3356          */
3357         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_EVENT_COLLECT_FAIL \
3358                 (UINT32_C(0x7) << 6)
3359         #define CFA_CMPLS_CMP_DATA_MSG_STATUS_LAST \
3360                 CFA_CMPLS_CMP_DATA_MSG_STATUS_EVENT_COLLECT_FAIL
3361         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED0_MASK             UINT32_C(0xc00)
3362         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED0_SFT              10
3363         /* This is the opcode from the command. */
3364         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_MASK \
3365                 UINT32_C(0xff000)
3366         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_SFT               12
3367         /*
3368          * This is read command. From 32 to 128B can be read from a table
3369          * using this command.
3370          */
3371         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_READ \
3372                 (UINT32_C(0x0) << 12)
3373         /*
3374          * This is write command. From 32 to 128B can be written to a table
3375          * using this command.
3376          */
3377         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_WRITE \
3378                 (UINT32_C(0x1) << 12)
3379         /*
3380          * This is read-clear command. 32B can be read from a table and a 16b
3381          * mask can be used to clear specific 16b units after the read as an
3382          * atomic operation.
3383          */
3384         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_READ_CLR \
3385                 (UINT32_C(0x2) << 12)
3386         /*
3387          * An exact match table insert will be attempted into the table. If
3388          * there is a free location in the bucket, the payload will be
3389          * written to the bucket.
3390          */
3391         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EM_INSERT \
3392                 (UINT32_C(0x3) << 12)
3393         /* An exact match table delete will be attempted. */
3394         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EM_DELETE \
3395                 (UINT32_C(0x4) << 12)
3396         /*
3397          * The specified table area will be invalidated. If it is needed
3398          * again, it will be read from the backing store.
3399          */
3400         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_INVALIDATE \
3401                 (UINT32_C(0x5) << 12)
3402         /* Reads notification messages from the Host Notification Queue. */
3403         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_EVENT_COLLECT \
3404                 (UINT32_C(0x6) << 12)
3405         #define CFA_CMPLS_CMP_DATA_MSG_OPCODE_LAST \
3406                 CFA_CMPLS_CMP_DATA_MSG_OPCODE_EVENT_COLLECT
3407         /*
3408          * This field indicates the length of the DMA that accompanies the
3409          * completion. Specified in units of DWords (32b). Valid values are
3410          * between 0 and 128. A value of zero indicates that there is no DMA
3411          * that accompanies the completion.
3412          */
3413         #define CFA_CMPLS_CMP_DATA_MSG_DMA_LENGTH_MASK \
3414                 UINT32_C(0xff00000)
3415         #define CFA_CMPLS_CMP_DATA_MSG_DMA_LENGTH_SFT           20
3416         /*
3417          * This field represents the Mid-Path client that generated the
3418          * completion.
3419          */
3420         #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_MASK \
3421                 UINT32_C(0xf0000000)
3422         #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_SFT            28
3423         /* TX configrable flow processing block. */
3424         #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_TE_CFA \
3425                 (UINT32_C(0x2) << 28)
3426         /* RX configrable flow processing block. */
3427         #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_RE_CFA \
3428                 (UINT32_C(0x3) << 28)
3429         #define CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_LAST \
3430                 CFA_CMPLS_CMP_DATA_MSG_MP_CLIENT_RE_CFA
3431         /*
3432          * This is a copy of the opaque field from the mid path BD of this
3433          * command.
3434          */
3435         uint32_t        opaque;
3436         uint16_t        hash_msb_v;
3437         /*
3438          * This value is written by the NIC such that it will be different for
3439          * each pass through the completion queue. The even passes will
3440          * write 1. The odd passes will write 0.
3441          */
3442         #define CFA_CMPLS_CMP_DATA_MSG_V            UINT32_C(0x1)
3443         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED1_MASK UINT32_C(0xe)
3444         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED1_SFT  1
3445         /*
3446          * This is the upper 12b of the hash, returned on Exact Match
3447          * Insertion/Deletion Commands.
3448          */
3449         #define CFA_CMPLS_CMP_DATA_MSG_HASH_MSB_MASK UINT32_C(0xfff0)
3450         #define CFA_CMPLS_CMP_DATA_MSG_HASH_MSB_SFT 4
3451         /* This is the table type from the command. */
3452         uint8_t table_type;
3453         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED2_MASK     UINT32_C(0xf)
3454         #define CFA_CMPLS_CMP_DATA_MSG_UNUSED2_SFT      0
3455         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_MASK  UINT32_C(0xf0)
3456         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_SFT   4
3457         /* This command acts on the action table of the specified scope. */
3458         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_ACTION  (UINT32_C(0x0) << 4)
3459         /* This command acts on the exact match table of the specified scope. */
3460         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_EM      (UINT32_C(0x1) << 4)
3461         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_LAST \
3462                 CFA_CMPLS_CMP_DATA_MSG_TABLE_TYPE_EM
3463         uint8_t table_scope;
3464         /* This is the table scope from the command. */
3465         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_SCOPE_MASK UINT32_C(0x1f)
3466         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_SCOPE_SFT 0
3467         uint32_t        table_index;
3468         /*
3469          * This is the table index from the command (if it exists). However, if
3470          * an Exact Match Insertion/Deletion command failed, then this is the
3471          * table index of the calculated static hash bucket.
3472          */
3473         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_INDEX_MASK UINT32_C(0x3ffffff)
3474         #define CFA_CMPLS_CMP_DATA_MSG_TABLE_INDEX_SFT 0
3475 } __rte_packed;
3476
3477 /* CFA Mid-Path 32B DMA Message */
3478 /* cfa_dma32b_data_msg (size:256b/32B) */
3479 struct cfa_dma32b_data_msg {
3480         /* DMA data value. */
3481         uint32_t        dta[8];
3482 } __rte_packed;
3483
3484 /* CFA Mid-Path 64B DMA Message */
3485 /* cfa_dma64b_data_msg (size:512b/64B) */
3486 struct cfa_dma64b_data_msg {
3487         /* DMA data value. */
3488         uint32_t        dta[16];
3489 } __rte_packed;
3490
3491 /* CFA Mid-Path 96B DMA Message */
3492 /* cfa_dma96b_data_msg (size:768b/96B) */
3493 struct cfa_dma96b_data_msg {
3494         /* DMA data value. */
3495         uint32_t        dta[24];
3496 } __rte_packed;
3497
3498 /* CFA Mid-Path 128B DMA Message */
3499 /* cfa_dma128b_data_msg (size:1024b/128B) */
3500 struct cfa_dma128b_data_msg {
3501         /* DMA data value. */
3502         uint32_t        dta[32];
3503 } __rte_packed;
3504
3505 /* ce_cmpls_cmp_data_msg (size:128b/16B) */
3506 struct ce_cmpls_cmp_data_msg {
3507         uint16_t        status_subtype_type;
3508         /*
3509          * This field indicates the exact type of the completion. By
3510          * convention, the LSB identifies the length of the record in 16B
3511          * units. Even values indicate 16B records. Odd values indicate 32B
3512          * records.
3513          */
3514         #define CE_CMPLS_CMP_DATA_MSG_TYPE_MASK          UINT32_C(0x3f)
3515         #define CE_CMPLS_CMP_DATA_MSG_TYPE_SFT           0
3516         /* Completion of a Mid Path Command. Length = 16B */
3517         #define CE_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT  UINT32_C(0x1e)
3518         #define CE_CMPLS_CMP_DATA_MSG_TYPE_LAST \
3519                 CE_CMPLS_CMP_DATA_MSG_TYPE_MID_PATH_SHORT
3520         /*
3521          * This value indicates the CE sub-type operation that is being
3522          * completed.
3523          */
3524         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_MASK       UINT32_C(0x3c0)
3525         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_SFT        6
3526         /* Completion Response for a Solicited Command. */
3527         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_SOLICITED    (UINT32_C(0x0) << 6)
3528         /* Error Completion (Unsolicited). */
3529         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_ERR          (UINT32_C(0x1) << 6)
3530         /* Re-Sync Completion (Unsolicited) */
3531         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_RESYNC       (UINT32_C(0x2) << 6)
3532         #define CE_CMPLS_CMP_DATA_MSG_SUBTYPE_LAST \
3533                 CE_CMPLS_CMP_DATA_MSG_SUBTYPE_RESYNC
3534         /* This value indicates the status for the command. */
3535         #define CE_CMPLS_CMP_DATA_MSG_STATUS_MASK        UINT32_C(0x3c00)
3536         #define CE_CMPLS_CMP_DATA_MSG_STATUS_SFT         10
3537         /* Completed without error. */
3538         #define CE_CMPLS_CMP_DATA_MSG_STATUS_OK \
3539                 (UINT32_C(0x0) << 10)
3540         /* CFCK load error. */
3541         #define CE_CMPLS_CMP_DATA_MSG_STATUS_CTX_LD_ERR \
3542                 (UINT32_C(0x1) << 10)
3543         /* FID check error. */
3544         #define CE_CMPLS_CMP_DATA_MSG_STATUS_FID_CHK_ERR \
3545                 (UINT32_C(0x2) << 10)
3546         #define CE_CMPLS_CMP_DATA_MSG_STATUS_LAST \
3547                 CE_CMPLS_CMP_DATA_MSG_STATUS_FID_CHK_ERR
3548         uint8_t unused0;
3549         uint8_t mp_clients;
3550         #define CE_CMPLS_CMP_DATA_MSG_UNUSED1_MASK   UINT32_C(0xf)
3551         #define CE_CMPLS_CMP_DATA_MSG_UNUSED1_SFT    0
3552         /*
3553          * This field represents the Mid-Path client that generated the
3554          * completion.
3555          */
3556         #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_MASK UINT32_C(0xf0)
3557         #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_SFT 4
3558         /* TX crypto engine block. */
3559         #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_TCE   (UINT32_C(0x0) << 4)
3560         /* RX crypto engine block. */
3561         #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_RCE   (UINT32_C(0x1) << 4)
3562         #define CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_LAST \
3563                 CE_CMPLS_CMP_DATA_MSG_MP_CLIENTS_RCE
3564         /*
3565          * This is a copy of the opaque field from the mid path BD of this
3566          * command.
3567          */
3568         uint32_t        opaque;
3569         /*  */
3570         uint32_t        kid_v;
3571         /*
3572          * This value is written by the NIC such that it will be different
3573          * for each pass through the completion queue. The even passes will
3574          * write 1. The odd passes will write 0.
3575          */
3576         #define CE_CMPLS_CMP_DATA_MSG_V       UINT32_C(0x1)
3577         /*
3578          * This field is the Crypto Context ID. The KID is used to store
3579          * information used by the associated kTLS offloaded connection.
3580          */
3581         #define CE_CMPLS_CMP_DATA_MSG_KID_MASK UINT32_C(0x1ffffe)
3582         #define CE_CMPLS_CMP_DATA_MSG_KID_SFT 1
3583         uint32_t        unused2;
3584 } __rte_packed;
3585
3586 /* cmpl_base (size:128b/16B) */
3587 struct cmpl_base {
3588         uint16_t        type;
3589         /*
3590          * This field indicates the exact type of the completion.
3591          * By convention, the LSB identifies the length of the
3592          * record in 16B units. Even values indicate 16B
3593          * records. Odd values indicate 32B
3594          * records.
3595          */
3596         #define CMPL_BASE_TYPE_MASK            UINT32_C(0x3f)
3597         #define CMPL_BASE_TYPE_SFT             0
3598         /*
3599          * TX L2 completion:
3600          * Completion of TX packet. Length = 16B
3601          */
3602         #define CMPL_BASE_TYPE_TX_L2             UINT32_C(0x0)
3603         /*
3604          * NO-OP completion:
3605          * Completion of NO-OP. Length = 16B
3606          */
3607         #define CMPL_BASE_TYPE_NO_OP             UINT32_C(0x1)
3608         /*
3609          * TX L2 coalesced completion:
3610          * Completion of coalesced TX packet. Length = 16B
3611          */
3612         #define CMPL_BASE_TYPE_TX_L2_COAL        UINT32_C(0x2)
3613         /*
3614          * TX L2 PTP completion:
3615          * Completion of PTP TX packet. Length = 32B
3616          */
3617         #define CMPL_BASE_TYPE_TX_L2_PTP         UINT32_C(0x3)
3618         /*
3619          * RX L2 TPA Start V2 Completion:
3620          * Completion of and L2 RX packet. Length = 32B
3621          * This is the new version of the RX_TPA_START completion used
3622          * in SR2 and later chips.
3623          */
3624         #define CMPL_BASE_TYPE_RX_TPA_START_V2   UINT32_C(0xd)
3625         /*
3626          * RX L2 V2 completion:
3627          * Completion of and L2 RX packet. Length = 32B
3628          * This is the new version of the RX_L2 completion used in SR2
3629          * and later chips.
3630          */
3631         #define CMPL_BASE_TYPE_RX_L2_V2          UINT32_C(0xf)
3632         /*
3633          * RX L2 completion:
3634          * Completion of and L2 RX packet. Length = 32B
3635          */
3636         #define CMPL_BASE_TYPE_RX_L2             UINT32_C(0x11)
3637         /*
3638          * RX Aggregation Buffer completion :
3639          * Completion of an L2 aggregation buffer in support of
3640          * TPA, HDS, or Jumbo packet completion. Length = 16B
3641          */
3642         #define CMPL_BASE_TYPE_RX_AGG            UINT32_C(0x12)
3643         /*
3644          * RX L2 TPA Start Completion:
3645          * Completion at the beginning of a TPA operation.
3646          * Length = 32B
3647          */
3648         #define CMPL_BASE_TYPE_RX_TPA_START      UINT32_C(0x13)
3649         /*
3650          * RX L2 TPA End Completion:
3651          * Completion at the end of a TPA operation.
3652          * Length = 32B
3653          */
3654         #define CMPL_BASE_TYPE_RX_TPA_END        UINT32_C(0x15)
3655         /*
3656          * Statistics Ejection Completion:
3657          * Completion of statistics data ejection buffer.
3658          * Length = 16B
3659          */
3660         #define CMPL_BASE_TYPE_STAT_EJECT        UINT32_C(0x1a)
3661         /*
3662          * VEE Flush Completion:
3663          * This completion is inserted manually by
3664          * the Primate and processed by the VEE hardware to ensure that
3665          * all completions on a VEE function have been processed by the
3666          * VEE hardware before FLR process is completed.
3667          */
3668         #define CMPL_BASE_TYPE_VEE_FLUSH         UINT32_C(0x1c)
3669         /*
3670          * Mid Path Short Completion :
3671          * Completion of a Mid Path Command. Length = 16B
3672          */
3673         #define CMPL_BASE_TYPE_MID_PATH_SHORT    UINT32_C(0x1e)
3674         /*
3675          * Mid Path Long Completion :
3676          * Completion of a Mid Path Command. Length = 32B
3677          */
3678         #define CMPL_BASE_TYPE_MID_PATH_LONG     UINT32_C(0x1f)
3679         /*
3680          * HWRM Command Completion:
3681          * Completion of an HWRM command.
3682          */
3683         #define CMPL_BASE_TYPE_HWRM_DONE         UINT32_C(0x20)
3684         /* Forwarded HWRM Request */
3685         #define CMPL_BASE_TYPE_HWRM_FWD_REQ      UINT32_C(0x22)
3686         /* Forwarded HWRM Response */
3687         #define CMPL_BASE_TYPE_HWRM_FWD_RESP     UINT32_C(0x24)
3688         /* HWRM Asynchronous Event Information */
3689         #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
3690         /* CQ Notification */
3691         #define CMPL_BASE_TYPE_CQ_NOTIFICATION   UINT32_C(0x30)
3692         /* SRQ Threshold Event */
3693         #define CMPL_BASE_TYPE_SRQ_EVENT         UINT32_C(0x32)
3694         /* DBQ Threshold Event */
3695         #define CMPL_BASE_TYPE_DBQ_EVENT         UINT32_C(0x34)
3696         /* QP Async Notification */
3697         #define CMPL_BASE_TYPE_QP_EVENT          UINT32_C(0x38)
3698         /* Function Async Notification */
3699         #define CMPL_BASE_TYPE_FUNC_EVENT        UINT32_C(0x3a)
3700         #define CMPL_BASE_TYPE_LAST             CMPL_BASE_TYPE_FUNC_EVENT
3701         /* info1 is 16 b */
3702         uint16_t        info1;
3703         /* info2 is 32 b */
3704         uint32_t        info2;
3705         /*
3706          * This value is written by the NIC such that it will be different
3707          * for each pass through the completion queue. The even passes
3708          * will write 1. The odd passes will write 0.
3709          */
3710         uint32_t        info3_v;
3711         #define CMPL_BASE_V         UINT32_C(0x1)
3712         #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
3713         #define CMPL_BASE_INFO3_SFT 1
3714         /* info4 is 32 b */
3715         uint32_t        info4;
3716 } __rte_packed;
3717
3718 /* tx_cmpl (size:128b/16B) */
3719 struct tx_cmpl {
3720         uint16_t        flags_type;
3721         /*
3722          * This field indicates the exact type of the completion.
3723          * By convention, the LSB identifies the length of the
3724          * record in 16B units. Even values indicate 16B
3725          * records. Odd values indicate 32B
3726          * records.
3727          */
3728         #define TX_CMPL_TYPE_MASK       UINT32_C(0x3f)
3729         #define TX_CMPL_TYPE_SFT        0
3730         /*
3731          * TX L2 completion:
3732          * Completion of TX packet. Length = 16B
3733          */
3734         #define TX_CMPL_TYPE_TX_L2        UINT32_C(0x0)
3735         #define TX_CMPL_TYPE_LAST        TX_CMPL_TYPE_TX_L2
3736         #define TX_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
3737         #define TX_CMPL_FLAGS_SFT       6
3738         /*
3739          * When this bit is '1', it indicates a packet that has an
3740          * error of some type. Type of error is indicated in
3741          * error_flags.
3742          */
3743         #define TX_CMPL_FLAGS_ERROR      UINT32_C(0x40)
3744         /*
3745          * When this bit is '1', it indicates that the packet completed
3746          * was transmitted using the push acceleration data provided
3747          * by the driver. When this bit is '0', it indicates that the
3748          * packet had not push acceleration data written or was executed
3749          * as a normal packet even though push data was provided.
3750          */
3751         #define TX_CMPL_FLAGS_PUSH       UINT32_C(0x80)
3752         /* unused1 is 16 b */
3753         uint16_t        unused_0;
3754         /*
3755          * This is a copy of the opaque field from the first TX BD of this
3756          * transmitted packet. Note that, if the packet was described by a short
3757          * CSO or short CSO inline BD, then the 16-bit opaque field from the
3758          * short CSO BD will appear in the bottom 16 bits of this field.
3759          */
3760         uint32_t        opaque;
3761         uint16_t        errors_v;
3762         /*
3763          * This value is written by the NIC such that it will be different
3764          * for each pass through the completion queue. The even passes
3765          * will write 1. The odd passes will write 0.
3766          */
3767         #define TX_CMPL_V                                  UINT32_C(0x1)
3768         #define TX_CMPL_ERRORS_MASK                        UINT32_C(0xfffe)
3769         #define TX_CMPL_ERRORS_SFT                         1
3770         /*
3771          * This error indicates that there was some sort of problem
3772          * with the BDs for the packet.
3773          */
3774         #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK            UINT32_C(0xe)
3775         #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT             1
3776         /* No error */
3777         #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR \
3778                 (UINT32_C(0x0) << 1)
3779         /*
3780          * Bad Format:
3781          * BDs were not formatted correctly.
3782          */
3783         #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT \
3784                 (UINT32_C(0x2) << 1)
3785         #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \
3786                 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
3787         /*
3788          * When this bit is '1', it indicates that the length of
3789          * the packet was zero. No packet was transmitted.
3790          */
3791         #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT              UINT32_C(0x10)
3792         /*
3793          * When this bit is '1', it indicates that the packet
3794          * was longer than the programmed limit in TDI. No
3795          * packet was transmitted.
3796          */
3797         #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH          UINT32_C(0x20)
3798         /*
3799          * When this bit is '1', it indicates that one or more of the
3800          * BDs associated with this packet generated a PCI error.
3801          * This probably means the address was not valid.
3802          */
3803         #define TX_CMPL_ERRORS_DMA_ERROR                    UINT32_C(0x40)
3804         /*
3805          * When this bit is '1', it indicates that the packet was longer
3806          * than indicated by the hint. No packet was transmitted.
3807          */
3808         #define TX_CMPL_ERRORS_HINT_TOO_SHORT               UINT32_C(0x80)
3809         /*
3810          * When this bit is '1', it indicates that the packet was
3811          * dropped due to Poison TLP error on one or more of the
3812          * TLPs in the PXP completion.
3813          */
3814         #define TX_CMPL_ERRORS_POISON_TLP_ERROR             UINT32_C(0x100)
3815         /*
3816          * When this bit is '1', it indicates that the packet was dropped
3817          * due to a transient internal error in TDC. The packet or LSO can
3818          * be retried and may transmit successfully on a subsequent attempt.
3819          */
3820         #define TX_CMPL_ERRORS_INTERNAL_ERROR               UINT32_C(0x200)
3821         /*
3822          * When this bit is '1', it was not possible to collect a a timestamp
3823          * for a PTP completion, in which case the timestamp_hi and
3824          * timestamp_lo fields are invalid. When this bit is '0' for a PTP
3825          * completion, the timestamp_hi and timestamp_lo fields are valid.
3826          * RJRN will copy the value of this bit into the field of the same
3827          * name in all TX completions, regardless of whether such completions
3828          * are PTP completions or other TX completions.
3829          */
3830         #define TX_CMPL_ERRORS_TIMESTAMP_INVALID_ERROR      UINT32_C(0x400)
3831         /* unused2 is 16 b */
3832         uint16_t        unused_1;
3833         /* unused3 is 32 b */
3834         uint32_t        unused_2;
3835 } __rte_packed;
3836
3837 /* tx_cmpl_coal (size:128b/16B) */
3838 struct tx_cmpl_coal {
3839         uint16_t        flags_type;
3840         /*
3841          * This field indicates the exact type of the completion.
3842          * By convention, the LSB identifies the length of the
3843          * record in 16B units. Even values indicate 16B
3844          * records. Odd values indicate 32B
3845          * records.
3846          */
3847         #define TX_CMPL_COAL_TYPE_MASK       UINT32_C(0x3f)
3848         #define TX_CMPL_COAL_TYPE_SFT        0
3849         /*
3850          * TX L2 coalesced completion:
3851          * Completion of TX packet. Length = 16B
3852          */
3853         #define TX_CMPL_COAL_TYPE_TX_L2_COAL   UINT32_C(0x2)
3854         #define TX_CMPL_COAL_TYPE_LAST        TX_CMPL_COAL_TYPE_TX_L2_COAL
3855         #define TX_CMPL_COAL_FLAGS_MASK      UINT32_C(0xffc0)
3856         #define TX_CMPL_COAL_FLAGS_SFT       6
3857         /*
3858          * When this bit is '1', it indicates a packet that has an
3859          * error of some type. Type of error is indicated in
3860          * error_flags.
3861          */
3862         #define TX_CMPL_COAL_FLAGS_ERROR      UINT32_C(0x40)
3863         /*
3864          * When this bit is '1', it indicates that the packet completed
3865          * was transmitted using the push acceleration data provided
3866          * by the driver. When this bit is '0', it indicates that the
3867          * packet had not push acceleration data written or was executed
3868          * as a normal packet even though push data was provided.
3869          */
3870         #define TX_CMPL_COAL_FLAGS_PUSH       UINT32_C(0x80)
3871         /* unused1 is 16 b */
3872         uint16_t        unused_0;
3873         /*
3874          * This is a copy of the opaque field from the first TX BD of the packet
3875          * which corresponds with the reported sq_cons_idx. Note that, with
3876          * coalesced completions, completions are generated for only some of the
3877          * packets. The driver will see the opaque field for only those packets.
3878          * Note that, if the packet was described by a short CSO or short CSO
3879          * inline BD, then the 16-bit opaque field from the short CSO BD will
3880          * appear in the bottom 16 bits of this field. For TX rings with
3881          * completion coalescing enabled (which would use the coalesced
3882          * completion record), it is suggested that the driver populate the
3883          * opaque field to indicate the specific TX ring with which the
3884          * completion is associated, then utilize the opaque and sq_cons_idx
3885          * fields in the coalesced completion record to determine the specific
3886          * packets that are to be completed on that ring.
3887          */
3888         uint32_t        opaque;
3889         uint16_t        errors_v;
3890         /*
3891          * This value is written by the NIC such that it will be different
3892          * for each pass through the completion queue. The even passes
3893          * will write 1. The odd passes will write 0.
3894          */
3895         #define TX_CMPL_COAL_V                                  UINT32_C(0x1)
3896         #define TX_CMPL_COAL_ERRORS_MASK \
3897                 UINT32_C(0xfffe)
3898         #define TX_CMPL_COAL_ERRORS_SFT                         1
3899         /*
3900          * This error indicates that there was some sort of problem
3901          * with the BDs for the packet.
3902          */
3903         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_MASK            UINT32_C(0xe)
3904         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_SFT             1
3905         /* No error */
3906         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_NO_ERROR \
3907                 (UINT32_C(0x0) << 1)
3908         /*
3909          * Bad Format:
3910          * BDs were not formatted correctly.
3911          */
3912         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT \
3913                 (UINT32_C(0x2) << 1)
3914         #define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_LAST \
3915                 TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT
3916         /*
3917          * When this bit is '1', it indicates that the length of
3918          * the packet was zero. No packet was transmitted.
3919          */
3920         #define TX_CMPL_COAL_ERRORS_ZERO_LENGTH_PKT              UINT32_C(0x10)
3921         /*
3922          * When this bit is '1', it indicates that the packet
3923          * was longer than the programmed limit in TDI. No
3924          * packet was transmitted.
3925          */
3926         #define TX_CMPL_COAL_ERRORS_EXCESSIVE_BD_LENGTH          UINT32_C(0x20)
3927         /*
3928          * When this bit is '1', it indicates that one or more of the
3929          * BDs associated with this packet generated a PCI error.
3930          * This probably means the address was not valid.
3931          */
3932         #define TX_CMPL_COAL_ERRORS_DMA_ERROR                    UINT32_C(0x40)
3933         /*
3934          * When this bit is '1', it indicates that the packet was longer
3935          * than indicated by the hint. No packet was transmitted.
3936          */
3937         #define TX_CMPL_COAL_ERRORS_HINT_TOO_SHORT               UINT32_C(0x80)
3938         /*
3939          * When this bit is '1', it indicates that the packet was
3940          * dropped due to Poison TLP error on one or more of the
3941          * TLPs in the PXP completion.
3942          */
3943         #define TX_CMPL_COAL_ERRORS_POISON_TLP_ERROR \
3944                 UINT32_C(0x100)
3945         /*
3946          * When this bit is '1', it indicates that the packet was dropped
3947          * due to a transient internal error in TDC. The packet or LSO can
3948          * be retried and may transmit successfully on a subsequent attempt.
3949          */
3950         #define TX_CMPL_COAL_ERRORS_INTERNAL_ERROR \
3951                 UINT32_C(0x200)
3952         /*
3953          * When this bit is '1', it was not possible to collect a a timestamp
3954          * for a PTP completion, in which case the timestamp_hi and
3955          * timestamp_lo fields are invalid. When this bit is '0' for a PTP
3956          * completion, the timestamp_hi and timestamp_lo fields are valid.
3957          * RJRN will copy the value of this bit into the field of the same
3958          * name in all TX completions, regardless of whether such
3959          * completions are PTP completions or other TX completions.
3960          */
3961         #define TX_CMPL_COAL_ERRORS_TIMESTAMP_INVALID_ERROR \
3962                 UINT32_C(0x400)
3963         /* unused2 is 16 b */
3964         uint16_t        unused_1;
3965         uint32_t        sq_cons_idx;
3966         /*
3967          * This value is SQ index for the start of the packet following the
3968          * last completed packet.
3969          */
3970         #define TX_CMPL_COAL_SQ_CONS_IDX_MASK UINT32_C(0xffffff)
3971         #define TX_CMPL_COAL_SQ_CONS_IDX_SFT 0
3972 } __rte_packed;
3973
3974 /* tx_cmpl_ptp (size:128b/16B) */
3975 struct tx_cmpl_ptp {
3976         uint16_t        flags_type;
3977         /*
3978          * This field indicates the exact type of the completion.
3979          * By convention, the LSB identifies the length of the
3980          * record in 16B units. Even values indicate 16B
3981          * records. Odd values indicate 32B
3982          * records.
3983          */
3984         #define TX_CMPL_PTP_TYPE_MASK       UINT32_C(0x3f)
3985         #define TX_CMPL_PTP_TYPE_SFT        0
3986         /*
3987          * TX L2 PTP completion:
3988          * Completion of TX packet. Length = 32B
3989          */
3990         #define TX_CMPL_PTP_TYPE_TX_L2_PTP    UINT32_C(0x2)
3991         #define TX_CMPL_PTP_TYPE_LAST        TX_CMPL_PTP_TYPE_TX_L2_PTP
3992         #define TX_CMPL_PTP_FLAGS_MASK      UINT32_C(0xffc0)
3993         #define TX_CMPL_PTP_FLAGS_SFT       6
3994         /*
3995          * When this bit is '1', it indicates a packet that has an
3996          * error of some type. Type of error is indicated in
3997          * error_flags.
3998          */
3999         #define TX_CMPL_PTP_FLAGS_ERROR      UINT32_C(0x40)
4000         /*
4001          * When this bit is '1', it indicates that the packet completed
4002          * was transmitted using the push acceleration data provided
4003          * by the driver. When this bit is '0', it indicates that the
4004          * packet had not push acceleration data written or was executed
4005          * as a normal packet even though push data was provided.
4006          */
4007         #define TX_CMPL_PTP_FLAGS_PUSH       UINT32_C(0x80)
4008         /* unused1 is 16 b */
4009         uint16_t        unused_0;
4010         /*
4011          * This is a copy of the opaque field from the first TX BD of this
4012          * transmitted packet. Note that, if the packet was described by a short
4013          * CSO or short CSO inline BD, then the 16-bit opaque field from the
4014          * short CSO BD will appear in the bottom 16 bits of this field.
4015          */
4016         uint32_t        opaque;
4017         uint16_t        errors_v;
4018         /*
4019          * This value is written by the NIC such that it will be different
4020          * for each pass through the completion queue. The even passes
4021          * will write 1. The odd passes will write 0.
4022          */
4023         #define TX_CMPL_PTP_V                                  UINT32_C(0x1)
4024         #define TX_CMPL_PTP_ERRORS_MASK                        UINT32_C(0xfffe)
4025         #define TX_CMPL_PTP_ERRORS_SFT                         1
4026         /*
4027          * This error indicates that there was some sort of problem
4028          * with the BDs for the packet.
4029          */
4030         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_MASK            UINT32_C(0xe)
4031         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_SFT             1
4032         /* No error */
4033         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_NO_ERROR \
4034                 (UINT32_C(0x0) << 1)
4035         /*
4036          * Bad Format:
4037          * BDs were not formatted correctly.
4038          */
4039         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_BAD_FMT \
4040                 (UINT32_C(0x2) << 1)
4041         #define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_LAST \
4042                 TX_CMPL_PTP_ERRORS_BUFFER_ERROR_BAD_FMT
4043         /*
4044          * When this bit is '1', it indicates that the length of
4045          * the packet was zero. No packet was transmitted.
4046          */
4047         #define TX_CMPL_PTP_ERRORS_ZERO_LENGTH_PKT              UINT32_C(0x10)
4048         /*
4049          * When this bit is '1', it indicates that the packet
4050          * was longer than the programmed limit in TDI. No
4051          * packet was transmitted.
4052          */
4053         #define TX_CMPL_PTP_ERRORS_EXCESSIVE_BD_LENGTH          UINT32_C(0x20)
4054         /*
4055          * When this bit is '1', it indicates that one or more of the
4056          * BDs associated with this packet generated a PCI error.
4057          * This probably means the address was not valid.
4058          */
4059         #define TX_CMPL_PTP_ERRORS_DMA_ERROR                    UINT32_C(0x40)
4060         /*
4061          * When this bit is '1', it indicates that the packet was longer
4062          * than indicated by the hint. No packet was transmitted.
4063          */
4064         #define TX_CMPL_PTP_ERRORS_HINT_TOO_SHORT               UINT32_C(0x80)
4065         /*
4066          * When this bit is '1', it indicates that the packet was
4067          * dropped due to Poison TLP error on one or more of the
4068          * TLPs in the PXP completion.
4069          */
4070         #define TX_CMPL_PTP_ERRORS_POISON_TLP_ERROR             UINT32_C(0x100)
4071         /*
4072          * When this bit is '1', it indicates that the packet was dropped due
4073          * to a transient internal error in TDC. The packet or LSO can be
4074          * retried and may transmit successfully on a subsequent attempt.
4075          */
4076         #define TX_CMPL_PTP_ERRORS_INTERNAL_ERROR               UINT32_C(0x200)
4077         /*
4078          * When this bit is '1', it was not possible to collect a a timestamp
4079          * for a PTP completion, in which case the timestamp_hi and
4080          * timestamp_lo fields are invalid. When this bit is '0' for a PTP
4081          * completion, the timestamp_hi and timestamp_lo fields are valid.
4082          * RJRN will copy the value of this bit into the field of the same
4083          * name in all TX completions, regardless of whether such
4084          * completions are PTP completions or other TX completions.
4085          */
4086         #define TX_CMPL_PTP_ERRORS_TIMESTAMP_INVALID_ERROR      UINT32_C(0x400)
4087         /* unused2 is 16 b */
4088         uint16_t        unused_1;
4089         /*
4090          * This is timestamp value (lower 32bits) read from PM for the PTP
4091          * timestamp enabled packet.
4092          */
4093         uint32_t        timestamp_lo;
4094 } __rte_packed;
4095
4096 /* tx_cmpl_ptp_hi (size:128b/16B) */
4097 struct tx_cmpl_ptp_hi {
4098         /*
4099          * This is timestamp value (lower 32bits) read from PM for the PTP
4100          * timestamp enabled packet.
4101          */
4102         uint16_t        timestamp_hi[3];
4103         uint16_t        reserved16;
4104         uint64_t        v2;
4105         /*
4106          * This value is written by the NIC such that it will be different for
4107          * each pass through the completion queue.The even passes will write 1.
4108          * The odd passes will write 0
4109          */
4110         #define TX_CMPL_PTP_HI_V2     UINT32_C(0x1)
4111 } __rte_packed;
4112
4113 /* rx_pkt_cmpl (size:128b/16B) */
4114 struct rx_pkt_cmpl {
4115         uint16_t        flags_type;
4116         /*
4117          * This field indicates the exact type of the completion.
4118          * By convention, the LSB identifies the length of the
4119          * record in 16B units. Even values indicate 16B
4120          * records. Odd values indicate 32B
4121          * records.
4122          */
4123         #define RX_PKT_CMPL_TYPE_MASK                   UINT32_C(0x3f)
4124         #define RX_PKT_CMPL_TYPE_SFT                    0
4125         /*
4126          * RX L2 completion:
4127          * Completion of and L2 RX packet. Length = 32B
4128          */
4129         #define RX_PKT_CMPL_TYPE_RX_L2                    UINT32_C(0x11)
4130         #define RX_PKT_CMPL_TYPE_LAST                    RX_PKT_CMPL_TYPE_RX_L2
4131         #define RX_PKT_CMPL_FLAGS_MASK                  UINT32_C(0xffc0)
4132         #define RX_PKT_CMPL_FLAGS_SFT                   6
4133         /*
4134          * When this bit is '1', it indicates a packet that has an
4135          * error of some type. Type of error is indicated in
4136          * error_flags.
4137          */
4138         #define RX_PKT_CMPL_FLAGS_ERROR                  UINT32_C(0x40)
4139         /* This field indicates how the packet was placed in the buffer. */
4140         #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK         UINT32_C(0x380)
4141         #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT          7
4142         /*
4143          * Normal:
4144          * Packet was placed using normal algorithm.
4145          */
4146         #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL         (UINT32_C(0x0) << 7)
4147         /*
4148          * Jumbo:
4149          * Packet was placed using jumbo algorithm.
4150          */
4151         #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO          (UINT32_C(0x1) << 7)
4152         /*
4153          * Header/Data Separation:
4154          * Packet was placed using Header/Data separation algorithm.
4155          * The separation location is indicated by the itype field.
4156          */
4157         #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS            (UINT32_C(0x2) << 7)
4158         #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \
4159                 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
4160         /* This bit is '1' if the RSS field in this completion is valid. */
4161         #define RX_PKT_CMPL_FLAGS_RSS_VALID              UINT32_C(0x400)
4162         /* unused is 1 b */
4163         #define RX_PKT_CMPL_FLAGS_UNUSED                 UINT32_C(0x800)
4164         /*
4165          * This value indicates what the inner packet determined for the
4166          * packet was.
4167          */
4168         #define RX_PKT_CMPL_FLAGS_ITYPE_MASK             UINT32_C(0xf000)
4169         #define RX_PKT_CMPL_FLAGS_ITYPE_SFT              12
4170         /*
4171          * Not Known:
4172          * Indicates that the packet type was not known.
4173          */
4174         #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN \
4175                 (UINT32_C(0x0) << 12)
4176         /*
4177          * IP Packet:
4178          * Indicates that the packet was an IP packet, but further
4179          * classification was not possible.
4180          */
4181         #define RX_PKT_CMPL_FLAGS_ITYPE_IP \
4182                 (UINT32_C(0x1) << 12)
4183         /*
4184          * TCP Packet:
4185          * Indicates that the packet was IP and TCP.
4186          * This indicates that the payload_offset field is valid.
4187          */
4188         #define RX_PKT_CMPL_FLAGS_ITYPE_TCP \
4189                 (UINT32_C(0x2) << 12)
4190         /*
4191          * UDP Packet:
4192          * Indicates that the packet was IP and UDP.
4193          * This indicates that the payload_offset field is valid.
4194          */
4195         #define RX_PKT_CMPL_FLAGS_ITYPE_UDP \
4196                 (UINT32_C(0x3) << 12)
4197         /*
4198          * FCoE Packet:
4199          * Indicates that the packet was recognized as a FCoE.
4200          * This also indicates that the payload_offset field is valid.
4201          */
4202         #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE \
4203                 (UINT32_C(0x4) << 12)
4204         /*
4205          * RoCE Packet:
4206          * Indicates that the packet was recognized as a RoCE.
4207          * This also indicates that the payload_offset field is valid.
4208          */
4209         #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE \
4210                 (UINT32_C(0x5) << 12)
4211         /*
4212          * ICMP Packet:
4213          * Indicates that the packet was recognized as ICMP.
4214          * This indicates that the payload_offset field is valid.
4215          */
4216         #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP \
4217                 (UINT32_C(0x7) << 12)
4218         /*
4219          * PtP packet wo/timestamp:
4220          * Indicates that the packet was recognized as a PtP
4221          * packet.
4222          */
4223         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
4224                 (UINT32_C(0x8) << 12)
4225         /*
4226          * PtP packet w/timestamp:
4227          * Indicates that the packet was recognized as a PtP
4228          * packet and that a timestamp was taken for the packet.
4229          */
4230         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
4231                 (UINT32_C(0x9) << 12)
4232         #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \
4233                 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
4234         /*
4235          * This is the length of the data for the packet stored in the
4236          * buffer(s) identified by the opaque value. This includes
4237          * the packet BD and any associated buffer BDs. This does not include
4238          * the length of any data places in aggregation BDs.
4239          */
4240         uint16_t        len;
4241         /*
4242          * This is a copy of the opaque field from the RX BD this completion
4243          * corresponds to.
4244          */
4245         uint32_t        opaque;
4246         uint8_t agg_bufs_v1;
4247         /*
4248          * This value is written by the NIC such that it will be different
4249          * for each pass through the completion queue. The even passes
4250          * will write 1. The odd passes will write 0.
4251          */
4252         #define RX_PKT_CMPL_V1           UINT32_C(0x1)
4253         /*
4254          * This value is the number of aggregation buffers that follow this
4255          * entry in the completion ring that are a part of this packet.
4256          * If the value is zero, then the packet is completely contained
4257          * in the buffer space provided for the packet in the RX ring.
4258          */
4259         #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
4260         #define RX_PKT_CMPL_AGG_BUFS_SFT 1
4261         /* unused1 is 2 b */
4262         #define RX_PKT_CMPL_UNUSED1_MASK UINT32_C(0xc0)
4263         #define RX_PKT_CMPL_UNUSED1_SFT  6
4264         /*
4265          * This is the RSS hash type for the packet. The value is packed
4266          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
4267          *
4268          * The value of tuple_extrac_op provides the information about
4269          * what fields the hash was computed on.
4270          * * 0: The RSS hash was computed over source IP address,
4271          * destination IP address, source port, and destination port of inner
4272          * IP and TCP or UDP headers. Note: For non-tunneled packets,
4273          * the packet headers are considered inner packet headers for the RSS
4274          * hash computation purpose.
4275          * * 1: The RSS hash was computed over source IP address and destination
4276          * IP address of inner IP header. Note: For non-tunneled packets,
4277          * the packet headers are considered inner packet headers for the RSS
4278          * hash computation purpose.
4279          * * 2: The RSS hash was computed over source IP address,
4280          * destination IP address, source port, and destination port of
4281          * IP and TCP or UDP headers of outer tunnel headers.
4282          * Note: For non-tunneled packets, this value is not applicable.
4283          * * 3: The RSS hash was computed over source IP address and
4284          * destination IP address of IP header of outer tunnel headers.
4285          * Note: For non-tunneled packets, this value is not applicable.
4286          *
4287          * Note that 4-tuples values listed above are applicable
4288          * for layer 4 protocols supported and enabled for RSS in the hardware,
4289          * HWRM firmware, and drivers. For example, if RSS hash is supported and
4290          * enabled for TCP traffic only, then the values of tuple_extract_op
4291          * corresponding to 4-tuples are only valid for TCP traffic.
4292          */
4293         uint8_t rss_hash_type;
4294         /*
4295          * This value indicates the offset in bytes from the beginning of the packet
4296          * where the inner payload starts. This value is valid for TCP, UDP,
4297          * FCoE, and RoCE packets.
4298          *
4299          * A value of zero indicates that header is 256B into the packet.
4300          */
4301         uint8_t payload_offset;
4302         /* unused2 is 8 b */
4303         uint8_t unused1;
4304         /*
4305          * This value is the RSS hash value calculated for the packet
4306          * based on the mode bits and key value in the VNIC.
4307          */
4308         uint32_t        rss_hash;
4309 } __rte_packed;
4310
4311 /* Last 16 bytes of rx_pkt_cmpl. */
4312 /* rx_pkt_cmpl_hi (size:128b/16B) */
4313 struct rx_pkt_cmpl_hi {
4314         uint32_t        flags2;
4315         /*
4316          * This indicates that the ip checksum was calculated for the
4317          * inner packet and that the ip_cs_error field indicates if there
4318          * was an error.
4319          */
4320         #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC                 UINT32_C(0x1)
4321         /*
4322          * This indicates that the TCP, UDP or ICMP checksum was
4323          * calculated for the inner packet and that the l4_cs_error field
4324          * indicates if there was an error.
4325          */
4326         #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC                 UINT32_C(0x2)
4327         /*
4328          * This indicates that the ip checksum was calculated for the
4329          * tunnel header and that the t_ip_cs_error field indicates if there
4330          * was an error.
4331          */
4332         #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC               UINT32_C(0x4)
4333         /*
4334          * This indicates that the UDP checksum was
4335          * calculated for the tunnel packet and that the t_l4_cs_error field
4336          * indicates if there was an error.
4337          */
4338         #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC               UINT32_C(0x8)
4339         /* This value indicates what format the metadata field is. */
4340         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK           UINT32_C(0xf0)
4341         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT            4
4342         /* No metadata information. Value is zero. */
4343         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE \
4344                 (UINT32_C(0x0) << 4)
4345         /*
4346          * The metadata field contains the VLAN tag and TPID value.
4347          * - metadata[11:0] contains the vlan VID value.
4348          * - metadata[12] contains the vlan DE value.
4349          * - metadata[15:13] contains the vlan PRI value.
4350          * - metadata[31:16] contains the vlan TPID value.
4351          */
4352         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN \
4353                 (UINT32_C(0x1) << 4)
4354         /*
4355          * If ext_meta_format is equal to 1, the metadata field
4356          * contains the lower 16b of the tunnel ID value, justified
4357          * to LSB
4358          * - VXLAN = VNI[23:0] -> VXLAN Network ID
4359          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
4360          * - NVGRE = TNI[23:0] -> Tenant Network ID
4361          * - GRE = KEY[31:0] -> key field with bit mask. zero if K = 0
4362          * - IPV4 = 0 (not populated)
4363          * - IPV6 = Flow Label[19:0]
4364          * - PPPoE = sessionID[15:0]
4365          * - MPLs = Outer label[19:0]
4366          * - UPAR = Selected[31:0] with bit mask
4367          */
4368         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
4369                 (UINT32_C(0x2) << 4)
4370         /*
4371          * if ext_meta_format is equal to 1, metadata field contains
4372          * 16b metadata from the prepended header (chdr_data).
4373          */
4374         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
4375                 (UINT32_C(0x3) << 4)
4376         /*
4377          * If ext_meta_format is equal to 1, the metadata field contains
4378          * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
4379          * inner_l4_size.
4380          * - metadata[8:0] contains the outer_l3_offset.
4381          * - metadata[17:9] contains the inner_l2_offset.
4382          * - metadata[26:18] contains the inner_l3_offset.
4383          * - metadata[31:27] contains the inner_l4_size.
4384          */
4385         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
4386                 (UINT32_C(0x4) << 4)
4387         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \
4388                 RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
4389         /*
4390          * This field indicates the IP type for the inner-most IP header.
4391          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
4392          * This value is only valid if itype indicates a packet
4393          * with an IP header.
4394          */
4395         #define RX_PKT_CMPL_FLAGS2_IP_TYPE                    UINT32_C(0x100)
4396         /*
4397          * This indicates that the complete 1's complement checksum was
4398          * calculated for the packet.
4399          */
4400         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC     UINT32_C(0x200)
4401         /*
4402          * The combination of this value and meta_format indicated what
4403          * format the metadata field is.
4404          */
4405         #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_MASK       UINT32_C(0xc00)
4406         #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_SFT        10
4407         /*
4408          * This value is the complete 1's complement checksum calculated from
4409          * the start of the outer L3 header to the end of the packet (not
4410          * including the ethernet crc). It is valid when the
4411          * 'complete_checksum_calc' flag is set.
4412          */
4413         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
4414                 UINT32_C(0xffff0000)
4415         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
4416         /*
4417          * This is data from the CFA block as indicated by the meta_format
4418          * field.
4419          */
4420         uint32_t        metadata;
4421         /* When meta_format=1, this value is the VLAN VID. */
4422         #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
4423         #define RX_PKT_CMPL_METADATA_VID_SFT  0
4424         /* When meta_format=1, this value is the VLAN DE. */
4425         #define RX_PKT_CMPL_METADATA_DE       UINT32_C(0x1000)
4426         /* When meta_format=1, this value is the VLAN PRI. */
4427         #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
4428         #define RX_PKT_CMPL_METADATA_PRI_SFT  13
4429         /* When meta_format=1, this value is the VLAN TPID. */
4430         #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
4431         #define RX_PKT_CMPL_METADATA_TPID_SFT 16
4432         uint16_t        errors_v2;
4433         /*
4434          * This value is written by the NIC such that it will be different
4435          * for each pass through the completion queue. The even passes
4436          * will write 1. The odd passes will write 0.
4437          */
4438         #define RX_PKT_CMPL_V2 \
4439                 UINT32_C(0x1)
4440         #define RX_PKT_CMPL_ERRORS_MASK \
4441                 UINT32_C(0xfffe)
4442         #define RX_PKT_CMPL_ERRORS_SFT                               1
4443         /*
4444          * This error indicates that there was some sort of problem with
4445          * the BDs for the packet that was found after part of the
4446          * packet was already placed. The packet should be treated as
4447          * invalid.
4448          */
4449         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK \
4450                 UINT32_C(0xe)
4451         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT                   1
4452         /* No buffer error */
4453         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
4454                 (UINT32_C(0x0) << 1)
4455         /*
4456          * Did Not Fit:
4457          * Packet did not fit into packet buffer provided.
4458          * For regular placement, this means the packet did not fit
4459          * in the buffer provided. For HDS and jumbo placement, this
4460          * means that the packet could not be placed into 7 physical
4461          * buffers or less.
4462          */
4463         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
4464                 (UINT32_C(0x1) << 1)
4465         /*
4466          * Not On Chip:
4467          * All BDs needed for the packet were not on-chip when
4468          * the packet arrived.
4469          */
4470         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
4471                 (UINT32_C(0x2) << 1)
4472         /*
4473          * Bad Format:
4474          * BDs were not formatted correctly.
4475          */
4476         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
4477                 (UINT32_C(0x3) << 1)
4478         /*
4479          * Flush:
4480          * There was a bad_format error on the previous operation
4481          */
4482         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
4483                 (UINT32_C(0x5) << 1)
4484         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \
4485                 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
4486         /*
4487          * This indicates that there was an error in the IP header
4488          * checksum.
4489          */
4490         #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR \
4491                 UINT32_C(0x10)
4492         /*
4493          * This indicates that there was an error in the TCP, UDP
4494          * or ICMP checksum.
4495          */
4496         #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR \
4497                 UINT32_C(0x20)
4498         /*
4499          * This indicates that there was an error in the tunnel
4500          * IP header checksum.
4501          */
4502         #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR \
4503                 UINT32_C(0x40)
4504         /*
4505          * This indicates that there was an error in the tunnel
4506          * UDP checksum.
4507          */
4508         #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR \
4509                 UINT32_C(0x80)
4510         /*
4511          * This indicates that there was a CRC error on either an FCoE
4512          * or RoCE packet. The itype indicates the packet type.
4513          */
4514         #define RX_PKT_CMPL_ERRORS_CRC_ERROR \
4515                 UINT32_C(0x100)
4516         /*
4517          * This indicates that there was an error in the tunnel
4518          * portion of the packet when this
4519          * field is non-zero.
4520          */
4521         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK \
4522                 UINT32_C(0xe00)
4523         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT                    9
4524         /*
4525          * No additional error occurred on the tunnel portion
4526          * or the packet of the packet does not have a tunnel.
4527          */
4528         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR \
4529                 (UINT32_C(0x0) << 9)
4530         /*
4531          * Indicates that IP header version does not match
4532          * expectation from L2 Ethertype for IPv4 and IPv6
4533          * in the tunnel header.
4534          */
4535         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
4536                 (UINT32_C(0x1) << 9)
4537         /*
4538          * Indicates that header length is out of range in the
4539          * tunnel header. Valid for
4540          * IPv4.
4541          */
4542         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
4543                 (UINT32_C(0x2) << 9)
4544         /*
4545          * Indicates that the physical packet is shorter than that
4546          * claimed by the PPPoE header length for a tunnel PPPoE
4547          * packet.
4548          */
4549         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
4550                 (UINT32_C(0x3) << 9)
4551         /*
4552          * Indicates that physical packet is shorter than that claimed
4553          * by the tunnel l3 header length. Valid for IPv4, or IPv6
4554          * tunnel packet packets.
4555          */
4556         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
4557                 (UINT32_C(0x4) << 9)
4558         /*
4559          * Indicates that the physical packet is shorter than that
4560          * claimed by the tunnel UDP header length for a tunnel
4561          * UDP packet that is not fragmented.
4562          */
4563         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
4564                 (UINT32_C(0x5) << 9)
4565         /*
4566          * indicates that the IPv4 TTL or IPv6 hop limit check
4567          * have failed (e.g. TTL = 0) in the tunnel header. Valid
4568          * for IPv4, and IPv6.
4569          */
4570         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
4571                 (UINT32_C(0x6) << 9)
4572         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \
4573                 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
4574         /*
4575          * This indicates that there was an error in the inner
4576          * portion of the packet when this
4577          * field is non-zero.
4578          */
4579         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK \
4580                 UINT32_C(0xf000)
4581         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT                      12
4582         /*
4583          * No additional error occurred on the tunnel portion
4584          * or the packet of the packet does not have a tunnel.
4585          */
4586         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR \
4587                 (UINT32_C(0x0) << 12)
4588         /*
4589          * Indicates that IP header version does not match
4590          * expectation from L2 Ethertype for IPv4 and IPv6 or that
4591          * option other than VFT was parsed on
4592          * FCoE packet.
4593          */
4594         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \
4595                 (UINT32_C(0x1) << 12)
4596         /*
4597          * indicates that header length is out of range. Valid for
4598          * IPv4 and RoCE
4599          */
4600         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
4601                 (UINT32_C(0x2) << 12)
4602         /*
4603          * indicates that the IPv4 TTL or IPv6 hop limit check
4604          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
4605          */
4606         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL \
4607                 (UINT32_C(0x3) << 12)
4608         /*
4609          * Indicates that physical packet is shorter than that
4610          * claimed by the l3 header length. Valid for IPv4,
4611          * IPv6 packet or RoCE packets.
4612          */
4613         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
4614                 (UINT32_C(0x4) << 12)
4615         /*
4616          * Indicates that the physical packet is shorter than that
4617          * claimed by the UDP header length for a UDP packet that is
4618          * not fragmented.
4619          */
4620         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
4621                 (UINT32_C(0x5) << 12)
4622         /*
4623          * Indicates that TCP header length > IP payload. Valid for
4624          * TCP packets only.
4625          */
4626         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
4627                 (UINT32_C(0x6) << 12)
4628         /* Indicates that TCP header length < 5. Valid for TCP. */
4629         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
4630                 (UINT32_C(0x7) << 12)
4631         /*
4632          * Indicates that TCP option headers result in a TCP header
4633          * size that does not match data offset in TCP header. Valid
4634          * for TCP.
4635          */
4636         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
4637                 (UINT32_C(0x8) << 12)
4638         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \
4639                 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
4640         /*
4641          * This field identifies the CFA action rule that was used for this
4642          * packet.
4643          */
4644         uint16_t        cfa_code;
4645         uint32_t        reorder;
4646         /*
4647          * This value holds the reordering sequence number for the packet.
4648          * If the reordering sequence is not valid, then this value is zero.
4649          * The reordering domain for the packet is in the bottom 8 to 10b of
4650          * the rss_hash value. The bottom 20b of this value contain the
4651          * ordering domain value for the packet.
4652          */
4653         #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
4654         #define RX_PKT_CMPL_REORDER_SFT 0
4655 } __rte_packed;
4656
4657 /* rx_pkt_v2_cmpl (size:128b/16B) */
4658 struct rx_pkt_v2_cmpl {
4659         uint16_t        flags_type;
4660         /*
4661          * This field indicates the exact type of the completion.
4662          * By convention, the LSB identifies the length of the
4663          * record in 16B units. Even values indicate 16B
4664          * records. Odd values indicate 32B
4665          * records.
4666          */
4667         #define RX_PKT_V2_CMPL_TYPE_MASK                      UINT32_C(0x3f)
4668         #define RX_PKT_V2_CMPL_TYPE_SFT                       0
4669         /*
4670          * RX L2 V2 completion:
4671          * Completion of and L2 RX packet. Length = 32B
4672          * This is the new version of the RX_L2 completion used in SR2
4673          * and later chips.
4674          */
4675         #define RX_PKT_V2_CMPL_TYPE_RX_L2_V2                    UINT32_C(0xf)
4676         #define RX_PKT_V2_CMPL_TYPE_LAST \
4677                 RX_PKT_V2_CMPL_TYPE_RX_L2_V2
4678         #define RX_PKT_V2_CMPL_FLAGS_MASK                     UINT32_C(0xffc0)
4679         #define RX_PKT_V2_CMPL_FLAGS_SFT                      6
4680         /*
4681          * When this bit is '1', it indicates a packet that has an
4682          * error of some type. Type of error is indicated in
4683          * error_flags.
4684          */
4685         #define RX_PKT_V2_CMPL_FLAGS_ERROR                     UINT32_C(0x40)
4686         /* This field indicates how the packet was placed in the buffer. */
4687         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_MASK            UINT32_C(0x380)
4688         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_SFT             7
4689         /*
4690          * Normal:
4691          * Packet was placed using normal algorithm.
4692          */
4693         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_NORMAL \
4694                 (UINT32_C(0x0) << 7)
4695         /*
4696          * Jumbo:
4697          * Packet was placed using jumbo algorithm.
4698          */
4699         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_JUMBO \
4700                 (UINT32_C(0x1) << 7)
4701         /*
4702          * Header/Data Separation:
4703          * Packet was placed using Header/Data separation algorithm.
4704          * The separation location is indicated by the itype field.
4705          */
4706         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_HDS \
4707                 (UINT32_C(0x2) << 7)
4708         /*
4709          * Truncation:
4710          * Packet was placed using truncation algorithm. The
4711          * placed (truncated) length is indicated in the payload_offset
4712          * field. The original length is indicated in the len field.
4713          */
4714         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION \
4715                 (UINT32_C(0x3) << 7)
4716         #define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_LAST \
4717                 RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION
4718         /* This bit is '1' if the RSS field in this completion is valid. */
4719         #define RX_PKT_V2_CMPL_FLAGS_RSS_VALID                 UINT32_C(0x400)
4720         /*
4721          * This bit is '1' if metadata has been added to the end of the
4722          * packet in host memory. Metadata starts at the first 32B boundary
4723          * after the end of the packet for regular and jumbo placement.
4724          * It starts at the first 32B boundary after the end of the header
4725          * for HDS placement. The length of the metadata is indicated in the
4726          * metadata itself.
4727          */
4728         #define RX_PKT_V2_CMPL_FLAGS_PKT_METADATA_PRESENT      UINT32_C(0x800)
4729         /*
4730          * This value indicates what the inner packet determined for the
4731          * packet was.
4732          */
4733         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_MASK                UINT32_C(0xf000)
4734         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_SFT                 12
4735         /*
4736          * Not Known:
4737          * Indicates that the packet type was not known.
4738          */
4739         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_NOT_KNOWN \
4740                 (UINT32_C(0x0) << 12)
4741         /*
4742          * IP Packet:
4743          * Indicates that the packet was an IP packet, but further
4744          * classification was not possible.
4745          */
4746         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_IP \
4747                 (UINT32_C(0x1) << 12)
4748         /*
4749          * TCP Packet:
4750          * Indicates that the packet was IP and TCP.
4751          * This indicates that the payload_offset field is valid.
4752          */
4753         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_TCP \
4754                 (UINT32_C(0x2) << 12)
4755         /*
4756          * UDP Packet:
4757          * Indicates that the packet was IP and UDP.
4758          * This indicates that the payload_offset field is valid.
4759          */
4760         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_UDP \
4761                 (UINT32_C(0x3) << 12)
4762         /*
4763          * FCoE Packet:
4764          * Indicates that the packet was recognized as a FCoE.
4765          * This also indicates that the payload_offset field is valid.
4766          */
4767         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_FCOE \
4768                 (UINT32_C(0x4) << 12)
4769         /*
4770          * RoCE Packet:
4771          * Indicates that the packet was recognized as a RoCE.
4772          * This also indicates that the payload_offset field is valid.
4773          */
4774         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_ROCE \
4775                 (UINT32_C(0x5) << 12)
4776         /*
4777          * ICMP Packet:
4778          * Indicates that the packet was recognized as ICMP.
4779          * This indicates that the payload_offset field is valid.
4780          */
4781         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_ICMP \
4782                 (UINT32_C(0x7) << 12)
4783         /*
4784          * PtP packet wo/timestamp:
4785          * Indicates that the packet was recognized as a PtP
4786          * packet.
4787          */
4788         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
4789                 (UINT32_C(0x8) << 12)
4790         /*
4791          * PtP packet w/timestamp:
4792          * Indicates that the packet was recognized as a PtP
4793          * packet and that a timestamp was taken for the packet.
4794          */
4795         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
4796                 (UINT32_C(0x9) << 12)
4797         #define RX_PKT_V2_CMPL_FLAGS_ITYPE_LAST \
4798                 RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
4799         /*
4800          * This is the length of the data for the packet stored in the
4801          * buffer(s) identified by the opaque value. This includes
4802          * the packet BD and any associated buffer BDs. This does not include
4803          * the length of any data places in aggregation BDs.
4804          */
4805         uint16_t        len;
4806         /*
4807          * This is a copy of the opaque field from the RX BD this completion
4808          * corresponds to.
4809          */
4810         uint32_t        opaque;
4811         uint8_t agg_bufs_v1;
4812         /*
4813          * This value is written by the NIC such that it will be different
4814          * for each pass through the completion queue. The even passes
4815          * will write 1. The odd passes will write 0.
4816          */
4817         #define RX_PKT_V2_CMPL_V1           UINT32_C(0x1)
4818         /*
4819          * This value is the number of aggregation buffers that follow this
4820          * entry in the completion ring that are a part of this packet.
4821          * If the value is zero, then the packet is completely contained
4822          * in the buffer space provided for the packet in the RX ring.
4823          */
4824         #define RX_PKT_V2_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
4825         #define RX_PKT_V2_CMPL_AGG_BUFS_SFT 1
4826         /* unused1 is 2 b */
4827         #define RX_PKT_V2_CMPL_UNUSED1_MASK UINT32_C(0xc0)
4828         #define RX_PKT_V2_CMPL_UNUSED1_SFT  6
4829         /*
4830          * This is the RSS hash type for the packet. The value is packed
4831          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
4832          *
4833          * The value of tuple_extrac_op provides the information about
4834          * what fields the hash was computed on.
4835          * * 0: The RSS hash was computed over source IP address,
4836          * destination IP address, source port, and destination port of inner
4837          * IP and TCP or UDP headers. Note: For non-tunneled packets,
4838          * the packet headers are considered inner packet headers for the RSS
4839          * hash computation purpose.
4840          * * 1: The RSS hash was computed over source IP address and destination
4841          * IP address of inner IP header. Note: For non-tunneled packets,
4842          * the packet headers are considered inner packet headers for the RSS
4843          * hash computation purpose.
4844          * * 2: The RSS hash was computed over source IP address,
4845          * destination IP address, source port, and destination port of
4846          * IP and TCP or UDP headers of outer tunnel headers.
4847          * Note: For non-tunneled packets, this value is not applicable.
4848          * * 3: The RSS hash was computed over source IP address and
4849          * destination IP address of IP header of outer tunnel headers.
4850          * Note: For non-tunneled packets, this value is not applicable.
4851          *
4852          * Note that 4-tuples values listed above are applicable
4853          * for layer 4 protocols supported and enabled for RSS in the hardware,
4854          * HWRM firmware, and drivers. For example, if RSS hash is supported and
4855          * enabled for TCP traffic only, then the values of tuple_extract_op
4856          * corresponding to 4-tuples are only valid for TCP traffic.
4857          */
4858         uint8_t rss_hash_type;
4859         uint16_t        metadata1_payload_offset;
4860         /*
4861          * This is data from the CFA as indicated by the meta_format field.
4862          * If truncation placement is not used, this value indicates the offset
4863          * in bytes from the beginning of the packet where the inner payload
4864          * starts. This value is valid for TCP, UDP, FCoE, and RoCE packets. If
4865          * truncation placement is used, this value represents the placed
4866          * (truncated) length of the packet.
4867          */
4868         #define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_MASK        UINT32_C(0x1ff)
4869         #define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_SFT         0
4870         /* This is data from the CFA as indicated by the meta_format field. */
4871         #define RX_PKT_V2_CMPL_METADATA1_MASK             UINT32_C(0xf000)
4872         #define RX_PKT_V2_CMPL_METADATA1_SFT              12
4873         /* When meta_format != 0, this value is the VLAN TPID_SEL. */
4874         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_MASK     UINT32_C(0x7000)
4875         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_SFT      12
4876         /* 0x88a8 */
4877         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID88A8 \
4878                 (UINT32_C(0x0) << 12)
4879         /* 0x8100 */
4880         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID8100 \
4881                 (UINT32_C(0x1) << 12)
4882         /* 0x9100 */
4883         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9100 \
4884                 (UINT32_C(0x2) << 12)
4885         /* 0x9200 */
4886         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9200 \
4887                 (UINT32_C(0x3) << 12)
4888         /* 0x9300 */
4889         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPID9300 \
4890                 (UINT32_C(0x4) << 12)
4891         /* Value programmed in CFA VLANTPID register. */
4892         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG \
4893                 (UINT32_C(0x5) << 12)
4894         #define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_LAST \
4895                 RX_PKT_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
4896         /* When meta_format != 0, this value is the VLAN valid. */
4897         #define RX_PKT_V2_CMPL_METADATA1_VALID             UINT32_C(0x8000)
4898         /*
4899          * This value is the RSS hash value calculated for the packet
4900          * based on the mode bits and key value in the VNIC. When vee_cmpl_mode
4901          * is set in VNIC context, this is the lower 32b of the host address
4902          * from the first BD used to place the packet.
4903          */
4904         uint32_t        rss_hash;
4905 } __rte_packed;
4906
4907 /* Last 16 bytes of RX Packet V2 Completion Record */
4908 /* rx_pkt_v2_cmpl_hi (size:128b/16B) */
4909 struct rx_pkt_v2_cmpl_hi {
4910         uint32_t        flags2;
4911         /*
4912          * When this bit is '0', the cs_ok field has the following definition:-
4913          * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
4914          * in the delivered packet, counted from the outer-most header group to
4915          * the inner-most header group, stopping at the first error. -
4916          * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
4917          * in the delivered packet, counted from the outer-most header group to
4918          * the inner-most header group, stopping at the first error. When this
4919          * bit is '1', the cs_ok field has the following definition: -
4920          * hdr_cnt[2:0] = The number of header groups that were parsed by the
4921          * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
4922          * will be '1' if all the parsed header groups with an IP checksum are
4923          * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
4924          * header groups with an L4 checksum are valid.
4925          */
4926         #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_ALL_OK_MODE \
4927                 UINT32_C(0x8)
4928         /* This value indicates what format the metadata field is. */
4929         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_MASK \
4930                 UINT32_C(0xf0)
4931         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_SFT            4
4932         /* There is no metadata information. Values are zero. */
4933         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_NONE \
4934                 (UINT32_C(0x0) << 4)
4935         /*
4936          * The {metadata1, metadata0} fields contain the vtag
4937          * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
4938          * de, vid[11:0]} The metadata2 field contains the table scope
4939          * and action record pointer. - metadata2[25:0] contains the
4940          * action record pointer. - metadata2[31:26] contains the table
4941          * scope.
4942          */
4943         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR \
4944                 (UINT32_C(0x1) << 4)
4945         /*
4946          * The {metadata1, metadata0} fields contain the vtag
4947          * information:
4948          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
4949          * The metadata2 field contains the Tunnel ID
4950          * value, justified to LSB. i
4951          * - VXLAN = VNI[23:0] -> VXLAN Network ID
4952          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
4953          * - NVGRE = TNI[23:0] -> Tenant Network ID
4954          * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
4955          * - IPv4 = 0 (not populated)
4956          * - IPv6 = Flow Label[19:0]
4957          * - PPPoE = sessionID[15:0]
4958          * - MPLs = Outer label[19:0]
4959          * - UPAR = Selected[31:0] with bit mask
4960          */
4961         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_TUNNEL_ID \
4962                 (UINT32_C(0x2) << 4)
4963         /*
4964          * The {metadata1, metadata0} fields contain the vtag
4965          * information:
4966          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
4967          * The metadata2 field contains the 32b metadata from the prepended
4968          * header (chdr_data).
4969          */
4970         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_CHDR_DATA \
4971                 (UINT32_C(0x3) << 4)
4972         /*
4973          * The {metadata1, metadata0} fields contain the vtag
4974          * information:
4975          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
4976          * The metadata2 field contains the outer_l3_offset,
4977          * inner_l2_offset, inner_l3_offset, and inner_l4_size.
4978          * - metadata2[8:0] contains the outer_l3_offset.
4979          * - metadata2[17:9] contains the inner_l2_offset.
4980          * - metadata2[26:18] contains the inner_l3_offset.
4981          * - metadata2[31:27] contains the inner_l4_size.
4982          */
4983         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET \
4984                 (UINT32_C(0x4) << 4)
4985         #define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_LAST \
4986                 RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET
4987         /*
4988          * This field indicates the IP type for the inner-most IP header.
4989          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
4990          * This value is only valid if itype indicates a packet
4991          * with an IP header.
4992          */
4993         #define RX_PKT_V2_CMPL_HI_FLAGS2_IP_TYPE \
4994                 UINT32_C(0x100)
4995         /*
4996          * This indicates that the complete 1's complement checksum was
4997          * calculated for the packet.
4998          */
4999         #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_CALC \
5000                 UINT32_C(0x200)
5001         /*
5002          * This field indicates the status of IP and L4 CS calculations done
5003          * by the chip. The format of this field is indicated by the
5004          * cs_all_ok_mode bit.
5005          */
5006         #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_MASK \
5007                 UINT32_C(0xfc00)
5008         #define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_SFT                  10
5009         /*
5010          * This value is the complete 1's complement checksum calculated from
5011          * the start of the outer L3 header to the end of the packet (not
5012          * including the ethernet crc). It is valid when the
5013          * 'complete_checksum_calc' flag is set.
5014          */
5015         #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_MASK \
5016                 UINT32_C(0xffff0000)
5017         #define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_SFT      16
5018         /*
5019          * This is data from the CFA block as indicated by the meta_format
5020          * field.
5021          * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
5022          * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
5023          *   act_rec_ptr[25:0]}
5024          * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
5025          * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
5026          * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
5027          * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
5028          * of the host address from the first BD used to place the packet.
5029          */
5030         uint32_t        metadata2;
5031         uint16_t        errors_v2;
5032         /*
5033          * This value is written by the NIC such that it will be different
5034          * for each pass through the completion queue. The even passes
5035          * will write 1. The odd passes will write 0.
5036          */
5037         #define RX_PKT_V2_CMPL_HI_V2 \
5038                 UINT32_C(0x1)
5039         #define RX_PKT_V2_CMPL_HI_ERRORS_MASK \
5040                 UINT32_C(0xfffe)
5041         #define RX_PKT_V2_CMPL_HI_ERRORS_SFT                               1
5042         /*
5043          * This error indicates that there was some sort of problem with
5044          * the BDs for the packet that was found after part of the
5045          * packet was already placed. The packet should be treated as
5046          * invalid.
5047          */
5048         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_MASK \
5049                 UINT32_C(0xe)
5050         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_SFT                   1
5051         /* No buffer error */
5052         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NO_BUFFER \
5053                 (UINT32_C(0x0) << 1)
5054         /*
5055          * Did Not Fit: Packet did not fit into packet buffer provided.
5056          * For regular placement, this means the packet did not fit in
5057          * the buffer provided. For HDS and jumbo placement, this means
5058          * that the packet could not be placed into 8 physical buffers
5059          * (if fixed-size buffers are used), or that the packet could
5060          * not be placed in the number of physical buffers configured
5061          * for the VNIC (if variable-size buffers are used)
5062          */
5063         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
5064                 (UINT32_C(0x1) << 1)
5065         /*
5066          * Not On Chip: All BDs needed for the packet were not on-chip
5067          * when the packet arrived. For regular placement, this error is
5068          * not valid. For HDS and jumbo placement, this means that not
5069          * enough agg BDs were posted to place the packet.
5070          */
5071         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
5072                 (UINT32_C(0x2) << 1)
5073         /*
5074          * Bad Format:
5075          * BDs were not formatted correctly.
5076          */
5077         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_BAD_FORMAT \
5078                 (UINT32_C(0x3) << 1)
5079         /*
5080          * Flush:
5081          * There was a bad_format error on the previous operation
5082          */
5083         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH \
5084                 (UINT32_C(0x5) << 1)
5085         #define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_LAST \
5086                 RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH
5087         /*
5088          * This indicates that there was an error in the outer tunnel
5089          * portion of the packet when this field is non-zero.
5090          */
5091         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_MASK \
5092                 UINT32_C(0x70)
5093         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_SFT                   4
5094         /*
5095          * No additional error occurred on the outer tunnel portion
5096          * of the packet or the packet does not have a outer tunnel.
5097          */
5098         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_NO_ERROR \
5099                 (UINT32_C(0x0) << 4)
5100         /*
5101          * Indicates that IP header version does not match expectation
5102          * from L2 Ethertype for IPv4 and IPv6 in the outer tunnel header.
5103          */
5104         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_VERSION \
5105                 (UINT32_C(0x1) << 4)
5106         /*
5107          * Indicates that header length is out of range in the outer
5108          * tunnel header. Valid for IPv4.
5109          */
5110         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_HDR_LEN \
5111                 (UINT32_C(0x2) << 4)
5112         /*
5113          * Indicates that physical packet is shorter than that claimed
5114          * by the outer tunnel l3 header length. Valid for IPv4, or
5115          * IPv6 outer tunnel packets.
5116          */
5117         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_TOTAL_ERROR \
5118                 (UINT32_C(0x3) << 4)
5119         /*
5120          * Indicates that the physical packet is shorter than that
5121          * claimed by the outer tunnel UDP header length for a outer
5122          * tunnel UDP packet that is not fragmented.
5123          */
5124         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_UDP_TOTAL_ERROR \
5125                 (UINT32_C(0x4) << 4)
5126         /*
5127          * Indicates that the IPv4 TTL or IPv6 hop limit check have
5128          * failed (e.g. TTL = 0) in the outer tunnel header. Valid for
5129          * IPv4, and IPv6.
5130          */
5131         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_TTL \
5132                 (UINT32_C(0x5) << 4)
5133         /*
5134          * Indicates that the IP checksum failed its check in the outer
5135          * tunnel header.
5136          */
5137         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_CS_ERROR \
5138                 (UINT32_C(0x6) << 4)
5139         /*
5140          * Indicates that the L4 checksum failed its check in the outer
5141          * tunnel header.
5142          */
5143         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR \
5144                 (UINT32_C(0x7) << 4)
5145         #define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_LAST \
5146                 RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR
5147         /*
5148          * This indicates that there was a CRC error on either an FCoE
5149          * or RoCE packet. The itype indicates the packet type.
5150          */
5151         #define RX_PKT_V2_CMPL_HI_ERRORS_CRC_ERROR \
5152                 UINT32_C(0x100)
5153         /*
5154          * This indicates that there was an error in the tunnel portion
5155          * of the packet when this field is non-zero.
5156          */
5157         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_MASK \
5158                 UINT32_C(0xe00)
5159         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_SFT                    9
5160         /*
5161          * No additional error occurred on the tunnel portion
5162          * of the packet or the packet does not have a tunnel.
5163          */
5164         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_NO_ERROR \
5165                 (UINT32_C(0x0) << 9)
5166         /*
5167          * Indicates that IP header version does not match expectation
5168          * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
5169          */
5170         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
5171                 (UINT32_C(0x1) << 9)
5172         /*
5173          * Indicates that header length is out of range in the tunnel
5174          * header. Valid for IPv4.
5175          */
5176         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
5177                 (UINT32_C(0x2) << 9)
5178         /*
5179          * Indicates that physical packet is shorter than that claimed
5180          * by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel
5181          * packet packets.
5182          */
5183         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
5184                 (UINT32_C(0x3) << 9)
5185         /*
5186          * Indicates that the physical packet is shorter than that claimed
5187          * by the tunnel UDP header length for a tunnel UDP packet that is
5188          * not fragmented.
5189          */
5190         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
5191                 (UINT32_C(0x4) << 9)
5192         /*
5193          * Indicates that the IPv4 TTL or IPv6 hop limit check have failed
5194          * (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6.
5195          */
5196         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
5197                 (UINT32_C(0x5) << 9)
5198         /*
5199          * Indicates that the IP checksum failed its check in the tunnel
5200          * header.
5201          */
5202         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR \
5203                 (UINT32_C(0x6) << 9)
5204         /*
5205          * Indicates that the L4 checksum failed its check in the tunnel
5206          * header.
5207          */
5208         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR \
5209                 (UINT32_C(0x7) << 9)
5210         #define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_LAST \
5211                 RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR
5212         /*
5213          * This indicates that there was an error in the inner
5214          * portion of the packet when this
5215          * field is non-zero.
5216          */
5217         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_MASK \
5218                 UINT32_C(0xf000)
5219         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_SFT                      12
5220         /*
5221          * No additional error occurred on the tunnel portion
5222          * or the packet of the packet does not have a tunnel.
5223          */
5224         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_NO_ERROR \
5225                 (UINT32_C(0x0) << 12)
5226         /*
5227          * Indicates that IP header version does not match
5228          * expectation from L2 Ethertype for IPv4 and IPv6 or that
5229          * option other than VFT was parsed on
5230          * FCoE packet.
5231          */
5232         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_VERSION \
5233                 (UINT32_C(0x1) << 12)
5234         /*
5235          * indicates that header length is out of range. Valid for
5236          * IPv4 and RoCE
5237          */
5238         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
5239                 (UINT32_C(0x2) << 12)
5240         /*
5241          * indicates that the IPv4 TTL or IPv6 hop limit check
5242          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
5243          */
5244         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_TTL \
5245                 (UINT32_C(0x3) << 12)
5246         /*
5247          * Indicates that physical packet is shorter than that
5248          * claimed by the l3 header length. Valid for IPv4,
5249          * IPv6 packet or RoCE packets.
5250          */
5251         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
5252                 (UINT32_C(0x4) << 12)
5253         /*
5254          * Indicates that the physical packet is shorter than that
5255          * claimed by the UDP header length for a UDP packet that is
5256          * not fragmented.
5257          */
5258         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
5259                 (UINT32_C(0x5) << 12)
5260         /*
5261          * Indicates that TCP header length > IP payload. Valid for
5262          * TCP packets only.
5263          */
5264         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
5265                 (UINT32_C(0x6) << 12)
5266         /* Indicates that TCP header length < 5. Valid for TCP. */
5267         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
5268                 (UINT32_C(0x7) << 12)
5269         /*
5270          * Indicates that TCP option headers result in a TCP header
5271          * size that does not match data offset in TCP header. Valid
5272          * for TCP.
5273          */
5274         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
5275                 (UINT32_C(0x8) << 12)
5276         /*
5277          * Indicates that the IP checksum failed its check in the
5278          * inner header.
5279          */
5280         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_CS_ERROR \
5281                 (UINT32_C(0x9) << 12)
5282         /*
5283          * Indicates that the L4 checksum failed its check in the
5284          * inner header.
5285          */
5286         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR \
5287                 (UINT32_C(0xa) << 12)
5288         #define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_LAST \
5289                 RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR
5290         /*
5291          * This is data from the CFA block as indicated by the meta_format
5292          * field.
5293          */
5294         uint16_t        metadata0;
5295         /* When meta_format=1, this value is the VLAN VID. */
5296         #define RX_PKT_V2_CMPL_HI_METADATA0_VID_MASK UINT32_C(0xfff)
5297         #define RX_PKT_V2_CMPL_HI_METADATA0_VID_SFT 0
5298         /* When meta_format=1, this value is the VLAN DE. */
5299         #define RX_PKT_V2_CMPL_HI_METADATA0_DE      UINT32_C(0x1000)
5300         /* When meta_format=1, this value is the VLAN PRI. */
5301         #define RX_PKT_V2_CMPL_HI_METADATA0_PRI_MASK UINT32_C(0xe000)
5302         #define RX_PKT_V2_CMPL_HI_METADATA0_PRI_SFT 13
5303         /*
5304          * The timestamp field contains the 32b timestamp for the packet from
5305          * the MAC.
5306          */
5307         uint32_t        timestamp;
5308 } __rte_packed;
5309
5310 /*
5311  * This TPA completion structure is used on devices where the
5312  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
5313  */
5314 /* rx_tpa_start_cmpl (size:128b/16B) */
5315 struct rx_tpa_start_cmpl {
5316         uint16_t        flags_type;
5317         /*
5318          * This field indicates the exact type of the completion.
5319          * By convention, the LSB identifies the length of the
5320          * record in 16B units. Even values indicate 16B
5321          * records. Odd values indicate 32B
5322          * records.
5323          */
5324         #define RX_TPA_START_CMPL_TYPE_MASK                UINT32_C(0x3f)
5325         #define RX_TPA_START_CMPL_TYPE_SFT                 0
5326         /*
5327          * RX L2 TPA Start Completion:
5328          * Completion at the beginning of a TPA operation.
5329          * Length = 32B
5330          */
5331         #define RX_TPA_START_CMPL_TYPE_RX_TPA_START          UINT32_C(0x13)
5332         #define RX_TPA_START_CMPL_TYPE_LAST \
5333                 RX_TPA_START_CMPL_TYPE_RX_TPA_START
5334         #define RX_TPA_START_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
5335         #define RX_TPA_START_CMPL_FLAGS_SFT                6
5336         /* This bit will always be '0' for TPA start completions. */
5337         #define RX_TPA_START_CMPL_FLAGS_ERROR               UINT32_C(0x40)
5338         /* This field indicates how the packet was placed in the buffer. */
5339         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
5340         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT       7
5341         /*
5342          * Jumbo:
5343          * TPA Packet was placed using jumbo algorithm. This means
5344          * that the first buffer will be filled with data before
5345          * moving to aggregation buffers. Each aggregation buffer
5346          * will be filled before moving to the next aggregation
5347          * buffer.
5348          */
5349         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO \
5350                 (UINT32_C(0x1) << 7)
5351         /*
5352          * Header/Data Separation:
5353          * Packet was placed using Header/Data separation algorithm.
5354          * The separation location is indicated by the itype field.
5355          */
5356         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS \
5357                 (UINT32_C(0x2) << 7)
5358         /*
5359          * GRO/Jumbo:
5360          * Packet will be placed using GRO/Jumbo where the first
5361          * packet is filled with data. Subsequent packets will be
5362          * placed such that any one packet does not span two
5363          * aggregation buffers unless it starts at the beginning of
5364          * an aggregation buffer.
5365          */
5366         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
5367                 (UINT32_C(0x5) << 7)
5368         /*
5369          * GRO/Header-Data Separation:
5370          * Packet will be placed using GRO/HDS where the header
5371          * is in the first packet.
5372          * Payload of each packet will be
5373          * placed such that any one packet does not span two
5374          * aggregation buffers unless it starts at the beginning of
5375          * an aggregation buffer.
5376          */
5377         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \
5378                 (UINT32_C(0x6) << 7)
5379         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \
5380                 RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
5381         /* This bit is '1' if the RSS field in this completion is valid. */
5382         #define RX_TPA_START_CMPL_FLAGS_RSS_VALID           UINT32_C(0x400)
5383         /* unused is 1 b */
5384         #define RX_TPA_START_CMPL_FLAGS_UNUSED              UINT32_C(0x800)
5385         /*
5386          * This value indicates what the inner packet determined for the
5387          * packet was.
5388          */
5389         #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
5390         #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT           12
5391         /*
5392          * TCP Packet:
5393          * Indicates that the packet was IP and TCP.
5394          */
5395         #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP \
5396                 (UINT32_C(0x2) << 12)
5397         #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \
5398                 RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
5399         /*
5400          * This value indicates the amount of packet data written to the
5401          * buffer the opaque field in this completion corresponds to.
5402          */
5403         uint16_t        len;
5404         /*
5405          * This is a copy of the opaque field from the RX BD this completion
5406          * corresponds to.
5407          */
5408         uint32_t        opaque;
5409         /*
5410          * This value is written by the NIC such that it will be different
5411          * for each pass through the completion queue. The even passes
5412          * will write 1. The odd passes will write 0.
5413          */
5414         uint8_t v1;
5415         /*
5416          * This value is written by the NIC such that it will be different
5417          * for each pass through the completion queue. The even passes
5418          * will write 1. The odd passes will write 0.
5419          */
5420         #define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
5421         #define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1
5422         /*
5423          * This is the RSS hash type for the packet. The value is packed
5424          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5425          *
5426          * The value of tuple_extrac_op provides the information about
5427          * what fields the hash was computed on.
5428          * * 0: The RSS hash was computed over source IP address,
5429          * destination IP address, source port, and destination port of inner
5430          * IP and TCP or UDP headers. Note: For non-tunneled packets,
5431          * the packet headers are considered inner packet headers for the RSS
5432          * hash computation purpose.
5433          * * 1: The RSS hash was computed over source IP address and destination
5434          * IP address of inner IP header. Note: For non-tunneled packets,
5435          * the packet headers are considered inner packet headers for the RSS
5436          * hash computation purpose.
5437          * * 2: The RSS hash was computed over source IP address,
5438          * destination IP address, source port, and destination port of
5439          * IP and TCP or UDP headers of outer tunnel headers.
5440          * Note: For non-tunneled packets, this value is not applicable.
5441          * * 3: The RSS hash was computed over source IP address and
5442          * destination IP address of IP header of outer tunnel headers.
5443          * Note: For non-tunneled packets, this value is not applicable.
5444          *
5445          * Note that 4-tuples values listed above are applicable
5446          * for layer 4 protocols supported and enabled for RSS in the hardware,
5447          * HWRM firmware, and drivers. For example, if RSS hash is supported and
5448          * enabled for TCP traffic only, then the values of tuple_extract_op
5449          * corresponding to 4-tuples are only valid for TCP traffic.
5450          */
5451         uint8_t rss_hash_type;
5452         /*
5453          * This is the aggregation ID that the completion is associated
5454          * with. Use this number to correlate the TPA start completion
5455          * with the TPA end completion.
5456          */
5457         uint16_t        agg_id;
5458         /* unused2 is 9 b */
5459         #define RX_TPA_START_CMPL_UNUSED2_MASK UINT32_C(0x1ff)
5460         #define RX_TPA_START_CMPL_UNUSED2_SFT 0
5461         /*
5462          * This is the aggregation ID that the completion is associated
5463          * with. Use this number to correlate the TPA start completion
5464          * with the TPA end completion.
5465          */
5466         #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
5467         #define RX_TPA_START_CMPL_AGG_ID_SFT  9
5468         /*
5469          * This value is the RSS hash value calculated for the packet
5470          * based on the mode bits and key value in the VNIC.
5471          */
5472         uint32_t        rss_hash;
5473 } __rte_packed;
5474
5475 /*
5476  * Last 16 bytes of rx_tpa_start_cmpl.
5477  *
5478  * This TPA completion structure is used on devices where the
5479  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
5480  */
5481 /* rx_tpa_start_cmpl_hi (size:128b/16B) */
5482 struct rx_tpa_start_cmpl_hi {
5483         uint32_t        flags2;
5484         /*
5485          * This indicates that the ip checksum was calculated for the
5486          * inner packet and that the sum passed for all segments
5487          * included in the aggregation.
5488          */
5489         #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC       UINT32_C(0x1)
5490         /*
5491          * This indicates that the TCP, UDP or ICMP checksum was
5492          * calculated for the inner packet and that the sum passed
5493          * for all segments included in the aggregation.
5494          */
5495         #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC       UINT32_C(0x2)
5496         /*
5497          * This indicates that the ip checksum was calculated for the
5498          * tunnel header and that the sum passed for all segments
5499          * included in the aggregation.
5500          */
5501         #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC     UINT32_C(0x4)
5502         /*
5503          * This indicates that the UDP checksum was
5504          * calculated for the tunnel packet and that the sum passed for
5505          * all segments included in the aggregation.
5506          */
5507         #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC     UINT32_C(0x8)
5508         /* This value indicates what format the metadata field is. */
5509         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
5510         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT  4
5511         /* No metadata information. Value is zero. */
5512         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE \
5513                 (UINT32_C(0x0) << 4)
5514         /*
5515          * The metadata field contains the VLAN tag and TPID value.
5516          * - metadata[11:0] contains the vlan VID value.
5517          * - metadata[12] contains the vlan DE value.
5518          * - metadata[15:13] contains the vlan PRI value.
5519          * - metadata[31:16] contains the vlan TPID value.
5520          */
5521         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN \
5522                 (UINT32_C(0x1) << 4)
5523         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST \
5524                 RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
5525         /*
5526          * This field indicates the IP type for the inner-most IP header.
5527          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
5528          */
5529         #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE          UINT32_C(0x100)
5530         /*
5531          * This is data from the CFA block as indicated by the meta_format
5532          * field.
5533          */
5534         uint32_t        metadata;
5535         /* When meta_format=1, this value is the VLAN VID. */
5536         #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
5537         #define RX_TPA_START_CMPL_METADATA_VID_SFT  0
5538         /* When meta_format=1, this value is the VLAN DE. */
5539         #define RX_TPA_START_CMPL_METADATA_DE       UINT32_C(0x1000)
5540         /* When meta_format=1, this value is the VLAN PRI. */
5541         #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
5542         #define RX_TPA_START_CMPL_METADATA_PRI_SFT  13
5543         /* When meta_format=1, this value is the VLAN TPID. */
5544         #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
5545         #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
5546         uint16_t        v2;
5547         /*
5548          * This value is written by the NIC such that it will be different
5549          * for each pass through the completion queue. The even passes
5550          * will write 1. The odd passes will write 0.
5551          */
5552         #define RX_TPA_START_CMPL_V2     UINT32_C(0x1)
5553         /*
5554          * This field identifies the CFA action rule that was used for this
5555          * packet.
5556          */
5557         uint16_t        cfa_code;
5558         /*
5559          * This is the size in bytes of the inner most L4 header.
5560          * This can be subtracted from the payload_offset to determine
5561          * the start of the inner most L4 header.
5562          */
5563         uint32_t        inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
5564         /*
5565          * This is the offset from the beginning of the packet in bytes for
5566          * the outer L3 header. If there is no outer L3 header, then this
5567          * value is zero.
5568          */
5569         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
5570         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
5571         /*
5572          * This is the offset from the beginning of the packet in bytes for
5573          * the inner most L2 header.
5574          */
5575         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
5576         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
5577         /*
5578          * This is the offset from the beginning of the packet in bytes for
5579          * the inner most L3 header.
5580          */
5581         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
5582         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
5583         /*
5584          * This is the size in bytes of the inner most L4 header.
5585          * This can be subtracted from the payload_offset to determine
5586          * the start of the inner most L4 header.
5587          */
5588         #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
5589         #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT   27
5590 } __rte_packed;
5591
5592 /*
5593  * This TPA completion structure is used on devices where the
5594  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
5595  * RX L2 TPA Start V2 Completion Record (32 bytes split to 2 16-byte
5596  * struct)
5597  */
5598 /* rx_tpa_start_v2_cmpl (size:128b/16B) */
5599 struct rx_tpa_start_v2_cmpl {
5600         uint16_t        flags_type;
5601         /*
5602          * This field indicates the exact type of the completion.
5603          * By convention, the LSB identifies the length of the
5604          * record in 16B units. Even values indicate 16B
5605          * records. Odd values indicate 32B
5606          * records.
5607          */
5608         #define RX_TPA_START_V2_CMPL_TYPE_MASK \
5609                 UINT32_C(0x3f)
5610         #define RX_TPA_START_V2_CMPL_TYPE_SFT                       0
5611         /*
5612          * RX L2 TPA Start V2 Completion:
5613          * Completion at the beginning of a TPA operation.
5614          * Length = 32B
5615          * This is the new version of the RX_TPA_START completion used
5616          * in SR2 and later chips.
5617          */
5618         #define RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2 \
5619                 UINT32_C(0xd)
5620         #define RX_TPA_START_V2_CMPL_TYPE_LAST \
5621                 RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2
5622         #define RX_TPA_START_V2_CMPL_FLAGS_MASK \
5623                 UINT32_C(0xffc0)
5624         #define RX_TPA_START_V2_CMPL_FLAGS_SFT                      6
5625         /*
5626          * When this bit is '1', it indicates a packet that has an error
5627          * of some type. Type of error is indicated in error_flags.
5628          */
5629         #define RX_TPA_START_V2_CMPL_FLAGS_ERROR \
5630                 UINT32_C(0x40)
5631         /* This field indicates how the packet was placed in the buffer. */
5632         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_MASK \
5633                 UINT32_C(0x380)
5634         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_SFT             7
5635         /*
5636          * Jumbo:
5637          * TPA Packet was placed using jumbo algorithm. This means
5638          * that the first buffer will be filled with data before
5639          * moving to aggregation buffers. Each aggregation buffer
5640          * will be filled before moving to the next aggregation
5641          * buffer.
5642          */
5643         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_JUMBO \
5644                 (UINT32_C(0x1) << 7)
5645         /*
5646          * Header/Data Separation:
5647          * Packet was placed using Header/Data separation algorithm.
5648          * The separation location is indicated by the itype field.
5649          */
5650         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_HDS \
5651                 (UINT32_C(0x2) << 7)
5652         /*
5653          * IOC/Jumbo:
5654          * Packet will be placed using In-Order Completion/Jumbo where
5655          * the first packet of the aggregation is placed using Jumbo
5656          * Placement. Subsequent packets will be placed such that each
5657          * packet starts at the beginning of an aggregation buffer.
5658          */
5659         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_JUMBO \
5660                 (UINT32_C(0x4) << 7)
5661         /*
5662          * GRO/Jumbo:
5663          * Packet will be placed using GRO/Jumbo where the first
5664          * packet is filled with data. Subsequent packets will be
5665          * placed such that any one packet does not span two
5666          * aggregation buffers unless it starts at the beginning of
5667          * an aggregation buffer.
5668          */
5669         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
5670                 (UINT32_C(0x5) << 7)
5671         /*
5672          * GRO/Header-Data Separation:
5673          * Packet will be placed using GRO/HDS where the header
5674          * is in the first packet.
5675          * Payload of each packet will be
5676          * placed such that any one packet does not span two
5677          * aggregation buffers unless it starts at the beginning of
5678          * an aggregation buffer.
5679          */
5680         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_HDS \
5681                 (UINT32_C(0x6) << 7)
5682         /*
5683          * IOC/Header-Data Separation:
5684          * Packet will be placed using In-Order Completion/HDS where
5685          * the header is in the first packet buffer. Payload of each
5686          * packet will be placed such that each packet starts at the
5687          * beginning of an aggregation buffer.
5688          */
5689         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS \
5690                 (UINT32_C(0x7) << 7)
5691         #define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_LAST \
5692                 RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS
5693         /* This bit is '1' if the RSS field in this completion is valid. */
5694         #define RX_TPA_START_V2_CMPL_FLAGS_RSS_VALID \
5695                 UINT32_C(0x400)
5696         /*
5697          * This bit is '1' if metadata has been added to the end of the
5698          * packet in host memory. Metadata starts at the first 32B boundary
5699          * after the end of the packet for regular and jumbo placement. It
5700          * starts at the first 32B boundary after the end of the header for
5701          * HDS placement. The length of the metadata is indicated in the
5702          * metadata itself.
5703          */
5704         #define RX_TPA_START_V2_CMPL_FLAGS_PKT_METADATA_PRESENT \
5705                 UINT32_C(0x800)
5706         /*
5707          * This value indicates what the inner packet determined for the
5708          * packet was.
5709          */
5710         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_MASK \
5711                 UINT32_C(0xf000)
5712         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_SFT                 12
5713         /*
5714          * TCP Packet:
5715          * Indicates that the packet was IP and TCP.
5716          */
5717         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP \
5718                 (UINT32_C(0x2) << 12)
5719         #define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_LAST \
5720                 RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP
5721         /*
5722          * This value indicates the amount of packet data written to the
5723          * buffer the opaque field in this completion corresponds to.
5724          */
5725         uint16_t        len;
5726         /*
5727          * This is a copy of the opaque field from the RX BD this completion
5728          * corresponds to. If the VNIC is configured to not use an Rx BD for
5729          * the TPA Start completion, then this is a copy of the opaque field
5730          * from the first BD used to place the TPA Start packet.
5731          */
5732         uint32_t        opaque;
5733         /*
5734          * This value is written by the NIC such that it will be different
5735          * for each pass through the completion queue. The even passes
5736          * will write 1. The odd passes will write 0.
5737          */
5738         uint8_t v1;
5739         /*
5740          * This value is written by the NIC such that it will be different
5741          * for each pass through the completion queue. The even passes
5742          * will write 1. The odd passes will write 0.
5743          */
5744         #define RX_TPA_START_V2_CMPL_V1 UINT32_C(0x1)
5745         #define RX_TPA_START_V2_CMPL_LAST RX_TPA_START_V2_CMPL_V1
5746         /*
5747          * This is the RSS hash type for the packet. The value is packed
5748          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
5749          *
5750          * The value of tuple_extrac_op provides the information about
5751          * what fields the hash was computed on.
5752          * * 0: The RSS hash was computed over source IP address,
5753          * destination IP address, source port, and destination port of inner
5754          * IP and TCP or UDP headers. Note: For non-tunneled packets,
5755          * the packet headers are considered inner packet headers for the RSS
5756          * hash computation purpose.
5757          * * 1: The RSS hash was computed over source IP address and destination
5758          * IP address of inner IP header. Note: For non-tunneled packets,
5759          * the packet headers are considered inner packet headers for the RSS
5760          * hash computation purpose.
5761          * * 2: The RSS hash was computed over source IP address,
5762          * destination IP address, source port, and destination port of
5763          * IP and TCP or UDP headers of outer tunnel headers.
5764          * Note: For non-tunneled packets, this value is not applicable.
5765          * * 3: The RSS hash was computed over source IP address and
5766          * destination IP address of IP header of outer tunnel headers.
5767          * Note: For non-tunneled packets, this value is not applicable.
5768          *
5769          * Note that 4-tuples values listed above are applicable
5770          * for layer 4 protocols supported and enabled for RSS in the hardware,
5771          * HWRM firmware, and drivers. For example, if RSS hash is supported and
5772          * enabled for TCP traffic only, then the values of tuple_extract_op
5773          * corresponding to 4-tuples are only valid for TCP traffic.
5774          */
5775         uint8_t rss_hash_type;
5776         /*
5777          * This is the aggregation ID that the completion is associated
5778          * with. Use this number to correlate the TPA start completion
5779          * with the TPA end completion.
5780          */
5781         uint16_t        agg_id;
5782         /*
5783          * This is the aggregation ID that the completion is associated
5784          * with. Use this number to correlate the TPA start completion
5785          * with the TPA end completion.
5786          */
5787         #define RX_TPA_START_V2_CMPL_AGG_ID_MASK                UINT32_C(0xfff)
5788         #define RX_TPA_START_V2_CMPL_AGG_ID_SFT                 0
5789         #define RX_TPA_START_V2_CMPL_METADATA1_MASK \
5790                 UINT32_C(0xf000)
5791         #define RX_TPA_START_V2_CMPL_METADATA1_SFT              12
5792         /* When meta_format != 0, this value is the VLAN TPID_SEL. */
5793         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_MASK \
5794                 UINT32_C(0x7000)
5795         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_SFT      12
5796         /* 0x88a8 */
5797         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID88A8 \
5798                 (UINT32_C(0x0) << 12)
5799         /* 0x8100 */
5800         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID8100 \
5801                 (UINT32_C(0x1) << 12)
5802         /* 0x9100 */
5803         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9100 \
5804                 (UINT32_C(0x2) << 12)
5805         /* 0x9200 */
5806         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9200 \
5807                 (UINT32_C(0x3) << 12)
5808         /* 0x9300 */
5809         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPID9300 \
5810                 (UINT32_C(0x4) << 12)
5811         /* Value programmed in CFA VLANTPID register. */
5812         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG \
5813                 (UINT32_C(0x5) << 12)
5814         #define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_LAST \
5815                 RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_TPIDCFG
5816         /* When meta_format != 0, this value is the VLAN valid. */
5817         #define RX_TPA_START_V2_CMPL_METADATA1_VALID \
5818                 UINT32_C(0x8000)
5819         /*
5820          * This value is the RSS hash value calculated for the packet
5821          * based on the mode bits and key value in the VNIC.
5822          * When vee_cmpl_mode is set in VNIC context, this is the lower
5823          * 32b of the host address from the first BD used to place the packet.
5824          */
5825         uint32_t        rss_hash;
5826 } __rte_packed;
5827
5828 /*
5829  * Last 16 bytes of RX L2 TPA Start V2 Completion Record
5830  *
5831  * This TPA completion structure is used on devices where the
5832  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
5833  */
5834 /* rx_tpa_start_v2_cmpl_hi (size:128b/16B) */
5835 struct rx_tpa_start_v2_cmpl_hi {
5836         uint32_t        flags2;
5837         /* This indicates that the aggregation was done using GRO rules. */
5838         #define RX_TPA_START_V2_CMPL_FLAGS2_AGG_GRO \
5839                 UINT32_C(0x4)
5840         /*
5841          * When this bit is '0', the cs_ok field has the following definition:-
5842          * ip_cs_ok[2:0] = The number of header groups with a valid IP checksum
5843          * in the delivered packet, counted from the outer-most header group to
5844          * the inner-most header group, stopping at the first error. -
5845          * l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum
5846          * in the delivered packet, counted from the outer-most header group to
5847          * the inner-most header group, stopping at the first error. When this
5848          * bit is '1', the cs_ok field has the following definition: -
5849          * hdr_cnt[2:0] = The number of header groups that were parsed by the
5850          * chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit
5851          * will be '1' if all the parsed header groups with an IP checksum are
5852          * valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed
5853          * header groups with an L4 checksum are valid.
5854          */
5855         #define RX_TPA_START_V2_CMPL_FLAGS2_CS_ALL_OK_MODE \
5856                 UINT32_C(0x8)
5857         /* This value indicates what format the metadata field is. */
5858         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_MASK \
5859                 UINT32_C(0xf0)
5860         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_SFT            4
5861         /* There is no metadata information. Values are zero. */
5862         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_NONE \
5863                 (UINT32_C(0x0) << 4)
5864         /*
5865          * The {metadata1, metadata0} fields contain the vtag
5866          * information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],
5867          * de, vid[11:0]} The metadata2 field contains the table scope
5868          * and action record pointer. - metadata2[25:0] contains the
5869          * action record pointer. - metadata2[31:26] contains the table
5870          * scope.
5871          */
5872         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_ACT_REC_PTR \
5873                 (UINT32_C(0x1) << 4)
5874         /*
5875          * The {metadata1, metadata0} fields contain the vtag
5876          * information:
5877          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
5878          * The metadata2 field contains the Tunnel ID
5879          * value, justified to LSB. i
5880          * - VXLAN = VNI[23:0] -> VXLAN Network ID
5881          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier
5882          * - NVGRE = TNI[23:0] -> Tenant Network ID
5883          * - GRE = KEY[31:0] -> key field with bit mask. zero if K=0
5884          * - IPv4 = 0 (not populated)
5885          * - IPv6 = Flow Label[19:0]
5886          * - PPPoE = sessionID[15:0]
5887          * - MPLs = Outer label[19:0]
5888          * - UPAR = Selected[31:0] with bit mask
5889          */
5890         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
5891                 (UINT32_C(0x2) << 4)
5892         /*
5893          * The {metadata1, metadata0} fields contain the vtag
5894          * information:
5895          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]}
5896          * The metadata2 field contains the 32b metadata from the prepended
5897          * header (chdr_data).
5898          */
5899         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
5900                 (UINT32_C(0x3) << 4)
5901         /*
5902          * The {metadata1, metadata0} fields contain the vtag
5903          * information:
5904          * - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]}
5905          * The metadata2 field contains the outer_l3_offset,
5906          * inner_l2_offset, inner_l3_offset, and inner_l4_size.
5907          * - metadata2[8:0] contains the outer_l3_offset.
5908          * - metadata2[17:9] contains the inner_l2_offset.
5909          * - metadata2[26:18] contains the inner_l3_offset.
5910          * - metadata2[31:27] contains the inner_l4_size.
5911          */
5912         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
5913                 (UINT32_C(0x4) << 4)
5914         #define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_LAST \
5915                 RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
5916         /*
5917          * This field indicates the IP type for the inner-most IP header.
5918          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
5919          * This value is only valid if itype indicates a packet
5920          * with an IP header.
5921          */
5922         #define RX_TPA_START_V2_CMPL_FLAGS2_IP_TYPE \
5923                 UINT32_C(0x100)
5924         /*
5925          * This indicates that the complete 1's complement checksum was
5926          * calculated for the packet in the affregation.
5927          */
5928         #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC \
5929                 UINT32_C(0x200)
5930         /*
5931          * This field indicates the status of IP and L4 CS calculations done
5932          * by the chip. The format of this field is indicated by the
5933          * cs_all_ok_mode bit.
5934          * CS status for TPA packets is always valid. This means that "all_ok"
5935          * status will always be set. The ok count status will be set
5936          * appropriately for the packet header, such that all existing CS
5937          * values are ok.
5938          */
5939         #define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_MASK \
5940                 UINT32_C(0xfc00)
5941         #define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_SFT                  10
5942         /*
5943          * This value is the complete 1's complement checksum calculated from
5944          * the start of the outer L3 header to the end of the packet (not
5945          * including the ethernet crc). It is valid when the
5946          * 'complete_checksum_calc' flag is set. For TPA Start completions,
5947          * the complete checksum is calculated for the first packet in the
5948          * aggregation only.
5949          */
5950         #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
5951                 UINT32_C(0xffff0000)
5952         #define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
5953         /*
5954          * This is data from the CFA block as indicated by the meta_format
5955          * field.
5956          * - meta_format 0 - none - metadata2 = 0 - not valid/not stripped
5957          * - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0],
5958          *   act_rec_ptr[25:0]}
5959          * - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0]
5960          * - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0]
5961          * - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0]
5962          * When vee_cmpl_mode is set in VNIC context, this is the upper 32b
5963          * of the host address from the first BD used to place the packet.
5964          */
5965         uint32_t        metadata2;
5966         uint16_t        errors_v2;
5967         /*
5968          * This value is written by the NIC such that it will be different
5969          * for each pass through the completion queue. The even passes
5970          * will write 1. The odd passes will write 0.
5971          */
5972         #define RX_TPA_START_V2_CMPL_V2 \
5973                 UINT32_C(0x1)
5974         #define RX_TPA_START_V2_CMPL_ERRORS_MASK \
5975                 UINT32_C(0xfffe)
5976         #define RX_TPA_START_V2_CMPL_ERRORS_SFT                     1
5977         /*
5978          * This error indicates that there was some sort of problem with
5979          * the BDs for the packetThe packet should be treated as
5980          * invalid.
5981          */
5982         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_MASK \
5983                 UINT32_C(0xe)
5984         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_SFT         1
5985         /* No buffer error */
5986         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
5987                 (UINT32_C(0x0) << 1)
5988         /*
5989          * Did Not Fit:
5990          * Packet did not fit into packet buffer provided. This means
5991          * that the TPA Start packet was too big to be placed into the
5992          * per-packet maximum number of physical buffers configured for
5993          * the VNIC, or that it was too big to be placed into the
5994          * per-aggregation maximum number of physical buffers configured
5995          * for the VNIC. This error only occurs when the VNIC is
5996          * configured for variable size receive buffers.
5997          */
5998         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
5999                 (UINT32_C(0x1) << 1)
6000         /*
6001          * Bad Format:
6002          * BDs were not formatted correctly.
6003          */
6004         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
6005                 (UINT32_C(0x3) << 1)
6006         /*
6007          * Flush:
6008          * There was a bad_format error on the previous operation
6009          */
6010         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
6011                 (UINT32_C(0x5) << 1)
6012         #define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_LAST \
6013                 RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH
6014         /*
6015          * This is data from the CFA block as indicated by the meta_format
6016          * field.
6017          */
6018         uint16_t        metadata0;
6019         /* When meta_format != 0, this value is the VLAN VID. */
6020         #define RX_TPA_START_V2_CMPL_METADATA0_VID_MASK UINT32_C(0xfff)
6021         #define RX_TPA_START_V2_CMPL_METADATA0_VID_SFT 0
6022         /* When meta_format != 0, this value is the VLAN DE. */
6023         #define RX_TPA_START_V2_CMPL_METADATA0_DE      UINT32_C(0x1000)
6024         /* When meta_format != 0, this value is the VLAN PRI. */
6025         #define RX_TPA_START_V2_CMPL_METADATA0_PRI_MASK UINT32_C(0xe000)
6026         #define RX_TPA_START_V2_CMPL_METADATA0_PRI_SFT 13
6027         /*
6028          * This field contains the outer_l3_offset, inner_l2_offset,
6029          * inner_l3_offset, and inner_l4_size.
6030          *
6031          * hdr_offsets[8:0] contains the outer_l3_offset.
6032          * hdr_offsets[17:9] contains the inner_l2_offset.
6033          * hdr_offsets[26:18] contains the inner_l3_offset.
6034          * hdr_offsets[31:27] contains the inner_l4_size.
6035          */
6036         uint32_t        hdr_offsets;
6037 } __rte_packed;
6038
6039 /*
6040  * This TPA completion structure is used on devices where the
6041  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
6042  */
6043 /* rx_tpa_end_cmpl (size:128b/16B) */
6044 struct rx_tpa_end_cmpl {
6045         uint16_t        flags_type;
6046         /*
6047          * This field indicates the exact type of the completion.
6048          * By convention, the LSB identifies the length of the
6049          * record in 16B units. Even values indicate 16B
6050          * records. Odd values indicate 32B
6051          * records.
6052          */
6053         #define RX_TPA_END_CMPL_TYPE_MASK                      UINT32_C(0x3f)
6054         #define RX_TPA_END_CMPL_TYPE_SFT                       0
6055         /*
6056          * RX L2 TPA End Completion:
6057          * Completion at the end of a TPA operation.
6058          * Length = 32B
6059          */
6060         #define RX_TPA_END_CMPL_TYPE_RX_TPA_END                  UINT32_C(0x15)
6061         #define RX_TPA_END_CMPL_TYPE_LAST \
6062                 RX_TPA_END_CMPL_TYPE_RX_TPA_END
6063         #define RX_TPA_END_CMPL_FLAGS_MASK                     UINT32_C(0xffc0)
6064         #define RX_TPA_END_CMPL_FLAGS_SFT                      6
6065         /*
6066          * When this bit is '1', it indicates a packet that has an
6067          * error of some type. Type of error is indicated in
6068          * error_flags.
6069          */
6070         #define RX_TPA_END_CMPL_FLAGS_ERROR                     UINT32_C(0x40)
6071         /* This field indicates how the packet was placed in the buffer. */
6072         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK            UINT32_C(0x380)
6073         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT             7
6074         /*
6075          * Jumbo:
6076          * TPA Packet was placed using jumbo algorithm. This means
6077          * that the first buffer will be filled with data before
6078          * moving to aggregation buffers. Each aggregation buffer
6079          * will be filled before moving to the next aggregation
6080          * buffer.
6081          */
6082         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO \
6083                 (UINT32_C(0x1) << 7)
6084         /*
6085          * Header/Data Separation:
6086          * Packet was placed using Header/Data separation algorithm.
6087          * The separation location is indicated by the itype field.
6088          */
6089         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS \
6090                 (UINT32_C(0x2) << 7)
6091         /*
6092          * IOC/Jumbo:
6093          * Packet will be placed using In-Order Completion/Jumbo where
6094          * the first packet of the aggregation is placed using Jumbo
6095          * Placement. Subsequent packets will be placed such that each
6096          * packet starts at the beginning of an aggregation buffer.
6097          */
6098         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_JUMBO \
6099                 (UINT32_C(0x4) << 7)
6100         /*
6101          * GRO/Jumbo:
6102          * Packet will be placed using GRO/Jumbo where the first
6103          * packet is filled with data. Subsequent packets will be
6104          * placed such that any one packet does not span two
6105          * aggregation buffers unless it starts at the beginning of
6106          * an aggregation buffer.
6107          */
6108         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
6109                 (UINT32_C(0x5) << 7)
6110         /*
6111          * GRO/Header-Data Separation:
6112          * Packet will be placed using GRO/HDS where the header
6113          * is in the first packet.
6114          * Payload of each packet will be
6115          * placed such that any one packet does not span two
6116          * aggregation buffers unless it starts at the beginning of
6117          * an aggregation buffer.
6118          */
6119         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \
6120                 (UINT32_C(0x6) << 7)
6121         /*
6122          * IOC/Header-Data Separation:
6123          * Packet will be placed using In-Order Completion/HDS where
6124          * the header is in the first packet buffer. Payload of each
6125          * packet will be placed such that each packet starts at the
6126          * beginning of an aggregation buffer.
6127          */
6128         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS \
6129                 (UINT32_C(0x7) << 7)
6130         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \
6131                 RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
6132         /* unused is 1 b */
6133         #define RX_TPA_END_CMPL_FLAGS_UNUSED                    UINT32_C(0x400)
6134         /*
6135          * This bit is '1' if metadata has been added to the end of the
6136          * packet in host memory. Metadata starts at the first 32B boundary
6137          * after the end of the packet for regular and jumbo placement.
6138          * It starts at the first 32B boundary after the end of the header
6139          * for HDS placement. The length of the metadata is indicated in the
6140          * metadata itself.
6141          */
6142         #define RX_TPA_END_CMPL_FLAGS_PKT_METADATA_PRESENT      UINT32_C(0x800)
6143         /*
6144          * This value indicates what the inner packet determined for the
6145          * packet was.
6146          * - 2 TCP Packet
6147          *     Indicates that the packet was IP and TCP. This indicates
6148          *     that the ip_cs field is valid and that the tcp_udp_cs
6149          *     field is valid and contains the TCP checksum.
6150          *     This also indicates that the payload_offset field is valid.
6151          */
6152         #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK \
6153                 UINT32_C(0xf000)
6154         #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT                 12
6155         /*
6156          * This value is zero for TPA End completions.
6157          * There is no data in the buffer that corresponds to the opaque
6158          * value in this completion.
6159          */
6160         uint16_t        len;
6161         /*
6162          * This is a copy of the opaque field from the RX BD this completion
6163          * corresponds to.
6164          */
6165         uint32_t        opaque;
6166         /*
6167          * This value is written by the NIC such that it will be different
6168          * for each pass through the completion queue. The even passes
6169          * will write 1. The odd passes will write 0.
6170          */
6171         uint8_t agg_bufs_v1;
6172         /*
6173          * This value is written by the NIC such that it will be different
6174          * for each pass through the completion queue. The even passes
6175          * will write 1. The odd passes will write 0.
6176          */
6177         #define RX_TPA_END_CMPL_V1           UINT32_C(0x1)
6178         /*
6179          * This value is the number of aggregation buffers that follow this
6180          * entry in the completion ring that are a part of this aggregation
6181          * packet.
6182          * If the value is zero, then the packet is completely contained
6183          * in the buffer space provided in the aggregation start completion.
6184          */
6185         #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
6186         #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
6187         /* This value is the number of segments in the TPA operation. */
6188         uint8_t tpa_segs;
6189         /*
6190          * This value indicates the offset in bytes from the beginning of the packet
6191          * where the inner payload starts. This value is valid for TCP, UDP,
6192          * FCoE, and RoCE packets.
6193          *
6194          * A value of zero indicates an offset of 256 bytes.
6195          */
6196         uint8_t payload_offset;
6197         uint8_t agg_id;
6198         /* unused2 is 1 b */
6199         #define RX_TPA_END_CMPL_UNUSED2     UINT32_C(0x1)
6200         /*
6201          * This is the aggregation ID that the completion is associated
6202          * with. Use this number to correlate the TPA start completion
6203          * with the TPA end completion.
6204          */
6205         #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
6206         #define RX_TPA_END_CMPL_AGG_ID_SFT  1
6207         /*
6208          * For non-GRO packets, this value is the
6209          * timestamp delta between earliest and latest timestamp values for
6210          * TPA packet. If packets were not time stamped, then delta will be
6211          * zero.
6212          *
6213          * For GRO packets, this field is zero except for the following
6214          * sub-fields.
6215          * - tsdelta[31]
6216          *     Timestamp present indication. When '0', no Timestamp
6217          *     option is in the packet. When '1', then a Timestamp
6218          *     option is present in the packet.
6219          */
6220         uint32_t        tsdelta;
6221 } __rte_packed;
6222
6223 /*
6224  * Last 16 bytes of rx_tpa_end_cmpl.
6225  *
6226  * This TPA completion structure is used on devices where the
6227  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
6228  */
6229 /* rx_tpa_end_cmpl_hi (size:128b/16B) */
6230 struct rx_tpa_end_cmpl_hi {
6231         uint32_t        tpa_dup_acks;
6232         /*
6233          * This value is the number of duplicate ACKs that have been
6234          * received as part of the TPA operation.
6235          */
6236         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
6237         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
6238         /*
6239          * This value is the valid when TPA completion is active. It
6240          * indicates the length of the longest segment of the TPA operation
6241          * for LRO mode and the length of the first segment in GRO mode.
6242          *
6243          * This value may be used by GRO software to re-construct the original
6244          * packet stream from the TPA packet. This is the length of all
6245          * but the last segment for GRO. In LRO mode this value may be used
6246          * to indicate MSS size to the stack.
6247          */
6248         uint16_t        tpa_seg_len;
6249         /* unused4 is 16 b */
6250         uint16_t        unused3;
6251         uint16_t        errors_v2;
6252         /*
6253          * This value is written by the NIC such that it will be different
6254          * for each pass through the completion queue. The even passes
6255          * will write 1. The odd passes will write 0.
6256          */
6257         #define RX_TPA_END_CMPL_V2                             UINT32_C(0x1)
6258         #define RX_TPA_END_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
6259         #define RX_TPA_END_CMPL_ERRORS_SFT                     1
6260         /*
6261          * This error indicates that there was some sort of problem with
6262          * the BDs for the packet that was found after part of the
6263          * packet was already placed. The packet should be treated as
6264          * invalid.
6265          */
6266         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
6267         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT         1
6268         /*
6269          * This error occurs when there is a fatal HW problem in
6270          * the chip only. It indicates that there were not
6271          * BDs on chip but that there was adequate reservation.
6272          * provided by the TPA block.
6273          */
6274         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
6275                 (UINT32_C(0x2) << 1)
6276         /*
6277          * This error occurs when TPA block was not configured to
6278          * reserve adequate BDs for TPA operations on this RX
6279          * ring. All data for the TPA operation was not placed.
6280          *
6281          * This error can also be generated when the number of
6282          * segments is not programmed correctly in TPA and the
6283          * 33 total aggregation buffers allowed for the TPA
6284          * operation has been exceeded.
6285          */
6286         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
6287                 (UINT32_C(0x4) << 1)
6288         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
6289                 RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
6290         /* unused5 is 16 b */
6291         uint16_t        unused_4;
6292         /*
6293          * This is the opaque value that was completed for the TPA start
6294          * completion that corresponds to this TPA end completion.
6295          */
6296         uint32_t        start_opaque;
6297 } __rte_packed;
6298
6299 /*
6300  * This TPA completion structure is used on devices where the
6301  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
6302  */
6303 /* rx_tpa_v2_start_cmpl (size:128b/16B) */
6304 struct rx_tpa_v2_start_cmpl {
6305         uint16_t        flags_type;
6306         /*
6307          * This field indicates the exact type of the completion.
6308          * By convention, the LSB identifies the length of the
6309          * record in 16B units. Even values indicate 16B
6310          * records. Odd values indicate 32B
6311          * records.
6312          */
6313         #define RX_TPA_V2_START_CMPL_TYPE_MASK \
6314                 UINT32_C(0x3f)
6315         #define RX_TPA_V2_START_CMPL_TYPE_SFT                       0
6316         /*
6317          * RX L2 TPA Start Completion:
6318          * Completion at the beginning of a TPA operation.
6319          * Length = 32B
6320          */
6321         #define RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START \
6322                 UINT32_C(0x13)
6323         #define RX_TPA_V2_START_CMPL_TYPE_LAST \
6324                 RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START
6325         #define RX_TPA_V2_START_CMPL_FLAGS_MASK \
6326                 UINT32_C(0xffc0)
6327         #define RX_TPA_V2_START_CMPL_FLAGS_SFT                      6
6328         /* This bit will always be '0' for TPA start completions. */
6329         #define RX_TPA_V2_START_CMPL_FLAGS_ERROR \
6330                 UINT32_C(0x40)
6331         /* This field indicates how the packet was placed in the buffer. */
6332         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_MASK \
6333                 UINT32_C(0x380)
6334         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_SFT             7
6335         /*
6336          * Jumbo:
6337          * TPA Packet was placed using jumbo algorithm. This means
6338          * that the first buffer will be filled with data before
6339          * moving to aggregation buffers. Each aggregation buffer
6340          * will be filled before moving to the next aggregation
6341          * buffer.
6342          */
6343         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_JUMBO \
6344                 (UINT32_C(0x1) << 7)
6345         /*
6346          * Header/Data Separation:
6347          * Packet was placed using Header/Data separation algorithm.
6348          * The separation location is indicated by the itype field.
6349          */
6350         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_HDS \
6351                 (UINT32_C(0x2) << 7)
6352         /*
6353          * GRO/Jumbo:
6354          * Packet will be placed using GRO/Jumbo where the first
6355          * packet is filled with data. Subsequent packets will be
6356          * placed such that any one packet does not span two
6357          * aggregation buffers unless it starts at the beginning of
6358          * an aggregation buffer.
6359          */
6360         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
6361                 (UINT32_C(0x5) << 7)
6362         /*
6363          * GRO/Header-Data Separation:
6364          * Packet will be placed using GRO/HDS where the header
6365          * is in the first packet.
6366          * Payload of each packet will be
6367          * placed such that any one packet does not span two
6368          * aggregation buffers unless it starts at the beginning of
6369          * an aggregation buffer.
6370          */
6371         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \
6372                 (UINT32_C(0x6) << 7)
6373         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_LAST \
6374                 RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
6375         /* This bit is '1' if the RSS field in this completion is valid. */
6376         #define RX_TPA_V2_START_CMPL_FLAGS_RSS_VALID \
6377                 UINT32_C(0x400)
6378         /*
6379          * For devices that support timestamps, when this bit is cleared the
6380          * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
6381          * field contains the 32b timestamp for
6382          * the packet from the MAC. When this bit is set, the
6383          * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
6384          * field contains the outer_l3_offset, inner_l2_offset,
6385          * inner_l3_offset, and inner_l4_size.
6386          */
6387         #define RX_TPA_V2_START_CMPL_FLAGS_TIMESTAMP_FLD_FORMAT \
6388                 UINT32_C(0x800)
6389         /*
6390          * This value indicates what the inner packet determined for the
6391          * packet was.
6392          */
6393         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_MASK \
6394                 UINT32_C(0xf000)
6395         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_SFT                 12
6396         /*
6397          * TCP Packet:
6398          * Indicates that the packet was IP and TCP.
6399          */
6400         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP \
6401                 (UINT32_C(0x2) << 12)
6402         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_LAST \
6403                 RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP
6404         /*
6405          * This value indicates the amount of packet data written to the
6406          * buffer the opaque field in this completion corresponds to.
6407          */
6408         uint16_t        len;
6409         /*
6410          * This is a copy of the opaque field from the RX BD this completion
6411          * corresponds to.
6412          */
6413         uint32_t        opaque;
6414         /*
6415          * This value is written by the NIC such that it will be different
6416          * for each pass through the completion queue. The even passes
6417          * will write 1. The odd passes will write 0.
6418          */
6419         uint8_t v1;
6420         /*
6421          * This value is written by the NIC such that it will be different
6422          * for each pass through the completion queue. The even passes
6423          * will write 1. The odd passes will write 0.
6424          */
6425         #define RX_TPA_V2_START_CMPL_V1 UINT32_C(0x1)
6426         #define RX_TPA_V2_START_CMPL_LAST RX_TPA_V2_START_CMPL_V1
6427         /*
6428          * This is the RSS hash type for the packet. The value is packed
6429          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
6430          *
6431          * The value of tuple_extrac_op provides the information about
6432          * what fields the hash was computed on.
6433          * * 0: The RSS hash was computed over source IP address,
6434          * destination IP address, source port, and destination port of inner
6435          * IP and TCP or UDP headers. Note: For non-tunneled packets,
6436          * the packet headers are considered inner packet headers for the RSS
6437          * hash computation purpose.
6438          * * 1: The RSS hash was computed over source IP address and destination
6439          * IP address of inner IP header. Note: For non-tunneled packets,
6440          * the packet headers are considered inner packet headers for the RSS
6441          * hash computation purpose.
6442          * * 2: The RSS hash was computed over source IP address,
6443          * destination IP address, source port, and destination port of
6444          * IP and TCP or UDP headers of outer tunnel headers.
6445          * Note: For non-tunneled packets, this value is not applicable.
6446          * * 3: The RSS hash was computed over source IP address and
6447          * destination IP address of IP header of outer tunnel headers.
6448          * Note: For non-tunneled packets, this value is not applicable.
6449          *
6450          * Note that 4-tuples values listed above are applicable
6451          * for layer 4 protocols supported and enabled for RSS in the hardware,
6452          * HWRM firmware, and drivers. For example, if RSS hash is supported and
6453          * enabled for TCP traffic only, then the values of tuple_extract_op
6454          * corresponding to 4-tuples are only valid for TCP traffic.
6455          */
6456         uint8_t rss_hash_type;
6457         /*
6458          * This is the aggregation ID that the completion is associated
6459          * with. Use this number to correlate the TPA start completion
6460          * with the TPA end completion.
6461          */
6462         uint16_t        agg_id;
6463         /*
6464          * This value is the RSS hash value calculated for the packet
6465          * based on the mode bits and key value in the VNIC.
6466          */
6467         uint32_t        rss_hash;
6468 } __rte_packed;
6469
6470 /*
6471  * Last 16 bytes of rx_tpa_v2_start_cmpl.
6472  *
6473  * This TPA completion structure is used on devices where the
6474  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
6475  */
6476 /* rx_tpa_v2_start_cmpl_hi (size:128b/16B) */
6477 struct rx_tpa_v2_start_cmpl_hi {
6478         uint32_t        flags2;
6479         /*
6480          * This indicates that the ip checksum was calculated for the
6481          * inner packet and that the sum passed for all segments
6482          * included in the aggregation.
6483          */
6484         #define RX_TPA_V2_START_CMPL_FLAGS2_IP_CS_CALC \
6485                 UINT32_C(0x1)
6486         /*
6487          * This indicates that the TCP, UDP or ICMP checksum was
6488          * calculated for the inner packet and that the sum passed
6489          * for all segments included in the aggregation.
6490          */
6491         #define RX_TPA_V2_START_CMPL_FLAGS2_L4_CS_CALC \
6492                 UINT32_C(0x2)
6493         /*
6494          * This indicates that the ip checksum was calculated for the
6495          * tunnel header and that the sum passed for all segments
6496          * included in the aggregation.
6497          */
6498         #define RX_TPA_V2_START_CMPL_FLAGS2_T_IP_CS_CALC \
6499                 UINT32_C(0x4)
6500         /*
6501          * This indicates that the UDP checksum was
6502          * calculated for the tunnel packet and that the sum passed for
6503          * all segments included in the aggregation.
6504          */
6505         #define RX_TPA_V2_START_CMPL_FLAGS2_T_L4_CS_CALC \
6506                 UINT32_C(0x8)
6507         /* This value indicates what format the metadata field is. */
6508         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_MASK \
6509                 UINT32_C(0xf0)
6510         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_SFT            4
6511         /* No metadata informtaion. Value is zero. */
6512         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_NONE \
6513                 (UINT32_C(0x0) << 4)
6514         /*
6515          * The metadata field contains the VLAN tag and TPID value.
6516          * - metadata[11:0] contains the vlan VID value.
6517          * - metadata[12] contains the vlan DE value.
6518          * - metadata[15:13] contains the vlan PRI value.
6519          * - metadata[31:16] contains the vlan TPID value.
6520          */
6521         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_VLAN \
6522                 (UINT32_C(0x1) << 4)
6523         /*
6524          * If ext_meta_format is equal to 1, the metadata field
6525          * contains the lower 16b of the tunnel ID value, justified
6526          * to LSB
6527          * - VXLAN = VNI[23:0] -> VXLAN Network ID
6528          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
6529          * - NVGRE = TNI[23:0] -> Tenant Network ID
6530          * - GRE = KEY[31:0 -> key fieled with bit mask. zero if K = 0
6531          * - IPV4 = 0 (not populated)
6532          * - IPV6 = Flow Label[19:0]
6533          * - PPPoE = sessionID[15:0]
6534          * - MPLs = Outer label[19:0]
6535          * - UPAR = Selected[31:0] with bit mask
6536          */
6537         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
6538                 (UINT32_C(0x2) << 4)
6539         /*
6540          * if ext_meta_format is equal to 1, metadata field contains
6541          * 16b metadata from the prepended header (chdr_data).
6542          */
6543         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
6544                 (UINT32_C(0x3) << 4)
6545         /*
6546          * If ext_meta_format is equal to 1, the metadata field contains
6547          * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
6548          * inner_l4_size.
6549          * - metadata[8:0] contains the outer_l3_offset.
6550          * - metadata[17:9] contains the inner_l2_offset.
6551          * - metadata[26:18] contains the inner_l3_offset.
6552          * - metadata[31:27] contains the inner_l4_size.
6553          */
6554         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
6555                 (UINT32_C(0x4) << 4)
6556         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_LAST \
6557                 RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
6558         /*
6559          * This field indicates the IP type for the inner-most IP header.
6560          * A value of '0' indicates IPv4. A value of '1' indicates IPv6.
6561          */
6562         #define RX_TPA_V2_START_CMPL_FLAGS2_IP_TYPE \
6563                 UINT32_C(0x100)
6564         /*
6565          * This indicates that the complete 1's complement checksum was
6566          * calculated for the packet.
6567          */
6568         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC \
6569                 UINT32_C(0x200)
6570         /*
6571          * The combination of this value and meta_format indicated what
6572          * format the metadata field is.
6573          */
6574         #define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_MASK \
6575                 UINT32_C(0xc00)
6576         #define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_SFT        10
6577         /*
6578          * This value is the complete 1's complement checksum calculated from
6579          * the start of the outer L3 header to the end of the packet (not
6580          * including the ethernet crc). It is valid when the
6581          * 'complete_checksum_calc' flag is set. For TPA Start completions,
6582          * the complete checksum is calculated for the first packet in the
6583          * aggregation only.
6584          */
6585         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
6586                 UINT32_C(0xffff0000)
6587         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
6588         /*
6589          * This is data from the CFA block as indicated by the meta_format
6590          * field.
6591          */
6592         uint32_t        metadata;
6593         /* When {ext_meta_format,meta_format}=1, this value is the VLAN VID. */
6594         #define RX_TPA_V2_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
6595         #define RX_TPA_V2_START_CMPL_METADATA_VID_SFT  0
6596         /* When {ext_meta_format,meta_format}=1, this value is the VLAN DE. */
6597         #define RX_TPA_V2_START_CMPL_METADATA_DE       UINT32_C(0x1000)
6598         /* When {ext_meta_format,meta_format}=1, this value is the VLAN PRI. */
6599         #define RX_TPA_V2_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
6600         #define RX_TPA_V2_START_CMPL_METADATA_PRI_SFT  13
6601         /* When {ext_meta_format,meta_format}=1, this value is the VLAN TPID. */
6602         #define RX_TPA_V2_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
6603         #define RX_TPA_V2_START_CMPL_METADATA_TPID_SFT 16
6604         uint16_t        errors_v2;
6605         /*
6606          * This value is written by the NIC such that it will be different
6607          * for each pass through the completion queue. The even passes
6608          * will write 1. The odd passes will write 0.
6609          */
6610         #define RX_TPA_V2_START_CMPL_V2 \
6611                 UINT32_C(0x1)
6612         #define RX_TPA_V2_START_CMPL_ERRORS_MASK \
6613                 UINT32_C(0xfffe)
6614         #define RX_TPA_V2_START_CMPL_ERRORS_SFT                    1
6615         /*
6616          * This error indicates that there was some sort of problem with
6617          * the BDs for the packet that was found after part of the
6618          * packet was already placed. The packet should be treated as
6619          * invalid.
6620          */
6621         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_MASK \
6622                 UINT32_C(0xe)
6623         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_SFT        1
6624         /* No buffer error */
6625         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
6626                 (UINT32_C(0x0) << 1)
6627         /*
6628          * Bad Format:
6629          * BDs were not formatted correctly.
6630          */
6631         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
6632                 (UINT32_C(0x3) << 1)
6633         /*
6634          * Flush:
6635          * There was a bad_format error on the previous operation
6636          */
6637         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
6638                 (UINT32_C(0x5) << 1)
6639         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_LAST \
6640                 RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH
6641         /*
6642          * This field identifies the CFA action rule that was used for this
6643          * packet.
6644          */
6645         uint16_t        cfa_code;
6646         /*
6647          * For devices that support timestamps this field is overridden
6648          * with the timestamp value. When `flags.timestamp_fld_format` is
6649          * cleared, this field contains the 32b timestamp for the packet from the
6650          * MAC.
6651          *
6652          * When `flags.timestamp_fld_format` is set, this field contains the
6653          * outer_l3_offset, inner_l2_offset, inner_l3_offset, and inner_l4_size
6654          * as defined below.
6655          */
6656         uint32_t        inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
6657         /*
6658          * This is the offset from the beginning of the packet in bytes for
6659          * the outer L3 header. If there is no outer L3 header, then this
6660          * value is zero.
6661          */
6662         #define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
6663         #define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_SFT 0
6664         /*
6665          * This is the offset from the beginning of the packet in bytes for
6666          * the inner most L2 header.
6667          */
6668         #define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
6669         #define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_SFT 9
6670         /*
6671          * This is the offset from the beginning of the packet in bytes for
6672          * the inner most L3 header.
6673          */
6674         #define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
6675         #define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_SFT 18
6676         /*
6677          * This is the size in bytes of the inner most L4 header.
6678          * This can be subtracted from the payload_offset to determine
6679          * the start of the inner most L4 header.
6680          */
6681         #define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
6682         #define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_SFT   27
6683 } __rte_packed;
6684
6685 /*
6686  * This TPA completion structure is used on devices where the
6687  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
6688  */
6689 /* rx_tpa_v2_end_cmpl (size:128b/16B) */
6690 struct rx_tpa_v2_end_cmpl {
6691         uint16_t        flags_type;
6692         /*
6693          * This field indicates the exact type of the completion.
6694          * By convention, the LSB identifies the length of the
6695          * record in 16B units. Even values indicate 16B
6696          * records. Odd values indicate 32B
6697          * records.
6698          */
6699         #define RX_TPA_V2_END_CMPL_TYPE_MASK \
6700                 UINT32_C(0x3f)
6701         #define RX_TPA_V2_END_CMPL_TYPE_SFT                       0
6702         /*
6703          * RX L2 TPA End Completion:
6704          * Completion at the end of a TPA operation.
6705          * Length = 32B
6706          */
6707         #define RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END \
6708                 UINT32_C(0x15)
6709         #define RX_TPA_V2_END_CMPL_TYPE_LAST \
6710                 RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END
6711         #define RX_TPA_V2_END_CMPL_FLAGS_MASK \
6712                 UINT32_C(0xffc0)
6713         #define RX_TPA_V2_END_CMPL_FLAGS_SFT                      6
6714         /*
6715          * When this bit is '1', it indicates a packet that has an
6716          * error of some type. Type of error is indicated in
6717          * error_flags.
6718          */
6719         #define RX_TPA_V2_END_CMPL_FLAGS_ERROR \
6720                 UINT32_C(0x40)
6721         /* This field indicates how the packet was placed in the buffer. */
6722         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_MASK \
6723                 UINT32_C(0x380)
6724         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_SFT             7
6725         /*
6726          * Jumbo:
6727          * TPA Packet was placed using jumbo algorithm. This means
6728          * that the first buffer will be filled with data before
6729          * moving to aggregation buffers. Each aggregation buffer
6730          * will be filled before moving to the next aggregation
6731          * buffer.
6732          */
6733         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_JUMBO \
6734                 (UINT32_C(0x1) << 7)
6735         /*
6736          * Header/Data Separation:
6737          * Packet was placed using Header/Data separation algorithm.
6738          * The separation location is indicated by the itype field.
6739          */
6740         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_HDS \
6741                 (UINT32_C(0x2) << 7)
6742         /*
6743          * GRO/Jumbo:
6744          * Packet will be placed using GRO/Jumbo where the first
6745          * packet is filled with data. Subsequent packets will be
6746          * placed such that any one packet does not span two
6747          * aggregation buffers unless it starts at the beginning of
6748          * an aggregation buffer.
6749          */
6750         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
6751                 (UINT32_C(0x5) << 7)
6752         /*
6753          * GRO/Header-Data Separation:
6754          * Packet will be placed using GRO/HDS where the header
6755          * is in the first packet.
6756          * Payload of each packet will be
6757          * placed such that any one packet does not span two
6758          * aggregation buffers unless it starts at the beginning of
6759          * an aggregation buffer.
6760          */
6761         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \
6762                 (UINT32_C(0x6) << 7)
6763         /*
6764          * IOC/Header-Data Separation:
6765          * Packet will be placed using In-Order Completion/HDS where
6766          * the header is in the first packet buffer. Payload of each
6767          * packet will be placed such that each packet starts at the
6768          * beginning of an aggregation buffer.
6769          */
6770         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_IOC_HDS \
6771                 (UINT32_C(0x7) << 7)
6772         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_LAST \
6773                 RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_IOC_HDS
6774         /* unused is 1 b */
6775         #define RX_TPA_V2_END_CMPL_FLAGS_UNUSED \
6776                 UINT32_C(0x400)
6777         /*
6778          * This bit is '1' if metadata has been added to the end of the
6779          * packet in host memory. Metadata starts at the first 32B boundary
6780          * after the end of the packet for regular and jumbo placement.
6781          * It starts at the first 32B boundary after the end of the header
6782          * for HDS placement. The length of the metadata is indicated in the
6783          * metadata itself.
6784          */
6785         #define RX_TPA_V2_END_CMPL_FLAGS_PKT_METADATA_PRESENT \
6786                 UINT32_C(0x800)
6787         /*
6788          * This value indicates what the inner packet determined for the
6789          * packet was.
6790          * - 2 TCP Packet
6791          *     Indicates that the packet was IP and TCP. This indicates
6792          *     that the ip_cs field is valid and that the tcp_udp_cs
6793          *     field is valid and contains the TCP checksum.
6794          *     This also indicates that the payload_offset field is valid.
6795          */
6796         #define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_MASK \
6797                 UINT32_C(0xf000)
6798         #define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_SFT                 12
6799         /*
6800          * This value is zero for TPA End completions.
6801          * There is no data in the buffer that corresponds to the opaque
6802          * value in this completion.
6803          */
6804         uint16_t        len;
6805         /*
6806          * This is a copy of the opaque field from the RX BD this completion
6807          * corresponds to.
6808          */
6809         uint32_t        opaque;
6810         uint8_t v1;
6811         /*
6812          * This value is written by the NIC such that it will be different
6813          * for each pass through the completion queue. The even passes
6814          * will write 1. The odd passes will write 0.
6815          */
6816         #define RX_TPA_V2_END_CMPL_V1     UINT32_C(0x1)
6817         /* This value is the number of segments in the TPA operation. */
6818         uint8_t tpa_segs;
6819         /*
6820          * This is the aggregation ID that the completion is associated
6821          * with. Use this number to correlate the TPA start completion
6822          * with the TPA end completion.
6823          */
6824         uint16_t        agg_id;
6825         /*
6826          * For non-GRO packets, this value is the
6827          * timestamp delta between earliest and latest timestamp values for
6828          * TPA packet. If packets were not time stamped, then delta will be
6829          * zero.
6830          *
6831          * For GRO packets, this field is zero except for the following
6832          * sub-fields.
6833          * - tsdelta[31]
6834          *     Timestamp present indication. When '0', no Timestamp
6835          *     option is in the packet. When '1', then a Timestamp
6836          *     option is present in the packet.
6837          */
6838         uint32_t        tsdelta;
6839 } __rte_packed;
6840
6841 /*
6842  * Last 16 bytes of rx_tpa_v2_end_cmpl.
6843  *
6844  * This TPA completion structure is used on devices where the
6845  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
6846  */
6847 /* rx_tpa_v2_end_cmpl_hi (size:128b/16B) */
6848 struct rx_tpa_v2_end_cmpl_hi {
6849         /*
6850          * This value is the number of duplicate ACKs that have been
6851          * received as part of the TPA operation.
6852          */
6853         uint16_t        tpa_dup_acks;
6854         /*
6855          * This value is the number of duplicate ACKs that have been
6856          * received as part of the TPA operation.
6857          */
6858         #define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
6859         #define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_SFT 0
6860         /*
6861          * This value indicated the offset in bytes from the beginning of
6862          * the packet where the inner payload starts. This value is valid
6863          * for TCP, UDP, FCoE and RoCE packets
6864          */
6865         uint8_t payload_offset;
6866         /*
6867          * The value is the total number of aggregation buffers that were
6868          * used in the TPA operation. All TPA aggregation buffer completions
6869          * precede the TPA End completion. If the value is zero, then the
6870          * aggregation is completely contained in the buffer space provided
6871          * in the aggregation start completion.
6872          * Note that the field is simply provided as a cross check.
6873          */
6874         uint8_t tpa_agg_bufs;
6875         /*
6876          * This value is the valid when TPA completion is active. It
6877          * indicates the length of the longest segment of the TPA operation
6878          * for LRO mode and the length of the first segment in GRO mode.
6879          *
6880          * This value may be used by GRO software to re-construct the original
6881          * packet stream from the TPA packet. This is the length of all
6882          * but the last segment for GRO. In LRO mode this value may be used
6883          * to indicate MSS size to the stack.
6884          */
6885         uint16_t        tpa_seg_len;
6886         uint16_t        unused_1;
6887         uint16_t        errors_v2;
6888         /*
6889          * This value is written by the NIC such that it will be different
6890          * for each pass through the completion queue. The even passes
6891          * will write 1. The odd passes will write 0.
6892          */
6893         #define RX_TPA_V2_END_CMPL_V2                             UINT32_C(0x1)
6894         #define RX_TPA_V2_END_CMPL_ERRORS_MASK \
6895                 UINT32_C(0xfffe)
6896         #define RX_TPA_V2_END_CMPL_ERRORS_SFT                     1
6897         /*
6898          * This error indicates that there was some sort of problem with
6899          * the BDs for the packet that was found after part of the
6900          * packet was already placed. The packet should be treated as
6901          * invalid.
6902          */
6903         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_MASK \
6904                 UINT32_C(0xe)
6905         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_SFT         1
6906         /* No buffer error */
6907         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
6908                 (UINT32_C(0x0) << 1)
6909         /*
6910          * This error occurs when there is a fatal HW problem in
6911          * the chip only. It indicates that there were not
6912          * BDs on chip but that there was adequate reservation.
6913          * provided by the TPA block.
6914          */
6915         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
6916                 (UINT32_C(0x2) << 1)
6917         /*
6918          * Bad Format:
6919          * BDs were not formatted correctly.
6920          */
6921         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
6922                 (UINT32_C(0x3) << 1)
6923         /*
6924          * This error occurs when TPA block was not configured to
6925          * reserve adequate BDs for TPA operations on this RX
6926          * ring. All data for the TPA operation was not placed.
6927          *
6928          * This error can also be generated when the number of
6929          * segments is not programmed correctly in TPA and the
6930          * 33 total aggregation buffers allowed for the TPA
6931          * operation has been exceeded.
6932          */
6933         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
6934                 (UINT32_C(0x4) << 1)
6935         /*
6936          * Flush:
6937          * There was a bad_format error on the previous operation
6938          */
6939         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
6940                 (UINT32_C(0x5) << 1)
6941         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
6942                 RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH
6943         uint16_t        unused_2;
6944         /*
6945          * This is the opaque value that was completed for the TPA start
6946          * completion that corresponds to this TPA end completion.
6947          */
6948         uint32_t        start_opaque;
6949 } __rte_packed;
6950
6951 /*
6952  * This TPA completion structure is used on devices where the
6953  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
6954  */
6955 /* rx_tpa_v2_abuf_cmpl (size:128b/16B) */
6956 struct rx_tpa_v2_abuf_cmpl {
6957         uint16_t        type;
6958         /*
6959          * This field indicates the exact type of the completion.
6960          * By convention, the LSB identifies the length of the
6961          * record in 16B units. Even values indicate 16B
6962          * records. Odd values indicate 32B
6963          * records.
6964          */
6965         #define RX_TPA_V2_ABUF_CMPL_TYPE_MASK      UINT32_C(0x3f)
6966         #define RX_TPA_V2_ABUF_CMPL_TYPE_SFT       0
6967         /*
6968          * RX TPA Aggregation Buffer completion :
6969          * Completion of an L2 aggregation buffer in support of
6970          * TPA packet completion. Length = 16B
6971          */
6972         #define RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG  UINT32_C(0x16)
6973         #define RX_TPA_V2_ABUF_CMPL_TYPE_LAST \
6974                 RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG
6975         /*
6976          * This is the length of the data for the packet stored in this
6977          * aggregation buffer identified by the opaque value. This does not
6978          * include the length of any
6979          * data placed in other aggregation BDs or in the packet or buffer
6980          * BDs. This length does not include any space added due to
6981          * hdr_offset register during HDS placement mode.
6982          */
6983         uint16_t        len;
6984         /*
6985          * This is a copy of the opaque field from the RX BD this aggregation
6986          * buffer corresponds to.
6987          */
6988         uint32_t        opaque;
6989         uint16_t        v;
6990         /*
6991          * This value is written by the NIC such that it will be different
6992          * for each pass through the completion queue. The even passes
6993          * will write 1. The odd passes will write 0.
6994          */
6995         #define RX_TPA_V2_ABUF_CMPL_V     UINT32_C(0x1)
6996         /*
6997          * This is the aggregation ID that the completion is associated with. Use
6998          * this number to correlate the TPA agg completion with the TPA start
6999          * completion and the TPA end completion.
7000          */
7001         uint16_t        agg_id;
7002         uint32_t        unused_1;
7003 } __rte_packed;
7004
7005 /* rx_abuf_cmpl (size:128b/16B) */
7006 struct rx_abuf_cmpl {
7007         uint16_t        type;
7008         /*
7009          * This field indicates the exact type of the completion.
7010          * By convention, the LSB identifies the length of the
7011          * record in 16B units. Even values indicate 16B
7012          * records. Odd values indicate 32B
7013          * records.
7014          */
7015         #define RX_ABUF_CMPL_TYPE_MASK  UINT32_C(0x3f)
7016         #define RX_ABUF_CMPL_TYPE_SFT   0
7017         /*
7018          * RX Aggregation Buffer completion :
7019          * Completion of an L2 aggregation buffer in support of
7020          * TPA, HDS, or Jumbo packet completion. Length = 16B
7021          */
7022         #define RX_ABUF_CMPL_TYPE_RX_AGG  UINT32_C(0x12)
7023         #define RX_ABUF_CMPL_TYPE_LAST   RX_ABUF_CMPL_TYPE_RX_AGG
7024         /*
7025          * This is the length of the data for the packet stored in this
7026          * aggregation buffer identified by the opaque value. This does not
7027          * include the length of any
7028          * data placed in other aggregation BDs or in the packet or buffer
7029          * BDs. This length does not include any space added due to
7030          * hdr_offset register during HDS placement mode.
7031          */
7032         uint16_t        len;
7033         /*
7034          * This is a copy of the opaque field from the RX BD this aggregation
7035          * buffer corresponds to.
7036          */
7037         uint32_t        opaque;
7038         uint32_t        v;
7039         /*
7040          * This value is written by the NIC such that it will be different
7041          * for each pass through the completion queue. The even passes
7042          * will write 1. The odd passes will write 0.
7043          */
7044         #define RX_ABUF_CMPL_V     UINT32_C(0x1)
7045         /* unused3 is 32 b */
7046         uint32_t        unused_2;
7047 } __rte_packed;
7048
7049 /* VEE FLUSH Completion Record (16 bytes) */
7050 /* vee_flush (size:128b/16B) */
7051 struct vee_flush {
7052         uint32_t        downstream_path_type;
7053         /*
7054          * This field indicates the exact type of the completion.
7055          * By convention, the LSB identifies the length of the
7056          * record in 16B units. Even values indicate 16B
7057          * records. Odd values indicate 32B
7058          * records.
7059          */
7060         #define VEE_FLUSH_TYPE_MASK           UINT32_C(0x3f)
7061         #define VEE_FLUSH_TYPE_SFT            0
7062         /*
7063          * VEE Flush Completion:
7064          * This completion is inserted manually by the Primate and processed
7065          * by the VEE hardware to ensure that all completions on a VEE
7066          * function have been processed by the VEE hardware before FLR
7067          * process is completed.
7068          */
7069         #define VEE_FLUSH_TYPE_VEE_FLUSH        UINT32_C(0x1c)
7070         #define VEE_FLUSH_TYPE_LAST            VEE_FLUSH_TYPE_VEE_FLUSH
7071         /* downstream_path is 1 b */
7072         #define VEE_FLUSH_DOWNSTREAM_PATH     UINT32_C(0x40)
7073         /* This completion is associated with VEE Transmit */
7074         #define VEE_FLUSH_DOWNSTREAM_PATH_TX    (UINT32_C(0x0) << 6)
7075         /* This completion is associated with VEE Receive */
7076         #define VEE_FLUSH_DOWNSTREAM_PATH_RX    (UINT32_C(0x1) << 6)
7077         #define VEE_FLUSH_DOWNSTREAM_PATH_LAST VEE_FLUSH_DOWNSTREAM_PATH_RX
7078         /*
7079          * This is an opaque value that is passed through the completion
7080          * to the VEE handler SW and is used to indicate what VEE VQ or
7081          * function has completed FLR processing.
7082          */
7083         uint32_t        opaque;
7084         uint32_t        v;
7085         /*
7086          * This value is written by the NIC such that it will be different
7087          * for each pass through the completion queue. The even passes will
7088          * write 1. The odd passes will write 0.
7089          */
7090         #define VEE_FLUSH_V     UINT32_C(0x1)
7091         /* unused3 is 32 b */
7092         uint32_t        unused_3;
7093 } __rte_packed;
7094
7095 /* eject_cmpl (size:128b/16B) */
7096 struct eject_cmpl {
7097         uint16_t        type;
7098         /*
7099          * This field indicates the exact type of the completion.
7100          * By convention, the LSB identifies the length of the
7101          * record in 16B units. Even values indicate 16B
7102          * records. Odd values indicate 32B
7103          * records.
7104          */
7105         #define EJECT_CMPL_TYPE_MASK       UINT32_C(0x3f)
7106         #define EJECT_CMPL_TYPE_SFT        0
7107         /*
7108          * Statistics Ejection Completion:
7109          * Completion of statistics data ejection buffer.
7110          * Length = 16B
7111          */
7112         #define EJECT_CMPL_TYPE_STAT_EJECT   UINT32_C(0x1a)
7113         #define EJECT_CMPL_TYPE_LAST        EJECT_CMPL_TYPE_STAT_EJECT
7114         #define EJECT_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
7115         #define EJECT_CMPL_FLAGS_SFT       6
7116         /*
7117          * When this bit is '1', it indicates a packet that has an
7118          * error of some type. Type of error is indicated in
7119          * error_flags.
7120          */
7121         #define EJECT_CMPL_FLAGS_ERROR      UINT32_C(0x40)
7122         /*
7123          * This is the length of the statistics data stored in this
7124          * buffer.
7125          */
7126         uint16_t        len;
7127         /*
7128          * This is a copy of the opaque field from the RX BD this ejection
7129          * buffer corresponds to.
7130          */
7131         uint32_t        opaque;
7132         uint16_t        v;
7133         /*
7134          * This value is written by the NIC such that it will be different
7135          * for each pass through the completion queue. The even passes
7136          * will write 1. The odd passes will write 0.
7137          */
7138         #define EJECT_CMPL_V                              UINT32_C(0x1)
7139         #define EJECT_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
7140         #define EJECT_CMPL_ERRORS_SFT                     1
7141         /*
7142          * This error indicates that there was some sort of problem with
7143          * the BDs for statistics ejection. The statistics ejection should
7144          * be treated as invalid
7145          */
7146         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
7147         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_SFT         1
7148         /* No buffer error */
7149         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
7150                 (UINT32_C(0x0) << 1)
7151         /*
7152          * Did Not Fit:
7153          * Statistics did not fit into aggregation buffer provided.
7154          */
7155         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
7156                 (UINT32_C(0x1) << 1)
7157         /*
7158          * Bad Format:
7159          * BDs were not formatted correctly.
7160          */
7161         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
7162                 (UINT32_C(0x3) << 1)
7163         /*
7164          * Flush:
7165          * There was a bad_format error on the previous operation
7166          */
7167         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
7168                 (UINT32_C(0x5) << 1)
7169         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_LAST \
7170                 EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
7171         /* reserved16 is 16 b */
7172         uint16_t        reserved16;
7173         /* unused3 is 32 b */
7174         uint32_t        unused_2;
7175 } __rte_packed;
7176
7177 /* hwrm_cmpl (size:128b/16B) */
7178 struct hwrm_cmpl {
7179         uint16_t        type;
7180         /*
7181          * This field indicates the exact type of the completion.
7182          * By convention, the LSB identifies the length of the
7183          * record in 16B units. Even values indicate 16B
7184          * records. Odd values indicate 32B
7185          * records.
7186          */
7187         #define HWRM_CMPL_TYPE_MASK     UINT32_C(0x3f)
7188         #define HWRM_CMPL_TYPE_SFT      0
7189         /*
7190          * HWRM Command Completion:
7191          * Completion of an HWRM command.
7192          */
7193         #define HWRM_CMPL_TYPE_HWRM_DONE  UINT32_C(0x20)
7194         #define HWRM_CMPL_TYPE_LAST      HWRM_CMPL_TYPE_HWRM_DONE
7195         /* This is the sequence_id of the HWRM command that has completed. */
7196         uint16_t        sequence_id;
7197         /* unused2 is 32 b */
7198         uint32_t        unused_1;
7199         uint32_t        v;
7200         /*
7201          * This value is written by the NIC such that it will be different
7202          * for each pass through the completion queue. The even passes
7203          * will write 1. The odd passes will write 0.
7204          */
7205         #define HWRM_CMPL_V     UINT32_C(0x1)
7206         /* unused4 is 32 b */
7207         uint32_t        unused_3;
7208 } __rte_packed;
7209
7210 /* hwrm_fwd_req_cmpl (size:128b/16B) */
7211 struct hwrm_fwd_req_cmpl {
7212         /*
7213          * This field indicates the exact type of the completion.
7214          * By convention, the LSB identifies the length of the
7215          * record in 16B units. Even values indicate 16B
7216          * records. Odd values indicate 32B
7217          * records.
7218          */
7219         uint16_t        req_len_type;
7220         /*
7221          * This field indicates the exact type of the completion.
7222          * By convention, the LSB identifies the length of the
7223          * record in 16B units. Even values indicate 16B
7224          * records. Odd values indicate 32B
7225          * records.
7226          */
7227         #define HWRM_FWD_REQ_CMPL_TYPE_MASK        UINT32_C(0x3f)
7228         #define HWRM_FWD_REQ_CMPL_TYPE_SFT         0
7229         /* Forwarded HWRM Request */
7230         #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ  UINT32_C(0x22)
7231         #define HWRM_FWD_REQ_CMPL_TYPE_LAST \
7232                 HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ
7233         /* Length of forwarded request in bytes. */
7234         #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK     UINT32_C(0xffc0)
7235         #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT      6
7236         /*
7237          * Source ID of this request.
7238          * Typically used in forwarding requests and responses.
7239          * 0x0 - 0xFFF8 - Used for function ids
7240          * 0xFFF8 - 0xFFFE - Reserved for internal processors
7241          * 0xFFFF - HWRM
7242          */
7243         uint16_t        source_id;
7244         /* unused1 is 32 b */
7245         uint32_t        unused0;
7246         /* Address of forwarded request. */
7247         uint32_t        req_buf_addr_v[2];
7248         /*
7249          * This value is written by the NIC such that it will be different
7250          * for each pass through the completion queue. The even passes
7251          * will write 1. The odd passes will write 0.
7252          */
7253         #define HWRM_FWD_REQ_CMPL_V                UINT32_C(0x1)
7254         /* Address of forwarded request. */
7255         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
7256         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
7257 } __rte_packed;
7258
7259 /* hwrm_fwd_resp_cmpl (size:128b/16B) */
7260 struct hwrm_fwd_resp_cmpl {
7261         uint16_t        type;
7262         /*
7263          * This field indicates the exact type of the completion.
7264          * By convention, the LSB identifies the length of the
7265          * record in 16B units. Even values indicate 16B
7266          * records. Odd values indicate 32B
7267          * records.
7268          */
7269         #define HWRM_FWD_RESP_CMPL_TYPE_MASK         UINT32_C(0x3f)
7270         #define HWRM_FWD_RESP_CMPL_TYPE_SFT          0
7271         /* Forwarded HWRM Response */
7272         #define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP  UINT32_C(0x24)
7273         #define HWRM_FWD_RESP_CMPL_TYPE_LAST \
7274                 HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP
7275         /*
7276          * Source ID of this response.
7277          * Typically used in forwarding requests and responses.
7278          * 0x0 - 0xFFF8 - Used for function ids
7279          * 0xFFF8 - 0xFFFE - Reserved for internal processors
7280          * 0xFFFF - HWRM
7281          */
7282         uint16_t        source_id;
7283         /* Length of forwarded response in bytes. */
7284         uint16_t        resp_len;
7285         /* unused2 is 16 b */
7286         uint16_t        unused_1;
7287         /* Address of forwarded request. */
7288         uint32_t        resp_buf_addr_v[2];
7289         /*
7290          * This value is written by the NIC such that it will be different
7291          * for each pass through the completion queue. The even passes
7292          * will write 1. The odd passes will write 0.
7293          */
7294         #define HWRM_FWD_RESP_CMPL_V                 UINT32_C(0x1)
7295         /* Address of forwarded request. */
7296         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe)
7297         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
7298 } __rte_packed;
7299
7300 /* hwrm_async_event_cmpl (size:128b/16B) */
7301 struct hwrm_async_event_cmpl {
7302         uint16_t        type;
7303         /*
7304          * This field indicates the exact type of the completion.
7305          * By convention, the LSB identifies the length of the
7306          * record in 16B units. Even values indicate 16B
7307          * records. Odd values indicate 32B
7308          * records.
7309          */
7310         #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK            UINT32_C(0x3f)
7311         #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT             0
7312         /* HWRM Asynchronous Event Information */
7313         #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
7314         #define HWRM_ASYNC_EVENT_CMPL_TYPE_LAST \
7315                 HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT
7316         /* Identifiers of events. */
7317         uint16_t        event_id;
7318         /* Link status changed */
7319         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \
7320                 UINT32_C(0x0)
7321         /* Link MTU changed */
7322         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \
7323                 UINT32_C(0x1)
7324         /* Link speed changed */
7325         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \
7326                 UINT32_C(0x2)
7327         /* DCB Configuration changed */
7328         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \
7329                 UINT32_C(0x3)
7330         /* Port connection not allowed */
7331         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \
7332                 UINT32_C(0x4)
7333         /* Link speed configuration was not allowed */
7334         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
7335                 UINT32_C(0x5)
7336         /* Link speed configuration change */
7337         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE \
7338                 UINT32_C(0x6)
7339         /* Port PHY configuration change */
7340         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE \
7341                 UINT32_C(0x7)
7342         /* Reset notification to clients */
7343         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY \
7344                 UINT32_C(0x8)
7345         /* Master function selection event */
7346         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY \
7347                 UINT32_C(0x9)
7348         /*
7349          * An event signifying that a ring has been disabled by
7350          * hw due to error.
7351          */
7352         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG \
7353                 UINT32_C(0xa)
7354         /* Function driver unloaded */
7355         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \
7356                 UINT32_C(0x10)
7357         /* Function driver loaded */
7358         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \
7359                 UINT32_C(0x11)
7360         /* Function FLR related processing has completed */
7361         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT \
7362                 UINT32_C(0x12)
7363         /* PF driver unloaded */
7364         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \
7365                 UINT32_C(0x20)
7366         /* PF driver loaded */
7367         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \
7368                 UINT32_C(0x21)
7369         /* VF Function Level Reset (FLR) */
7370         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR \
7371                 UINT32_C(0x30)
7372         /* VF MAC Address Change */
7373         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \
7374                 UINT32_C(0x31)
7375         /* PF-VF communication channel status change. */
7376         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
7377                 UINT32_C(0x32)
7378         /* VF Configuration Change */
7379         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE \
7380                 UINT32_C(0x33)
7381         /* LLFC/PFC Configuration Change */
7382         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE \
7383                 UINT32_C(0x34)
7384         /* Default VNIC Configuration Change */
7385         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE \
7386                 UINT32_C(0x35)
7387         /* HW flow aged */
7388         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HW_FLOW_AGED \
7389                 UINT32_C(0x36)
7390         /*
7391          * A debug notification being posted to the driver. These
7392          * notifications are purely for diagnostic purpose and should not be
7393          * used for functional purpose. The driver is not supposed to act
7394          * on these messages except to log/record it.
7395          */
7396         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION \
7397                 UINT32_C(0x37)
7398         /*
7399          * An EEM flow cached memory flush for all flows request event being
7400          * posted to the PF driver.
7401          */
7402         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_REQ \
7403                 UINT32_C(0x38)
7404         /*
7405          * An EEM flow cache memory flush completion event being posted to the
7406          * firmware by the PF driver. This is indication that host EEM flush
7407          * has completed by the PF.
7408          */
7409         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_DONE \
7410                 UINT32_C(0x39)
7411         /*
7412          * A tcp flag action change event being posted to the PF or trusted VF
7413          * driver by the firmware. The PF or trusted VF driver should query
7414          * the firmware for the new TCP flag action update after receiving
7415          * this async event.
7416          */
7417         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TCP_FLAG_ACTION_CHANGE \
7418                 UINT32_C(0x3a)
7419         /*
7420          * An EEM flow active event being posted to the PF or trusted VF driver
7421          * by the firmware. The PF or trusted VF driver should update the
7422          * flow's aging timer after receiving this async event.
7423          */
7424         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_FLOW_ACTIVE \
7425                 UINT32_C(0x3b)
7426         /*
7427          * A eem cfg change event being posted to the trusted VF driver by the
7428          * firmware if the parent PF EEM configuration changed.
7429          */
7430         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CFG_CHANGE \
7431                 UINT32_C(0x3c)
7432         /*
7433          * Deprecated.
7434          * TFLIB unique default VNIC Configuration Change
7435          */
7436         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_DEFAULT_VNIC_CHANGE \
7437                 UINT32_C(0x3d)
7438         /*
7439          * Deprecated.
7440          * TFLIB unique link status changed
7441          */
7442         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_LINK_STATUS_CHANGE \
7443                 UINT32_C(0x3e)
7444         /*
7445          * An event signifying completion for HWRM_FW_STATE_QUIESCE
7446          * (completion, timeout, or error)
7447          */
7448         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_QUIESCE_DONE \
7449                 UINT32_C(0x3f)
7450         /*
7451          * An event signifying a HWRM command is in progress and its
7452          * response will be deferred. This event is used on crypto controllers
7453          * only.
7454          */
7455         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFERRED_RESPONSE \
7456                 UINT32_C(0x40)
7457         /*
7458          * An event signifying that a PFC WatchDog configuration
7459          * has changed on any port / cos.
7460          */
7461         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE \
7462                 UINT32_C(0x41)
7463         /*
7464          * An echo request from the firmware. An echo response is expected by
7465          * the firmware.
7466          */
7467         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST \
7468                 UINT32_C(0x42)
7469         /* Maximum Registrable event id. */
7470         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID \
7471                 UINT32_C(0x43)
7472         /*
7473          * A trace log message. This contains firmware trace logs string
7474          * embedded in the asynchronous message. This is an experimental
7475          * event, not meant for production use at this time.
7476          */
7477         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG \
7478                 UINT32_C(0xfe)
7479         /* HWRM Error */
7480         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \
7481                 UINT32_C(0xff)
7482         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LAST \
7483                 HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR
7484         /* Event specific data */
7485         uint32_t        event_data2;
7486         uint8_t opaque_v;
7487         /*
7488          * This value is written by the NIC such that it will be different
7489          * for each pass through the completion queue. The even passes
7490          * will write 1. The odd passes will write 0.
7491          */
7492         #define HWRM_ASYNC_EVENT_CMPL_V          UINT32_C(0x1)
7493         /* opaque is 7 b */
7494         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
7495         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
7496         /* 8-lsb timestamp from POR (100-msec resolution) */
7497         uint8_t timestamp_lo;
7498         /* 16-lsb timestamp from POR (100-msec resolution) */
7499         uint16_t        timestamp_hi;
7500         /* Event specific data */
7501         uint32_t        event_data1;
7502 } __rte_packed;
7503
7504 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */
7505 struct hwrm_async_event_cmpl_link_status_change {
7506         uint16_t        type;
7507         /*
7508          * This field indicates the exact type of the completion.
7509          * By convention, the LSB identifies the length of the
7510          * record in 16B units. Even values indicate 16B
7511          * records. Odd values indicate 32B
7512          * records.
7513          */
7514         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK \
7515                 UINT32_C(0x3f)
7516         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT             0
7517         /* HWRM Asynchronous Event Information */
7518         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7519                 UINT32_C(0x2e)
7520         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_LAST \
7521                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
7522         /* Identifiers of events. */
7523         uint16_t        event_id;
7524         /* Link status changed */
7525         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE \
7526                 UINT32_C(0x0)
7527         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LAST \
7528                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE
7529         /* Event specific data */
7530         uint32_t        event_data2;
7531         uint8_t opaque_v;
7532         /*
7533          * This value is written by the NIC such that it will be different
7534          * for each pass through the completion queue. The even passes
7535          * will write 1. The odd passes will write 0.
7536          */
7537         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V \
7538                 UINT32_C(0x1)
7539         /* opaque is 7 b */
7540         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK \
7541                 UINT32_C(0xfe)
7542         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
7543         /* 8-lsb timestamp from POR (100-msec resolution) */
7544         uint8_t timestamp_lo;
7545         /* 16-lsb timestamp from POR (100-msec resolution) */
7546         uint16_t        timestamp_hi;
7547         /* Event specific data */
7548         uint32_t        event_data1;
7549         /* Indicates link status change */
7550         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE \
7551                 UINT32_C(0x1)
7552         /*
7553          * If this bit set to 0, then it indicates that the link
7554          * was up and it went down.
7555          */
7556         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN \
7557                 UINT32_C(0x0)
7558         /*
7559          * If this bit is set to 1, then it indicates that the link
7560          * was down and it went up.
7561          */
7562         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP \
7563                 UINT32_C(0x1)
7564         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_LAST \
7565                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP
7566         /* Indicates the physical port this link status change occur */
7567         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK \
7568                 UINT32_C(0xe)
7569         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT \
7570                 1
7571         /* PORT ID */
7572         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK \
7573                 UINT32_C(0xffff0)
7574         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT \
7575                 4
7576         /* Indicates the physical function this event occurred on. */
7577         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_MASK \
7578                 UINT32_C(0xff00000)
7579         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_SFT \
7580                 20
7581 } __rte_packed;
7582
7583 /* hwrm_async_event_cmpl_link_mtu_change (size:128b/16B) */
7584 struct hwrm_async_event_cmpl_link_mtu_change {
7585         uint16_t        type;
7586         /*
7587          * This field indicates the exact type of the completion.
7588          * By convention, the LSB identifies the length of the
7589          * record in 16B units. Even values indicate 16B
7590          * records. Odd values indicate 32B
7591          * records.
7592          */
7593         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK \
7594                 UINT32_C(0x3f)
7595         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT             0
7596         /* HWRM Asynchronous Event Information */
7597         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7598                 UINT32_C(0x2e)
7599         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_LAST \
7600                 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT
7601         /* Identifiers of events. */
7602         uint16_t        event_id;
7603         /* Link MTU changed */
7604         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE \
7605                 UINT32_C(0x1)
7606         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LAST \
7607                 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE
7608         /* Event specific data */
7609         uint32_t        event_data2;
7610         uint8_t opaque_v;
7611         /*
7612          * This value is written by the NIC such that it will be different
7613          * for each pass through the completion queue. The even passes
7614          * will write 1. The odd passes will write 0.
7615          */
7616         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V          UINT32_C(0x1)
7617         /* opaque is 7 b */
7618         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK \
7619                 UINT32_C(0xfe)
7620         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT 1
7621         /* 8-lsb timestamp from POR (100-msec resolution) */
7622         uint8_t timestamp_lo;
7623         /* 16-lsb timestamp from POR (100-msec resolution) */
7624         uint16_t        timestamp_hi;
7625         /* Event specific data */
7626         uint32_t        event_data1;
7627         /* The new MTU of the link in bytes. */
7628         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK \
7629                 UINT32_C(0xffff)
7630         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
7631 } __rte_packed;
7632
7633 /* hwrm_async_event_cmpl_link_speed_change (size:128b/16B) */
7634 struct hwrm_async_event_cmpl_link_speed_change {
7635         uint16_t        type;
7636         /*
7637          * This field indicates the exact type of the completion.
7638          * By convention, the LSB identifies the length of the
7639          * record in 16B units. Even values indicate 16B
7640          * records. Odd values indicate 32B
7641          * records.
7642          */
7643         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK \
7644                 UINT32_C(0x3f)
7645         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT             0
7646         /* HWRM Asynchronous Event Information */
7647         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7648                 UINT32_C(0x2e)
7649         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_LAST \
7650                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT
7651         /* Identifiers of events. */
7652         uint16_t        event_id;
7653         /* Link speed changed */
7654         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE \
7655                 UINT32_C(0x2)
7656         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LAST \
7657                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE
7658         /* Event specific data */
7659         uint32_t        event_data2;
7660         uint8_t opaque_v;
7661         /*
7662          * This value is written by the NIC such that it will be different
7663          * for each pass through the completion queue. The even passes
7664          * will write 1. The odd passes will write 0.
7665          */
7666         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V \
7667                 UINT32_C(0x1)
7668         /* opaque is 7 b */
7669         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK \
7670                 UINT32_C(0xfe)
7671         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
7672         /* 8-lsb timestamp from POR (100-msec resolution) */
7673         uint8_t timestamp_lo;
7674         /* 16-lsb timestamp from POR (100-msec resolution) */
7675         uint16_t        timestamp_hi;
7676         /* Event specific data */
7677         uint32_t        event_data1;
7678         /*
7679          * When this bit is '1', the link was forced to the
7680          * force_link_speed value.
7681          */
7682         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE \
7683                 UINT32_C(0x1)
7684         /* The new link speed in 100 Mbps units. */
7685         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK \
7686                 UINT32_C(0xfffe)
7687         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT \
7688                 1
7689         /* 100Mb link speed */
7690         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB \
7691                 (UINT32_C(0x1) << 1)
7692         /* 1Gb link speed */
7693         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB \
7694                 (UINT32_C(0xa) << 1)
7695         /* 2Gb link speed */
7696         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB \
7697                 (UINT32_C(0x14) << 1)
7698         /* 25Gb link speed */
7699         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB \
7700                 (UINT32_C(0x19) << 1)
7701         /* 10Gb link speed */
7702         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB \
7703                 (UINT32_C(0x64) << 1)
7704         /* 20Mb link speed */
7705         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB \
7706                 (UINT32_C(0xc8) << 1)
7707         /* 25Gb link speed */
7708         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB \
7709                 (UINT32_C(0xfa) << 1)
7710         /* 40Gb link speed */
7711         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB \
7712                 (UINT32_C(0x190) << 1)
7713         /* 50Gb link speed */
7714         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB \
7715                 (UINT32_C(0x1f4) << 1)
7716         /* 100Gb link speed */
7717         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB \
7718                 (UINT32_C(0x3e8) << 1)
7719         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_LAST \
7720                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB
7721         /* PORT ID */
7722         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK \
7723                 UINT32_C(0xffff0000)
7724         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT \
7725                 16
7726 } __rte_packed;
7727
7728 /* hwrm_async_event_cmpl_dcb_config_change (size:128b/16B) */
7729 struct hwrm_async_event_cmpl_dcb_config_change {
7730         uint16_t        type;
7731         /*
7732          * This field indicates the exact type of the completion.
7733          * By convention, the LSB identifies the length of the
7734          * record in 16B units. Even values indicate 16B
7735          * records. Odd values indicate 32B
7736          * records.
7737          */
7738         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK \
7739                 UINT32_C(0x3f)
7740         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT             0
7741         /* HWRM Asynchronous Event Information */
7742         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7743                 UINT32_C(0x2e)
7744         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_LAST \
7745                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT
7746         /* Identifiers of events. */
7747         uint16_t        event_id;
7748         /* DCB Configuration changed */
7749         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE \
7750                 UINT32_C(0x3)
7751         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_LAST \
7752                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE
7753         /* Event specific data */
7754         uint32_t        event_data2;
7755         /* ETS configuration change */
7756         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS \
7757                 UINT32_C(0x1)
7758         /* PFC configuration change */
7759         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC \
7760                 UINT32_C(0x2)
7761         /* APP configuration change */
7762         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP \
7763                 UINT32_C(0x4)
7764         uint8_t opaque_v;
7765         /*
7766          * This value is written by the NIC such that it will be different
7767          * for each pass through the completion queue. The even passes
7768          * will write 1. The odd passes will write 0.
7769          */
7770         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V \
7771                 UINT32_C(0x1)
7772         /* opaque is 7 b */
7773         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK \
7774                 UINT32_C(0xfe)
7775         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
7776         /* 8-lsb timestamp from POR (100-msec resolution) */
7777         uint8_t timestamp_lo;
7778         /* 16-lsb timestamp from POR (100-msec resolution) */
7779         uint16_t        timestamp_hi;
7780         /* Event specific data */
7781         uint32_t        event_data1;
7782         /* PORT ID */
7783         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
7784                 UINT32_C(0xffff)
7785         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
7786                 0
7787         /* Priority recommended for RoCE traffic */
7788         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK \
7789                 UINT32_C(0xff0000)
7790         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT \
7791                 16
7792         /* none is 255 */
7793         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE \
7794                 (UINT32_C(0xff) << 16)
7795         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_LAST \
7796                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE
7797         /* Priority recommended for L2 traffic */
7798         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK \
7799                 UINT32_C(0xff000000)
7800         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT \
7801                 24
7802         /* none is 255 */
7803         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE \
7804                 (UINT32_C(0xff) << 24)
7805         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_LAST \
7806                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE
7807 } __rte_packed;
7808
7809 /* hwrm_async_event_cmpl_port_conn_not_allowed (size:128b/16B) */
7810 struct hwrm_async_event_cmpl_port_conn_not_allowed {
7811         uint16_t        type;
7812         /*
7813          * This field indicates the exact type of the completion.
7814          * By convention, the LSB identifies the length of the
7815          * record in 16B units. Even values indicate 16B
7816          * records. Odd values indicate 32B
7817          * records.
7818          */
7819         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK \
7820                 UINT32_C(0x3f)
7821         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT \
7822                 0
7823         /* HWRM Asynchronous Event Information */
7824         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \
7825                 UINT32_C(0x2e)
7826         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_LAST \
7827                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
7828         /* Identifiers of events. */
7829         uint16_t        event_id;
7830         /* Port connection not allowed */
7831         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED \
7832                 UINT32_C(0x4)
7833         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_LAST \
7834                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED
7835         /* Event specific data */
7836         uint32_t        event_data2;
7837         uint8_t opaque_v;
7838         /*
7839          * This value is written by the NIC such that it will be different
7840          * for each pass through the completion queue. The even passes
7841          * will write 1. The odd passes will write 0.
7842          */
7843         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V \
7844                 UINT32_C(0x1)
7845         /* opaque is 7 b */
7846         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK \
7847                 UINT32_C(0xfe)
7848         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
7849         /* 8-lsb timestamp from POR (100-msec resolution) */
7850         uint8_t timestamp_lo;
7851         /* 16-lsb timestamp from POR (100-msec resolution) */
7852         uint16_t        timestamp_hi;
7853         /* Event specific data */
7854         uint32_t        event_data1;
7855         /* PORT ID */
7856         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \
7857                 UINT32_C(0xffff)
7858         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
7859                 0
7860         /*
7861          * This value indicates the current port level enforcement policy
7862          * for the optics module when there is an optical module mismatch
7863          * and port is not connected.
7864          */
7865         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK \
7866                 UINT32_C(0xff0000)
7867         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT \
7868                 16
7869         /* No enforcement */
7870         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE \
7871                 (UINT32_C(0x0) << 16)
7872         /* Disable Transmit side Laser. */
7873         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX \
7874                 (UINT32_C(0x1) << 16)
7875         /* Raise a warning message. */
7876         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG \
7877                 (UINT32_C(0x2) << 16)
7878         /* Power down the module. */
7879         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN \
7880                 (UINT32_C(0x3) << 16)
7881         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_LAST \
7882                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN
7883 } __rte_packed;
7884
7885 /* hwrm_async_event_cmpl_link_speed_cfg_not_allowed (size:128b/16B) */
7886 struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
7887         uint16_t        type;
7888         /*
7889          * This field indicates the exact type of the completion.
7890          * By convention, the LSB identifies the length of the
7891          * record in 16B units. Even values indicate 16B
7892          * records. Odd values indicate 32B
7893          * records.
7894          */
7895         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK \
7896                 UINT32_C(0x3f)
7897         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT \
7898                 0
7899         /* HWRM Asynchronous Event Information */
7900         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \
7901                 UINT32_C(0x2e)
7902         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_LAST \
7903                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
7904         /* Identifiers of events. */
7905         uint16_t        event_id;
7906         /* Link speed configuration was not allowed */
7907         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
7908                 UINT32_C(0x5)
7909         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LAST \
7910                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED
7911         /* Event specific data */
7912         uint32_t        event_data2;
7913         uint8_t opaque_v;
7914         /*
7915          * This value is written by the NIC such that it will be different
7916          * for each pass through the completion queue. The even passes
7917          * will write 1. The odd passes will write 0.
7918          */
7919         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V \
7920                 UINT32_C(0x1)
7921         /* opaque is 7 b */
7922         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK \
7923                 UINT32_C(0xfe)
7924         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1
7925         /* 8-lsb timestamp from POR (100-msec resolution) */
7926         uint8_t timestamp_lo;
7927         /* 16-lsb timestamp from POR (100-msec resolution) */
7928         uint16_t        timestamp_hi;
7929         /* Event specific data */
7930         uint32_t        event_data1;
7931         /* PORT ID */
7932         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \
7933                 UINT32_C(0xffff)
7934         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
7935                 0
7936 } __rte_packed;
7937
7938 /* hwrm_async_event_cmpl_link_speed_cfg_change (size:128b/16B) */
7939 struct hwrm_async_event_cmpl_link_speed_cfg_change {
7940         uint16_t        type;
7941         /*
7942          * This field indicates the exact type of the completion.
7943          * By convention, the LSB identifies the length of the
7944          * record in 16B units. Even values indicate 16B
7945          * records. Odd values indicate 32B
7946          * records.
7947          */
7948         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK \
7949                 UINT32_C(0x3f)
7950         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT \
7951                 0
7952         /* HWRM Asynchronous Event Information */
7953         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
7954                 UINT32_C(0x2e)
7955         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_LAST \
7956                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
7957         /* Identifiers of events. */
7958         uint16_t        event_id;
7959         /* Link speed configuration change */
7960         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE \
7961                 UINT32_C(0x6)
7962         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LAST \
7963                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE
7964         /* Event specific data */
7965         uint32_t        event_data2;
7966         uint8_t opaque_v;
7967         /*
7968          * This value is written by the NIC such that it will be different
7969          * for each pass through the completion queue. The even passes
7970          * will write 1. The odd passes will write 0.
7971          */
7972         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V \
7973                 UINT32_C(0x1)
7974         /* opaque is 7 b */
7975         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK \
7976                 UINT32_C(0xfe)
7977         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1
7978         /* 8-lsb timestamp from POR (100-msec resolution) */
7979         uint8_t timestamp_lo;
7980         /* 16-lsb timestamp from POR (100-msec resolution) */
7981         uint16_t        timestamp_hi;
7982         /* Event specific data */
7983         uint32_t        event_data1;
7984         /* PORT ID */
7985         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
7986                 UINT32_C(0xffff)
7987         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
7988                 0
7989         /*
7990          * If set to 1, it indicates that the supported link speeds
7991          * configuration on the port has changed.
7992          * If set to 0, then there is no change in supported link speeds
7993          * configuration.
7994          */
7995         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE \
7996                 UINT32_C(0x10000)
7997         /*
7998          * If set to 1, it indicates that the link speed configuration
7999          * on the port has become illegal or invalid.
8000          * If set to 0, then the link speed configuration on the port is
8001          * legal or valid.
8002          */
8003         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG \
8004                 UINT32_C(0x20000)
8005 } __rte_packed;
8006
8007 /* hwrm_async_event_cmpl_port_phy_cfg_change (size:128b/16B) */
8008 struct hwrm_async_event_cmpl_port_phy_cfg_change {
8009         uint16_t        type;
8010         /*
8011          * This field indicates the exact type of the completion.
8012          * By convention, the LSB identifies the length of the
8013          * record in 16B units. Even values indicate 16B
8014          * records. Odd values indicate 32B
8015          * records.
8016          */
8017         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_MASK \
8018                 UINT32_C(0x3f)
8019         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_SFT \
8020                 0
8021         /* HWRM Asynchronous Event Information */
8022         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
8023                 UINT32_C(0x2e)
8024         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_LAST \
8025                 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
8026         /* Identifiers of events. */
8027         uint16_t        event_id;
8028         /* Port PHY configuration change */
8029         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE \
8030                 UINT32_C(0x7)
8031         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_LAST \
8032                 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE
8033         /* Event specific data */
8034         uint32_t        event_data2;
8035         uint8_t opaque_v;
8036         /*
8037          * This value is written by the NIC such that it will be different
8038          * for each pass through the completion queue. The even passes
8039          * will write 1. The odd passes will write 0.
8040          */
8041         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_V \
8042                 UINT32_C(0x1)
8043         /* opaque is 7 b */
8044         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_MASK \
8045                 UINT32_C(0xfe)
8046         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_SFT 1
8047         /* 8-lsb timestamp from POR (100-msec resolution) */
8048         uint8_t timestamp_lo;
8049         /* 16-lsb timestamp from POR (100-msec resolution) */
8050         uint16_t        timestamp_hi;
8051         /* Event specific data */
8052         uint32_t        event_data1;
8053         /* PORT ID */
8054         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
8055                 UINT32_C(0xffff)
8056         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
8057                 0
8058         /*
8059          * If set to 1, it indicates that the FEC
8060          * configuration on the port has changed.
8061          * If set to 0, then there is no change in FEC configuration.
8062          */
8063         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_FEC_CFG_CHANGE \
8064                 UINT32_C(0x10000)
8065         /*
8066          * If set to 1, it indicates that the EEE configuration
8067          * on the port has changed.
8068          * If set to 0, then there is no change in EEE configuration
8069          * on the port.
8070          */
8071         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_EEE_CFG_CHANGE \
8072                 UINT32_C(0x20000)
8073         /*
8074          * If set to 1, it indicates that the pause configuration
8075          * on the PHY has changed.
8076          * If set to 0, then there is no change in the pause
8077          * configuration on the PHY.
8078          */
8079         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE \
8080                 UINT32_C(0x40000)
8081 } __rte_packed;
8082
8083 /* hwrm_async_event_cmpl_reset_notify (size:128b/16B) */
8084 struct hwrm_async_event_cmpl_reset_notify {
8085         uint16_t        type;
8086         /*
8087          * This field indicates the exact type of the completion.
8088          * By convention, the LSB identifies the length of the
8089          * record in 16B units. Even values indicate 16B
8090          * records. Odd values indicate 32B
8091          * records.
8092          */
8093         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_MASK \
8094                 UINT32_C(0x3f)
8095         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_SFT             0
8096         /* HWRM Asynchronous Event Information */
8097         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT \
8098                 UINT32_C(0x2e)
8099         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_LAST \
8100                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT
8101         /* Identifiers of events. */
8102         uint16_t        event_id;
8103         /* Notify clients of imminent reset. */
8104         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY \
8105                 UINT32_C(0x8)
8106         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_LAST \
8107                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY
8108         /* Event specific data. The data is for internal debug use only. */
8109         uint32_t        event_data2;
8110         /*
8111          * These bits indicate the status as being reported by the firmware.
8112          * This value is exactly the same as status code in fw_status register.
8113          * If the status code is equal to 0x8000, then the reset is initiated
8114          * by the Host using the FW_RESET command when the FW is in a healthy
8115          * state. If the status code is not equal to 0x8000, then the reset is
8116          * initiated by the FW to recover from the error or FATAL state.
8117          */
8118         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_MASK \
8119                 UINT32_C(0xffff)
8120         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA2_FW_STATUS_CODE_SFT \
8121                 0
8122         uint8_t opaque_v;
8123         /*
8124          * This value is written by the NIC such that it will be different
8125          * for each pass through the completion queue. The even passes
8126          * will write 1. The odd passes will write 0.
8127          */
8128         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_V          UINT32_C(0x1)
8129         /* opaque is 7 b */
8130         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_MASK UINT32_C(0xfe)
8131         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_SFT 1
8132         /*
8133          * 8-lsb timestamp (100-msec resolution)
8134          * The Minimum time required for the Firmware readiness after sending this
8135          * notification to the driver instances.
8136          */
8137         uint8_t timestamp_lo;
8138         /*
8139          * 16-lsb timestamp (100-msec resolution)
8140          * The Maximum Firmware Reset bail out value in the order of 100
8141          * milli seconds. The driver instances will use this value to re-initiate the
8142          * registration process again if the core firmware didn’t set the ready
8143          * state bit.
8144          */
8145         uint16_t        timestamp_hi;
8146         /* Event specific data */
8147         uint32_t        event_data1;
8148         /* Indicates driver action requested */
8149         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_MASK \
8150                 UINT32_C(0xff)
8151         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_SFT \
8152                 0
8153         /*
8154          * If set to 1, it indicates that the l2 client should
8155          * stop sending in band traffic to Nitro.
8156          * if set to 0, there is no change in L2 client behavior.
8157          */
8158         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_STOP_TX_QUEUE \
8159                 UINT32_C(0x1)
8160         /*
8161          * If set to 1, it indicates that the L2 client should
8162          * bring down the interface.
8163          * If set to 0, then there is no change in L2 client behavior.
8164          */
8165         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN \
8166                 UINT32_C(0x2)
8167         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_LAST \
8168                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN
8169         /* Indicates reason for reset. */
8170         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK \
8171                 UINT32_C(0xff00)
8172         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_SFT \
8173                 8
8174         /* A management client has requested reset. */
8175         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MANAGEMENT_RESET_REQUEST \
8176                 (UINT32_C(0x1) << 8)
8177         /* A fatal firmware exception has occurred. */
8178         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL \
8179                 (UINT32_C(0x2) << 8)
8180         /* A non-fatal firmware exception has occurred. */
8181         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL \
8182                 (UINT32_C(0x3) << 8)
8183         /* Fast reset */
8184         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FAST_RESET \
8185                 (UINT32_C(0x4) << 8)
8186         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_LAST \
8187                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FAST_RESET
8188         /*
8189          * Minimum time before driver should attempt access - units 100ms ticks.
8190          * Range 0-65535
8191          */
8192         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_MASK \
8193                 UINT32_C(0xffff0000)
8194         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_SFT \
8195                 16
8196 } __rte_packed;
8197
8198 /* hwrm_async_event_cmpl_error_recovery (size:128b/16B) */
8199 struct hwrm_async_event_cmpl_error_recovery {
8200         uint16_t        type;
8201         /*
8202          * This field indicates the exact type of the completion.
8203          * By convention, the LSB identifies the length of the
8204          * record in 16B units. Even values indicate 16B
8205          * records. Odd values indicate 32B
8206          * records.
8207          */
8208         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_MASK \
8209                 UINT32_C(0x3f)
8210         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_SFT             0
8211         /* HWRM Asynchronous Event Information */
8212         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT \
8213                 UINT32_C(0x2e)
8214         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_LAST \
8215                 HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT
8216         /* Identifiers of events. */
8217         uint16_t        event_id;
8218         /*
8219          * This async notification message can be used for selecting or
8220          * deselecting master function for error recovery,
8221          * and to communicate to all the functions whether error recovery
8222          * was enabled/disabled.
8223          */
8224         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY \
8225                 UINT32_C(0x9)
8226         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_LAST \
8227                 HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY
8228         /* Event specific data */
8229         uint32_t        event_data2;
8230         uint8_t opaque_v;
8231         /*
8232          * This value is written by the NIC such that it will be different
8233          * for each pass through the completion queue. The even passes
8234          * will write 1. The odd passes will write 0.
8235          */
8236         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_V          UINT32_C(0x1)
8237         /* opaque is 7 b */
8238         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_MASK UINT32_C(0xfe)
8239         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_SFT 1
8240         /* 8-lsb timestamp (100-msec resolution) */
8241         uint8_t timestamp_lo;
8242         /* 16-lsb timestamp (100-msec resolution) */
8243         uint16_t        timestamp_hi;
8244         /* Event specific data */
8245         uint32_t        event_data1;
8246         /* Indicates driver action requested */
8247         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASK \
8248                 UINT32_C(0xff)
8249         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_SFT \
8250                 0
8251         /*
8252          * If set to 1, this function is selected as Master function.
8253          * This function has responsibility to do 'chip reset' when it
8254          * detects a fatal error. If set to 0, master function functionality
8255          * is disabled on this function.
8256          */
8257         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASTER_FUNC \
8258                 UINT32_C(0x1)
8259         /*
8260          * If set to 1, error recovery is enabled.
8261          * If set to 0, error recovery is disabled.
8262          */
8263         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED \
8264                 UINT32_C(0x2)
8265 } __rte_packed;
8266
8267 /* hwrm_async_event_cmpl_ring_monitor_msg (size:128b/16B) */
8268 struct hwrm_async_event_cmpl_ring_monitor_msg {
8269         uint16_t        type;
8270         /*
8271          * This field indicates the exact type of the completion.
8272          * By convention, the LSB identifies the length of the
8273          * record in 16B units. Even values indicate 16B
8274          * records. Odd values indicate 32B
8275          * records.
8276          */
8277         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_MASK \
8278                 UINT32_C(0x3f)
8279         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_SFT             0
8280         /* HWRM Asynchronous Event Information */
8281         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_HWRM_ASYNC_EVENT \
8282                 UINT32_C(0x2e)
8283         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_LAST \
8284                 HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_TYPE_HWRM_ASYNC_EVENT
8285         /* Identifiers of events. */
8286         uint16_t        event_id;
8287         /* Ring Monitor Message. */
8288         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_RING_MONITOR_MSG \
8289                 UINT32_C(0xa)
8290         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_LAST \
8291                 HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_ID_RING_MONITOR_MSG
8292         /* Event specific data */
8293         uint32_t        event_data2;
8294         /* Type of Ring disabled. */
8295         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_MASK \
8296                 UINT32_C(0xff)
8297         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_SFT \
8298                 0
8299         /* tx ring disabled. */
8300         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_TX \
8301                 UINT32_C(0x0)
8302         /* rx ring disabled. */
8303         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_RX \
8304                 UINT32_C(0x1)
8305         /* cmpl ring disabled. */
8306         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_CMPL \
8307                 UINT32_C(0x2)
8308         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_LAST \
8309                 HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_EVENT_DATA2_DISABLE_RING_TYPE_CMPL
8310         uint8_t opaque_v;
8311         /*
8312          * This value is written by the NIC such that it will be different
8313          * for each pass through the completion queue. The even passes
8314          * will write 1. The odd passes will write 0.
8315          */
8316         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_V          UINT32_C(0x1)
8317         /* opaque is 7 b */
8318         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_OPAQUE_MASK \
8319                 UINT32_C(0xfe)
8320         #define HWRM_ASYNC_EVENT_CMPL_RING_MONITOR_MSG_OPAQUE_SFT 1
8321         /* 8-lsb timestamp from POR (100-msec resolution) */
8322         uint8_t timestamp_lo;
8323         /* 16-lsb timestamp from POR (100-msec resolution) */
8324         uint16_t        timestamp_hi;
8325         /*
8326          * Event specific data. If ring_type_disabled indicates a tx,rx or cmpl
8327          * then this field will indicate the ring id.
8328          */
8329         uint32_t        event_data1;
8330 } __rte_packed;
8331
8332 /* hwrm_async_event_cmpl_func_drvr_unload (size:128b/16B) */
8333 struct hwrm_async_event_cmpl_func_drvr_unload {
8334         uint16_t        type;
8335         /*
8336          * This field indicates the exact type of the completion.
8337          * By convention, the LSB identifies the length of the
8338          * record in 16B units. Even values indicate 16B
8339          * records. Odd values indicate 32B
8340          * records.
8341          */
8342         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK \
8343                 UINT32_C(0x3f)
8344         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT             0
8345         /* HWRM Asynchronous Event Information */
8346         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \
8347                 UINT32_C(0x2e)
8348         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_LAST \
8349                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
8350         /* Identifiers of events. */
8351         uint16_t        event_id;
8352         /* Function driver unloaded */
8353         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD \
8354                 UINT32_C(0x10)
8355         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_LAST \
8356                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD
8357         /* Event specific data */
8358         uint32_t        event_data2;
8359         uint8_t opaque_v;
8360         /*
8361          * This value is written by the NIC such that it will be different
8362          * for each pass through the completion queue. The even passes
8363          * will write 1. The odd passes will write 0.
8364          */
8365         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V          UINT32_C(0x1)
8366         /* opaque is 7 b */
8367         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK \
8368                 UINT32_C(0xfe)
8369         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT 1
8370         /* 8-lsb timestamp from POR (100-msec resolution) */
8371         uint8_t timestamp_lo;
8372         /* 16-lsb timestamp from POR (100-msec resolution) */
8373         uint16_t        timestamp_hi;
8374         /* Event specific data */
8375         uint32_t        event_data1;
8376         /* Function ID */
8377         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \
8378                 UINT32_C(0xffff)
8379         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT \
8380                 0
8381 } __rte_packed;
8382
8383 /* hwrm_async_event_cmpl_func_drvr_load (size:128b/16B) */
8384 struct hwrm_async_event_cmpl_func_drvr_load {
8385         uint16_t        type;
8386         /*
8387          * This field indicates the exact type of the completion.
8388          * By convention, the LSB identifies the length of the
8389          * record in 16B units. Even values indicate 16B
8390          * records. Odd values indicate 32B
8391          * records.
8392          */
8393         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK \
8394                 UINT32_C(0x3f)
8395         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT             0
8396         /* HWRM Asynchronous Event Information */
8397         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \
8398                 UINT32_C(0x2e)
8399         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_LAST \
8400                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
8401         /* Identifiers of events. */
8402         uint16_t        event_id;
8403         /* Function driver loaded */
8404         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD \
8405                 UINT32_C(0x11)
8406         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_LAST \
8407                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD
8408         /* Event specific data */
8409         uint32_t        event_data2;
8410         uint8_t opaque_v;
8411         /*
8412          * This value is written by the NIC such that it will be different
8413          * for each pass through the completion queue. The even passes
8414          * will write 1. The odd passes will write 0.
8415          */
8416         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V          UINT32_C(0x1)
8417         /* opaque is 7 b */
8418         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
8419         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT 1
8420         /* 8-lsb timestamp from POR (100-msec resolution) */
8421         uint8_t timestamp_lo;
8422         /* 16-lsb timestamp from POR (100-msec resolution) */
8423         uint16_t        timestamp_hi;
8424         /* Event specific data */
8425         uint32_t        event_data1;
8426         /* Function ID */
8427         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
8428                 UINT32_C(0xffff)
8429         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
8430 } __rte_packed;
8431
8432 /* hwrm_async_event_cmpl_func_flr_proc_cmplt (size:128b/16B) */
8433 struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
8434         uint16_t        type;
8435         /*
8436          * This field indicates the exact type of the completion.
8437          * By convention, the LSB identifies the length of the
8438          * record in 16B units. Even values indicate 16B
8439          * records. Odd values indicate 32B
8440          * records.
8441          */
8442         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_MASK \
8443                 UINT32_C(0x3f)
8444         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_SFT \
8445                 0
8446         /* HWRM Asynchronous Event Information */
8447         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT \
8448                 UINT32_C(0x2e)
8449         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_LAST \
8450                 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT
8451         /* Identifiers of events. */
8452         uint16_t        event_id;
8453         /* Function FLR related processing has completed */
8454         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT \
8455                 UINT32_C(0x12)
8456         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_LAST \
8457                 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT
8458         /* Event specific data */
8459         uint32_t        event_data2;
8460         uint8_t opaque_v;
8461         /*
8462          * This value is written by the NIC such that it will be different
8463          * for each pass through the completion queue. The even passes
8464          * will write 1. The odd passes will write 0.
8465          */
8466         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_V \
8467                 UINT32_C(0x1)
8468         /* opaque is 7 b */
8469         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_MASK \
8470                 UINT32_C(0xfe)
8471         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_SFT 1
8472         /* 8-lsb timestamp from POR (100-msec resolution) */
8473         uint8_t timestamp_lo;
8474         /* 16-lsb timestamp from POR (100-msec resolution) */
8475         uint16_t        timestamp_hi;
8476         /* Event specific data */
8477         uint32_t        event_data1;
8478         /* Function ID */
8479         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_MASK \
8480                 UINT32_C(0xffff)
8481         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT \
8482                 0
8483 } __rte_packed;
8484
8485 /* hwrm_async_event_cmpl_pf_drvr_unload (size:128b/16B) */
8486 struct hwrm_async_event_cmpl_pf_drvr_unload {
8487         uint16_t        type;
8488         /*
8489          * This field indicates the exact type of the completion.
8490          * By convention, the LSB identifies the length of the
8491          * record in 16B units. Even values indicate 16B
8492          * records. Odd values indicate 32B
8493          * records.
8494          */
8495         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK \
8496                 UINT32_C(0x3f)
8497         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT             0
8498         /* HWRM Asynchronous Event Information */
8499         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \
8500                 UINT32_C(0x2e)
8501         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_LAST \
8502                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
8503         /* Identifiers of events. */
8504         uint16_t        event_id;
8505         /* PF driver unloaded */
8506         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD \
8507                 UINT32_C(0x20)
8508         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_LAST \
8509                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD
8510         /* Event specific data */
8511         uint32_t        event_data2;
8512         uint8_t opaque_v;
8513         /*
8514          * This value is written by the NIC such that it will be different
8515          * for each pass through the completion queue. The even passes
8516          * will write 1. The odd passes will write 0.
8517          */
8518         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V          UINT32_C(0x1)
8519         /* opaque is 7 b */
8520         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
8521         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT 1
8522         /* 8-lsb timestamp from POR (100-msec resolution) */
8523         uint8_t timestamp_lo;
8524         /* 16-lsb timestamp from POR (100-msec resolution) */
8525         uint16_t        timestamp_hi;
8526         /* Event specific data */
8527         uint32_t        event_data1;
8528         /* PF ID */
8529         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \
8530                 UINT32_C(0xffff)
8531         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
8532         /* Indicates the physical port this pf belongs to */
8533         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK \
8534                 UINT32_C(0x70000)
8535         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT    16
8536 } __rte_packed;
8537
8538 /* hwrm_async_event_cmpl_pf_drvr_load (size:128b/16B) */
8539 struct hwrm_async_event_cmpl_pf_drvr_load {
8540         uint16_t        type;
8541         /*
8542          * This field indicates the exact type of the completion.
8543          * By convention, the LSB identifies the length of the
8544          * record in 16B units. Even values indicate 16B
8545          * records. Odd values indicate 32B
8546          * records.
8547          */
8548         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK \
8549                 UINT32_C(0x3f)
8550         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT             0
8551         /* HWRM Asynchronous Event Information */
8552         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \
8553                 UINT32_C(0x2e)
8554         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_LAST \
8555                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
8556         /* Identifiers of events. */
8557         uint16_t        event_id;
8558         /* PF driver loaded */
8559         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD \
8560                 UINT32_C(0x21)
8561         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_LAST \
8562                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD
8563         /* Event specific data */
8564         uint32_t        event_data2;
8565         uint8_t opaque_v;
8566         /*
8567          * This value is written by the NIC such that it will be different
8568          * for each pass through the completion queue. The even passes
8569          * will write 1. The odd passes will write 0.
8570          */
8571         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V          UINT32_C(0x1)
8572         /* opaque is 7 b */
8573         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
8574         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT 1
8575         /* 8-lsb timestamp from POR (100-msec resolution) */
8576         uint8_t timestamp_lo;
8577         /* 16-lsb timestamp from POR (100-msec resolution) */
8578         uint16_t        timestamp_hi;
8579         /* Event specific data */
8580         uint32_t        event_data1;
8581         /* PF ID */
8582         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
8583                 UINT32_C(0xffff)
8584         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
8585         /* Indicates the physical port this pf belongs to */
8586         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK \
8587                 UINT32_C(0x70000)
8588         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT    16
8589 } __rte_packed;
8590
8591 /* hwrm_async_event_cmpl_vf_flr (size:128b/16B) */
8592 struct hwrm_async_event_cmpl_vf_flr {
8593         uint16_t        type;
8594         /*
8595          * This field indicates the exact type of the completion.
8596          * By convention, the LSB identifies the length of the
8597          * record in 16B units. Even values indicate 16B
8598          * records. Odd values indicate 32B
8599          * records.
8600          */
8601         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK \
8602                 UINT32_C(0x3f)
8603         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT             0
8604         /* HWRM Asynchronous Event Information */
8605         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT \
8606                 UINT32_C(0x2e)
8607         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_LAST \
8608                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT
8609         /* Identifiers of events. */
8610         uint16_t        event_id;
8611         /* VF Function Level Reset (FLR) */
8612         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR UINT32_C(0x30)
8613         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_LAST \
8614                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR
8615         /* Event specific data */
8616         uint32_t        event_data2;
8617         uint8_t opaque_v;
8618         /*
8619          * This value is written by the NIC such that it will be different
8620          * for each pass through the completion queue. The even passes
8621          * will write 1. The odd passes will write 0.
8622          */
8623         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V          UINT32_C(0x1)
8624         /* opaque is 7 b */
8625         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK UINT32_C(0xfe)
8626         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT 1
8627         /* 8-lsb timestamp from POR (100-msec resolution) */
8628         uint8_t timestamp_lo;
8629         /* 16-lsb timestamp from POR (100-msec resolution) */
8630         uint16_t        timestamp_hi;
8631         /* Event specific data */
8632         uint32_t        event_data1;
8633         /* VF ID */
8634         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK \
8635                 UINT32_C(0xffff)
8636         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
8637         /* Indicates the physical function this event occurred on. */
8638         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK \
8639                 UINT32_C(0xff0000)
8640         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT 16
8641 } __rte_packed;
8642
8643 /* hwrm_async_event_cmpl_vf_mac_addr_change (size:128b/16B) */
8644 struct hwrm_async_event_cmpl_vf_mac_addr_change {
8645         uint16_t        type;
8646         /*
8647          * This field indicates the exact type of the completion.
8648          * By convention, the LSB identifies the length of the
8649          * record in 16B units. Even values indicate 16B
8650          * records. Odd values indicate 32B
8651          * records.
8652          */
8653         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK \
8654                 UINT32_C(0x3f)
8655         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT             0
8656         /* HWRM Asynchronous Event Information */
8657         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT \
8658                 UINT32_C(0x2e)
8659         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_LAST \
8660                 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT
8661         /* Identifiers of events. */
8662         uint16_t        event_id;
8663         /* VF MAC Address Change */
8664         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE \
8665                 UINT32_C(0x31)
8666         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_LAST \
8667                 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE
8668         /* Event specific data */
8669         uint32_t        event_data2;
8670         uint8_t opaque_v;
8671         /*
8672          * This value is written by the NIC such that it will be different
8673          * for each pass through the completion queue. The even passes
8674          * will write 1. The odd passes will write 0.
8675          */
8676         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V \
8677                 UINT32_C(0x1)
8678         /* opaque is 7 b */
8679         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK \
8680                 UINT32_C(0xfe)
8681         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
8682         /* 8-lsb timestamp from POR (100-msec resolution) */
8683         uint8_t timestamp_lo;
8684         /* 16-lsb timestamp from POR (100-msec resolution) */
8685         uint16_t        timestamp_hi;
8686         /* Event specific data */
8687         uint32_t        event_data1;
8688         /* VF ID */
8689         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK \
8690                 UINT32_C(0xffff)
8691         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT \
8692                 0
8693 } __rte_packed;
8694
8695 /* hwrm_async_event_cmpl_pf_vf_comm_status_change (size:128b/16B) */
8696 struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
8697         uint16_t        type;
8698         /*
8699          * This field indicates the exact type of the completion.
8700          * By convention, the LSB identifies the length of the
8701          * record in 16B units. Even values indicate 16B
8702          * records. Odd values indicate 32B
8703          * records.
8704          */
8705         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK \
8706                 UINT32_C(0x3f)
8707         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT \
8708                 0
8709         /* HWRM Asynchronous Event Information */
8710         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
8711                 UINT32_C(0x2e)
8712         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_LAST \
8713                 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
8714         /* Identifiers of events. */
8715         uint16_t        event_id;
8716         /* PF-VF communication channel status change. */
8717         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
8718                 UINT32_C(0x32)
8719         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_LAST \
8720                 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE
8721         /* Event specific data */
8722         uint32_t        event_data2;
8723         uint8_t opaque_v;
8724         /*
8725          * This value is written by the NIC such that it will be different
8726          * for each pass through the completion queue. The even passes
8727          * will write 1. The odd passes will write 0.
8728          */
8729         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V \
8730                 UINT32_C(0x1)
8731         /* opaque is 7 b */
8732         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK \
8733                 UINT32_C(0xfe)
8734         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1
8735         /* 8-lsb timestamp from POR (100-msec resolution) */
8736         uint8_t timestamp_lo;
8737         /* 16-lsb timestamp from POR (100-msec resolution) */
8738         uint16_t        timestamp_hi;
8739         /* Event specific data */
8740         uint32_t        event_data1;
8741         /*
8742          * If this bit is set to 1, then it indicates that the PF-VF
8743          * communication was lost and it is established.
8744          * If this bit set to 0, then it indicates that the PF-VF
8745          * communication was established and it is lost.
8746          */
8747         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED \
8748                 UINT32_C(0x1)
8749 } __rte_packed;
8750
8751 /* hwrm_async_event_cmpl_vf_cfg_change (size:128b/16B) */
8752 struct hwrm_async_event_cmpl_vf_cfg_change {
8753         uint16_t        type;
8754         /*
8755          * This field indicates the exact type of the completion.
8756          * By convention, the LSB identifies the length of the
8757          * record in 16B units. Even values indicate 16B
8758          * records. Odd values indicate 32B
8759          * records.
8760          */
8761         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK \
8762                 UINT32_C(0x3f)
8763         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT             0
8764         /* HWRM Asynchronous Event Information */
8765         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
8766                 UINT32_C(0x2e)
8767         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_LAST \
8768                 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
8769         /* Identifiers of events. */
8770         uint16_t        event_id;
8771         /* VF Configuration Change */
8772         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE \
8773                 UINT32_C(0x33)
8774         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_LAST \
8775                 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE
8776         /* Event specific data */
8777         uint32_t        event_data2;
8778         uint8_t opaque_v;
8779         /*
8780          * This value is written by the NIC such that it will be different
8781          * for each pass through the completion queue. The even passes
8782          * will write 1. The odd passes will write 0.
8783          */
8784         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V          UINT32_C(0x1)
8785         /* opaque is 7 b */
8786         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
8787         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT 1
8788         /* 8-lsb timestamp from POR (100-msec resolution) */
8789         uint8_t timestamp_lo;
8790         /* 16-lsb timestamp from POR (100-msec resolution) */
8791         uint16_t        timestamp_hi;
8792         /*
8793          * Each flag provided in this field indicates a specific VF
8794          * configuration change. At least one of these flags shall be set to 1
8795          * when an asynchronous event completion of this type is provided
8796          * by the HWRM.
8797          */
8798         uint32_t        event_data1;
8799         /*
8800          * If this bit is set to 1, then the value of MTU
8801          * was changed on this VF.
8802          * If set to 0, then this bit should be ignored.
8803          */
8804         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE \
8805                 UINT32_C(0x1)
8806         /*
8807          * If this bit is set to 1, then the value of MRU
8808          * was changed on this VF.
8809          * If set to 0, then this bit should be ignored.
8810          */
8811         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE \
8812                 UINT32_C(0x2)
8813         /*
8814          * If this bit is set to 1, then the value of default MAC
8815          * address was changed on this VF.
8816          * If set to 0, then this bit should be ignored.
8817          */
8818         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE \
8819                 UINT32_C(0x4)
8820         /*
8821          * If this bit is set to 1, then the value of default VLAN
8822          * was changed on this VF.
8823          * If set to 0, then this bit should be ignored.
8824          */
8825         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE \
8826                 UINT32_C(0x8)
8827         /*
8828          * If this bit is set to 1, then the value of trusted VF enable
8829          * was changed on this VF.
8830          * If set to 0, then this bit should be ignored.
8831          */
8832         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE \
8833                 UINT32_C(0x10)
8834 } __rte_packed;
8835
8836 /* hwrm_async_event_cmpl_llfc_pfc_change (size:128b/16B) */
8837 struct hwrm_async_event_cmpl_llfc_pfc_change {
8838         uint16_t        type;
8839         /*
8840          * This field indicates the exact type of the completion.
8841          * By convention, the LSB identifies the length of the
8842          * record in 16B units. Even values indicate 16B
8843          * records. Odd values indicate 32B
8844          * records.
8845          */
8846         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK \
8847                 UINT32_C(0x3f)
8848         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT             0
8849         /* HWRM Asynchronous Event Information */
8850         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT \
8851                 UINT32_C(0x2e)
8852         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_LAST \
8853                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT
8854         /* unused1 is 10 b */
8855         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_MASK \
8856                 UINT32_C(0xffc0)
8857         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_SFT          6
8858         /* Identifiers of events. */
8859         uint16_t        event_id;
8860         /* LLFC/PFC Configuration Change */
8861         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE \
8862                 UINT32_C(0x34)
8863         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LAST \
8864                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE
8865         /* Event specific data */
8866         uint32_t        event_data2;
8867         uint8_t opaque_v;
8868         /*
8869          * This value is written by the NIC such that it will be different
8870          * for each pass through the completion queue. The even passes
8871          * will write 1. The odd passes will write 0.
8872          */
8873         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V          UINT32_C(0x1)
8874         /* opaque is 7 b */
8875         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK \
8876                 UINT32_C(0xfe)
8877         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT 1
8878         /* 8-lsb timestamp from POR (100-msec resolution) */
8879         uint8_t timestamp_lo;
8880         /* 16-lsb timestamp from POR (100-msec resolution) */
8881         uint16_t        timestamp_hi;
8882         /* Event specific data */
8883         uint32_t        event_data1;
8884         /* Indicates llfc pfc status change */
8885         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK \
8886                 UINT32_C(0x3)
8887         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT \
8888                 0
8889         /*
8890          * If this field set to 1, then it indicates that llfc is
8891          * enabled.
8892          */
8893         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC \
8894                 UINT32_C(0x1)
8895         /*
8896          * If this field is set to 2, then it indicates that pfc
8897          * is enabled.
8898          */
8899         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC \
8900                 UINT32_C(0x2)
8901         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LAST \
8902                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC
8903         /* Indicates the physical port this llfc pfc change occur */
8904         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK \
8905                 UINT32_C(0x1c)
8906         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT \
8907                 2
8908         /* PORT ID */
8909         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK \
8910                 UINT32_C(0x1fffe0)
8911         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT \
8912                 5
8913 } __rte_packed;
8914
8915 /* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */
8916 struct hwrm_async_event_cmpl_default_vnic_change {
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 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_MASK \
8926                 UINT32_C(0x3f)
8927         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_SFT \
8928                 0
8929         /* HWRM Asynchronous Event Information */
8930         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT \
8931                 UINT32_C(0x2e)
8932         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_LAST \
8933                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT
8934         /* unused1 is 10 b */
8935         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_MASK \
8936                 UINT32_C(0xffc0)
8937         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_SFT \
8938                 6
8939         /* Identifiers of events. */
8940         uint16_t        event_id;
8941         /* Notification of a default vnic allocation or free */
8942         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION \
8943                 UINT32_C(0x35)
8944         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_LAST \
8945                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION
8946         /* Event specific data */
8947         uint32_t        event_data2;
8948         uint8_t opaque_v;
8949         /*
8950          * This value is written by the NIC such that it will be different
8951          * for each pass through the completion queue. The even passes
8952          * will write 1. The odd passes will write 0.
8953          */
8954         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_V \
8955                 UINT32_C(0x1)
8956         /* opaque is 7 b */
8957         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_MASK \
8958                 UINT32_C(0xfe)
8959         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_SFT 1
8960         /* 8-lsb timestamp from POR (100-msec resolution) */
8961         uint8_t timestamp_lo;
8962         /* 16-lsb timestamp from POR (100-msec resolution) */
8963         uint16_t        timestamp_hi;
8964         /* Event specific data */
8965         uint32_t        event_data1;
8966         /* Indicates default vnic configuration change */
8967         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_MASK \
8968                 UINT32_C(0x3)
8969         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_SFT \
8970                 0
8971         /*
8972          * If this field is set to 1, then it indicates that
8973          * a default VNIC has been allocate.
8974          */
8975         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_ALLOC \
8976                 UINT32_C(0x1)
8977         /*
8978          * If this field is set to 2, then it indicates that
8979          * a default VNIC has been freed.
8980          */
8981         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE \
8982                 UINT32_C(0x2)
8983         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_LAST \
8984                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE
8985         /* Indicates the physical function this event occurred on. */
8986         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_MASK \
8987                 UINT32_C(0x3fc)
8988         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_SFT \
8989                 2
8990         /* Indicates the virtual function this event occurred on */
8991         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_MASK \
8992                 UINT32_C(0x3fffc00)
8993         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT \
8994                 10
8995 } __rte_packed;
8996
8997 /* hwrm_async_event_cmpl_hw_flow_aged (size:128b/16B) */
8998 struct hwrm_async_event_cmpl_hw_flow_aged {
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_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_MASK \
9008                 UINT32_C(0x3f)
9009         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_SFT             0
9010         /* HWRM Asynchronous Event Information */
9011         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT \
9012                 UINT32_C(0x2e)
9013         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_LAST \
9014                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT
9015         /* Identifiers of events. */
9016         uint16_t        event_id;
9017         /* Notification of a hw flow aged */
9018         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED \
9019                 UINT32_C(0x36)
9020         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_LAST \
9021                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED
9022         /* Event specific data */
9023         uint32_t        event_data2;
9024         uint8_t opaque_v;
9025         /*
9026          * This value is written by the NIC such that it will be different
9027          * for each pass through the completion queue. The even passes
9028          * will write 1. The odd passes will write 0.
9029          */
9030         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_V          UINT32_C(0x1)
9031         /* opaque is 7 b */
9032         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_MASK UINT32_C(0xfe)
9033         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_SFT 1
9034         /* 8-lsb timestamp from POR (100-msec resolution) */
9035         uint8_t timestamp_lo;
9036         /* 16-lsb timestamp from POR (100-msec resolution) */
9037         uint16_t        timestamp_hi;
9038         /* Event specific data */
9039         uint32_t        event_data1;
9040         /* Indicates flow ID this event occurred on. */
9041         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_MASK \
9042                 UINT32_C(0x7fffffff)
9043         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_SFT \
9044                 0
9045         /* Indicates flow direction this event occurred on. */
9046         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION \
9047                 UINT32_C(0x80000000)
9048         /*
9049          * If this bit set to 0, then it indicates that the aged
9050          * event was rx flow.
9051          */
9052         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_RX \
9053                 (UINT32_C(0x0) << 31)
9054         /*
9055          * If this bit is set to 1, then it indicates that the aged
9056          * event was tx flow.
9057          */
9058         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX \
9059                 (UINT32_C(0x1) << 31)
9060         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_LAST \
9061                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX
9062 } __rte_packed;
9063
9064 /* hwrm_async_event_cmpl_eem_cache_flush_req (size:128b/16B) */
9065 struct hwrm_async_event_cmpl_eem_cache_flush_req {
9066         uint16_t        type;
9067         /*
9068          * This field indicates the exact type of the completion.
9069          * By convention, the LSB identifies the length of the
9070          * record in 16B units. Even values indicate 16B
9071          * records. Odd values indicate 32B
9072          * records.
9073          */
9074         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_MASK \
9075                 UINT32_C(0x3f)
9076         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_SFT \
9077                 0
9078         /* HWRM Asynchronous Event Information */
9079         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT \
9080                 UINT32_C(0x2e)
9081         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_LAST \
9082                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT
9083         /* Identifiers of events. */
9084         uint16_t        event_id;
9085         /* Notification of a eem_cache_flush request */
9086         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ \
9087                 UINT32_C(0x38)
9088         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_LAST \
9089                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ
9090         /* Event specific data */
9091         uint32_t        event_data2;
9092         uint8_t opaque_v;
9093         /*
9094          * This value is written by the NIC such that it will be different
9095          * for each pass through the completion queue. The even passes
9096          * will write 1. The odd passes will write 0.
9097          */
9098         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_V \
9099                 UINT32_C(0x1)
9100         /* opaque is 7 b */
9101         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_MASK \
9102                 UINT32_C(0xfe)
9103         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_SFT 1
9104         /* 8-lsb timestamp from POR (100-msec resolution) */
9105         uint8_t timestamp_lo;
9106         /* 16-lsb timestamp from POR (100-msec resolution) */
9107         uint16_t        timestamp_hi;
9108         /* Event specific data */
9109         uint32_t        event_data1;
9110 } __rte_packed;
9111
9112 /* hwrm_async_event_cmpl_eem_cache_flush_done (size:128b/16B) */
9113 struct hwrm_async_event_cmpl_eem_cache_flush_done {
9114         uint16_t        type;
9115         /*
9116          * This field indicates the exact type of the completion.
9117          * By convention, the LSB identifies the length of the
9118          * record in 16B units. Even values indicate 16B
9119          * records. Odd values indicate 32B
9120          * records.
9121          */
9122         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_MASK \
9123                 UINT32_C(0x3f)
9124         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_SFT \
9125                 0
9126         /* HWRM Asynchronous Event Information */
9127         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT \
9128                 UINT32_C(0x2e)
9129         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_LAST \
9130                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT
9131         /* Identifiers of events. */
9132         uint16_t        event_id;
9133         /*
9134          * Notification of a host eem_cache_flush has completed. This event
9135          * is generated by the host driver.
9136          */
9137         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE \
9138                 UINT32_C(0x39)
9139         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_LAST \
9140                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE
9141         /* Event specific data */
9142         uint32_t        event_data2;
9143         uint8_t opaque_v;
9144         /*
9145          * This value is written by the NIC such that it will be different
9146          * for each pass through the completion queue. The even passes
9147          * will write 1. The odd passes will write 0.
9148          */
9149         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_V \
9150                 UINT32_C(0x1)
9151         /* opaque is 7 b */
9152         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_MASK \
9153                 UINT32_C(0xfe)
9154         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_SFT 1
9155         /* 8-lsb timestamp from POR (100-msec resolution) */
9156         uint8_t timestamp_lo;
9157         /* 16-lsb timestamp from POR (100-msec resolution) */
9158         uint16_t        timestamp_hi;
9159         /* Event specific data */
9160         uint32_t        event_data1;
9161         /* Indicates function ID that this event occurred on. */
9162         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_MASK \
9163                 UINT32_C(0xffff)
9164         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_SFT \
9165                 0
9166 } __rte_packed;
9167
9168 /* hwrm_async_event_cmpl_tcp_flag_action_change (size:128b/16B) */
9169 struct hwrm_async_event_cmpl_tcp_flag_action_change {
9170         uint16_t        type;
9171         /*
9172          * This field indicates the exact type of the completion.
9173          * By convention, the LSB identifies the length of the
9174          * record in 16B units. Even values indicate 16B
9175          * records. Odd values indicate 32B
9176          * records.
9177          */
9178         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_MASK \
9179                 UINT32_C(0x3f)
9180         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_SFT \
9181                 0
9182         /* HWRM Asynchronous Event Information */
9183         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT \
9184                 UINT32_C(0x2e)
9185         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_LAST \
9186                 HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT
9187         /* Identifiers of events. */
9188         uint16_t        event_id;
9189         /* Notification of tcp flag action change */
9190         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE \
9191                 UINT32_C(0x3a)
9192         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_LAST \
9193                 HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE
9194         /* Event specific data */
9195         uint32_t        event_data2;
9196         uint8_t opaque_v;
9197         /*
9198          * This value is written by the NIC such that it will be different
9199          * for each pass through the completion queue. The even passes
9200          * will write 1. The odd passes will write 0.
9201          */
9202         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_V \
9203                 UINT32_C(0x1)
9204         /* opaque is 7 b */
9205         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_MASK \
9206                 UINT32_C(0xfe)
9207         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_SFT 1
9208         /* 8-lsb timestamp from POR (100-msec resolution) */
9209         uint8_t timestamp_lo;
9210         /* 16-lsb timestamp from POR (100-msec resolution) */
9211         uint16_t        timestamp_hi;
9212         /* Event specific data */
9213         uint32_t        event_data1;
9214 } __rte_packed;
9215
9216 /* hwrm_async_event_cmpl_eem_flow_active (size:128b/16B) */
9217 struct hwrm_async_event_cmpl_eem_flow_active {
9218         uint16_t        type;
9219         /*
9220          * This field indicates the exact type of the completion.
9221          * By convention, the LSB identifies the length of the
9222          * record in 16B units. Even values indicate 16B
9223          * records. Odd values indicate 32B
9224          * records.
9225          */
9226         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_MASK \
9227                 UINT32_C(0x3f)
9228         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_SFT             0
9229         /* HWRM Asynchronous Event Information */
9230         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT \
9231                 UINT32_C(0x2e)
9232         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_LAST \
9233                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT
9234         /* Identifiers of events. */
9235         uint16_t        event_id;
9236         /* Notification of an active eem flow */
9237         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE \
9238                 UINT32_C(0x3b)
9239         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_LAST \
9240                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE
9241         /* Event specific data */
9242         uint32_t        event_data2;
9243         /* Indicates the 2nd global id this event occurred on. */
9244         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_MASK \
9245                 UINT32_C(0x3fffffff)
9246         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_SFT \
9247                 0
9248         /*
9249          * Indicates flow direction of the flow identified by
9250          * the global_id_2.
9251          */
9252         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION \
9253                 UINT32_C(0x40000000)
9254         /* If this bit is set to 0, then it indicates that this rx flow. */
9255         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_RX \
9256                 (UINT32_C(0x0) << 30)
9257         /* If this bit is set to 1, then it indicates that this tx flow. */
9258         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX \
9259                 (UINT32_C(0x1) << 30)
9260         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_LAST \
9261                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX
9262         uint8_t opaque_v;
9263         /*
9264          * This value is written by the NIC such that it will be different
9265          * for each pass through the completion queue. The even passes
9266          * will write 1. The odd passes will write 0.
9267          */
9268         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_V          UINT32_C(0x1)
9269         /* opaque is 7 b */
9270         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_MASK \
9271                 UINT32_C(0xfe)
9272         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_SFT 1
9273         /* 8-lsb timestamp from POR (100-msec resolution) */
9274         uint8_t timestamp_lo;
9275         /* 16-lsb timestamp from POR (100-msec resolution) */
9276         uint16_t        timestamp_hi;
9277         /* Event specific data */
9278         uint32_t        event_data1;
9279         /* Indicates the 1st global id this event occurred on. */
9280         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_MASK \
9281                 UINT32_C(0x3fffffff)
9282         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_SFT \
9283                 0
9284         /*
9285          * Indicates flow direction of the flow identified by the
9286          * global_id_1.
9287          */
9288         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION \
9289                 UINT32_C(0x40000000)
9290         /* If this bit is set to 0, then it indicates that this is rx flow. */
9291         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_RX \
9292                 (UINT32_C(0x0) << 30)
9293         /* If this bit is set to 1, then it indicates that this is tx flow. */
9294         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX \
9295                 (UINT32_C(0x1) << 30)
9296         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_LAST \
9297                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX
9298         /*
9299          * Indicates EEM flow aging mode this event occurred on. If
9300          * this bit is set to 0, the event_data1 is the EEM global
9301          * ID. If this bit is set to 1, the event_data1 is the number
9302          * of global ID in the context memory.
9303          */
9304         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE \
9305                 UINT32_C(0x80000000)
9306         /* EEM flow aging mode 0. */
9307         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_0 \
9308                 (UINT32_C(0x0) << 31)
9309         /* EEM flow aging mode 1. */
9310         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1 \
9311                 (UINT32_C(0x1) << 31)
9312         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_LAST \
9313                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1
9314 } __rte_packed;
9315
9316 /* hwrm_async_event_cmpl_eem_cfg_change (size:128b/16B) */
9317 struct hwrm_async_event_cmpl_eem_cfg_change {
9318         uint16_t        type;
9319         /*
9320          * This field indicates the exact type of the completion.
9321          * By convention, the LSB identifies the length of the
9322          * record in 16B units. Even values indicate 16B
9323          * records. Odd values indicate 32B
9324          * records.
9325          */
9326         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_MASK \
9327                 UINT32_C(0x3f)
9328         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_SFT             0
9329         /* HWRM Asynchronous Event Information */
9330         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
9331                 UINT32_C(0x2e)
9332         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_LAST \
9333                 HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
9334         /* Identifiers of events. */
9335         uint16_t        event_id;
9336         /* Notification of EEM configuration change */
9337         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE \
9338                 UINT32_C(0x3c)
9339         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_LAST \
9340                 HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE
9341         /* Event specific data */
9342         uint32_t        event_data2;
9343         uint8_t opaque_v;
9344         /*
9345          * This value is written by the NIC such that it will be different
9346          * for each pass through the completion queue. The even passes
9347          * will write 1. The odd passes will write 0.
9348          */
9349         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_V          UINT32_C(0x1)
9350         /* opaque is 7 b */
9351         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
9352         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_SFT 1
9353         /* 8-lsb timestamp from POR (100-msec resolution) */
9354         uint8_t timestamp_lo;
9355         /* 16-lsb timestamp from POR (100-msec resolution) */
9356         uint16_t        timestamp_hi;
9357         /* Event specific data */
9358         uint32_t        event_data1;
9359         /*
9360          * Value of 1 to indicate EEM TX configuration is enabled. Value of
9361          * 0 to indicate the EEM TX configuration is disabled.
9362          */
9363         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_TX_ENABLE \
9364                 UINT32_C(0x1)
9365         /*
9366          * Value of 1 to indicate EEM RX configuration is enabled. Value of 0
9367          * to indicate the EEM RX configuration is disabled.
9368          */
9369         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_RX_ENABLE \
9370                 UINT32_C(0x2)
9371 } __rte_packed;
9372
9373 /* hwrm_async_event_cmpl_quiesce_done (size:128b/16B) */
9374 struct hwrm_async_event_cmpl_quiesce_done {
9375         uint16_t        type;
9376         /*
9377          * This field indicates the exact type of the completion.
9378          * By convention, the LSB identifies the length of the
9379          * record in 16B units. Even values indicate 16B
9380          * records. Odd values indicate 32B
9381          * records.
9382          */
9383         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_MASK \
9384                 UINT32_C(0x3f)
9385         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_SFT             0
9386         /* HWRM Asynchronous Event Information */
9387         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT \
9388                 UINT32_C(0x2e)
9389         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_LAST \
9390                 HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_TYPE_HWRM_ASYNC_EVENT
9391         /* Identifiers of events. */
9392         uint16_t        event_id;
9393         /* An event signifying completion of HWRM_FW_STATE_QUIESCE */
9394         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE \
9395                 UINT32_C(0x3f)
9396         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_LAST \
9397                 HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_ID_QUIESCE_DONE
9398         /* Event specific data */
9399         uint32_t        event_data2;
9400         /* Status of HWRM_FW_STATE_QUIESCE completion */
9401         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_MASK \
9402                 UINT32_C(0xff)
9403         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SFT \
9404                 0
9405         /*
9406          * The quiesce operation started by HWRM_FW_STATE_QUIESCE
9407          * completed successfully.
9408          */
9409         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_SUCCESS \
9410                 UINT32_C(0x0)
9411         /*
9412          * The quiesce operation started by HWRM_FW_STATE_QUIESCE timed
9413          * out.
9414          */
9415         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_TIMEOUT \
9416                 UINT32_C(0x1)
9417         /*
9418          * The quiesce operation started by HWRM_FW_STATE_QUIESCE
9419          * encountered an error.
9420          */
9421         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR \
9422                 UINT32_C(0x2)
9423         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_LAST \
9424                 HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_QUIESCE_STATUS_ERROR
9425         /* opaque is 8 b */
9426         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_MASK \
9427                 UINT32_C(0xff00)
9428         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_OPAQUE_SFT \
9429                 8
9430         /*
9431          * Additional information about internal hardware state related to
9432          * idle/quiesce state.  QUIESCE may succeed per quiesce_status
9433          * regardless of idle_state_flags.  If QUIESCE fails, the host may
9434          * inspect idle_state_flags to determine whether a retry is warranted.
9435          */
9436         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_MASK \
9437                 UINT32_C(0xff0000)
9438         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_SFT \
9439                 16
9440         /*
9441          * Failure to quiesce is caused by host not updating the NQ consumer
9442          * index.
9443          */
9444         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_INCOMPLETE_NQ \
9445                 UINT32_C(0x10000)
9446         /* Flag 1 indicating partial non-idle state. */
9447         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_1 \
9448                 UINT32_C(0x20000)
9449         /* Flag 2 indicating partial non-idle state. */
9450         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_2 \
9451                 UINT32_C(0x40000)
9452         /* Flag 3 indicating partial non-idle state. */
9453         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA2_IDLE_STATE_FLAGS_IDLE_STATUS_3 \
9454                 UINT32_C(0x80000)
9455         uint8_t opaque_v;
9456         /*
9457          * This value is written by the NIC such that it will be different
9458          * for each pass through the completion queue. The even passes
9459          * will write 1. The odd passes will write 0.
9460          */
9461         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_V          UINT32_C(0x1)
9462         /* opaque is 7 b */
9463         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_MASK UINT32_C(0xfe)
9464         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_OPAQUE_SFT 1
9465         /* 8-lsb timestamp from POR (100-msec resolution) */
9466         uint8_t timestamp_lo;
9467         /* 16-lsb timestamp from POR (100-msec resolution) */
9468         uint16_t        timestamp_hi;
9469         /* Event specific data */
9470         uint32_t        event_data1;
9471         /* Time stamp for error event */
9472         #define HWRM_ASYNC_EVENT_CMPL_QUIESCE_DONE_EVENT_DATA1_TIMESTAMP \
9473                 UINT32_C(0x1)
9474 } __rte_packed;
9475
9476 /* hwrm_async_event_cmpl_deferred_response (size:128b/16B) */
9477 struct hwrm_async_event_cmpl_deferred_response {
9478         uint16_t        type;
9479         /*
9480          * This field indicates the exact type of the completion.
9481          * By convention, the LSB identifies the length of the
9482          * record in 16B units. Even values indicate 16B
9483          * records. Odd values indicate 32B
9484          * records.
9485          */
9486         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_MASK \
9487                 UINT32_C(0x3f)
9488         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_SFT             0
9489         /* HWRM Asynchronous Event Information */
9490         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT \
9491                 UINT32_C(0x2e)
9492         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_LAST \
9493                 HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_TYPE_HWRM_ASYNC_EVENT
9494         /* Identifiers of events. */
9495         uint16_t        event_id;
9496         /*
9497          * An event signifying a HWRM command is in progress and its
9498          * response will be deferred
9499          */
9500         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE \
9501                 UINT32_C(0x40)
9502         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_LAST \
9503                 HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_ID_DEFERRED_RESPONSE
9504         /* Event specific data */
9505         uint32_t        event_data2;
9506         /*
9507          * The PF's mailbox is clear to issue another command.
9508          * A command with this seq_id is still in progress
9509          * and will return a regular HWRM completion when done.
9510          * 'event_data1' field, if non-zero, contains the estimated
9511          * execution time for the command.
9512          */
9513         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_MASK \
9514                 UINT32_C(0xffff)
9515         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_EVENT_DATA2_SEQ_ID_SFT \
9516                 0
9517         uint8_t opaque_v;
9518         /*
9519          * This value is written by the NIC such that it will be different
9520          * for each pass through the completion queue. The even passes
9521          * will write 1. The odd passes will write 0.
9522          */
9523         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_V \
9524                 UINT32_C(0x1)
9525         /* opaque is 7 b */
9526         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_MASK \
9527                 UINT32_C(0xfe)
9528         #define HWRM_ASYNC_EVENT_CMPL_DEFERRED_RESPONSE_OPAQUE_SFT 1
9529         /* 8-lsb timestamp from POR (100-msec resolution) */
9530         uint8_t timestamp_lo;
9531         /* 16-lsb timestamp from POR (100-msec resolution) */
9532         uint16_t        timestamp_hi;
9533         /* Estimated remaining time of command execution in ms (if not zero) */
9534         uint32_t        event_data1;
9535 } __rte_packed;
9536
9537 /* hwrm_async_event_cmpl_pfc_watchdog_cfg_change (size:128b/16B) */
9538 struct hwrm_async_event_cmpl_pfc_watchdog_cfg_change {
9539         uint16_t        type;
9540         /*
9541          * This field indicates the exact type of the completion.
9542          * By convention, the LSB identifies the length of the
9543          * record in 16B units. Even values indicate 16B
9544          * records. Odd values indicate 32B
9545          * records.
9546          */
9547         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_MASK \
9548                 UINT32_C(0x3f)
9549         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_SFT \
9550                 0
9551         /* HWRM Asynchronous Event Information */
9552         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
9553                 UINT32_C(0x2e)
9554         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_LAST \
9555                 HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
9556         /* Identifiers of events. */
9557         uint16_t        event_id;
9558         /* PFC watchdog configuration change for given port/cos */
9559         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE \
9560                 UINT32_C(0x41)
9561         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_LAST \
9562                 HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE
9563         /* Event specific data */
9564         uint32_t        event_data2;
9565         uint8_t opaque_v;
9566         /*
9567          * This value is written by the NIC such that it will be different
9568          * for each pass through the completion queue. The even passes
9569          * will write 1. The odd passes will write 0.
9570          */
9571         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_V \
9572                 UINT32_C(0x1)
9573         /* opaque is 7 b */
9574         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_MASK \
9575                 UINT32_C(0xfe)
9576         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_OPAQUE_SFT 1
9577         /* 8-lsb timestamp from POR (100-msec resolution) */
9578         uint8_t timestamp_lo;
9579         /* 16-lsb timestamp from POR (100-msec resolution) */
9580         uint16_t        timestamp_hi;
9581         /* Event specific data */
9582         uint32_t        event_data1;
9583         /*
9584          * 1 in bit position X indicates PFC watchdog should
9585          * be on for COSX
9586          */
9587         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_MASK \
9588                 UINT32_C(0xff)
9589         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_SFT \
9590                 0
9591         /* 1 means PFC WD for COS0 is on, 0 - off. */
9592         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS0 \
9593                 UINT32_C(0x1)
9594         /* 1 means PFC WD for COS1 is on, 0 - off. */
9595         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS1 \
9596                 UINT32_C(0x2)
9597         /* 1 means PFC WD for COS2 is on, 0 - off. */
9598         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS2 \
9599                 UINT32_C(0x4)
9600         /* 1 means PFC WD for COS3 is on, 0 - off. */
9601         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS3 \
9602                 UINT32_C(0x8)
9603         /* 1 means PFC WD for COS4 is on, 0 - off. */
9604         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS4 \
9605                 UINT32_C(0x10)
9606         /* 1 means PFC WD for COS5 is on, 0 - off. */
9607         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS5 \
9608                 UINT32_C(0x20)
9609         /* 1 means PFC WD for COS6 is on, 0 - off. */
9610         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS6 \
9611                 UINT32_C(0x40)
9612         /* 1 means PFC WD for COS7 is on, 0 - off. */
9613         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PFC_WD_COS_PFC_WD_COS7 \
9614                 UINT32_C(0x80)
9615         /* PORT ID */
9616         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
9617                 UINT32_C(0xffff00)
9618         #define HWRM_ASYNC_EVENT_CMPL_PFC_WATCHDOG_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
9619                 8
9620 } __rte_packed;
9621
9622 /* hwrm_async_event_cmpl_echo_request (size:128b/16B) */
9623 struct hwrm_async_event_cmpl_echo_request {
9624         uint16_t        type;
9625         /*
9626          * This field indicates the exact type of the completion.
9627          * By convention, the LSB identifies the length of the
9628          * record in 16B units. Even values indicate 16B
9629          * records. Odd values indicate 32B
9630          * records.
9631          */
9632         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_MASK \
9633                 UINT32_C(0x3f)
9634         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_SFT             0
9635         /* HWRM Asynchronous Event Information */
9636         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_HWRM_ASYNC_EVENT \
9637                 UINT32_C(0x2e)
9638         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_LAST \
9639                 HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_TYPE_HWRM_ASYNC_EVENT
9640         /* Identifiers of events. */
9641         uint16_t        event_id;
9642         /*
9643          * An echo request from the firmware. An echo response is expected by
9644          * the firmware.
9645          */
9646         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_ECHO_REQUEST \
9647                 UINT32_C(0x42)
9648         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_LAST \
9649                 HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_EVENT_ID_ECHO_REQUEST
9650         /* Event specific data that should be provided in the echo response */
9651         uint32_t        event_data2;
9652         uint8_t opaque_v;
9653         /*
9654          * This value is written by the NIC such that it will be different
9655          * for each pass through the completion queue. The even passes
9656          * will write 1. The odd passes will write 0.
9657          */
9658         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_V          UINT32_C(0x1)
9659         /* opaque is 7 b */
9660         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_OPAQUE_MASK UINT32_C(0xfe)
9661         #define HWRM_ASYNC_EVENT_CMPL_ECHO_REQUEST_OPAQUE_SFT 1
9662         /* 8-lsb timestamp from POR (100-msec resolution) */
9663         uint8_t timestamp_lo;
9664         /* 16-lsb timestamp from POR (100-msec resolution) */
9665         uint16_t        timestamp_hi;
9666         /* Event specific data that should be provided in the echo response */
9667         uint32_t        event_data1;
9668 } __rte_packed;
9669
9670 /* hwrm_async_event_cmpl_fw_trace_msg (size:128b/16B) */
9671 struct hwrm_async_event_cmpl_fw_trace_msg {
9672         uint16_t        type;
9673         /*
9674          * This field indicates the exact type of the completion.
9675          * By convention, the LSB identifies the length of the
9676          * record in 16B units. Even values indicate 16B
9677          * records. Odd values indicate 32B
9678          * records.
9679          */
9680         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_MASK \
9681                 UINT32_C(0x3f)
9682         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_SFT             0
9683         /* HWRM Asynchronous Event Information */
9684         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT \
9685                 UINT32_C(0x2e)
9686         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_LAST \
9687                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT
9688         /* Identifiers of events. */
9689         uint16_t        event_id;
9690         /* Firmware trace log message */
9691         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG \
9692                 UINT32_C(0xfe)
9693         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_LAST \
9694                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG
9695         /* Trace byte 0 to 3 */
9696         uint32_t        event_data2;
9697         /* Trace byte0 */
9698         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_MASK \
9699                 UINT32_C(0xff)
9700         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_SFT 0
9701         /* Trace byte1 */
9702         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_MASK \
9703                 UINT32_C(0xff00)
9704         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_SFT 8
9705         /* Trace byte2 */
9706         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_MASK \
9707                 UINT32_C(0xff0000)
9708         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_SFT 16
9709         /* Trace byte3 */
9710         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_MASK \
9711                 UINT32_C(0xff000000)
9712         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_SFT 24
9713         uint8_t opaque_v;
9714         /*
9715          * This value is written by the NIC such that it will be different
9716          * for each pass through the completion queue. The even passes
9717          * will write 1. The odd passes will write 0.
9718          */
9719         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_V          UINT32_C(0x1)
9720         /* opaque is 7 b */
9721         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_MASK UINT32_C(0xfe)
9722         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_SFT 1
9723         /* Trace flags */
9724         uint8_t timestamp_lo;
9725         /* Indicates if the string is partial or complete. */
9726         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING \
9727                 UINT32_C(0x1)
9728         /* Complete string */
9729         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_COMPLETE \
9730                 UINT32_C(0x0)
9731         /* Partial string */
9732         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL \
9733                 UINT32_C(0x1)
9734         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_LAST \
9735                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL
9736         /* Indicates the firmware that sent the trace message. */
9737         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE \
9738                 UINT32_C(0x2)
9739         /* Primary firmware */
9740         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_PRIMARY \
9741                 (UINT32_C(0x0) << 1)
9742         /* Secondary firmware */
9743         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY \
9744                 (UINT32_C(0x1) << 1)
9745         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_LAST \
9746                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY
9747         /* Trace byte 4 to 5 */
9748         uint16_t        timestamp_hi;
9749         /* Trace byte4 */
9750         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_MASK \
9751                 UINT32_C(0xff)
9752         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_SFT 0
9753         /* Trace byte5 */
9754         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_MASK \
9755                 UINT32_C(0xff00)
9756         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_SFT 8
9757         /* Trace byte 6 to 9 */
9758         uint32_t        event_data1;
9759         /* Trace byte6 */
9760         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_MASK \
9761                 UINT32_C(0xff)
9762         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_SFT 0
9763         /* Trace byte7 */
9764         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_MASK \
9765                 UINT32_C(0xff00)
9766         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_SFT 8
9767         /* Trace byte8 */
9768         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_MASK \
9769                 UINT32_C(0xff0000)
9770         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_SFT 16
9771         /* Trace byte9 */
9772         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_MASK \
9773                 UINT32_C(0xff000000)
9774         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_SFT 24
9775 } __rte_packed;
9776
9777 /* hwrm_async_event_cmpl_hwrm_error (size:128b/16B) */
9778 struct hwrm_async_event_cmpl_hwrm_error {
9779         uint16_t        type;
9780         /*
9781          * This field indicates the exact type of the completion.
9782          * By convention, the LSB identifies the length of the
9783          * record in 16B units. Even values indicate 16B
9784          * records. Odd values indicate 32B
9785          * records.
9786          */
9787         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK \
9788                 UINT32_C(0x3f)
9789         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT             0
9790         /* HWRM Asynchronous Event Information */
9791         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT \
9792                 UINT32_C(0x2e)
9793         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_LAST \
9794                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT
9795         /* Identifiers of events. */
9796         uint16_t        event_id;
9797         /* HWRM Error */
9798         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR \
9799                 UINT32_C(0xff)
9800         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_LAST \
9801                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR
9802         /* Event specific data */
9803         uint32_t        event_data2;
9804         /* Severity of HWRM Error */
9805         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK \
9806                 UINT32_C(0xff)
9807         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT     0
9808         /* Warning */
9809         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING \
9810                 UINT32_C(0x0)
9811         /* Non-fatal Error */
9812         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL \
9813                 UINT32_C(0x1)
9814         /* Fatal Error */
9815         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL \
9816                 UINT32_C(0x2)
9817         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST \
9818                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL
9819         uint8_t opaque_v;
9820         /*
9821          * This value is written by the NIC such that it will be different
9822          * for each pass through the completion queue. The even passes
9823          * will write 1. The odd passes will write 0.
9824          */
9825         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V          UINT32_C(0x1)
9826         /* opaque is 7 b */
9827         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK UINT32_C(0xfe)
9828         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_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         /* Time stamp for error event */
9836         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP \
9837                 UINT32_C(0x1)
9838 } __rte_packed;
9839
9840 /* metadata_base_msg (size:64b/8B) */
9841 struct metadata_base_msg {
9842         uint16_t        md_type_link;
9843         /* This field classifies the data present in the meta-data. */
9844         #define METADATA_BASE_MSG_MD_TYPE_MASK      UINT32_C(0x1f)
9845         #define METADATA_BASE_MSG_MD_TYPE_SFT       0
9846         /* Meta data fields are not valid */
9847         #define METADATA_BASE_MSG_MD_TYPE_NONE        UINT32_C(0x0)
9848         /*
9849          * This setting is used when packets are coming in-order. Depending on
9850          * the state of the receive context, the meta-data will carry different
9851          * information.
9852          */
9853         #define METADATA_BASE_MSG_MD_TYPE_TLS_INSYNC  UINT32_C(0x1)
9854         /*
9855          * With this setting HW passes the TCP sequence number of the TLS
9856          * record that it is requesting a resync on in the meta data.
9857          */
9858         #define METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC  UINT32_C(0x2)
9859         #define METADATA_BASE_MSG_MD_TYPE_LAST \
9860                 METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC
9861         /*
9862          * This field indicates where the next metadata block starts. It is
9863          * counted in 16B units. A value of zero indicates that there is no
9864          * metadata.
9865          */
9866         #define METADATA_BASE_MSG_LINK_MASK         UINT32_C(0x1e0)
9867         #define METADATA_BASE_MSG_LINK_SFT          5
9868         uint16_t        unused0;
9869         uint32_t        unused1;
9870 } __rte_packed;
9871
9872 /* tls_metadata_base_msg (size:64b/8B) */
9873 struct tls_metadata_base_msg {
9874         uint32_t        md_type_link_flags_kid_lo;
9875         /* This field classifies the data present in the meta-data. */
9876         #define TLS_METADATA_BASE_MSG_MD_TYPE_MASK \
9877                 UINT32_C(0x1f)
9878         #define TLS_METADATA_BASE_MSG_MD_TYPE_SFT                  0
9879         /*
9880          * This setting is used when packets are coming in-order. Depending on
9881          * the state of the receive context, the meta-data will carry different
9882          * information.
9883          */
9884         #define TLS_METADATA_BASE_MSG_MD_TYPE_TLS_INSYNC \
9885                 UINT32_C(0x1)
9886         /*
9887          * With this setting HW passes the TCP sequence number of the TLS
9888          * record that it is requesting a resync on in the meta data.
9889          */
9890         #define TLS_METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC \
9891                 UINT32_C(0x2)
9892         #define TLS_METADATA_BASE_MSG_MD_TYPE_LAST \
9893                 TLS_METADATA_BASE_MSG_MD_TYPE_TLS_RESYNC
9894         /*
9895          * This field indicates where the next metadata block starts. It is
9896          * counted in 16B units. A value of zero indicates that there is no
9897          * metadata.
9898          */
9899         #define TLS_METADATA_BASE_MSG_LINK_MASK \
9900                 UINT32_C(0x1e0)
9901         #define TLS_METADATA_BASE_MSG_LINK_SFT                     5
9902         /* These are flags present in the metadata. */
9903         #define TLS_METADATA_BASE_MSG_FLAGS_MASK \
9904                 UINT32_C(0x1fffe00)
9905         #define TLS_METADATA_BASE_MSG_FLAGS_SFT                    9
9906         /*
9907          * A value of 1 implies that the packet was decrypted by HW. Otherwise
9908          * the packet is passed on as it came in on the wire.
9909          */
9910         #define TLS_METADATA_BASE_MSG_FLAGS_DECRYPTED \
9911                 UINT32_C(0x200)
9912         /*
9913          * This field indicates the state of the ghash field passed in the
9914          * meta-data.
9915          */
9916         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_MASK \
9917                 UINT32_C(0xc00)
9918         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_SFT               10
9919         /*
9920          * This enumeration states that the ghash is not valid in the
9921          * meta-data.
9922          */
9923         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_NOT_VALID \
9924                 (UINT32_C(0x0) << 10)
9925         /*
9926          * This enumeration indicates that this pkt contains the record's
9927          * tag and this pkt was received ooo, the partial_ghash field
9928          * contains the ghash.
9929          */
9930         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_CUR_REC \
9931                 (UINT32_C(0x1) << 10)
9932         /*
9933          * This enumeration indicates that the current record's tag wasn't
9934          * seen and the chip is moving on to the next record, the
9935          * partial_ghash field contains the ghash.
9936          */
9937         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_PRIOR_REC \
9938                 (UINT32_C(0x2) << 10)
9939         #define TLS_METADATA_BASE_MSG_FLAGS_GHASH_LAST \
9940                 TLS_METADATA_BASE_MSG_FLAGS_GHASH_PRIOR_REC
9941         /* This field indicates the status of tag authentication. */
9942         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_MASK \
9943                 UINT32_C(0x3000)
9944         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_SFT     12
9945         /*
9946          * This enumeration is set when there is no tags present in the
9947          * packet.
9948          */
9949         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_NONE \
9950                 (UINT32_C(0x0) << 12)
9951         /*
9952          * This enumeration states that there is at least one tag in the
9953          * packet and every tag is valid.
9954          */
9955         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_SUCCESS \
9956                 (UINT32_C(0x1) << 12)
9957         /*
9958          * This enumeration states that there is at least one tag in the
9959          * packet and at least one of the tag is invalid. The entire packet
9960          * is sent decrypted to the host.
9961          */
9962         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE \
9963                 (UINT32_C(0x2) << 12)
9964         #define TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_LAST \
9965                 TLS_METADATA_BASE_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE
9966         /*
9967          * A value of 1 indicates that this packet contains a record that
9968          * starts in the packet and extends beyond the packet.
9969          */
9970         #define TLS_METADATA_BASE_MSG_FLAGS_HEADER_FLDS_VALID \
9971                 UINT32_C(0x4000)
9972         /*
9973          * This value indicates the lower 7-bit of the Crypto Key ID
9974          * associated with this operation.
9975          */
9976         #define TLS_METADATA_BASE_MSG_KID_LO_MASK \
9977                 UINT32_C(0xfe000000)
9978         #define TLS_METADATA_BASE_MSG_KID_LO_SFT                   25
9979         uint16_t        kid_hi;
9980         /*
9981          * This value indicates the upper 13-bit of the Crypto Key ID
9982          * associated with this operation.
9983          */
9984         #define TLS_METADATA_BASE_MSG_KID_HI_MASK UINT32_C(0x1fff)
9985         #define TLS_METADATA_BASE_MSG_KID_HI_SFT 0
9986         uint16_t        unused0;
9987 } __rte_packed;
9988
9989 /* tls_metadata_insync_msg (size:192b/24B) */
9990 struct tls_metadata_insync_msg {
9991         uint32_t        md_type_link_flags_kid_lo;
9992         /* This field classifies the data present in the meta-data. */
9993         #define TLS_METADATA_INSYNC_MSG_MD_TYPE_MASK \
9994                 UINT32_C(0x1f)
9995         #define TLS_METADATA_INSYNC_MSG_MD_TYPE_SFT                  0
9996         /*
9997          * This setting is used when packets are coming in-order. Depending on
9998          * the state of the receive context, the meta-data will carry different
9999          * information.
10000          */
10001         #define TLS_METADATA_INSYNC_MSG_MD_TYPE_TLS_INSYNC \
10002                 UINT32_C(0x1)
10003         #define TLS_METADATA_INSYNC_MSG_MD_TYPE_LAST \
10004                 TLS_METADATA_INSYNC_MSG_MD_TYPE_TLS_INSYNC
10005         /*
10006          * This field indicates where the next metadata block starts. It is
10007          * counted in 16B units. A value of zero indicates that there is no
10008          * metadata.
10009          */
10010         #define TLS_METADATA_INSYNC_MSG_LINK_MASK \
10011                 UINT32_C(0x1e0)
10012         #define TLS_METADATA_INSYNC_MSG_LINK_SFT                     5
10013         /* These are flags present in the metadata. */
10014         #define TLS_METADATA_INSYNC_MSG_FLAGS_MASK \
10015                 UINT32_C(0x1fffe00)
10016         #define TLS_METADATA_INSYNC_MSG_FLAGS_SFT                    9
10017         /*
10018          * A value of 1 implies that the packet was decrypted by HW. Otherwise
10019          * the packet is passed on as it came in on the wire.
10020          */
10021         #define TLS_METADATA_INSYNC_MSG_FLAGS_DECRYPTED \
10022                 UINT32_C(0x200)
10023         /*
10024          * This field indicates the state of the ghash field passed in the
10025          * meta-data.
10026          */
10027         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_MASK \
10028                 UINT32_C(0xc00)
10029         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_SFT               10
10030         /*
10031          * This enumeration states that the ghash is not valid in the
10032          * meta-data.
10033          */
10034         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_NOT_VALID \
10035                 (UINT32_C(0x0) << 10)
10036         /*
10037          * This enumeration indicates that this pkt contains the record's
10038          * tag and this pkt was received ooo, the partial_ghash field
10039          * contains the ghash.
10040          */
10041         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_CUR_REC \
10042                 (UINT32_C(0x1) << 10)
10043         /*
10044          * This enumeration indicates that the current record's tag wasn't
10045          * seen and the chip is moving on to the next record, the
10046          * partial_ghash field contains the ghash.
10047          */
10048         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_PRIOR_REC \
10049                 (UINT32_C(0x2) << 10)
10050         #define TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_LAST \
10051                 TLS_METADATA_INSYNC_MSG_FLAGS_GHASH_PRIOR_REC
10052         /* This field indicates the status of tag authentication. */
10053         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_MASK \
10054                 UINT32_C(0x3000)
10055         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_SFT     12
10056         /*
10057          * This enumeration is set when there is no tags present in the
10058          * packet.
10059          */
10060         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_NONE \
10061                 (UINT32_C(0x0) << 12)
10062         /*
10063          * This enumeration states that there is at least one tag in the
10064          * packet and every tag is valid.
10065          */
10066         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_SUCCESS \
10067                 (UINT32_C(0x1) << 12)
10068         /*
10069          * This enumeration states that there is at least one tag in the
10070          * packet and at least one of the tag is invalid. The entire packet
10071          * is sent decrypted to the host.
10072          */
10073         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE \
10074                 (UINT32_C(0x2) << 12)
10075         #define TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_LAST \
10076                 TLS_METADATA_INSYNC_MSG_FLAGS_TAG_AUTH_STATUS_FAILURE
10077         /*
10078          * A value of 1 indicates that this packet contains a record that
10079          * starts in the packet and extends beyond the packet.
10080          */
10081         #define TLS_METADATA_INSYNC_MSG_FLAGS_HEADER_FLDS_VALID \
10082                 UINT32_C(0x4000)
10083         /*
10084          * This value indicates the lower 7-bit of the Crypto Key ID
10085          * associated with this operation.
10086          */
10087         #define TLS_METADATA_INSYNC_MSG_KID_LO_MASK \
10088                 UINT32_C(0xfe000000)
10089         #define TLS_METADATA_INSYNC_MSG_KID_LO_SFT                   25
10090         uint16_t        kid_hi;
10091         /*
10092          * This value indicates the upper 13-bit of the Crypto Key ID
10093          * associated with this operation.
10094          */
10095         #define TLS_METADATA_INSYNC_MSG_KID_HI_MASK UINT32_C(0x1fff)
10096         #define TLS_METADATA_INSYNC_MSG_KID_HI_SFT 0
10097         /*
10098          * This field is only valid when md_type is set to tls_insync. This field
10099          * indicates the offset within the current TCP packet where the TLS header
10100          * starts. If there are multiple TLS headers in the packet, this provides
10101          * the offset of the last TLS header.
10102          *
10103          * The field is calculated by subtracting TCP sequence number of the first
10104          * byte of the TCP payload of the packet from the TCP sequence number of
10105          * the last TLS header in the packet.
10106          */
10107         uint16_t        tls_header_offset;
10108         /*
10109          * This is the sequence Number of the record that was processed by the HW.
10110          * If there are multiple records in a packet, this would be the sequence
10111          * number of the last record.
10112          */
10113         uint64_t        record_seq_num;
10114         /*
10115          * This field contains cumulative partial GHASH value of all the packets
10116          * decrypted by the HW associated with a TLS record. This field is valid
10117          * on when packets belonging to have arrived out-of-order and HW could
10118          * not decrypt every packet and authenticate the record. Partial GHASH is
10119          * only sent out with packet having the TAG field.
10120          */
10121         uint64_t        partial_ghash;
10122 } __rte_packed;
10123
10124 /* tls_metadata_resync_msg (size:256b/32B) */
10125 struct tls_metadata_resync_msg {
10126         uint32_t        md_type_link_flags_kid_lo;
10127         /* This field classifies the data present in the meta-data. */
10128         #define TLS_METADATA_RESYNC_MSG_MD_TYPE_MASK \
10129                 UINT32_C(0x1f)
10130         #define TLS_METADATA_RESYNC_MSG_MD_TYPE_SFT                 0
10131         /*
10132          * With this setting HW passes the TCP sequence number of the TLS
10133          * record that it is requesting a resync on in the meta data.
10134          */
10135         #define TLS_METADATA_RESYNC_MSG_MD_TYPE_TLS_RESYNC \
10136                 UINT32_C(0x2)
10137         #define TLS_METADATA_RESYNC_MSG_MD_TYPE_LAST \
10138                 TLS_METADATA_RESYNC_MSG_MD_TYPE_TLS_RESYNC
10139         /*
10140          * This field indicates where the next metadata block starts. It is
10141          * counted in 16B units. A value of zero indicates that there is no
10142          * metadata.
10143          */
10144         #define TLS_METADATA_RESYNC_MSG_LINK_MASK \
10145                 UINT32_C(0x1e0)
10146         #define TLS_METADATA_RESYNC_MSG_LINK_SFT                    5
10147         /* These are flags present in the metadata. */
10148         #define TLS_METADATA_RESYNC_MSG_FLAGS_MASK \
10149                 UINT32_C(0x1fffe00)
10150         #define TLS_METADATA_RESYNC_MSG_FLAGS_SFT                   9
10151         /*
10152          * A value of 1 implies that the packet was decrypted by HW. Otherwise
10153          * the packet is passed on as it came in on the wire.
10154          */
10155         #define TLS_METADATA_RESYNC_MSG_FLAGS_DECRYPTED \
10156                 UINT32_C(0x200)
10157         /*
10158          * This field indicates the state of the ghash field passed in the
10159          * meta-data.
10160          */
10161         #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_MASK \
10162                 UINT32_C(0xc00)
10163         #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_SFT              10
10164         /*
10165          * This enumeration states that the ghash is not valid in the
10166          * meta-data.
10167          */
10168         #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_NOT_VALID \
10169                 (UINT32_C(0x0) << 10)
10170         #define TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_LAST \
10171                 TLS_METADATA_RESYNC_MSG_FLAGS_GHASH_NOT_VALID
10172         /* This field indicates the status of tag authentication. */
10173         #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_MASK \
10174                 UINT32_C(0x3000)
10175         #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_SFT    12
10176         /*
10177          * This enumeration is set when there is no tags present in the
10178          * packet.
10179          */
10180         #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_NONE \
10181                 (UINT32_C(0x0) << 12)
10182         #define TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_LAST \
10183                 TLS_METADATA_RESYNC_MSG_FLAGS_TAG_AUTH_STATUS_NONE
10184         /*
10185          * A value of 1 indicates that this packet contains a record that
10186          * starts in the packet and extends beyond the packet.
10187          */
10188         #define TLS_METADATA_RESYNC_MSG_FLAGS_HEADER_FLDS_VALID \
10189                 UINT32_C(0x4000)
10190         /*
10191          * This value indicates the lower 7-bit of the Crypto Key ID
10192          * associated with this operation.
10193          */
10194         #define TLS_METADATA_RESYNC_MSG_KID_LO_MASK \
10195                 UINT32_C(0xfe000000)
10196         #define TLS_METADATA_RESYNC_MSG_KID_LO_SFT                  25
10197         uint16_t        kid_hi;
10198         /*
10199          * This value indicates the upper 13-bit of the Crypto Key ID
10200          * associated with this operation.
10201          */
10202         #define TLS_METADATA_RESYNC_MSG_KID_HI_MASK UINT32_C(0x1fff)
10203         #define TLS_METADATA_RESYNC_MSG_KID_HI_SFT 0
10204         /* This field is unused in this context. */
10205         uint16_t        metadata_0;
10206         /*
10207          * This field indicates the TCP sequence number of the TLS record that HW
10208          * is requesting a resync on from the Driver. HW will keep a count of the
10209          * TLS records it found after this record (delta_records). Driver will
10210          * provide the TLS Record Sequence Number associated with the record. HW
10211          * will add the delta_records to the Record Sequence Number provided by
10212          * the driver and get back on sync.
10213          */
10214         uint32_t        resync_record_tcp_seq_num;
10215         uint32_t        unused0;
10216         /* This field is unused in this context. */
10217         uint64_t        metadata_2;
10218         /* This field is unused in this context. */
10219         uint64_t        metadata_3;
10220 } __rte_packed;
10221
10222 /*******************
10223  * hwrm_func_reset *
10224  *******************/
10225
10226
10227 /* hwrm_func_reset_input (size:192b/24B) */
10228 struct hwrm_func_reset_input {
10229         /* The HWRM command request type. */
10230         uint16_t        req_type;
10231         /*
10232          * The completion ring to send the completion event on. This should
10233          * be the NQ ID returned from the `nq_alloc` HWRM command.
10234          */
10235         uint16_t        cmpl_ring;
10236         /*
10237          * The sequence ID is used by the driver for tracking multiple
10238          * commands. This ID is treated as opaque data by the firmware and
10239          * the value is returned in the `hwrm_resp_hdr` upon completion.
10240          */
10241         uint16_t        seq_id;
10242         /*
10243          * The target ID of the command:
10244          * * 0x0-0xFFF8 - The function ID
10245          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10246          * * 0xFFFD - Reserved for user-space HWRM interface
10247          * * 0xFFFF - HWRM
10248          */
10249         uint16_t        target_id;
10250         /*
10251          * A physical address pointer pointing to a host buffer that the
10252          * command's response data will be written. This can be either a host
10253          * physical address (HPA) or a guest physical address (GPA) and must
10254          * point to a physically contiguous block of memory.
10255          */
10256         uint64_t        resp_addr;
10257         uint32_t        enables;
10258         /*
10259          * This bit must be '1' for the vf_id_valid field to be
10260          * configured.
10261          */
10262         #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
10263         /*
10264          * The ID of the VF that this PF is trying to reset.
10265          * Only the parent PF shall be allowed to reset a child VF.
10266          *
10267          * A parent PF driver shall use this field only when a specific child VF
10268          * is requested to be reset.
10269          */
10270         uint16_t        vf_id;
10271         /* This value indicates the level of a function reset. */
10272         uint8_t func_reset_level;
10273         /*
10274          * Reset the caller function and its children VFs (if any). If no
10275          * children functions exist, then reset the caller function only.
10276          */
10277         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL \
10278                 UINT32_C(0x0)
10279         /* Reset the caller function only */
10280         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME \
10281                 UINT32_C(0x1)
10282         /*
10283          * Reset all children VFs of the caller function driver if the
10284          * caller is a PF driver.
10285          * It is an error to specify this level by a VF driver.
10286          * It is an error to specify this level by a PF driver with
10287          * no children VFs.
10288          */
10289         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \
10290                 UINT32_C(0x2)
10291         /*
10292          * Reset a specific VF of the caller function driver if the caller
10293          * is the parent PF driver.
10294          * It is an error to specify this level by a VF driver.
10295          * It is an error to specify this level by a PF driver that is not
10296          * the parent of the VF that is being requested to reset.
10297          */
10298         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF \
10299                 UINT32_C(0x3)
10300         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST \
10301                 HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF
10302         uint8_t unused_0;
10303 } __rte_packed;
10304
10305 /* hwrm_func_reset_output (size:128b/16B) */
10306 struct hwrm_func_reset_output {
10307         /* The specific error status for the command. */
10308         uint16_t        error_code;
10309         /* The HWRM command request type. */
10310         uint16_t        req_type;
10311         /* The sequence ID from the original command. */
10312         uint16_t        seq_id;
10313         /* The length of the response data in number of bytes. */
10314         uint16_t        resp_len;
10315         uint8_t unused_0[7];
10316         /*
10317          * This field is used in Output records to indicate that the output
10318          * is completely written to RAM.  This field should be read as '1'
10319          * to indicate that the output has been completely written.
10320          * When writing a command completion or response to an internal processor,
10321          * the order of writes has to be such that this field is written last.
10322          */
10323         uint8_t valid;
10324 } __rte_packed;
10325
10326 /********************
10327  * hwrm_func_getfid *
10328  ********************/
10329
10330
10331 /* hwrm_func_getfid_input (size:192b/24B) */
10332 struct hwrm_func_getfid_input {
10333         /* The HWRM command request type. */
10334         uint16_t        req_type;
10335         /*
10336          * The completion ring to send the completion event on. This should
10337          * be the NQ ID returned from the `nq_alloc` HWRM command.
10338          */
10339         uint16_t        cmpl_ring;
10340         /*
10341          * The sequence ID is used by the driver for tracking multiple
10342          * commands. This ID is treated as opaque data by the firmware and
10343          * the value is returned in the `hwrm_resp_hdr` upon completion.
10344          */
10345         uint16_t        seq_id;
10346         /*
10347          * The target ID of the command:
10348          * * 0x0-0xFFF8 - The function ID
10349          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10350          * * 0xFFFD - Reserved for user-space HWRM interface
10351          * * 0xFFFF - HWRM
10352          */
10353         uint16_t        target_id;
10354         /*
10355          * A physical address pointer pointing to a host buffer that the
10356          * command's response data will be written. This can be either a host
10357          * physical address (HPA) or a guest physical address (GPA) and must
10358          * point to a physically contiguous block of memory.
10359          */
10360         uint64_t        resp_addr;
10361         uint32_t        enables;
10362         /*
10363          * This bit must be '1' for the pci_id field to be
10364          * configured.
10365          */
10366         #define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID     UINT32_C(0x1)
10367         /*
10368          * This value is the PCI ID of the queried function.
10369          * If ARI is enabled, then it is
10370          * Bus Number (8b):Function Number(8b). Otherwise, it is
10371          * Bus Number (8b):Device Number (5b):Function Number(3b).
10372          */
10373         uint16_t        pci_id;
10374         uint8_t unused_0[2];
10375 } __rte_packed;
10376
10377 /* hwrm_func_getfid_output (size:128b/16B) */
10378 struct hwrm_func_getfid_output {
10379         /* The specific error status for the command. */
10380         uint16_t        error_code;
10381         /* The HWRM command request type. */
10382         uint16_t        req_type;
10383         /* The sequence ID from the original command. */
10384         uint16_t        seq_id;
10385         /* The length of the response data in number of bytes. */
10386         uint16_t        resp_len;
10387         /*
10388          * FID value.  This value is used to identify operations on the PCI
10389          * bus as belonging to a particular PCI function.
10390          */
10391         uint16_t        fid;
10392         uint8_t unused_0[5];
10393         /*
10394          * This field is used in Output records to indicate that the output
10395          * is completely written to RAM.  This field should be read as '1'
10396          * to indicate that the output has been completely written.
10397          * When writing a command completion or response to an internal processor,
10398          * the order of writes has to be such that this field is written last.
10399          */
10400         uint8_t valid;
10401 } __rte_packed;
10402
10403 /**********************
10404  * hwrm_func_vf_alloc *
10405  **********************/
10406
10407
10408 /* hwrm_func_vf_alloc_input (size:192b/24B) */
10409 struct hwrm_func_vf_alloc_input {
10410         /* The HWRM command request type. */
10411         uint16_t        req_type;
10412         /*
10413          * The completion ring to send the completion event on. This should
10414          * be the NQ ID returned from the `nq_alloc` HWRM command.
10415          */
10416         uint16_t        cmpl_ring;
10417         /*
10418          * The sequence ID is used by the driver for tracking multiple
10419          * commands. This ID is treated as opaque data by the firmware and
10420          * the value is returned in the `hwrm_resp_hdr` upon completion.
10421          */
10422         uint16_t        seq_id;
10423         /*
10424          * The target ID of the command:
10425          * * 0x0-0xFFF8 - The function ID
10426          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10427          * * 0xFFFD - Reserved for user-space HWRM interface
10428          * * 0xFFFF - HWRM
10429          */
10430         uint16_t        target_id;
10431         /*
10432          * A physical address pointer pointing to a host buffer that the
10433          * command's response data will be written. This can be either a host
10434          * physical address (HPA) or a guest physical address (GPA) and must
10435          * point to a physically contiguous block of memory.
10436          */
10437         uint64_t        resp_addr;
10438         uint32_t        enables;
10439         /*
10440          * This bit must be '1' for the first_vf_id field to be
10441          * configured.
10442          */
10443         #define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
10444         /*
10445          * This value is used to identify a Virtual Function (VF).
10446          * The scope of VF ID is local within a PF.
10447          */
10448         uint16_t        first_vf_id;
10449         /* The number of virtual functions requested. */
10450         uint16_t        num_vfs;
10451 } __rte_packed;
10452
10453 /* hwrm_func_vf_alloc_output (size:128b/16B) */
10454 struct hwrm_func_vf_alloc_output {
10455         /* The specific error status for the command. */
10456         uint16_t        error_code;
10457         /* The HWRM command request type. */
10458         uint16_t        req_type;
10459         /* The sequence ID from the original command. */
10460         uint16_t        seq_id;
10461         /* The length of the response data in number of bytes. */
10462         uint16_t        resp_len;
10463         /* The ID of the first VF allocated. */
10464         uint16_t        first_vf_id;
10465         uint8_t unused_0[5];
10466         /*
10467          * This field is used in Output records to indicate that the output
10468          * is completely written to RAM.  This field should be read as '1'
10469          * to indicate that the output has been completely written.
10470          * When writing a command completion or response to an internal processor,
10471          * the order of writes has to be such that this field is written last.
10472          */
10473         uint8_t valid;
10474 } __rte_packed;
10475
10476 /*********************
10477  * hwrm_func_vf_free *
10478  *********************/
10479
10480
10481 /* hwrm_func_vf_free_input (size:192b/24B) */
10482 struct hwrm_func_vf_free_input {
10483         /* The HWRM command request type. */
10484         uint16_t        req_type;
10485         /*
10486          * The completion ring to send the completion event on. This should
10487          * be the NQ ID returned from the `nq_alloc` HWRM command.
10488          */
10489         uint16_t        cmpl_ring;
10490         /*
10491          * The sequence ID is used by the driver for tracking multiple
10492          * commands. This ID is treated as opaque data by the firmware and
10493          * the value is returned in the `hwrm_resp_hdr` upon completion.
10494          */
10495         uint16_t        seq_id;
10496         /*
10497          * The target ID of the command:
10498          * * 0x0-0xFFF8 - The function ID
10499          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10500          * * 0xFFFD - Reserved for user-space HWRM interface
10501          * * 0xFFFF - HWRM
10502          */
10503         uint16_t        target_id;
10504         /*
10505          * A physical address pointer pointing to a host buffer that the
10506          * command's response data will be written. This can be either a host
10507          * physical address (HPA) or a guest physical address (GPA) and must
10508          * point to a physically contiguous block of memory.
10509          */
10510         uint64_t        resp_addr;
10511         uint32_t        enables;
10512         /*
10513          * This bit must be '1' for the first_vf_id field to be
10514          * configured.
10515          */
10516         #define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
10517         /*
10518          * This value is used to identify a Virtual Function (VF).
10519          * The scope of VF ID is local within a PF.
10520          */
10521         uint16_t        first_vf_id;
10522         /*
10523          * The number of virtual functions requested.
10524          * 0xFFFF - Cleanup all children of this PF.
10525          */
10526         uint16_t        num_vfs;
10527 } __rte_packed;
10528
10529 /* hwrm_func_vf_free_output (size:128b/16B) */
10530 struct hwrm_func_vf_free_output {
10531         /* The specific error status for the command. */
10532         uint16_t        error_code;
10533         /* The HWRM command request type. */
10534         uint16_t        req_type;
10535         /* The sequence ID from the original command. */
10536         uint16_t        seq_id;
10537         /* The length of the response data in number of bytes. */
10538         uint16_t        resp_len;
10539         uint8_t unused_0[7];
10540         /*
10541          * This field is used in Output records to indicate that the output
10542          * is completely written to RAM.  This field should be read as '1'
10543          * to indicate that the output has been completely written.
10544          * When writing a command completion or response to an internal processor,
10545          * the order of writes has to be such that this field is written last.
10546          */
10547         uint8_t valid;
10548 } __rte_packed;
10549
10550 /********************
10551  * hwrm_func_vf_cfg *
10552  ********************/
10553
10554
10555 /* hwrm_func_vf_cfg_input (size:448b/56B) */
10556 struct hwrm_func_vf_cfg_input {
10557         /* The HWRM command request type. */
10558         uint16_t        req_type;
10559         /*
10560          * The completion ring to send the completion event on. This should
10561          * be the NQ ID returned from the `nq_alloc` HWRM command.
10562          */
10563         uint16_t        cmpl_ring;
10564         /*
10565          * The sequence ID is used by the driver for tracking multiple
10566          * commands. This ID is treated as opaque data by the firmware and
10567          * the value is returned in the `hwrm_resp_hdr` upon completion.
10568          */
10569         uint16_t        seq_id;
10570         /*
10571          * The target ID of the command:
10572          * * 0x0-0xFFF8 - The function ID
10573          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10574          * * 0xFFFD - Reserved for user-space HWRM interface
10575          * * 0xFFFF - HWRM
10576          */
10577         uint16_t        target_id;
10578         /*
10579          * A physical address pointer pointing to a host buffer that the
10580          * command's response data will be written. This can be either a host
10581          * physical address (HPA) or a guest physical address (GPA) and must
10582          * point to a physically contiguous block of memory.
10583          */
10584         uint64_t        resp_addr;
10585         uint32_t        enables;
10586         /*
10587          * This bit must be '1' for the mtu field to be
10588          * configured.
10589          */
10590         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU \
10591                 UINT32_C(0x1)
10592         /*
10593          * This bit must be '1' for the guest_vlan field to be
10594          * configured.
10595          */
10596         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN \
10597                 UINT32_C(0x2)
10598         /*
10599          * This bit must be '1' for the async_event_cr field to be
10600          * configured.
10601          */
10602         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
10603                 UINT32_C(0x4)
10604         /*
10605          * This bit must be '1' for the dflt_mac_addr field to be
10606          * configured.
10607          */
10608         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
10609                 UINT32_C(0x8)
10610         /*
10611          * This bit must be '1' for the num_rsscos_ctxs field to be
10612          * configured.
10613          */
10614         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
10615                 UINT32_C(0x10)
10616         /*
10617          * This bit must be '1' for the num_cmpl_rings field to be
10618          * configured.
10619          */
10620         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
10621                 UINT32_C(0x20)
10622         /*
10623          * This bit must be '1' for the num_tx_rings field to be
10624          * configured.
10625          */
10626         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS \
10627                 UINT32_C(0x40)
10628         /*
10629          * This bit must be '1' for the num_rx_rings field to be
10630          * configured.
10631          */
10632         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS \
10633                 UINT32_C(0x80)
10634         /*
10635          * This bit must be '1' for the num_l2_ctxs field to be
10636          * configured.
10637          */
10638         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS \
10639                 UINT32_C(0x100)
10640         /*
10641          * This bit must be '1' for the num_vnics field to be
10642          * configured.
10643          */
10644         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS \
10645                 UINT32_C(0x200)
10646         /*
10647          * This bit must be '1' for the num_stat_ctxs field to be
10648          * configured.
10649          */
10650         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
10651                 UINT32_C(0x400)
10652         /*
10653          * This bit must be '1' for the num_hw_ring_grps field to be
10654          * configured.
10655          */
10656         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
10657                 UINT32_C(0x800)
10658         /*
10659          * The maximum transmission unit requested on the function.
10660          * The HWRM should make sure that the mtu of
10661          * the function does not exceed the mtu of the physical
10662          * port that this function is associated with.
10663          *
10664          * In addition to requesting mtu per function, it is
10665          * possible to configure mtu per transmit ring.
10666          * By default, the mtu of each transmit ring associated
10667          * with a function is equal to the mtu of the function.
10668          * The HWRM should make sure that the mtu of each transmit
10669          * ring that is assigned to a function has a valid mtu.
10670          */
10671         uint16_t        mtu;
10672         /*
10673          * The guest VLAN for the function being configured.
10674          * This field's format is same as 802.1Q Tag's
10675          * Tag Control Information (TCI) format that includes both
10676          * Priority Code Point (PCP) and VLAN Identifier (VID).
10677          */
10678         uint16_t        guest_vlan;
10679         /*
10680          * ID of the target completion ring for receiving asynchronous
10681          * event completions. If this field is not valid, then the
10682          * HWRM shall use the default completion ring of the function
10683          * that is being configured as the target completion ring for
10684          * providing any asynchronous event completions for that
10685          * function.
10686          * If this field is valid, then the HWRM shall use the
10687          * completion ring identified by this ID as the target
10688          * completion ring for providing any asynchronous event
10689          * completions for the function that is being configured.
10690          */
10691         uint16_t        async_event_cr;
10692         /*
10693          * This value is the current MAC address requested by the VF
10694          * driver to be configured on this VF. A value of
10695          * 00-00-00-00-00-00 indicates no MAC address configuration
10696          * is requested by the VF driver.
10697          * The parent PF driver may reject or overwrite this
10698          * MAC address.
10699          */
10700         uint8_t dflt_mac_addr[6];
10701         uint32_t        flags;
10702         /*
10703          * This bit requests that the firmware test to see if all the assets
10704          * requested in this command (i.e. number of TX rings) are available.
10705          * The firmware will return an error if the requested assets are
10706          * not available. The firwmare will NOT reserve the assets if they
10707          * are available.
10708          */
10709         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
10710                 UINT32_C(0x1)
10711         /*
10712          * This bit requests that the firmware test to see if all the assets
10713          * requested in this command (i.e. number of RX rings) are available.
10714          * The firmware will return an error if the requested assets are
10715          * not available. The firwmare will NOT reserve the assets if they
10716          * are available.
10717          */
10718         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
10719                 UINT32_C(0x2)
10720         /*
10721          * This bit requests that the firmware test to see if all the assets
10722          * requested in this command (i.e. number of CMPL rings) are available.
10723          * The firmware will return an error if the requested assets are
10724          * not available. The firwmare will NOT reserve the assets if they
10725          * are available.
10726          */
10727         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
10728                 UINT32_C(0x4)
10729         /*
10730          * This bit requests that the firmware test to see if all the assets
10731          * requested in this command (i.e. number of RSS ctx) are available.
10732          * The firmware will return an error if the requested assets are
10733          * not available. The firwmare will NOT reserve the assets if they
10734          * are available.
10735          */
10736         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
10737                 UINT32_C(0x8)
10738         /*
10739          * This bit requests that the firmware test to see if all the assets
10740          * requested in this command (i.e. number of ring groups) are available.
10741          * The firmware will return an error if the requested assets are
10742          * not available. The firwmare will NOT reserve the assets if they
10743          * are available.
10744          */
10745         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
10746                 UINT32_C(0x10)
10747         /*
10748          * This bit requests that the firmware test to see if all the assets
10749          * requested in this command (i.e. number of stat ctx) are available.
10750          * The firmware will return an error if the requested assets are
10751          * not available. The firwmare will NOT reserve the assets if they
10752          * are available.
10753          */
10754         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
10755                 UINT32_C(0x20)
10756         /*
10757          * This bit requests that the firmware test to see if all the assets
10758          * requested in this command (i.e. number of VNICs) are available.
10759          * The firmware will return an error if the requested assets are
10760          * not available. The firwmare will NOT reserve the assets if they
10761          * are available.
10762          */
10763         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
10764                 UINT32_C(0x40)
10765         /*
10766          * This bit requests that the firmware test to see if all the assets
10767          * requested in this command (i.e. number of L2 ctx) are available.
10768          * The firmware will return an error if the requested assets are
10769          * not available. The firwmare will NOT reserve the assets if they
10770          * are available.
10771          */
10772         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
10773                 UINT32_C(0x80)
10774         /*
10775          * If this bit is set to 1, the VF driver is requesting FW to enable
10776          * PPP TX PUSH feature on all the TX rings specified in the
10777          * num_tx_rings field. By default, the PPP TX push feature is
10778          * disabled for all the TX rings of the VF. This flag is ignored if
10779          * the num_tx_rings field is not specified or the VF doesn't support
10780          * PPP tx push feature.
10781          */
10782         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE \
10783                 UINT32_C(0x100)
10784         /*
10785          * If this bit is set to 1, the VF driver is requesting FW to disable
10786          * PPP TX PUSH feature on all the TX rings of the VF. This flag is
10787          * ignored if the VF doesn't support PPP tx push feature.
10788          */
10789         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE \
10790                 UINT32_C(0x200)
10791         /* The number of RSS/COS contexts requested for the VF. */
10792         uint16_t        num_rsscos_ctxs;
10793         /* The number of completion rings requested for the VF. */
10794         uint16_t        num_cmpl_rings;
10795         /* The number of transmit rings requested for the VF. */
10796         uint16_t        num_tx_rings;
10797         /* The number of receive rings requested for the VF. */
10798         uint16_t        num_rx_rings;
10799         /* The number of L2 contexts requested for the VF. */
10800         uint16_t        num_l2_ctxs;
10801         /* The number of vnics requested for the VF. */
10802         uint16_t        num_vnics;
10803         /* The number of statistic contexts requested for the VF. */
10804         uint16_t        num_stat_ctxs;
10805         /* The number of HW ring groups requested for the VF. */
10806         uint16_t        num_hw_ring_grps;
10807         uint8_t unused_0[4];
10808 } __rte_packed;
10809
10810 /* hwrm_func_vf_cfg_output (size:128b/16B) */
10811 struct hwrm_func_vf_cfg_output {
10812         /* The specific error status for the command. */
10813         uint16_t        error_code;
10814         /* The HWRM command request type. */
10815         uint16_t        req_type;
10816         /* The sequence ID from the original command. */
10817         uint16_t        seq_id;
10818         /* The length of the response data in number of bytes. */
10819         uint16_t        resp_len;
10820         uint8_t unused_0[7];
10821         /*
10822          * This field is used in Output records to indicate that the output
10823          * is completely written to RAM.  This field should be read as '1'
10824          * to indicate that the output has been completely written.
10825          * When writing a command completion or response to an internal processor,
10826          * the order of writes has to be such that this field is written last.
10827          */
10828         uint8_t valid;
10829 } __rte_packed;
10830
10831 /*******************
10832  * hwrm_func_qcaps *
10833  *******************/
10834
10835
10836 /* hwrm_func_qcaps_input (size:192b/24B) */
10837 struct hwrm_func_qcaps_input {
10838         /* The HWRM command request type. */
10839         uint16_t        req_type;
10840         /*
10841          * The completion ring to send the completion event on. This should
10842          * be the NQ ID returned from the `nq_alloc` HWRM command.
10843          */
10844         uint16_t        cmpl_ring;
10845         /*
10846          * The sequence ID is used by the driver for tracking multiple
10847          * commands. This ID is treated as opaque data by the firmware and
10848          * the value is returned in the `hwrm_resp_hdr` upon completion.
10849          */
10850         uint16_t        seq_id;
10851         /*
10852          * The target ID of the command:
10853          * * 0x0-0xFFF8 - The function ID
10854          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10855          * * 0xFFFD - Reserved for user-space HWRM interface
10856          * * 0xFFFF - HWRM
10857          */
10858         uint16_t        target_id;
10859         /*
10860          * A physical address pointer pointing to a host buffer that the
10861          * command's response data will be written. This can be either a host
10862          * physical address (HPA) or a guest physical address (GPA) and must
10863          * point to a physically contiguous block of memory.
10864          */
10865         uint64_t        resp_addr;
10866         /*
10867          * Function ID of the function that is being queried.
10868          * 0xFF... (All Fs) if the query is for the requesting
10869          * function.
10870          * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
10871          * to be used by a trusted VF to query its parent PF.
10872          */
10873         uint16_t        fid;
10874         uint8_t unused_0[6];
10875 } __rte_packed;
10876
10877 /* hwrm_func_qcaps_output (size:704b/88B) */
10878 struct hwrm_func_qcaps_output {
10879         /* The specific error status for the command. */
10880         uint16_t        error_code;
10881         /* The HWRM command request type. */
10882         uint16_t        req_type;
10883         /* The sequence ID from the original command. */
10884         uint16_t        seq_id;
10885         /* The length of the response data in number of bytes. */
10886         uint16_t        resp_len;
10887         /*
10888          * FID value.  This value is used to identify operations on the PCI
10889          * bus as belonging to a particular PCI function.
10890          */
10891         uint16_t        fid;
10892         /*
10893          * Port ID of port that this function is associated with.
10894          * Valid only for the PF.
10895          * 0xFF... (All Fs) if this function is not associated with
10896          * any port.
10897          * 0xFF... (All Fs) if this function is called from a VF.
10898          */
10899         uint16_t        port_id;
10900         uint32_t        flags;
10901         /* If 1, then Push mode is supported on this function. */
10902         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED \
10903                 UINT32_C(0x1)
10904         /*
10905          * If 1, then the global MSI-X auto-masking is enabled for the
10906          * device.
10907          */
10908         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
10909                 UINT32_C(0x2)
10910         /*
10911          * If 1, then the Precision Time Protocol (PTP) processing
10912          * is supported on this function.
10913          * The HWRM should enable PTP on only a single Physical
10914          * Function (PF) per port.
10915          */
10916         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED \
10917                 UINT32_C(0x4)
10918         /*
10919          * If 1, then RDMA over Converged Ethernet (RoCE) v1
10920          * is supported on this function.
10921          */
10922         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED \
10923                 UINT32_C(0x8)
10924         /*
10925          * If 1, then RDMA over Converged Ethernet (RoCE) v2
10926          * is supported on this function.
10927          */
10928         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED \
10929                 UINT32_C(0x10)
10930         /*
10931          * If 1, then control and configuration of WoL magic packet
10932          * are supported on this function.
10933          */
10934         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED \
10935                 UINT32_C(0x20)
10936         /*
10937          * If 1, then control and configuration of bitmap pattern
10938          * packet are supported on this function.
10939          */
10940         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED \
10941                 UINT32_C(0x40)
10942         /*
10943          * If set to 1, then the control and configuration of rate limit
10944          * of an allocated TX ring on the queried function is supported.
10945          */
10946         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED \
10947                 UINT32_C(0x80)
10948         /*
10949          * If 1, then control and configuration of minimum and
10950          * maximum bandwidths are supported on the queried function.
10951          */
10952         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED \
10953                 UINT32_C(0x100)
10954         /*
10955          * If the query is for a VF, then this flag shall be ignored.
10956          * If this query is for a PF and this flag is set to 1,
10957          * then the PF has the capability to set the rate limits
10958          * on the TX rings of its children VFs.
10959          * If this query is for a PF and this flag is set to 0, then
10960          * the PF does not have the capability to set the rate limits
10961          * on the TX rings of its children VFs.
10962          */
10963         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED \
10964                 UINT32_C(0x200)
10965         /*
10966          * If the query is for a VF, then this flag shall be ignored.
10967          * If this query is for a PF and this flag is set to 1,
10968          * then the PF has the capability to set the minimum and/or
10969          * maximum bandwidths for its children VFs.
10970          * If this query is for a PF and this flag is set to 0, then
10971          * the PF does not have the capability to set the minimum or
10972          * maximum bandwidths for its children VFs.
10973          */
10974         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED \
10975                 UINT32_C(0x400)
10976         /*
10977          * Standard TX Ring mode is used for the allocation of TX ring
10978          * and underlying scheduling resources that allow bandwidth
10979          * reservation and limit settings on the queried function.
10980          * If set to 1, then standard TX ring mode is supported
10981          * on the queried function.
10982          * If set to 0, then standard TX ring mode is not available
10983          * on the queried function.
10984          */
10985         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED \
10986                 UINT32_C(0x800)
10987         /*
10988          * If the query is for a VF, then this flag shall be ignored,
10989          * If this query is for a PF and this flag is set to 1,
10990          * then the PF has the capability to detect GENEVE tunnel
10991          * flags.
10992          */
10993         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GENEVE_TUN_FLAGS_SUPPORTED \
10994                 UINT32_C(0x1000)
10995         /*
10996          * If the query is for a VF, then this flag shall be ignored,
10997          * If this query is for a PF and this flag is set to 1,
10998          * then the PF has the capability to detect NVGRE tunnel
10999          * flags.
11000          */
11001         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NVGRE_TUN_FLAGS_SUPPORTED \
11002                 UINT32_C(0x2000)
11003         /*
11004          * If the query is for a VF, then this flag shall be ignored,
11005          * If this query is for a PF and this flag is set to 1,
11006          * then the PF has the capability to detect GRE tunnel
11007          * flags.
11008          */
11009         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GRE_TUN_FLAGS_SUPPORTED \
11010                 UINT32_C(0x4000)
11011         /*
11012          * If the query is for a VF, then this flag shall be ignored,
11013          * If this query is for a PF and this flag is set to 1,
11014          * then the PF has the capability to detect MPLS tunnel
11015          * flags.
11016          */
11017         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_MPLS_TUN_FLAGS_SUPPORTED \
11018                 UINT32_C(0x8000)
11019         /*
11020          * If the query is for a VF, then this flag shall be ignored,
11021          * If this query is for a PF and this flag is set to 1,
11022          * then the PF has the capability to support pcie stats.
11023          */
11024         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PCIE_STATS_SUPPORTED \
11025                 UINT32_C(0x10000)
11026         /*
11027          * If the query is for a VF, then this flag shall be ignored,
11028          * If this query is for a PF and this flag is set to 1,
11029          * then the PF has the capability to adopt the VF's belonging
11030          * to another PF.
11031          */
11032         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADOPTED_PF_SUPPORTED \
11033                 UINT32_C(0x20000)
11034         /*
11035          * If the query is for a VF, then this flag shall be ignored,
11036          * If this query is for a PF and this flag is set to 1,
11037          * then the PF has the administrative privilege to configure another PF
11038          */
11039         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADMIN_PF_SUPPORTED \
11040                 UINT32_C(0x40000)
11041         /*
11042          * If the query is for a VF, then this flag shall be ignored.
11043          * If this query is for a PF and this flag is set to 1, then
11044          * the PF will know that the firmware has the capability to track
11045          * the virtual link status.
11046          */
11047         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_LINK_ADMIN_STATUS_SUPPORTED \
11048                 UINT32_C(0x80000)
11049         /*
11050          * If 1, then this function supports the push mode that uses
11051          * write combine buffers and the long inline tx buffer descriptor.
11052          */
11053         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WCB_PUSH_MODE \
11054                 UINT32_C(0x100000)
11055         /*
11056          * If 1, then FW has capability to allocate TX rings dynamically
11057          * in ring alloc even if PF reserved pool is zero.
11058          * This bit will be used only for PFs.
11059          */
11060         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
11061                 UINT32_C(0x200000)
11062         /*
11063          * When this bit is '1', it indicates that core firmware is
11064          * capable of Hot Reset.
11065          */
11066         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE \
11067                 UINT32_C(0x400000)
11068         /*
11069          * This flag will be set to 1 by the FW if FW supports adapter error
11070          * recovery.
11071          */
11072         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERROR_RECOVERY_CAPABLE \
11073                 UINT32_C(0x800000)
11074         /*
11075          * If the query is for a VF, then this flag shall be ignored.
11076          * If this query is for a PF and this flag is set to 1, then
11077          * the PF has the capability to support extended stats.
11078          */
11079         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED \
11080                 UINT32_C(0x1000000)
11081         /*
11082          * If the query is for a VF, then this flag shall be ignored.
11083          * If this query is for a PF and this flag is set to 1, then host
11084          * must initiate reset or reload (or fastboot) the firmware image
11085          * upon detection of device shutdown state.
11086          */
11087         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERR_RECOVER_RELOAD \
11088                 UINT32_C(0x2000000)
11089         /*
11090          * If the query is for a VF, then this flag (always set to 0) shall
11091          * be ignored. If this query is for a PF and this flag is set to 1,
11092          * host, when registered for the default vnic change async event,
11093          * receives async notification whenever a default vnic state is
11094          * changed for any of child or adopted VFs.
11095          */
11096         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NOTIFY_VF_DEF_VNIC_CHNG_SUPPORTED \
11097                 UINT32_C(0x4000000)
11098         /* If set to 1, then the vlan acceleration for TX is disabled. */
11099         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED \
11100                 UINT32_C(0x8000000)
11101         /*
11102          * When this bit is '1', it indicates that core firmware supports
11103          * DBG_COREDUMP_XXX commands.
11104          */
11105         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_COREDUMP_CMD_SUPPORTED \
11106                 UINT32_C(0x10000000)
11107         /*
11108          * When this bit is '1', it indicates that core firmware supports
11109          * DBG_CRASHDUMP_XXX commands.
11110          */
11111         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_CRASHDUMP_CMD_SUPPORTED \
11112                 UINT32_C(0x20000000)
11113         /*
11114          * If the query is for a VF, then this flag should be ignored.
11115          * If the query is for a PF and this flag is set to 1, then
11116          * the PF has the capability to support retrieval of
11117          * rx_port_stats_ext_pfc_wd statistics (supported by the PFC
11118          * WatchDog feature) via the hwrm_port_qstats_ext_pfc_wd command.
11119          * If this flag is set to 1, only that (supported) command should
11120          * be used for retrieval of PFC related statistics (rather than
11121          * hwrm_port_qstats_ext command, which could previously be used).
11122          */
11123         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PFC_WD_STATS_SUPPORTED \
11124                 UINT32_C(0x40000000)
11125         /*
11126          * When this bit is '1', it indicates that core firmware supports
11127          * DBG_QCAPS command
11128          */
11129         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DBG_QCAPS_CMD_SUPPORTED \
11130                 UINT32_C(0x80000000)
11131         /*
11132          * This value is current MAC address configured for this
11133          * function. A value of 00-00-00-00-00-00 indicates no
11134          * MAC address is currently configured.
11135          */
11136         uint8_t mac_address[6];
11137         /*
11138          * The maximum number of RSS/COS contexts that can be
11139          * allocated to the function.
11140          */
11141         uint16_t        max_rsscos_ctx;
11142         /*
11143          * The maximum number of completion rings that can be
11144          * allocated to the function.
11145          */
11146         uint16_t        max_cmpl_rings;
11147         /*
11148          * The maximum number of transmit rings that can be
11149          * allocated to the function.
11150          */
11151         uint16_t        max_tx_rings;
11152         /*
11153          * The maximum number of receive rings that can be
11154          * allocated to the function.
11155          */
11156         uint16_t        max_rx_rings;
11157         /*
11158          * The maximum number of L2 contexts that can be
11159          * allocated to the function.
11160          */
11161         uint16_t        max_l2_ctxs;
11162         /*
11163          * The maximum number of VNICs that can be
11164          * allocated to the function.
11165          */
11166         uint16_t        max_vnics;
11167         /*
11168          * The identifier for the first VF enabled on a PF. This
11169          * is valid only on the PF with SR-IOV enabled.
11170          * 0xFF... (All Fs) if this command is called on a PF with
11171          * SR-IOV disabled or on a VF.
11172          */
11173         uint16_t        first_vf_id;
11174         /*
11175          * The maximum number of VFs that can be
11176          * allocated to the function. This is valid only on the
11177          * PF with SR-IOV enabled. 0xFF... (All Fs) if this
11178          * command is called on a PF with SR-IOV disabled or
11179          * on a VF.
11180          */
11181         uint16_t        max_vfs;
11182         /*
11183          * The maximum number of statistic contexts that can be
11184          * allocated to the function.
11185          */
11186         uint16_t        max_stat_ctx;
11187         /*
11188          * The maximum number of Encapsulation records that can be
11189          * offloaded by this function.
11190          */
11191         uint32_t        max_encap_records;
11192         /*
11193          * The maximum number of decapsulation records that can
11194          * be offloaded by this function.
11195          */
11196         uint32_t        max_decap_records;
11197         /*
11198          * The maximum number of Exact Match (EM) flows that can be
11199          * offloaded by this function on the TX side.
11200          */
11201         uint32_t        max_tx_em_flows;
11202         /*
11203          * The maximum number of Wildcard Match (WM) flows that can
11204          * be offloaded by this function on the TX side.
11205          */
11206         uint32_t        max_tx_wm_flows;
11207         /*
11208          * The maximum number of Exact Match (EM) flows that can be
11209          * offloaded by this function on the RX side.
11210          */
11211         uint32_t        max_rx_em_flows;
11212         /*
11213          * The maximum number of Wildcard Match (WM) flows that can
11214          * be offloaded by this function on the RX side.
11215          */
11216         uint32_t        max_rx_wm_flows;
11217         /*
11218          * The maximum number of multicast filters that can
11219          * be supported by this function on the RX side.
11220          */
11221         uint32_t        max_mcast_filters;
11222         /*
11223          * The maximum value of flow_id that can be supported
11224          * in completion records.
11225          */
11226         uint32_t        max_flow_id;
11227         /*
11228          * The maximum number of HW ring groups that can be
11229          * supported on this function.
11230          */
11231         uint32_t        max_hw_ring_grps;
11232         /*
11233          * The maximum number of strict priority transmit rings
11234          * that can be allocated to the function.
11235          * This number indicates the maximum number of TX rings
11236          * that can be assigned strict priorities out of the
11237          * maximum number of TX rings that can be allocated
11238          * (max_tx_rings) to the function.
11239          */
11240         uint16_t        max_sp_tx_rings;
11241         uint8_t unused_0[2];
11242         uint32_t        flags_ext;
11243         /*
11244          * If 1, the device can be configured to set the ECN bits in the
11245          * IP header of received packets if the receive queue length
11246          * exceeds a given threshold.
11247          */
11248         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_MARK_SUPPORTED \
11249                 UINT32_C(0x1)
11250         /*
11251          * If 1, the device can report the number of received packets
11252          * that it marked as having experienced congestion.
11253          */
11254         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_STATS_SUPPORTED \
11255                 UINT32_C(0x2)
11256         /*
11257          * If 1, the device can report extended hw statistics (including
11258          * additional tpa statistics).
11259          */
11260         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EXT_HW_STATS_SUPPORTED \
11261                 UINT32_C(0x4)
11262         /*
11263          * If set to 1, then the core firmware has support to enable/
11264          * disable hot reset support for interface dynamically through
11265          * HWRM_FUNC_CFG.
11266          */
11267         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_HOT_RESET_IF_SUPPORT \
11268                 UINT32_C(0x8)
11269         /* If 1, the proxy mode is supported on this function */
11270         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PROXY_MODE_SUPPORT \
11271                 UINT32_C(0x10)
11272         /*
11273          * If 1, the tx rings source interface override feature is supported
11274          * on this function.
11275          */
11276         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_PROXY_SRC_INTF_OVERRIDE_SUPPORT \
11277                 UINT32_C(0x20)
11278         /*
11279          * If 1, the device supports scheduler queues. SCHQs can be managed
11280          * using RING_SCHQ_ALLOC/CFG/FREE commands.
11281          */
11282         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SCHQ_SUPPORTED \
11283                 UINT32_C(0x40)
11284         /*
11285          * If set to 1, then this function supports the TX push mode that
11286          * uses ping-pong buffers from the push pages.
11287          */
11288         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_PPP_PUSH_MODE_SUPPORTED \
11289                 UINT32_C(0x80)
11290         /*
11291          * If set to 1, then this function doesn't have the privilege to
11292          * configure the EVB mode of the port it uses.
11293          */
11294         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EVB_MODE_CFG_NOT_SUPPORTED \
11295                 UINT32_C(0x100)
11296         /*
11297          * If set to 1, then the HW and FW support the SoC packet DMA
11298          * datapath between SoC and NIC. This function can act as the
11299          * HWRM communication transport agent on behalf of the SoC SPD
11300          * software module. This capability is only advertised to the
11301          * SoC PFs.
11302          */
11303         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_SOC_SPD_SUPPORTED \
11304                 UINT32_C(0x200)
11305         /*
11306          * If set to 1, then this function supports FW_LIVEPATCH for
11307          * firmware livepatch commands.
11308          */
11309         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_FW_LIVEPATCH_SUPPORTED \
11310                 UINT32_C(0x400)
11311         /*
11312          * When this bit is '1', it indicates that core firmware is
11313          * capable of fast Reset.
11314          */
11315         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_FAST_RESET_CAPABLE \
11316                 UINT32_C(0x800)
11317         /*
11318          * When this bit is '1', it indicates that firmware and hardware
11319          * are capable of updating tx_metadata via hwrm_ring_cfg command.
11320          */
11321         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_TX_METADATA_CFG_CAPABLE \
11322                 UINT32_C(0x1000)
11323         /*
11324          * If set to 1, then the device can report the action
11325          * needed to activate set nvm options.
11326          */
11327         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_NVM_OPTION_ACTION_SUPPORTED \
11328                 UINT32_C(0x2000)
11329         /*
11330          * When this bit is '1', it indicates that the BD metadata feature
11331          * is supported for this function.
11332          */
11333         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_BD_METADATA_SUPPORTED \
11334                 UINT32_C(0x4000)
11335         /*
11336          * When this bit is '1', it indicates that the echo request feature
11337          * is supported for this function. If the driver registers for the
11338          * echo request asynchronous event, then the firmware can send an
11339          * unsolicited echo request to the driver and expect an echo
11340          * response.
11341          */
11342         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECHO_REQUEST_SUPPORTED \
11343                 UINT32_C(0x8000)
11344         /* The maximum number of SCHQs supported by this device. */
11345         uint8_t max_schqs;
11346         uint8_t mpc_chnls_cap;
11347         /*
11348          * When this bit is '1', it indicates that HW and firmware
11349          * supports the use of a MPC channel with destination set
11350          * to the TX crypto engine block.
11351          */
11352         #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_TCE         UINT32_C(0x1)
11353         /*
11354          * When this bit is '1', it indicates that HW and firmware
11355          * supports the use of a MPC channel with destination set
11356          * to the RX crypto engine block.
11357          */
11358         #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_RCE         UINT32_C(0x2)
11359         /*
11360          * When this bit is '1', it indicates that HW and firmware
11361          * supports the use of a MPC channel with destination set
11362          * to the TX configurable flow processing block.
11363          */
11364         #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_TE_CFA      UINT32_C(0x4)
11365         /*
11366          * When this bit is '1', it indicates that HW and firmware
11367          * supports the use of a MPC channel with destination set
11368          * to the RX configurable flow processing block.
11369          */
11370         #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_RE_CFA      UINT32_C(0x8)
11371         /*
11372          * When this bit is '1', it indicates that HW and firmware
11373          * supports the use of a MPC channel with destination set
11374          * to the primate processor block.
11375          */
11376         #define HWRM_FUNC_QCAPS_OUTPUT_MPC_CHNLS_CAP_PRIMATE     UINT32_C(0x10)
11377         uint8_t unused_1;
11378         /*
11379          * This field is used in Output records to indicate that the output
11380          * is completely written to RAM.  This field should be read as '1'
11381          * to indicate that the output has been completely written.
11382          * When writing a command completion or response to an internal processor,
11383          * the order of writes has to be such that this field is written last.
11384          */
11385         uint8_t valid;
11386 } __rte_packed;
11387
11388 /******************
11389  * hwrm_func_qcfg *
11390  ******************/
11391
11392
11393 /* hwrm_func_qcfg_input (size:192b/24B) */
11394 struct hwrm_func_qcfg_input {
11395         /* The HWRM command request type. */
11396         uint16_t        req_type;
11397         /*
11398          * The completion ring to send the completion event on. This should
11399          * be the NQ ID returned from the `nq_alloc` HWRM command.
11400          */
11401         uint16_t        cmpl_ring;
11402         /*
11403          * The sequence ID is used by the driver for tracking multiple
11404          * commands. This ID is treated as opaque data by the firmware and
11405          * the value is returned in the `hwrm_resp_hdr` upon completion.
11406          */
11407         uint16_t        seq_id;
11408         /*
11409          * The target ID of the command:
11410          * * 0x0-0xFFF8 - The function ID
11411          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11412          * * 0xFFFD - Reserved for user-space HWRM interface
11413          * * 0xFFFF - HWRM
11414          */
11415         uint16_t        target_id;
11416         /*
11417          * A physical address pointer pointing to a host buffer that the
11418          * command's response data will be written. This can be either a host
11419          * physical address (HPA) or a guest physical address (GPA) and must
11420          * point to a physically contiguous block of memory.
11421          */
11422         uint64_t        resp_addr;
11423         /*
11424          * Function ID of the function that is being queried.
11425          * 0xFF... (All Fs) if the query is for the requesting
11426          * function.
11427          * 0xFFFE (REQUESTING_PARENT_FID) This is a special FID
11428          * to be used by a trusted VF to query its parent PF.
11429          */
11430         uint16_t        fid;
11431         uint8_t unused_0[6];
11432 } __rte_packed;
11433
11434 /* hwrm_func_qcfg_output (size:768b/96B) */
11435 struct hwrm_func_qcfg_output {
11436         /* The specific error status for the command. */
11437         uint16_t        error_code;
11438         /* The HWRM command request type. */
11439         uint16_t        req_type;
11440         /* The sequence ID from the original command. */
11441         uint16_t        seq_id;
11442         /* The length of the response data in number of bytes. */
11443         uint16_t        resp_len;
11444         /*
11445          * FID value.  This value is used to identify operations on the PCI
11446          * bus as belonging to a particular PCI function.
11447          */
11448         uint16_t        fid;
11449         /*
11450          * Port ID of port that this function is associated with.
11451          * 0xFF... (All Fs) if this function is not associated with
11452          * any port.
11453          */
11454         uint16_t        port_id;
11455         /*
11456          * This value is the current VLAN setting for this
11457          * function. The value of 0 for this field indicates
11458          * no priority tagging or VLAN is used.
11459          * This field's format is same as 802.1Q Tag's
11460          * Tag Control Information (TCI) format that includes both
11461          * Priority Code Point (PCP) and VLAN Identifier (VID).
11462          */
11463         uint16_t        vlan;
11464         uint16_t        flags;
11465         /*
11466          * If 1, then magic packet based Out-Of-Box WoL is enabled on
11467          * the port associated with this function.
11468          */
11469         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \
11470                 UINT32_C(0x1)
11471         /*
11472          * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled
11473          * on the port associated with this function.
11474          */
11475         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED \
11476                 UINT32_C(0x2)
11477         /*
11478          * If set to 1, then FW based DCBX agent is enabled and running on
11479          * the port associated with this function.
11480          * If set to 0, then DCBX agent is not running in the firmware.
11481          */
11482         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \
11483                 UINT32_C(0x4)
11484         /*
11485          * Standard TX Ring mode is used for the allocation of TX ring
11486          * and underlying scheduling resources that allow bandwidth
11487          * reservation and limit settings on the queried function.
11488          * If set to 1, then standard TX ring mode is enabled
11489          * on the queried function.
11490          * If set to 0, then the standard TX ring mode is disabled
11491          * on the queried function. In this extended TX ring resource
11492          * mode, the minimum and maximum bandwidth settings are not
11493          * supported to allow the allocation of TX rings to span multiple
11494          * scheduler nodes.
11495          */
11496         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \
11497                 UINT32_C(0x8)
11498         /*
11499          * If set to 1 then FW based LLDP agent is enabled and running on
11500          * the port associated with this function.
11501          * If set to 0 then the LLDP agent is not running in the firmware.
11502          */
11503         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED \
11504                 UINT32_C(0x10)
11505         /*
11506          * If set to 1, then multi-host mode is active for this function.
11507          * The NIC is attached to two or more independent host systems
11508          * through two or more PCIe endpoints.
11509          * If set to 0, then multi-host mode is inactive for this function
11510          * or not applicable for this device.
11511          */
11512         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST \
11513                 UINT32_C(0x20)
11514         /*
11515          * If the function that is being queried is a PF, then the HWRM shall
11516          * set this field to 0 and the HWRM client shall ignore this field.
11517          * If the function that is being queried is a VF, then the HWRM shall
11518          * set this field to 1 if the queried VF is trusted, otherwise the HWRM
11519          * shall set this field to 0.
11520          */
11521         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF \
11522                 UINT32_C(0x40)
11523         /*
11524          * If set to 1, then secure mode is enabled for this function or device.
11525          * If set to 0, then secure mode is disabled (or normal mode) for this
11526          * function or device.
11527          */
11528         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_SECURE_MODE_ENABLED \
11529                 UINT32_C(0x80)
11530         /*
11531          * If set to 1, then this PF is enabled with a preboot driver that
11532          * requires access to the legacy L2 ring model and legacy 32b
11533          * doorbells. If set to 0, then this PF is not allowed to use
11534          * the legacy L2 rings. This feature is not allowed on VFs and
11535          * is only relevant for devices that require a context backing
11536          * store.
11537          */
11538         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \
11539                 UINT32_C(0x100)
11540         /*
11541          * If set to 1, then the firmware and all currently registered driver
11542          * instances support hot reset. The hot reset support will be updated
11543          * dynamically based on the driver interface advertisement.
11544          * If set to 0, then the adapter is not currently able to initiate
11545          * hot reset.
11546          */
11547         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_HOT_RESET_ALLOWED \
11548                 UINT32_C(0x200)
11549         /*
11550          * If set to 1, then the PPP tx push mode is enabled for all the
11551          * reserved TX rings of this function. If set to 0, then PPP tx push
11552          * mode is disabled for all the reserved TX rings of this function.
11553          */
11554         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PPP_PUSH_MODE_ENABLED \
11555                 UINT32_C(0x400)
11556         /*
11557          * If set to 1, then the firmware will notify driver using async
11558          * event when a ring is disabled due to a Hardware error.
11559          */
11560         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_RING_MONITOR_ENABLED \
11561                 UINT32_C(0x800)
11562         /*
11563          * If set to 1, then the firmware and all currently registered driver
11564          * instances support fast reset. The fast reset support will be
11565          * updated dynamically based on the driver interface advertisement.
11566          * If set to 0, then the adapter is not currently able to initiate
11567          * fast reset.
11568          */
11569         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FAST_RESET_ALLOWED \
11570                 UINT32_C(0x1000)
11571         /*
11572          * If set to 1, then multi-root mode is active for this function.
11573          * The NIC is attached to a single host with a single operating
11574          * system, but through two or more PCIe endpoints.
11575          * If set to 0, then multi-root mode is inactive for this function
11576          * or not applicable for this device.
11577          */
11578         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_ROOT \
11579                 UINT32_C(0x2000)
11580         /*
11581          * This value is current MAC address configured for this
11582          * function. A value of 00-00-00-00-00-00 indicates no
11583          * MAC address is currently configured.
11584          */
11585         uint8_t mac_address[6];
11586         /*
11587          * This value is current PCI ID of this
11588          * function. If ARI is enabled, then it is
11589          * Bus Number (8b):Function Number(8b). Otherwise, it is
11590          * Bus Number (8b):Device Number (4b):Function Number(4b).
11591          * If multi-host mode is active, the 4 lsb will indicate
11592          * the PF index for this function.
11593          */
11594         uint16_t        pci_id;
11595         /*
11596          * The number of RSS/COS contexts currently
11597          * allocated to the function.
11598          */
11599         uint16_t        alloc_rsscos_ctx;
11600         /*
11601          * The number of completion rings currently allocated to
11602          * the function. This does not include the rings allocated
11603          * to any children functions if any.
11604          */
11605         uint16_t        alloc_cmpl_rings;
11606         /*
11607          * The number of transmit rings currently allocated to
11608          * the function. This does not include the rings allocated
11609          * to any children functions if any.
11610          */
11611         uint16_t        alloc_tx_rings;
11612         /*
11613          * The number of receive rings currently allocated to
11614          * the function. This does not include the rings allocated
11615          * to any children functions if any.
11616          */
11617         uint16_t        alloc_rx_rings;
11618         /* The allocated number of L2 contexts to the function. */
11619         uint16_t        alloc_l2_ctx;
11620         /* The allocated number of vnics to the function. */
11621         uint16_t        alloc_vnics;
11622         /*
11623          * The maximum transmission unit of the function.
11624          * If the reported mtu value is non-zero then it will used for the
11625          * rings allocated on this function. otherwise the default
11626          * value is used if ring MTU is not specified.
11627          */
11628         uint16_t        mtu;
11629         /*
11630          * The maximum receive unit of the function.
11631          * For vnics allocated on this function, this default
11632          * value is used if vnic MRU is not specified.
11633          */
11634         uint16_t        mru;
11635         /* The statistics context assigned to a function. */
11636         uint16_t        stat_ctx_id;
11637         /*
11638          * The HWRM shall return Unknown value for this field
11639          * when this command is used to query VF's configuration.
11640          */
11641         uint8_t port_partition_type;
11642         /* Single physical function */
11643         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF     UINT32_C(0x0)
11644         /* Multiple physical functions */
11645         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS    UINT32_C(0x1)
11646         /* Network Partitioning 1.0 */
11647         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
11648         /* Network Partitioning 1.5 */
11649         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
11650         /* Network Partitioning 2.0 */
11651         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
11652         /* Unknown */
11653         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN \
11654                 UINT32_C(0xff)
11655         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST \
11656                 HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN
11657         /*
11658          * This field will indicate number of physical functions on this port_partition.
11659          * HWRM shall return unavail (i.e. value of 0) for this field
11660          * when this command is used to query VF's configuration or
11661          * from older firmware that doesn't support this field.
11662          */
11663         uint8_t port_pf_cnt;
11664         /* number of PFs is not available */
11665         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
11666         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST \
11667                 HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL
11668         /*
11669          * The default VNIC ID assigned to a function that is
11670          * being queried.
11671          */
11672         uint16_t        dflt_vnic_id;
11673         uint16_t        max_mtu_configured;
11674         /*
11675          * Minimum BW allocated for this function.
11676          * The HWRM will translate this value into byte counter and
11677          * time interval used for the scheduler inside the device.
11678          * A value of 0 indicates the minimum bandwidth is not
11679          * configured.
11680          */
11681         uint32_t        min_bw;
11682         /* The bandwidth value. */
11683         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK \
11684                 UINT32_C(0xfffffff)
11685         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT              0
11686         /* The granularity of the value (bits or bytes). */
11687         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE \
11688                 UINT32_C(0x10000000)
11689         /* Value is in bits. */
11690         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS \
11691                 (UINT32_C(0x0) << 28)
11692         /* Value is in bytes. */
11693         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \
11694                 (UINT32_C(0x1) << 28)
11695         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \
11696                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
11697         /* bw_value_unit is 3 b */
11698         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \
11699                 UINT32_C(0xe0000000)
11700         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
11701         /* Value is in Mb or MB (base 10). */
11702         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
11703                 (UINT32_C(0x0) << 29)
11704         /* Value is in Kb or KB (base 10). */
11705         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \
11706                 (UINT32_C(0x2) << 29)
11707         /* Value is in bits or bytes. */
11708         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \
11709                 (UINT32_C(0x4) << 29)
11710         /* Value is in Gb or GB (base 10). */
11711         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
11712                 (UINT32_C(0x6) << 29)
11713         /* Value is in 1/100th of a percentage of total bandwidth. */
11714         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
11715                 (UINT32_C(0x1) << 29)
11716         /* Invalid unit */
11717         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
11718                 (UINT32_C(0x7) << 29)
11719         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \
11720                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
11721         /*
11722          * Maximum BW allocated for this function.
11723          * The HWRM will translate this value into byte counter and
11724          * time interval used for the scheduler inside the device.
11725          * A value of 0 indicates that the maximum bandwidth is not
11726          * configured.
11727          */
11728         uint32_t        max_bw;
11729         /* The bandwidth value. */
11730         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK \
11731                 UINT32_C(0xfffffff)
11732         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT              0
11733         /* The granularity of the value (bits or bytes). */
11734         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE \
11735                 UINT32_C(0x10000000)
11736         /* Value is in bits. */
11737         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS \
11738                 (UINT32_C(0x0) << 28)
11739         /* Value is in bytes. */
11740         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \
11741                 (UINT32_C(0x1) << 28)
11742         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \
11743                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
11744         /* bw_value_unit is 3 b */
11745         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \
11746                 UINT32_C(0xe0000000)
11747         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
11748         /* Value is in Mb or MB (base 10). */
11749         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
11750                 (UINT32_C(0x0) << 29)
11751         /* Value is in Kb or KB (base 10). */
11752         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \
11753                 (UINT32_C(0x2) << 29)
11754         /* Value is in bits or bytes. */
11755         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \
11756                 (UINT32_C(0x4) << 29)
11757         /* Value is in Gb or GB (base 10). */
11758         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
11759                 (UINT32_C(0x6) << 29)
11760         /* Value is in 1/100th of a percentage of total bandwidth. */
11761         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
11762                 (UINT32_C(0x1) << 29)
11763         /* Invalid unit */
11764         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
11765                 (UINT32_C(0x7) << 29)
11766         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \
11767                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
11768         /*
11769          * This value indicates the Edge virtual bridge mode for the
11770          * domain that this function belongs to.
11771          */
11772         uint8_t evb_mode;
11773         /* No Edge Virtual Bridging (EVB) */
11774         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
11775         /* Virtual Ethernet Bridge (VEB) */
11776         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB    UINT32_C(0x1)
11777         /* Virtual Ethernet Port Aggregator (VEPA) */
11778         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA   UINT32_C(0x2)
11779         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST \
11780                 HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA
11781         uint8_t options;
11782         /*
11783          * This value indicates the PCIE device cache line size.
11784          * The cache line size allows the DMA writes to terminate and
11785          * start at the cache boundary.
11786          */
11787         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK \
11788                 UINT32_C(0x3)
11789         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT          0
11790         /* Cache Line Size 64 bytes */
11791         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
11792                 UINT32_C(0x0)
11793         /* Cache Line Size 128 bytes */
11794         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
11795                 UINT32_C(0x1)
11796         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST \
11797                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
11798         /* This value is the virtual link admin state setting. */
11799         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
11800                 UINT32_C(0xc)
11801         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
11802         /* Admin link state is in forced down mode. */
11803         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
11804                 (UINT32_C(0x0) << 2)
11805         /* Admin link state is in forced up mode. */
11806         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
11807                 (UINT32_C(0x1) << 2)
11808         /* Admin link state is in auto mode  - follows the physical link state. */
11809         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
11810                 (UINT32_C(0x2) << 2)
11811         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
11812                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
11813         /* Reserved for future. */
11814         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK \
11815                 UINT32_C(0xf0)
11816         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT                    4
11817         /*
11818          * The number of VFs that are allocated to the function.
11819          * This is valid only on the PF with SR-IOV enabled.
11820          * 0xFF... (All Fs) if this command is called on a PF with
11821          * SR-IOV disabled or on a VF.
11822          */
11823         uint16_t        alloc_vfs;
11824         /*
11825          * The number of allocated multicast filters for this
11826          * function on the RX side.
11827          */
11828         uint32_t        alloc_mcast_filters;
11829         /*
11830          * The number of allocated HW ring groups for this
11831          * function.
11832          */
11833         uint32_t        alloc_hw_ring_grps;
11834         /*
11835          * The number of strict priority transmit rings out of
11836          * currently allocated TX rings to the function
11837          * (alloc_tx_rings).
11838          */
11839         uint16_t        alloc_sp_tx_rings;
11840         /*
11841          * The number of statistics contexts
11842          * currently reserved for the function.
11843          */
11844         uint16_t        alloc_stat_ctx;
11845         /*
11846          * This field specifies how many NQs are reserved for the PF.
11847          * Remaining NQs that belong to the PF are available for VFs.
11848          * Once a PF has created VFs, it cannot change how many NQs are
11849          * reserved for itself (since the NQs must be contiguous in HW).
11850          */
11851         uint16_t        alloc_msix;
11852         /*
11853          * The number of registered VF’s associated with the PF. This field
11854          * should be ignored when the request received on the VF interface.
11855          * This field will be updated on the PF interface to initiate
11856          * the unregister request on PF in the HOT Reset Process.
11857          */
11858         uint16_t        registered_vfs;
11859         /*
11860          * The size of the doorbell BAR in KBytes reserved for L2 including
11861          * any area that is shared between L2 and RoCE.  The L2 driver
11862          * should only map the L2 portion of the doorbell BAR.  Any rounding
11863          * of the BAR size to the native CPU page size should be performed
11864          * by the driver.  If the value is zero, no special partitioning
11865          * of the doorbell BAR between L2 and RoCE is required.
11866          */
11867         uint16_t        l2_doorbell_bar_size_kb;
11868         uint8_t unused_1;
11869         /*
11870          * For backward compatibility this field must be set to 1.
11871          * Older drivers might look for this field to be 1 before
11872          * processing the message.
11873          */
11874         uint8_t always_1;
11875         /*
11876          * This GRC address location is used by the Host driver interfaces to poll
11877          * the adapter ready state to re-initiate the registration process again
11878          * after receiving the RESET Notify event.
11879          */
11880         uint32_t        reset_addr_poll;
11881         /*
11882          * This field specifies legacy L2 doorbell size in KBytes. Drivers should use
11883          * this value to find out the doorbell page offset from the BAR.
11884          */
11885         uint16_t        legacy_l2_db_size_kb;
11886         uint16_t        svif_info;
11887         /*
11888          * This field specifies the source virtual interface of the function being
11889          * queried. Drivers can use this to program svif field in the L2 context
11890          * table
11891          */
11892         #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_MASK      UINT32_C(0x7fff)
11893         #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_SFT       0
11894         /* This field specifies whether svif is valid or not */
11895         #define HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_VALID     UINT32_C(0x8000)
11896         uint8_t mpc_chnls;
11897         /*
11898          * When this bit is '1', it indicates that a MPC channel with
11899          * destination set to the TX crypto engine block is enabled.
11900          */
11901         #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_TCE_ENABLED \
11902                 UINT32_C(0x1)
11903         /*
11904          * When this bit is '1', it indicates that a MPC channel with
11905          * destination set to the RX crypto engine block is enabled.
11906          */
11907         #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_RCE_ENABLED \
11908                 UINT32_C(0x2)
11909         /*
11910          * When this bit is '1', it indicates that a MPC channel with
11911          * destination set to the TX configurable flow processing block is
11912          * enabled.
11913          */
11914         #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_TE_CFA_ENABLED \
11915                 UINT32_C(0x4)
11916         /*
11917          * When this bit is '1', it indicates that a MPC channel with
11918          * destination set to the RX configurable flow processing block is
11919          * enabled.
11920          */
11921         #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_RE_CFA_ENABLED \
11922                 UINT32_C(0x8)
11923         /*
11924          * When this bit is '1', it indicates that a MPC channel with
11925          * destination set to the primate processor block is enabled.
11926          */
11927         #define HWRM_FUNC_QCFG_OUTPUT_MPC_CHNLS_PRIMATE_ENABLED \
11928                 UINT32_C(0x10)
11929         uint8_t unused_2[6];
11930         /*
11931          * This field is used in Output records to indicate that the output
11932          * is completely written to RAM.  This field should be read as '1'
11933          * to indicate that the output has been completely written.
11934          * When writing a command completion or response to an internal processor,
11935          * the order of writes has to be such that this field is written last.
11936          */
11937         uint8_t valid;
11938 } __rte_packed;
11939
11940 /*****************
11941  * hwrm_func_cfg *
11942  *****************/
11943
11944
11945 /* hwrm_func_cfg_input (size:768b/96B) */
11946 struct hwrm_func_cfg_input {
11947         /* The HWRM command request type. */
11948         uint16_t        req_type;
11949         /*
11950          * The completion ring to send the completion event on. This should
11951          * be the NQ ID returned from the `nq_alloc` HWRM command.
11952          */
11953         uint16_t        cmpl_ring;
11954         /*
11955          * The sequence ID is used by the driver for tracking multiple
11956          * commands. This ID is treated as opaque data by the firmware and
11957          * the value is returned in the `hwrm_resp_hdr` upon completion.
11958          */
11959         uint16_t        seq_id;
11960         /*
11961          * The target ID of the command:
11962          * * 0x0-0xFFF8 - The function ID
11963          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11964          * * 0xFFFD - Reserved for user-space HWRM interface
11965          * * 0xFFFF - HWRM
11966          */
11967         uint16_t        target_id;
11968         /*
11969          * A physical address pointer pointing to a host buffer that the
11970          * command's response data will be written. This can be either a host
11971          * physical address (HPA) or a guest physical address (GPA) and must
11972          * point to a physically contiguous block of memory.
11973          */
11974         uint64_t        resp_addr;
11975         /*
11976          * Function ID of the function that is being
11977          * configured.
11978          * If set to 0xFF... (All Fs), then the configuration is
11979          * for the requesting function.
11980          */
11981         uint16_t        fid;
11982         /*
11983          * This field specifies how many NQs will be reserved for the PF.
11984          * Remaining NQs that belong to the PF become available for VFs.
11985          * Once a PF has created VFs, it cannot change how many NQs are
11986          * reserved for itself (since the NQs must be contiguous in HW).
11987          */
11988         uint16_t        num_msix;
11989         uint32_t        flags;
11990         /*
11991          * When this bit is '1', the function is disabled with
11992          * source MAC address check.
11993          * This is an anti-spoofing check. If this flag is set,
11994          * then the function shall be configured to disallow
11995          * transmission of frames with the source MAC address that
11996          * is configured for this function.
11997          */
11998         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \
11999                 UINT32_C(0x1)
12000         /*
12001          * When this bit is '1', the function is enabled with
12002          * source MAC address check.
12003          * This is an anti-spoofing check. If this flag is set,
12004          * then the function shall be configured to allow
12005          * transmission of frames with the source MAC address that
12006          * is configured for this function.
12007          */
12008         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \
12009                 UINT32_C(0x2)
12010         /* reserved. */
12011         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK \
12012                 UINT32_C(0x1fc)
12013         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT                       2
12014         /*
12015          * Standard TX Ring mode is used for the allocation of TX ring
12016          * and underlying scheduling resources that allow bandwidth
12017          * reservation and limit settings on the queried function.
12018          * If set to 1, then standard TX ring mode is requested to be
12019          * enabled on the function being configured.
12020          */
12021         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \
12022                 UINT32_C(0x200)
12023         /*
12024          * Standard TX Ring mode is used for the allocation of TX ring
12025          * and underlying scheduling resources that allow bandwidth
12026          * reservation and limit settings on the queried function.
12027          * If set to 1, then the standard TX ring mode is requested to
12028          * be disabled on the function being configured. In this extended
12029          * TX ring resource mode, the minimum and maximum bandwidth settings
12030          * are not supported to allow the allocation of TX rings to
12031          * span multiple scheduler nodes.
12032          */
12033         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \
12034                 UINT32_C(0x400)
12035         /*
12036          * If this bit is set, virtual mac address configured
12037          * in this command will be persistent over warm boot.
12038          */
12039         #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST \
12040                 UINT32_C(0x800)
12041         /*
12042          * This bit only applies to the VF. If this bit is set, the statistic
12043          * context counters will not be cleared when the statistic context is freed
12044          * or a function reset is called on VF. This bit will be cleared when the PF
12045          * is unloaded or a function reset is called on the PF.
12046          */
12047         #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC \
12048                 UINT32_C(0x1000)
12049         /*
12050          * This bit requests that the firmware test to see if all the assets
12051          * requested in this command (i.e. number of TX rings) are available.
12052          * The firmware will return an error if the requested assets are
12053          * not available. The firwmare will NOT reserve the assets if they
12054          * are available.
12055          */
12056         #define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
12057                 UINT32_C(0x2000)
12058         /*
12059          * This bit requests that the firmware test to see if all the assets
12060          * requested in this command (i.e. number of RX rings) are available.
12061          * The firmware will return an error if the requested assets are
12062          * not available. The firwmare will NOT reserve the assets if they
12063          * are available.
12064          */
12065         #define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
12066                 UINT32_C(0x4000)
12067         /*
12068          * This bit requests that the firmware test to see if all the assets
12069          * requested in this command (i.e. number of CMPL rings) are available.
12070          * The firmware will return an error if the requested assets are
12071          * not available. The firwmare will NOT reserve the assets if they
12072          * are available.
12073          */
12074         #define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
12075                 UINT32_C(0x8000)
12076         /*
12077          * This bit requests that the firmware test to see if all the assets
12078          * requested in this command (i.e. number of RSS ctx) are available.
12079          * The firmware will return an error if the requested assets are
12080          * not available. The firwmare will NOT reserve the assets if they
12081          * are available.
12082          */
12083         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
12084                 UINT32_C(0x10000)
12085         /*
12086          * This bit requests that the firmware test to see if all the assets
12087          * requested in this command (i.e. number of ring groups) are available.
12088          * The firmware will return an error if the requested assets are
12089          * not available. The firwmare will NOT reserve the assets if they
12090          * are available.
12091          */
12092         #define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
12093                 UINT32_C(0x20000)
12094         /*
12095          * This bit requests that the firmware test to see if all the assets
12096          * requested in this command (i.e. number of stat ctx) are available.
12097          * The firmware will return an error if the requested assets are
12098          * not available. The firwmare will NOT reserve the assets if they
12099          * are available.
12100          */
12101         #define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
12102                 UINT32_C(0x40000)
12103         /*
12104          * This bit requests that the firmware test to see if all the assets
12105          * requested in this command (i.e. number of VNICs) are available.
12106          * The firmware will return an error if the requested assets are
12107          * not available. The firwmare will NOT reserve the assets if they
12108          * are available.
12109          */
12110         #define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
12111                 UINT32_C(0x80000)
12112         /*
12113          * This bit requests that the firmware test to see if all the assets
12114          * requested in this command (i.e. number of L2 ctx) are available.
12115          * The firmware will return an error if the requested assets are
12116          * not available. The firwmare will NOT reserve the assets if they
12117          * are available.
12118          */
12119         #define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
12120                 UINT32_C(0x100000)
12121         /*
12122          * This configuration change can be initiated by a PF driver. This
12123          * configuration request shall be targeted to a VF. From local host
12124          * resident HWRM clients, only the parent PF driver shall be allowed
12125          * to initiate this change on one of its children VFs. If this bit is
12126          * set to 1, then the VF that is being configured is requested to be
12127          * trusted.
12128          */
12129         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_ENABLE \
12130                 UINT32_C(0x200000)
12131         /*
12132          * When this bit it set, even if PF reserved pool size is zero,
12133          * FW will allow driver to create TX rings in ring alloc,
12134          * by reserving TX ring, S3 node dynamically.
12135          */
12136         #define HWRM_FUNC_CFG_INPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
12137                 UINT32_C(0x400000)
12138         /*
12139          * This bit requests that the firmware test to see if all the assets
12140          * requested in this command (i.e. number of NQ rings) are available.
12141          * The firmware will return an error if the requested assets are
12142          * not available. The firwmare will NOT reserve the assets if they
12143          * are available.
12144          */
12145         #define HWRM_FUNC_CFG_INPUT_FLAGS_NQ_ASSETS_TEST \
12146                 UINT32_C(0x800000)
12147         /*
12148          * This configuration change can be initiated by a PF driver. This
12149          * configuration request shall be targeted to a VF. From local host
12150          * resident HWRM clients, only the parent PF driver shall be allowed
12151          * to initiate this change on one of its children VFs. If this bit is
12152          * set to 1, then the VF that is being configured is requested to be
12153          * untrusted.
12154          */
12155         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_DISABLE \
12156                 UINT32_C(0x1000000)
12157         /*
12158          * This bit is used by preboot drivers on a PF that require access
12159          * to the legacy L2 ring model and legacy 32b doorbells. This
12160          * feature is not allowed on VFs and is only relevant for devices
12161          * that require a context backing store.
12162          */
12163         #define HWRM_FUNC_CFG_INPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \
12164                 UINT32_C(0x2000000)
12165         /*
12166          * If this bit is set to 0, then the interface does not support hot
12167          * reset capability which it advertised with the hot_reset_support
12168          * flag in HWRM_FUNC_DRV_RGTR. If any of the function has set this
12169          * flag to 0, adapter cannot do the hot reset. In this state, if the
12170          * firmware receives a hot reset request, firmware must fail the
12171          * request. If this bit is set to 1, then interface is renabling the
12172          * hot reset capability.
12173          */
12174         #define HWRM_FUNC_CFG_INPUT_FLAGS_HOT_RESET_IF_EN_DIS \
12175                 UINT32_C(0x4000000)
12176         /*
12177          * If this bit is set to 1, the PF driver is requesting FW
12178          * to enable PPP TX PUSH feature on all the TX rings specified in
12179          * the num_tx_rings field. By default, the PPP TX push feature is
12180          * disabled for all the TX rings of the function. This flag is
12181          * ignored if num_tx_rings field is not specified or the function
12182          * doesn't support PPP tx push feature.
12183          */
12184         #define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_ENABLE \
12185                 UINT32_C(0x8000000)
12186         /*
12187          * If this bit is set to 1, the PF driver is requesting FW
12188          * to disable PPP TX PUSH feature on all the TX rings specified in
12189          * the num_tx_rings field. This flag is ignored if num_tx_rings
12190          * field is not specified or the function doesn't support PPP tx
12191          * push feature.
12192          */
12193         #define HWRM_FUNC_CFG_INPUT_FLAGS_PPP_PUSH_MODE_DISABLE \
12194                 UINT32_C(0x10000000)
12195         /*
12196          * If this bit is set to 1, the driver is requesting FW to enable
12197          * the BD_METADATA feature for this function. The FW returns error
12198          * on this request if the TX_METADATA is enabled for this function.
12199          */
12200         #define HWRM_FUNC_CFG_INPUT_FLAGS_BD_METADATA_ENABLE \
12201                 UINT32_C(0x20000000)
12202         /*
12203          * If this bit is set to 1, the driver is requesting FW to disable
12204          * the BD_METADATA feature for this function. The FW returns error
12205          * on this request if the TX_METADATA is enabled for this function.
12206          */
12207         #define HWRM_FUNC_CFG_INPUT_FLAGS_BD_METADATA_DISABLE \
12208                 UINT32_C(0x40000000)
12209         uint32_t        enables;
12210         /*
12211          * This bit must be '1' for the mtu field to be
12212          * configured.
12213          */
12214         #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU \
12215                 UINT32_C(0x1)
12216         /*
12217          * This bit must be '1' for the mru field to be
12218          * configured.
12219          */
12220         #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU \
12221                 UINT32_C(0x2)
12222         /*
12223          * This bit must be '1' for the num_rsscos_ctxs field to be
12224          * configured.
12225          */
12226         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
12227                 UINT32_C(0x4)
12228         /*
12229          * This bit must be '1' for the num_cmpl_rings field to be
12230          * configured.
12231          */
12232         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
12233                 UINT32_C(0x8)
12234         /*
12235          * This bit must be '1' for the num_tx_rings field to be
12236          * configured.
12237          */
12238         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS \
12239                 UINT32_C(0x10)
12240         /*
12241          * This bit must be '1' for the num_rx_rings field to be
12242          * configured.
12243          */
12244         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS \
12245                 UINT32_C(0x20)
12246         /*
12247          * This bit must be '1' for the num_l2_ctxs field to be
12248          * configured.
12249          */
12250         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS \
12251                 UINT32_C(0x40)
12252         /*
12253          * This bit must be '1' for the num_vnics field to be
12254          * configured.
12255          */
12256         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS \
12257                 UINT32_C(0x80)
12258         /*
12259          * This bit must be '1' for the num_stat_ctxs field to be
12260          * configured.
12261          */
12262         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
12263                 UINT32_C(0x100)
12264         /*
12265          * This bit must be '1' for the dflt_mac_addr field to be
12266          * configured.
12267          */
12268         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
12269                 UINT32_C(0x200)
12270         /*
12271          * This bit must be '1' for the dflt_vlan field to be
12272          * configured.
12273          */
12274         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN \
12275                 UINT32_C(0x400)
12276         /*
12277          * This bit must be '1' for the dflt_ip_addr field to be
12278          * configured.
12279          */
12280         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR \
12281                 UINT32_C(0x800)
12282         /*
12283          * This bit must be '1' for the min_bw field to be
12284          * configured.
12285          */
12286         #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW \
12287                 UINT32_C(0x1000)
12288         /*
12289          * This bit must be '1' for the max_bw field to be
12290          * configured.
12291          */
12292         #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW \
12293                 UINT32_C(0x2000)
12294         /*
12295          * This bit must be '1' for the async_event_cr field to be
12296          * configured.
12297          */
12298         #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
12299                 UINT32_C(0x4000)
12300         /*
12301          * This bit must be '1' for the vlan_antispoof_mode field to be
12302          * configured.
12303          */
12304         #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE \
12305                 UINT32_C(0x8000)
12306         /*
12307          * This bit must be '1' for the allowed_vlan_pris field to be
12308          * configured.
12309          */
12310         #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS \
12311                 UINT32_C(0x10000)
12312         /*
12313          * This bit must be '1' for the evb_mode field to be
12314          * configured.
12315          */
12316         #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE \
12317                 UINT32_C(0x20000)
12318         /*
12319          * This bit must be '1' for the num_mcast_filters field to be
12320          * configured.
12321          */
12322         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS \
12323                 UINT32_C(0x40000)
12324         /*
12325          * This bit must be '1' for the num_hw_ring_grps field to be
12326          * configured.
12327          */
12328         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
12329                 UINT32_C(0x80000)
12330         /*
12331          * This bit must be '1' for the cache_linesize field to be
12332          * configured.
12333          */
12334         #define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE \
12335                 UINT32_C(0x100000)
12336         /*
12337          * This bit must be '1' for the num_msix field to be
12338          * configured.
12339          */
12340         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX \
12341                 UINT32_C(0x200000)
12342         /*
12343          * This bit must be '1' for the link admin state field to be
12344          * configured.
12345          */
12346         #define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE \
12347                 UINT32_C(0x400000)
12348         /*
12349          * This bit must be '1' for the hot_reset_if_en_dis field to be
12350          * configured.
12351          */
12352         #define HWRM_FUNC_CFG_INPUT_ENABLES_HOT_RESET_IF_SUPPORT \
12353                 UINT32_C(0x800000)
12354         /*
12355          * This bit must be '1' for the schq_id field to be
12356          * configured.
12357          */
12358         #define HWRM_FUNC_CFG_INPUT_ENABLES_SCHQ_ID \
12359                 UINT32_C(0x1000000)
12360         /*
12361          * This bit must be '1' for the mpc_chnls field to be
12362          * configured.
12363          */
12364         #define HWRM_FUNC_CFG_INPUT_ENABLES_MPC_CHNLS \
12365                 UINT32_C(0x2000000)
12366         /*
12367          * The maximum transmission unit of the function.
12368          * The HWRM should make sure that the mtu of
12369          * the function does not exceed the mtu of the physical
12370          * port that this function is associated with.
12371          *
12372          * In addition to configuring mtu per function, it is
12373          * possible to configure mtu per transmit ring.
12374          * By default, the mtu of each transmit ring associated
12375          * with a function is equal to the mtu of the function.
12376          * The HWRM should make sure that the mtu of each transmit
12377          * ring that is assigned to a function has a valid mtu.
12378          */
12379         uint16_t        mtu;
12380         /*
12381          * The maximum receive unit of the function.
12382          * The HWRM should make sure that the mru of
12383          * the function does not exceed the mru of the physical
12384          * port that this function is associated with.
12385          *
12386          * In addition to configuring mru per function, it is
12387          * possible to configure mru per vnic.
12388          * By default, the mru of each vnic associated
12389          * with a function is equal to the mru of the function.
12390          * The HWRM should make sure that the mru of each vnic
12391          * that is assigned to a function has a valid mru.
12392          */
12393         uint16_t        mru;
12394         /*
12395          * The number of RSS/COS contexts requested for the
12396          * function.
12397          */
12398         uint16_t        num_rsscos_ctxs;
12399         /*
12400          * The number of completion rings requested for the
12401          * function. This does not include the rings allocated
12402          * to any children functions if any.
12403          */
12404         uint16_t        num_cmpl_rings;
12405         /*
12406          * The number of transmit rings requested for the function.
12407          * This does not include the rings allocated to any
12408          * children functions if any.
12409          */
12410         uint16_t        num_tx_rings;
12411         /*
12412          * The number of receive rings requested for the function.
12413          * This does not include the rings allocated
12414          * to any children functions if any.
12415          */
12416         uint16_t        num_rx_rings;
12417         /* The requested number of L2 contexts for the function. */
12418         uint16_t        num_l2_ctxs;
12419         /* The requested number of vnics for the function. */
12420         uint16_t        num_vnics;
12421         /* The requested number of statistic contexts for the function. */
12422         uint16_t        num_stat_ctxs;
12423         /*
12424          * The number of HW ring groups that should
12425          * be reserved for this function.
12426          */
12427         uint16_t        num_hw_ring_grps;
12428         /* The default MAC address for the function being configured. */
12429         uint8_t dflt_mac_addr[6];
12430         /*
12431          * The default VLAN for the function being configured.
12432          * This field's format is same as 802.1Q Tag's
12433          * Tag Control Information (TCI) format that includes both
12434          * Priority Code Point (PCP) and VLAN Identifier (VID).
12435          */
12436         uint16_t        dflt_vlan;
12437         /*
12438          * The default IP address for the function being configured.
12439          * This address is only used in enabling source property check.
12440          */
12441         uint32_t        dflt_ip_addr[4];
12442         /*
12443          * Minimum BW allocated for this function.
12444          * The HWRM will translate this value into byte counter and
12445          * time interval used for the scheduler inside the device.
12446          */
12447         uint32_t        min_bw;
12448         /* The bandwidth value. */
12449         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK \
12450                 UINT32_C(0xfffffff)
12451         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT              0
12452         /* The granularity of the value (bits or bytes). */
12453         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE \
12454                 UINT32_C(0x10000000)
12455         /* Value is in bits. */
12456         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS \
12457                 (UINT32_C(0x0) << 28)
12458         /* Value is in bytes. */
12459         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES \
12460                 (UINT32_C(0x1) << 28)
12461         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \
12462                 HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
12463         /* bw_value_unit is 3 b */
12464         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \
12465                 UINT32_C(0xe0000000)
12466         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
12467         /* Value is in Mb or MB (base 10). */
12468         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
12469                 (UINT32_C(0x0) << 29)
12470         /* Value is in Kb or KB (base 10). */
12471         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \
12472                 (UINT32_C(0x2) << 29)
12473         /* Value is in bits or bytes. */
12474         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \
12475                 (UINT32_C(0x4) << 29)
12476         /* Value is in Gb or GB (base 10). */
12477         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
12478                 (UINT32_C(0x6) << 29)
12479         /* Value is in 1/100th of a percentage of total bandwidth. */
12480         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
12481                 (UINT32_C(0x1) << 29)
12482         /* Invalid unit */
12483         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
12484                 (UINT32_C(0x7) << 29)
12485         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \
12486                 HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
12487         /*
12488          * Maximum BW allocated for this function.
12489          * The HWRM will translate this value into byte counter and
12490          * time interval used for the scheduler inside the device.
12491          */
12492         uint32_t        max_bw;
12493         /* The bandwidth value. */
12494         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \
12495                 UINT32_C(0xfffffff)
12496         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT              0
12497         /* The granularity of the value (bits or bytes). */
12498         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE \
12499                 UINT32_C(0x10000000)
12500         /* Value is in bits. */
12501         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS \
12502                 (UINT32_C(0x0) << 28)
12503         /* Value is in bytes. */
12504         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES \
12505                 (UINT32_C(0x1) << 28)
12506         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \
12507                 HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
12508         /* bw_value_unit is 3 b */
12509         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
12510                 UINT32_C(0xe0000000)
12511         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
12512         /* Value is in Mb or MB (base 10). */
12513         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
12514                 (UINT32_C(0x0) << 29)
12515         /* Value is in Kb or KB (base 10). */
12516         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
12517                 (UINT32_C(0x2) << 29)
12518         /* Value is in bits or bytes. */
12519         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
12520                 (UINT32_C(0x4) << 29)
12521         /* Value is in Gb or GB (base 10). */
12522         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
12523                 (UINT32_C(0x6) << 29)
12524         /* Value is in 1/100th of a percentage of total bandwidth. */
12525         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
12526                 (UINT32_C(0x1) << 29)
12527         /* Invalid unit */
12528         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
12529                 (UINT32_C(0x7) << 29)
12530         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
12531                 HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
12532         /*
12533          * ID of the target completion ring for receiving asynchronous
12534          * event completions. If this field is not valid, then the
12535          * HWRM shall use the default completion ring of the function
12536          * that is being configured as the target completion ring for
12537          * providing any asynchronous event completions for that
12538          * function.
12539          * If this field is valid, then the HWRM shall use the
12540          * completion ring identified by this ID as the target
12541          * completion ring for providing any asynchronous event
12542          * completions for the function that is being configured.
12543          */
12544         uint16_t        async_event_cr;
12545         /* VLAN Anti-spoofing mode. */
12546         uint8_t vlan_antispoof_mode;
12547         /* No VLAN anti-spoofing checks are enabled */
12548         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK \
12549                 UINT32_C(0x0)
12550         /* Validate VLAN against the configured VLAN(s) */
12551         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \
12552                 UINT32_C(0x1)
12553         /* Insert VLAN if it does not exist, otherwise discard */
12554         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \
12555                 UINT32_C(0x2)
12556         /* Insert VLAN if it does not exist, override VLAN if it exists */
12557         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \
12558                 UINT32_C(0x3)
12559         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST \
12560                 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN
12561         /*
12562          * This bit field defines VLAN PRIs that are allowed on
12563          * this function.
12564          * If nth bit is set, then VLAN PRI n is allowed on this
12565          * function.
12566          */
12567         uint8_t allowed_vlan_pris;
12568         /*
12569          * The evb_mode is configured on a per port basis. The default evb_mode
12570          * is configured based on the NVM EVB mode setting upon firmware
12571          * initialization. The HWRM allows a PF driver to change EVB mode for a
12572          * port used by the PF only when one of the following conditions is
12573          * satisfied.
12574          * 1. The current operating mode is single function mode.
12575          *    (ie. one PF per port)
12576          * 2. For SmartNIC, any one of the PAXC PFs is permitted to change the
12577          *    EVB mode of the port used by the PAXC PF. None of the X86 PFs
12578          *    should have privileges.
12579          * The HWRM doesn't permit any PFs to change the underlying EVB mode
12580          * when running as MHB or NPAR mode in performance NIC configuration.
12581          * The HWRM doesn't permit a VF driver to change the EVB mode.
12582          * Once the HWRM determines a function doesn't meet the conditions
12583          * to configure the EVB mode, it sets the evb_mode_cfg_not_supported
12584          * flag in HWRM_FUNC_QCAPS command response for the function.
12585          * The HWRM takes into account the switching of EVB mode from one to
12586          * another and reconfigure hardware resources as reqiured. The
12587          * switching from VEB to VEPA mode requires the disabling of the
12588          * loopback traffic. Additionally, source knockouts are handled
12589          * differently in VEB and VEPA modes.
12590          */
12591         uint8_t evb_mode;
12592         /* No Edge Virtual Bridging (EVB) */
12593         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
12594         /* Virtual Ethernet Bridge (VEB) */
12595         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB    UINT32_C(0x1)
12596         /* Virtual Ethernet Port Aggregator (VEPA) */
12597         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA   UINT32_C(0x2)
12598         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST \
12599                 HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA
12600         uint8_t options;
12601         /*
12602          * This value indicates the PCIE device cache line size.
12603          * The cache line size allows the DMA writes to terminate and
12604          * start at the cache boundary.
12605          */
12606         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK \
12607                 UINT32_C(0x3)
12608         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT          0
12609         /* Cache Line Size 64 bytes */
12610         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
12611                 UINT32_C(0x0)
12612         /* Cache Line Size 128 bytes */
12613         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
12614                 UINT32_C(0x1)
12615         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST \
12616                 HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
12617         /* This value is the virtual link admin state setting. */
12618         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
12619                 UINT32_C(0xc)
12620         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
12621         /* Admin state is forced down. */
12622         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
12623                 (UINT32_C(0x0) << 2)
12624         /* Admin state is forced up. */
12625         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
12626                 (UINT32_C(0x1) << 2)
12627         /* Admin state is in auto mode - is to follow the physical link state. */
12628         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
12629                 (UINT32_C(0x2) << 2)
12630         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
12631                 HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
12632         /* Reserved for future. */
12633         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK \
12634                 UINT32_C(0xf0)
12635         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT                    4
12636         /*
12637          * The number of multicast filters that should
12638          * be reserved for this function on the RX side.
12639          */
12640         uint16_t        num_mcast_filters;
12641         /* Used by a PF driver to associate a SCHQ with a VF. */
12642         uint16_t        schq_id;
12643         uint16_t        mpc_chnls;
12644         /*
12645          * When this bit is '1', the caller requests to enable a MPC
12646          * channel with destination to the TX crypto engine block.
12647          * When this bit is ‘0’, this flag has no effect.
12648          */
12649         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TCE_ENABLE          UINT32_C(0x1)
12650         /*
12651          * When this bit is '1', the caller requests to disable a MPC
12652          * channel with destination to the TX crypto engine block.
12653          * When this bit is ‘0’, this flag has no effect.
12654          */
12655         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TCE_DISABLE         UINT32_C(0x2)
12656         /*
12657          * When this bit is '1', the caller requests to enable a MPC
12658          * channel with destination to the RX crypto engine block.
12659          * When this bit is ‘0’, this flag has no effect.
12660          */
12661         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RCE_ENABLE          UINT32_C(0x4)
12662         /*
12663          * When this bit is '1', the caller requests to disable a MPC
12664          * channel with destination to the RX crypto engine block.
12665          * When this bit is ‘0’, this flag has no effect.
12666          */
12667         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RCE_DISABLE         UINT32_C(0x8)
12668         /*
12669          * When this bit is '1', the caller requests to enable a MPC
12670          * channel with destination to the TX configurable flow processing
12671          * block. When this bit is ‘0’, this flag has no effect.
12672          */
12673         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TE_CFA_ENABLE \
12674                 UINT32_C(0x10)
12675         /*
12676          * When this bit is '1', the caller requests to disable a MPC
12677          * channel with destination to the TX configurable flow processing
12678          * block. When this bit is ‘0’, this flag has no effect.
12679          */
12680         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_TE_CFA_DISABLE \
12681                 UINT32_C(0x20)
12682         /*
12683          * When this bit is '1', the caller requests to enable a MPC
12684          * channel with destination to the RX configurable flow processing
12685          * block. When this bit is ‘0’, this flag has no effect.
12686          */
12687         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RE_CFA_ENABLE \
12688                 UINT32_C(0x40)
12689         /*
12690          * When this bit is '1', the caller requests to disable a MPC
12691          * channel with destination to the RX configurable flow processing
12692          * block. When this bit is ‘0’, this flag has no effect.
12693          */
12694         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_RE_CFA_DISABLE \
12695                 UINT32_C(0x80)
12696         /*
12697          * When this bit is '1', the caller requests to enable a MPC
12698          * channel with destination to the primate processor block.
12699          * When this bit is ‘0’, this flag has no effect.
12700          */
12701         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_PRIMATE_ENABLE \
12702                 UINT32_C(0x100)
12703         /*
12704          * When this bit is '1', the caller requests to disable a MPC
12705          * channel with destination to the primate processor block.
12706          * When this bit is ‘0’, this flag has no effect.
12707          */
12708         #define HWRM_FUNC_CFG_INPUT_MPC_CHNLS_PRIMATE_DISABLE \
12709                 UINT32_C(0x200)
12710         uint8_t unused_0[4];
12711 } __rte_packed;
12712
12713 /* hwrm_func_cfg_output (size:128b/16B) */
12714 struct hwrm_func_cfg_output {
12715         /* The specific error status for the command. */
12716         uint16_t        error_code;
12717         /* The HWRM command request type. */
12718         uint16_t        req_type;
12719         /* The sequence ID from the original command. */
12720         uint16_t        seq_id;
12721         /* The length of the response data in number of bytes. */
12722         uint16_t        resp_len;
12723         uint8_t unused_0[7];
12724         /*
12725          * This field is used in Output records to indicate that the output
12726          * is completely written to RAM.  This field should be read as '1'
12727          * to indicate that the output has been completely written.
12728          * When writing a command completion or response to an internal processor,
12729          * the order of writes has to be such that this field is written last.
12730          */
12731         uint8_t valid;
12732 } __rte_packed;
12733
12734 /********************
12735  * hwrm_func_qstats *
12736  ********************/
12737
12738
12739 /* hwrm_func_qstats_input (size:192b/24B) */
12740 struct hwrm_func_qstats_input {
12741         /* The HWRM command request type. */
12742         uint16_t        req_type;
12743         /*
12744          * The completion ring to send the completion event on. This should
12745          * be the NQ ID returned from the `nq_alloc` HWRM command.
12746          */
12747         uint16_t        cmpl_ring;
12748         /*
12749          * The sequence ID is used by the driver for tracking multiple
12750          * commands. This ID is treated as opaque data by the firmware and
12751          * the value is returned in the `hwrm_resp_hdr` upon completion.
12752          */
12753         uint16_t        seq_id;
12754         /*
12755          * The target ID of the command:
12756          * * 0x0-0xFFF8 - The function ID
12757          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12758          * * 0xFFFD - Reserved for user-space HWRM interface
12759          * * 0xFFFF - HWRM
12760          */
12761         uint16_t        target_id;
12762         /*
12763          * A physical address pointer pointing to a host buffer that the
12764          * command's response data will be written. This can be either a host
12765          * physical address (HPA) or a guest physical address (GPA) and must
12766          * point to a physically contiguous block of memory.
12767          */
12768         uint64_t        resp_addr;
12769         /*
12770          * Function ID of the function that is being queried.
12771          * 0xFF... (All Fs) if the query is for the requesting
12772          * function.
12773          * A privileged PF can query for other function's statistics.
12774          */
12775         uint16_t        fid;
12776         /* This flags indicates the type of statistics request. */
12777         uint8_t flags;
12778         /* This value is not used to avoid backward compatibility issues. */
12779         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
12780         /*
12781          * flags should be set to 1 when request is for only RoCE statistics.
12782          * This will be honored only if the caller_fid is a privileged PF.
12783          * In all other cases FID and caller_fid should be the same.
12784          */
12785         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_ROCE_ONLY    UINT32_C(0x1)
12786         /*
12787          * flags should be set to 2 when request is for the counter mask,
12788          * representing the width of each of the stats counters, rather
12789          * than counters themselves.
12790          */
12791         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x2)
12792         #define HWRM_FUNC_QSTATS_INPUT_FLAGS_LAST \
12793                 HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK
12794         uint8_t unused_0[5];
12795 } __rte_packed;
12796
12797 /* hwrm_func_qstats_output (size:1408b/176B) */
12798 struct hwrm_func_qstats_output {
12799         /* The specific error status for the command. */
12800         uint16_t        error_code;
12801         /* The HWRM command request type. */
12802         uint16_t        req_type;
12803         /* The sequence ID from the original command. */
12804         uint16_t        seq_id;
12805         /* The length of the response data in number of bytes. */
12806         uint16_t        resp_len;
12807         /* Number of transmitted unicast packets on the function. */
12808         uint64_t        tx_ucast_pkts;
12809         /* Number of transmitted multicast packets on the function. */
12810         uint64_t        tx_mcast_pkts;
12811         /* Number of transmitted broadcast packets on the function. */
12812         uint64_t        tx_bcast_pkts;
12813         /*
12814          * Number of transmitted packets that were discarded due to
12815          * internal NIC resource problems.  For transmit, this
12816          * can only happen if TMP is configured to allow dropping
12817          * in HOL blocking conditions, which is not a normal
12818          * configuration.
12819          */
12820         uint64_t        tx_discard_pkts;
12821         /*
12822          * Number of dropped packets on transmit path on the function.
12823          * These are packets that have been marked for drop by
12824          * the TE CFA block or are packets that exceeded the
12825          * transmit MTU limit for the function.
12826          */
12827         uint64_t        tx_drop_pkts;
12828         /* Number of transmitted bytes for unicast traffic on the function. */
12829         uint64_t        tx_ucast_bytes;
12830         /* Number of transmitted bytes for multicast traffic on the function. */
12831         uint64_t        tx_mcast_bytes;
12832         /* Number of transmitted bytes for broadcast traffic on the function. */
12833         uint64_t        tx_bcast_bytes;
12834         /* Number of received unicast packets on the function. */
12835         uint64_t        rx_ucast_pkts;
12836         /* Number of received multicast packets on the function. */
12837         uint64_t        rx_mcast_pkts;
12838         /* Number of received broadcast packets on the function. */
12839         uint64_t        rx_bcast_pkts;
12840         /*
12841          * Number of received packets that were discarded on the function
12842          * due to resource limitations.  This can happen for 3 reasons.
12843          * # The BD used for the packet has a bad format.
12844          * # There were no BDs available in the ring for the packet.
12845          * # There were no BDs available on-chip for the packet.
12846          */
12847         uint64_t        rx_discard_pkts;
12848         /*
12849          * Number of dropped packets on received path on the function.
12850          * These are packets that have been marked for drop by the
12851          * RE CFA.
12852          */
12853         uint64_t        rx_drop_pkts;
12854         /* Number of received bytes for unicast traffic on the function. */
12855         uint64_t        rx_ucast_bytes;
12856         /* Number of received bytes for multicast traffic on the function. */
12857         uint64_t        rx_mcast_bytes;
12858         /* Number of received bytes for broadcast traffic on the function. */
12859         uint64_t        rx_bcast_bytes;
12860         /* Number of aggregated unicast packets on the function. */
12861         uint64_t        rx_agg_pkts;
12862         /* Number of aggregated unicast bytes on the function. */
12863         uint64_t        rx_agg_bytes;
12864         /* Number of aggregation events on the function. */
12865         uint64_t        rx_agg_events;
12866         /* Number of aborted aggregations on the function. */
12867         uint64_t        rx_agg_aborts;
12868         uint8_t unused_0[7];
12869         /*
12870          * This field is used in Output records to indicate that the output
12871          * is completely written to RAM.  This field should be read as '1'
12872          * to indicate that the output has been completely written.
12873          * When writing a command completion or response to an internal processor,
12874          * the order of writes has to be such that this field is written last.
12875          */
12876         uint8_t valid;
12877 } __rte_packed;
12878
12879 /************************
12880  * hwrm_func_qstats_ext *
12881  ************************/
12882
12883
12884 /* hwrm_func_qstats_ext_input (size:256b/32B) */
12885 struct hwrm_func_qstats_ext_input {
12886         /* The HWRM command request type. */
12887         uint16_t        req_type;
12888         /*
12889          * The completion ring to send the completion event on. This should
12890          * be the NQ ID returned from the `nq_alloc` HWRM command.
12891          */
12892         uint16_t        cmpl_ring;
12893         /*
12894          * The sequence ID is used by the driver for tracking multiple
12895          * commands. This ID is treated as opaque data by the firmware and
12896          * the value is returned in the `hwrm_resp_hdr` upon completion.
12897          */
12898         uint16_t        seq_id;
12899         /*
12900          * The target ID of the command:
12901          * * 0x0-0xFFF8 - The function ID
12902          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12903          * * 0xFFFD - Reserved for user-space HWRM interface
12904          * * 0xFFFF - HWRM
12905          */
12906         uint16_t        target_id;
12907         /*
12908          * A physical address pointer pointing to a host buffer that the
12909          * command's response data will be written. This can be either a host
12910          * physical address (HPA) or a guest physical address (GPA) and must
12911          * point to a physically contiguous block of memory.
12912          */
12913         uint64_t        resp_addr;
12914         /*
12915          * Function ID of the function that is being queried.
12916          * 0xFF... (All Fs) if the query is for the requesting
12917          * function.
12918          * A privileged PF can query for other function's statistics.
12919          */
12920         uint16_t        fid;
12921         /* This flags indicates the type of statistics request. */
12922         uint8_t flags;
12923         /* This value is not used to avoid backward compatibility issues. */
12924         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
12925         /*
12926          * flags should be set to 1 when request is for only RoCE statistics.
12927          * This will be honored only if the caller_fid is a privileged PF.
12928          * In all other cases FID and caller_fid should be the same.
12929          */
12930         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_ROCE_ONLY    UINT32_C(0x1)
12931         /*
12932          * flags should be set to 2 when request is for the counter mask
12933          * representing the width of each of the stats counters, rather
12934          * than counters themselves.
12935          */
12936         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x2)
12937         #define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_LAST \
12938                 HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK
12939         uint8_t unused_0[1];
12940         uint32_t        enables;
12941         /*
12942          * This bit must be '1' for the schq_id and traffic_class fields to
12943          * be configured.
12944          */
12945         #define HWRM_FUNC_QSTATS_EXT_INPUT_ENABLES_SCHQ_ID     UINT32_C(0x1)
12946         /* Specifies the SCHQ for which to gather statistics */
12947         uint16_t        schq_id;
12948         /*
12949          * Specifies the traffic class for which to gather statistics. Valid
12950          * values are 0 through (max_configurable_queues - 1), where
12951          * max_configurable_queues is in the response of HWRM_QUEUE_QPORTCFG
12952          */
12953         uint16_t        traffic_class;
12954         uint8_t unused_1[4];
12955 } __rte_packed;
12956
12957 /* hwrm_func_qstats_ext_output (size:1536b/192B) */
12958 struct hwrm_func_qstats_ext_output {
12959         /* The specific error status for the command. */
12960         uint16_t        error_code;
12961         /* The HWRM command request type. */
12962         uint16_t        req_type;
12963         /* The sequence ID from the original command. */
12964         uint16_t        seq_id;
12965         /* The length of the response data in number of bytes. */
12966         uint16_t        resp_len;
12967         /* Number of received unicast packets */
12968         uint64_t        rx_ucast_pkts;
12969         /* Number of received multicast packets */
12970         uint64_t        rx_mcast_pkts;
12971         /* Number of received broadcast packets */
12972         uint64_t        rx_bcast_pkts;
12973         /* Number of discarded packets on received path */
12974         uint64_t        rx_discard_pkts;
12975         /* Number of packets on receive path with error */
12976         uint64_t        rx_error_pkts;
12977         /* Number of received bytes for unicast traffic */
12978         uint64_t        rx_ucast_bytes;
12979         /* Number of received bytes for multicast traffic */
12980         uint64_t        rx_mcast_bytes;
12981         /* Number of received bytes for broadcast traffic */
12982         uint64_t        rx_bcast_bytes;
12983         /* Number of transmitted unicast packets */
12984         uint64_t        tx_ucast_pkts;
12985         /* Number of transmitted multicast packets */
12986         uint64_t        tx_mcast_pkts;
12987         /* Number of transmitted broadcast packets */
12988         uint64_t        tx_bcast_pkts;
12989         /* Number of packets on transmit path with error */
12990         uint64_t        tx_error_pkts;
12991         /* Number of discarded packets on transmit path */
12992         uint64_t        tx_discard_pkts;
12993         /* Number of transmitted bytes for unicast traffic */
12994         uint64_t        tx_ucast_bytes;
12995         /* Number of transmitted bytes for multicast traffic */
12996         uint64_t        tx_mcast_bytes;
12997         /* Number of transmitted bytes for broadcast traffic */
12998         uint64_t        tx_bcast_bytes;
12999         /* Number of TPA eligible packets */
13000         uint64_t        rx_tpa_eligible_pkt;
13001         /* Number of TPA eligible bytes */
13002         uint64_t        rx_tpa_eligible_bytes;
13003         /* Number of TPA packets */
13004         uint64_t        rx_tpa_pkt;
13005         /* Number of TPA bytes */
13006         uint64_t        rx_tpa_bytes;
13007         /* Number of TPA errors */
13008         uint64_t        rx_tpa_errors;
13009         /* Number of TPA errors */
13010         uint64_t        rx_tpa_events;
13011         uint8_t unused_0[7];
13012         /*
13013          * This field is used in Output records to indicate that the output
13014          * is completely written to RAM.  This field should be read as '1'
13015          * to indicate that the output has been completely written.
13016          * When writing a command completion or response to an internal processor,
13017          * the order of writes has to be such that this field is written last.
13018          */
13019         uint8_t valid;
13020 } __rte_packed;
13021
13022 /***********************
13023  * hwrm_func_clr_stats *
13024  ***********************/
13025
13026
13027 /* hwrm_func_clr_stats_input (size:192b/24B) */
13028 struct hwrm_func_clr_stats_input {
13029         /* The HWRM command request type. */
13030         uint16_t        req_type;
13031         /*
13032          * The completion ring to send the completion event on. This should
13033          * be the NQ ID returned from the `nq_alloc` HWRM command.
13034          */
13035         uint16_t        cmpl_ring;
13036         /*
13037          * The sequence ID is used by the driver for tracking multiple
13038          * commands. This ID is treated as opaque data by the firmware and
13039          * the value is returned in the `hwrm_resp_hdr` upon completion.
13040          */
13041         uint16_t        seq_id;
13042         /*
13043          * The target ID of the command:
13044          * * 0x0-0xFFF8 - The function ID
13045          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13046          * * 0xFFFD - Reserved for user-space HWRM interface
13047          * * 0xFFFF - HWRM
13048          */
13049         uint16_t        target_id;
13050         /*
13051          * A physical address pointer pointing to a host buffer that the
13052          * command's response data will be written. This can be either a host
13053          * physical address (HPA) or a guest physical address (GPA) and must
13054          * point to a physically contiguous block of memory.
13055          */
13056         uint64_t        resp_addr;
13057         /*
13058          * Function ID of the function.
13059          * 0xFF... (All Fs) if the query is for the requesting
13060          * function.
13061          */
13062         uint16_t        fid;
13063         uint8_t unused_0[6];
13064 } __rte_packed;
13065
13066 /* hwrm_func_clr_stats_output (size:128b/16B) */
13067 struct hwrm_func_clr_stats_output {
13068         /* The specific error status for the command. */
13069         uint16_t        error_code;
13070         /* The HWRM command request type. */
13071         uint16_t        req_type;
13072         /* The sequence ID from the original command. */
13073         uint16_t        seq_id;
13074         /* The length of the response data in number of bytes. */
13075         uint16_t        resp_len;
13076         uint8_t unused_0[7];
13077         /*
13078          * This field is used in Output records to indicate that the output
13079          * is completely written to RAM.  This field should be read as '1'
13080          * to indicate that the output has been completely written.
13081          * When writing a command completion or response to an internal processor,
13082          * the order of writes has to be such that this field is written last.
13083          */
13084         uint8_t valid;
13085 } __rte_packed;
13086
13087 /**************************
13088  * hwrm_func_vf_resc_free *
13089  **************************/
13090
13091
13092 /* hwrm_func_vf_resc_free_input (size:192b/24B) */
13093 struct hwrm_func_vf_resc_free_input {
13094         /* The HWRM command request type. */
13095         uint16_t        req_type;
13096         /*
13097          * The completion ring to send the completion event on. This should
13098          * be the NQ ID returned from the `nq_alloc` HWRM command.
13099          */
13100         uint16_t        cmpl_ring;
13101         /*
13102          * The sequence ID is used by the driver for tracking multiple
13103          * commands. This ID is treated as opaque data by the firmware and
13104          * the value is returned in the `hwrm_resp_hdr` upon completion.
13105          */
13106         uint16_t        seq_id;
13107         /*
13108          * The target ID of the command:
13109          * * 0x0-0xFFF8 - The function ID
13110          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13111          * * 0xFFFD - Reserved for user-space HWRM interface
13112          * * 0xFFFF - HWRM
13113          */
13114         uint16_t        target_id;
13115         /*
13116          * A physical address pointer pointing to a host buffer that the
13117          * command's response data will be written. This can be either a host
13118          * physical address (HPA) or a guest physical address (GPA) and must
13119          * point to a physically contiguous block of memory.
13120          */
13121         uint64_t        resp_addr;
13122         /*
13123          * This value is used to identify a Virtual Function (VF).
13124          * The scope of VF ID is local within a PF.
13125          */
13126         uint16_t        vf_id;
13127         uint8_t unused_0[6];
13128 } __rte_packed;
13129
13130 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
13131 struct hwrm_func_vf_resc_free_output {
13132         /* The specific error status for the command. */
13133         uint16_t        error_code;
13134         /* The HWRM command request type. */
13135         uint16_t        req_type;
13136         /* The sequence ID from the original command. */
13137         uint16_t        seq_id;
13138         /* The length of the response data in number of bytes. */
13139         uint16_t        resp_len;
13140         uint8_t unused_0[7];
13141         /*
13142          * This field is used in Output records to indicate that the output
13143          * is completely written to RAM.  This field should be read as '1'
13144          * to indicate that the output has been completely written.
13145          * When writing a command completion or response to an internal processor,
13146          * the order of writes has to be such that this field is written last.
13147          */
13148         uint8_t valid;
13149 } __rte_packed;
13150
13151 /**********************
13152  * hwrm_func_drv_rgtr *
13153  **********************/
13154
13155
13156 /* hwrm_func_drv_rgtr_input (size:896b/112B) */
13157 struct hwrm_func_drv_rgtr_input {
13158         /* The HWRM command request type. */
13159         uint16_t        req_type;
13160         /*
13161          * The completion ring to send the completion event on. This should
13162          * be the NQ ID returned from the `nq_alloc` HWRM command.
13163          */
13164         uint16_t        cmpl_ring;
13165         /*
13166          * The sequence ID is used by the driver for tracking multiple
13167          * commands. This ID is treated as opaque data by the firmware and
13168          * the value is returned in the `hwrm_resp_hdr` upon completion.
13169          */
13170         uint16_t        seq_id;
13171         /*
13172          * The target ID of the command:
13173          * * 0x0-0xFFF8 - The function ID
13174          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13175          * * 0xFFFD - Reserved for user-space HWRM interface
13176          * * 0xFFFF - HWRM
13177          */
13178         uint16_t        target_id;
13179         /*
13180          * A physical address pointer pointing to a host buffer that the
13181          * command's response data will be written. This can be either a host
13182          * physical address (HPA) or a guest physical address (GPA) and must
13183          * point to a physically contiguous block of memory.
13184          */
13185         uint64_t        resp_addr;
13186         uint32_t        flags;
13187         /*
13188          * When this bit is '1', the function driver is requesting
13189          * all requests from its children VF drivers to be
13190          * forwarded to itself.
13191          * This flag can only be set by the PF driver.
13192          * If a VF driver sets this flag, it should be ignored
13193          * by the HWRM.
13194          */
13195         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE \
13196                 UINT32_C(0x1)
13197         /*
13198          * When this bit is '1', the function is requesting none of
13199          * the requests from its children VF drivers to be
13200          * forwarded to itself.
13201          * This flag can only be set by the PF driver.
13202          * If a VF driver sets this flag, it should be ignored
13203          * by the HWRM.
13204          */
13205         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE \
13206                 UINT32_C(0x2)
13207         /*
13208          * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b
13209          * fields shall be ignored and ver_maj, ver_min, ver_upd
13210          * and ver_patch shall be used for the driver version information.
13211          * When this bit is '0', then ver_maj_8b, ver_min_8b, ver_upd_8b
13212          * fields shall be used for the driver version information and
13213          * ver_maj, ver_min, ver_upd and ver_patch shall be ignored.
13214          */
13215         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE \
13216                 UINT32_C(0x4)
13217         /*
13218          * When this bit is '1', the function is indicating support of
13219          * 64bit flow handle.  The firmware that only supports 64bit flow
13220          * handle should check this bit before allowing processing of
13221          * HWRM_CFA_FLOW_XXX commands from the requesting function as firmware
13222          * with 64bit flow handle support can only be compatible with drivers
13223          * that support 64bit flow handle. The legacy drivers that don't support
13224          * 64bit flow handle won't be able to use HWRM_CFA_FLOW_XXX commands when
13225          * running with new firmware that only supports 64bit flow handle. The new
13226          * firmware support 64bit flow handle returns HWRM_ERR_CODE_CMD_NOT_SUPPORTED
13227          * status to the legacy driver when encounters these commands.
13228          */
13229         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE \
13230                 UINT32_C(0x8)
13231         /*
13232          * When this bit is '1', the function is indicating support of
13233          * Hot Reset. The driver interface will destroy the resources,
13234          * unregister the function and register again up on receiving
13235          * the RESET_NOTIFY Async notification from the core firmware.
13236          * The core firmware will this use flag and trigger the Hot Reset
13237          * process only if all the registered driver instances are capable
13238          * of this support.
13239          */
13240         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT \
13241                 UINT32_C(0x10)
13242         /*
13243          * When this bit is 1, the function is indicating the support of the
13244          * error recovery capability. Error recovery support will be used by
13245          * firmware only if all the driver instances support error recovery
13246          * process. By setting this bit, driver is indicating support for
13247          * corresponding async event completion message. These will be
13248          * delivered to the driver even if they did not register for it.
13249          * If supported, after receiving reset notify async event with fatal
13250          * flag set in event data1, then all the drivers have to tear down
13251          * their resources without sending any HWRM commands to FW.
13252          */
13253         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT \
13254                 UINT32_C(0x20)
13255         /*
13256          * When this bit is 1, the function is indicating the support of the
13257          * Master capability. The Firmware will use this capability to select the
13258          * Master function. The master function will be used to initiate
13259          * designated functionality like error recovery etc… If none of the
13260          * registered PF’s or trusted VF’s indicate this support, then
13261          * firmware will select the 1st registered PF as Master capable instance.
13262          */
13263         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_MASTER_SUPPORT \
13264                 UINT32_C(0x40)
13265         /*
13266          * When this bit is 1, the function is indicating the support of the
13267          * fast reset capability. Fast reset support will be used by
13268          * firmware only if all the driver instances support fast reset
13269          * process. By setting this bit, driver is indicating support for
13270          * corresponding async event completion message. These will be
13271          * delivered to the driver even if they did not register for it.
13272          * If supported, after receiving reset notify async event with fast
13273          * reset flag set in event data1, then all the drivers have to tear
13274          * down their resources without sending any HWRM commands to FW.
13275          */
13276         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FAST_RESET_SUPPORT \
13277                 UINT32_C(0x80)
13278         uint32_t        enables;
13279         /*
13280          * This bit must be '1' for the os_type field to be
13281          * configured.
13282          */
13283         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE \
13284                 UINT32_C(0x1)
13285         /*
13286          * This bit must be '1' for the ver field to be
13287          * configured.
13288          */
13289         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER \
13290                 UINT32_C(0x2)
13291         /*
13292          * This bit must be '1' for the timestamp field to be
13293          * configured.
13294          */
13295         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP \
13296                 UINT32_C(0x4)
13297         /*
13298          * This bit must be '1' for the vf_req_fwd field to be
13299          * configured.
13300          */
13301         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD \
13302                 UINT32_C(0x8)
13303         /*
13304          * This bit must be '1' for the async_event_fwd field to be
13305          * configured.
13306          */
13307         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
13308                 UINT32_C(0x10)
13309         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
13310         uint16_t        os_type;
13311         /* Unknown */
13312         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
13313         /* Other OS not listed below. */
13314         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER     UINT32_C(0x1)
13315         /* MSDOS OS. */
13316         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
13317         /* Windows OS. */
13318         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
13319         /* Solaris OS. */
13320         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
13321         /* Linux OS. */
13322         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX     UINT32_C(0x24)
13323         /* FreeBSD OS. */
13324         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
13325         /* VMware ESXi OS. */
13326         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI      UINT32_C(0x68)
13327         /* Microsoft Windows 8 64-bit OS. */
13328         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864    UINT32_C(0x73)
13329         /* Microsoft Windows Server 2012 R2 OS. */
13330         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
13331         /* UEFI driver. */
13332         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
13333         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST \
13334                 HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
13335         /* This is the 8bit major version of the driver. */
13336         uint8_t ver_maj_8b;
13337         /* This is the 8bit minor version of the driver. */
13338         uint8_t ver_min_8b;
13339         /* This is the 8bit update version of the driver. */
13340         uint8_t ver_upd_8b;
13341         uint8_t unused_0[3];
13342         /*
13343          * This is a 32-bit timestamp provided by the driver for
13344          * keep alive.
13345          * The timestamp is in multiples of 1ms.
13346          */
13347         uint32_t        timestamp;
13348         uint8_t unused_1[4];
13349         /*
13350          * This is a 256-bit bit mask provided by the PF driver for
13351          * letting the HWRM know what commands issued by the VF driver
13352          * to the HWRM should be forwarded to the PF driver.
13353          * Nth bit refers to the Nth req_type.
13354          *
13355          * Setting Nth bit to 1 indicates that requests from the
13356          * VF driver with req_type equal to N shall be forwarded to
13357          * the parent PF driver.
13358          *
13359          * This field is not valid for the VF driver.
13360          */
13361         uint32_t        vf_req_fwd[8];
13362         /*
13363          * This is a 256-bit bit mask provided by the function driver
13364          * (PF or VF driver) to indicate the list of asynchronous event
13365          * completions to be forwarded.
13366          *
13367          * Nth bit refers to the Nth event_id.
13368          *
13369          * Setting Nth bit to 1 by the function driver shall result in
13370          * the HWRM forwarding asynchronous event completion with
13371          * event_id equal to N.
13372          *
13373          * If all bits are set to 0 (value of 0), then the HWRM shall
13374          * not forward any asynchronous event completion to this
13375          * function driver.
13376          */
13377         uint32_t        async_event_fwd[8];
13378         /* This is the 16bit major version of the driver. */
13379         uint16_t        ver_maj;
13380         /* This is the 16bit minor version of the driver. */
13381         uint16_t        ver_min;
13382         /* This is the 16bit update version of the driver. */
13383         uint16_t        ver_upd;
13384         /* This is the 16bit patch version of the driver. */
13385         uint16_t        ver_patch;
13386 } __rte_packed;
13387
13388 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
13389 struct hwrm_func_drv_rgtr_output {
13390         /* The specific error status for the command. */
13391         uint16_t        error_code;
13392         /* The HWRM command request type. */
13393         uint16_t        req_type;
13394         /* The sequence ID from the original command. */
13395         uint16_t        seq_id;
13396         /* The length of the response data in number of bytes. */
13397         uint16_t        resp_len;
13398         uint32_t        flags;
13399         /*
13400          * When this bit is '1', it indicates that the
13401          * HWRM_FUNC_DRV_IF_CHANGE call is supported.
13402          */
13403         #define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED \
13404                 UINT32_C(0x1)
13405         uint8_t unused_0[3];
13406         /*
13407          * This field is used in Output records to indicate that the output
13408          * is completely written to RAM.  This field should be read as '1'
13409          * to indicate that the output has been completely written.
13410          * When writing a command completion or response to an internal processor,
13411          * the order of writes has to be such that this field is written last.
13412          */
13413         uint8_t valid;
13414 } __rte_packed;
13415
13416 /************************
13417  * hwrm_func_drv_unrgtr *
13418  ************************/
13419
13420
13421 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
13422 struct hwrm_func_drv_unrgtr_input {
13423         /* The HWRM command request type. */
13424         uint16_t        req_type;
13425         /*
13426          * The completion ring to send the completion event on. This should
13427          * be the NQ ID returned from the `nq_alloc` HWRM command.
13428          */
13429         uint16_t        cmpl_ring;
13430         /*
13431          * The sequence ID is used by the driver for tracking multiple
13432          * commands. This ID is treated as opaque data by the firmware and
13433          * the value is returned in the `hwrm_resp_hdr` upon completion.
13434          */
13435         uint16_t        seq_id;
13436         /*
13437          * The target ID of the command:
13438          * * 0x0-0xFFF8 - The function ID
13439          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13440          * * 0xFFFD - Reserved for user-space HWRM interface
13441          * * 0xFFFF - HWRM
13442          */
13443         uint16_t        target_id;
13444         /*
13445          * A physical address pointer pointing to a host buffer that the
13446          * command's response data will be written. This can be either a host
13447          * physical address (HPA) or a guest physical address (GPA) and must
13448          * point to a physically contiguous block of memory.
13449          */
13450         uint64_t        resp_addr;
13451         uint32_t        flags;
13452         /*
13453          * When this bit is '1', the function driver is notifying
13454          * the HWRM to prepare for the shutdown.
13455          */
13456         #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
13457                 UINT32_C(0x1)
13458         uint8_t unused_0[4];
13459 } __rte_packed;
13460
13461 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
13462 struct hwrm_func_drv_unrgtr_output {
13463         /* The specific error status for the command. */
13464         uint16_t        error_code;
13465         /* The HWRM command request type. */
13466         uint16_t        req_type;
13467         /* The sequence ID from the original command. */
13468         uint16_t        seq_id;
13469         /* The length of the response data in number of bytes. */
13470         uint16_t        resp_len;
13471         uint8_t unused_0[7];
13472         /*
13473          * This field is used in Output records to indicate that the output
13474          * is completely written to RAM.  This field should be read as '1'
13475          * to indicate that the output has been completely written.
13476          * When writing a command completion or response to an internal processor,
13477          * the order of writes has to be such that this field is written last.
13478          */
13479         uint8_t valid;
13480 } __rte_packed;
13481
13482 /**********************
13483  * hwrm_func_buf_rgtr *
13484  **********************/
13485
13486
13487 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
13488 struct hwrm_func_buf_rgtr_input {
13489         /* The HWRM command request type. */
13490         uint16_t        req_type;
13491         /*
13492          * The completion ring to send the completion event on. This should
13493          * be the NQ ID returned from the `nq_alloc` HWRM command.
13494          */
13495         uint16_t        cmpl_ring;
13496         /*
13497          * The sequence ID is used by the driver for tracking multiple
13498          * commands. This ID is treated as opaque data by the firmware and
13499          * the value is returned in the `hwrm_resp_hdr` upon completion.
13500          */
13501         uint16_t        seq_id;
13502         /*
13503          * The target ID of the command:
13504          * * 0x0-0xFFF8 - The function ID
13505          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13506          * * 0xFFFD - Reserved for user-space HWRM interface
13507          * * 0xFFFF - HWRM
13508          */
13509         uint16_t        target_id;
13510         /*
13511          * A physical address pointer pointing to a host buffer that the
13512          * command's response data will be written. This can be either a host
13513          * physical address (HPA) or a guest physical address (GPA) and must
13514          * point to a physically contiguous block of memory.
13515          */
13516         uint64_t        resp_addr;
13517         uint32_t        enables;
13518         /*
13519          * This bit must be '1' for the vf_id field to be
13520          * configured.
13521          */
13522         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID            UINT32_C(0x1)
13523         /*
13524          * This bit must be '1' for the err_buf_addr field to be
13525          * configured.
13526          */
13527         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR     UINT32_C(0x2)
13528         /*
13529          * This value is used to identify a Virtual Function (VF).
13530          * The scope of VF ID is local within a PF.
13531          */
13532         uint16_t        vf_id;
13533         /*
13534          * This field represents the number of pages used for request
13535          * buffer(s).
13536          */
13537         uint16_t        req_buf_num_pages;
13538         /*
13539          * This field represents the page size used for request
13540          * buffer(s).
13541          */
13542         uint16_t        req_buf_page_size;
13543         /* 16 bytes */
13544         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
13545         /* 4 Kbytes */
13546         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K  UINT32_C(0xc)
13547         /* 8 Kbytes */
13548         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K  UINT32_C(0xd)
13549         /* 64 Kbytes */
13550         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
13551         /* 2 Mbytes */
13552         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M  UINT32_C(0x15)
13553         /* 4 Mbytes */
13554         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M  UINT32_C(0x16)
13555         /* 1 Gbytes */
13556         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G  UINT32_C(0x1e)
13557         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST \
13558                 HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
13559         /* The length of the request buffer per VF in bytes. */
13560         uint16_t        req_buf_len;
13561         /* The length of the response buffer in bytes. */
13562         uint16_t        resp_buf_len;
13563         uint8_t unused_0[2];
13564         /* This field represents the page address of page #0. */
13565         uint64_t        req_buf_page_addr0;
13566         /* This field represents the page address of page #1. */
13567         uint64_t        req_buf_page_addr1;
13568         /* This field represents the page address of page #2. */
13569         uint64_t        req_buf_page_addr2;
13570         /* This field represents the page address of page #3. */
13571         uint64_t        req_buf_page_addr3;
13572         /* This field represents the page address of page #4. */
13573         uint64_t        req_buf_page_addr4;
13574         /* This field represents the page address of page #5. */
13575         uint64_t        req_buf_page_addr5;
13576         /* This field represents the page address of page #6. */
13577         uint64_t        req_buf_page_addr6;
13578         /* This field represents the page address of page #7. */
13579         uint64_t        req_buf_page_addr7;
13580         /* This field represents the page address of page #8. */
13581         uint64_t        req_buf_page_addr8;
13582         /* This field represents the page address of page #9. */
13583         uint64_t        req_buf_page_addr9;
13584         /*
13585          * This field is used to receive the error reporting from
13586          * the chipset. Only applicable for PFs.
13587          */
13588         uint64_t        error_buf_addr;
13589         /*
13590          * This field is used to receive the response forwarded by the
13591          * HWRM.
13592          */
13593         uint64_t        resp_buf_addr;
13594 } __rte_packed;
13595
13596 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
13597 struct hwrm_func_buf_rgtr_output {
13598         /* The specific error status for the command. */
13599         uint16_t        error_code;
13600         /* The HWRM command request type. */
13601         uint16_t        req_type;
13602         /* The sequence ID from the original command. */
13603         uint16_t        seq_id;
13604         /* The length of the response data in number of bytes. */
13605         uint16_t        resp_len;
13606         uint8_t unused_0[7];
13607         /*
13608          * This field is used in Output records to indicate that the output
13609          * is completely written to RAM.  This field should be read as '1'
13610          * to indicate that the output has been completely written.
13611          * When writing a command completion or response to an internal processor,
13612          * the order of writes has to be such that this field is written last.
13613          */
13614         uint8_t valid;
13615 } __rte_packed;
13616
13617 /************************
13618  * hwrm_func_buf_unrgtr *
13619  ************************/
13620
13621
13622 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
13623 struct hwrm_func_buf_unrgtr_input {
13624         /* The HWRM command request type. */
13625         uint16_t        req_type;
13626         /*
13627          * The completion ring to send the completion event on. This should
13628          * be the NQ ID returned from the `nq_alloc` HWRM command.
13629          */
13630         uint16_t        cmpl_ring;
13631         /*
13632          * The sequence ID is used by the driver for tracking multiple
13633          * commands. This ID is treated as opaque data by the firmware and
13634          * the value is returned in the `hwrm_resp_hdr` upon completion.
13635          */
13636         uint16_t        seq_id;
13637         /*
13638          * The target ID of the command:
13639          * * 0x0-0xFFF8 - The function ID
13640          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13641          * * 0xFFFD - Reserved for user-space HWRM interface
13642          * * 0xFFFF - HWRM
13643          */
13644         uint16_t        target_id;
13645         /*
13646          * A physical address pointer pointing to a host buffer that the
13647          * command's response data will be written. This can be either a host
13648          * physical address (HPA) or a guest physical address (GPA) and must
13649          * point to a physically contiguous block of memory.
13650          */
13651         uint64_t        resp_addr;
13652         uint32_t        enables;
13653         /*
13654          * This bit must be '1' for the vf_id field to be
13655          * configured.
13656          */
13657         #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID     UINT32_C(0x1)
13658         /*
13659          * This value is used to identify a Virtual Function (VF).
13660          * The scope of VF ID is local within a PF.
13661          */
13662         uint16_t        vf_id;
13663         uint8_t unused_0[2];
13664 } __rte_packed;
13665
13666 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
13667 struct hwrm_func_buf_unrgtr_output {
13668         /* The specific error status for the command. */
13669         uint16_t        error_code;
13670         /* The HWRM command request type. */
13671         uint16_t        req_type;
13672         /* The sequence ID from the original command. */
13673         uint16_t        seq_id;
13674         /* The length of the response data in number of bytes. */
13675         uint16_t        resp_len;
13676         uint8_t unused_0[7];
13677         /*
13678          * This field is used in Output records to indicate that the output
13679          * is completely written to RAM.  This field should be read as '1'
13680          * to indicate that the output has been completely written.
13681          * When writing a command completion or response to an internal processor,
13682          * the order of writes has to be such that this field is written last.
13683          */
13684         uint8_t valid;
13685 } __rte_packed;
13686
13687 /**********************
13688  * hwrm_func_drv_qver *
13689  **********************/
13690
13691
13692 /* hwrm_func_drv_qver_input (size:192b/24B) */
13693 struct hwrm_func_drv_qver_input {
13694         /* The HWRM command request type. */
13695         uint16_t        req_type;
13696         /*
13697          * The completion ring to send the completion event on. This should
13698          * be the NQ ID returned from the `nq_alloc` HWRM command.
13699          */
13700         uint16_t        cmpl_ring;
13701         /*
13702          * The sequence ID is used by the driver for tracking multiple
13703          * commands. This ID is treated as opaque data by the firmware and
13704          * the value is returned in the `hwrm_resp_hdr` upon completion.
13705          */
13706         uint16_t        seq_id;
13707         /*
13708          * The target ID of the command:
13709          * * 0x0-0xFFF8 - The function ID
13710          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13711          * * 0xFFFD - Reserved for user-space HWRM interface
13712          * * 0xFFFF - HWRM
13713          */
13714         uint16_t        target_id;
13715         /*
13716          * A physical address pointer pointing to a host buffer that the
13717          * command's response data will be written. This can be either a host
13718          * physical address (HPA) or a guest physical address (GPA) and must
13719          * point to a physically contiguous block of memory.
13720          */
13721         uint64_t        resp_addr;
13722         /* Reserved for future use. */
13723         uint32_t        reserved;
13724         /*
13725          * Function ID of the function that is being queried.
13726          * 0xFF... (All Fs) if the query is for the requesting
13727          * function.
13728          */
13729         uint16_t        fid;
13730         uint8_t unused_0[2];
13731 } __rte_packed;
13732
13733 /* hwrm_func_drv_qver_output (size:256b/32B) */
13734 struct hwrm_func_drv_qver_output {
13735         /* The specific error status for the command. */
13736         uint16_t        error_code;
13737         /* The HWRM command request type. */
13738         uint16_t        req_type;
13739         /* The sequence ID from the original command. */
13740         uint16_t        seq_id;
13741         /* The length of the response data in number of bytes. */
13742         uint16_t        resp_len;
13743         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
13744         uint16_t        os_type;
13745         /* Unknown */
13746         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
13747         /* Other OS not listed below. */
13748         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER     UINT32_C(0x1)
13749         /* MSDOS OS. */
13750         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
13751         /* Windows OS. */
13752         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
13753         /* Solaris OS. */
13754         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
13755         /* Linux OS. */
13756         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX     UINT32_C(0x24)
13757         /* FreeBSD OS. */
13758         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
13759         /* VMware ESXi OS. */
13760         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI      UINT32_C(0x68)
13761         /* Microsoft Windows 8 64-bit OS. */
13762         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864    UINT32_C(0x73)
13763         /* Microsoft Windows Server 2012 R2 OS. */
13764         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
13765         /* UEFI driver. */
13766         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
13767         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST \
13768                 HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
13769         /* This is the 8bit major version of the driver. */
13770         uint8_t ver_maj_8b;
13771         /* This is the 8bit minor version of the driver. */
13772         uint8_t ver_min_8b;
13773         /* This is the 8bit update version of the driver. */
13774         uint8_t ver_upd_8b;
13775         uint8_t unused_0[3];
13776         /* This is the 16bit major version of the driver. */
13777         uint16_t        ver_maj;
13778         /* This is the 16bit minor version of the driver. */
13779         uint16_t        ver_min;
13780         /* This is the 16bit update version of the driver. */
13781         uint16_t        ver_upd;
13782         /* This is the 16bit patch version of the driver. */
13783         uint16_t        ver_patch;
13784         uint8_t unused_1[7];
13785         /*
13786          * This field is used in Output records to indicate that the output
13787          * is completely written to RAM.  This field should be read as '1'
13788          * to indicate that the output has been completely written.
13789          * When writing a command completion or response to an internal processor,
13790          * the order of writes has to be such that this field is written last.
13791          */
13792         uint8_t valid;
13793 } __rte_packed;
13794
13795 /****************************
13796  * hwrm_func_resource_qcaps *
13797  ****************************/
13798
13799
13800 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
13801 struct hwrm_func_resource_qcaps_input {
13802         /* The HWRM command request type. */
13803         uint16_t        req_type;
13804         /*
13805          * The completion ring to send the completion event on. This should
13806          * be the NQ ID returned from the `nq_alloc` HWRM command.
13807          */
13808         uint16_t        cmpl_ring;
13809         /*
13810          * The sequence ID is used by the driver for tracking multiple
13811          * commands. This ID is treated as opaque data by the firmware and
13812          * the value is returned in the `hwrm_resp_hdr` upon completion.
13813          */
13814         uint16_t        seq_id;
13815         /*
13816          * The target ID of the command:
13817          * * 0x0-0xFFF8 - The function ID
13818          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13819          * * 0xFFFD - Reserved for user-space HWRM interface
13820          * * 0xFFFF - HWRM
13821          */
13822         uint16_t        target_id;
13823         /*
13824          * A physical address pointer pointing to a host buffer that the
13825          * command's response data will be written. This can be either a host
13826          * physical address (HPA) or a guest physical address (GPA) and must
13827          * point to a physically contiguous block of memory.
13828          */
13829         uint64_t        resp_addr;
13830         /*
13831          * Function ID of the function that is being queried.
13832          * 0xFF... (All Fs) if the query is for the requesting
13833          * function.
13834          */
13835         uint16_t        fid;
13836         uint8_t unused_0[6];
13837 } __rte_packed;
13838
13839 /* hwrm_func_resource_qcaps_output (size:448b/56B) */
13840 struct hwrm_func_resource_qcaps_output {
13841         /* The specific error status for the command. */
13842         uint16_t        error_code;
13843         /* The HWRM command request type. */
13844         uint16_t        req_type;
13845         /* The sequence ID from the original command. */
13846         uint16_t        seq_id;
13847         /* The length of the response data in number of bytes. */
13848         uint16_t        resp_len;
13849         /* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */
13850         uint16_t        max_vfs;
13851         /* Maximum guaranteed number of MSI-X vectors supported by function */
13852         uint16_t        max_msix;
13853         /* Hint of strategy to be used by PF driver to reserve resources for its VF */
13854         uint16_t        vf_reservation_strategy;
13855         /* The PF driver should evenly divide its remaining resources among all VFs. */
13856         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL \
13857                 UINT32_C(0x0)
13858         /* The PF driver should only reserve minimal resources for each VF. */
13859         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL \
13860                 UINT32_C(0x1)
13861         /*
13862          * The PF driver should not reserve any resources for each VF until the
13863          * the VF interface is brought up.
13864          */
13865         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC \
13866                 UINT32_C(0x2)
13867         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST \
13868                 HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
13869         /* Minimum guaranteed number of RSS/COS contexts */
13870         uint16_t        min_rsscos_ctx;
13871         /* Maximum non-guaranteed number of RSS/COS contexts */
13872         uint16_t        max_rsscos_ctx;
13873         /* Minimum guaranteed number of completion rings */
13874         uint16_t        min_cmpl_rings;
13875         /* Maximum non-guaranteed number of completion rings */
13876         uint16_t        max_cmpl_rings;
13877         /* Minimum guaranteed number of transmit rings */
13878         uint16_t        min_tx_rings;
13879         /* Maximum non-guaranteed number of transmit rings */
13880         uint16_t        max_tx_rings;
13881         /* Minimum guaranteed number of receive rings */
13882         uint16_t        min_rx_rings;
13883         /* Maximum non-guaranteed number of receive rings */
13884         uint16_t        max_rx_rings;
13885         /* Minimum guaranteed number of L2 contexts */
13886         uint16_t        min_l2_ctxs;
13887         /* Maximum non-guaranteed number of L2 contexts */
13888         uint16_t        max_l2_ctxs;
13889         /* Minimum guaranteed number of VNICs */
13890         uint16_t        min_vnics;
13891         /* Maximum non-guaranteed number of VNICs */
13892         uint16_t        max_vnics;
13893         /* Minimum guaranteed number of statistic contexts */
13894         uint16_t        min_stat_ctx;
13895         /* Maximum non-guaranteed number of statistic contexts */
13896         uint16_t        max_stat_ctx;
13897         /* Minimum guaranteed number of ring groups */
13898         uint16_t        min_hw_ring_grps;
13899         /* Maximum non-guaranteed number of ring groups */
13900         uint16_t        max_hw_ring_grps;
13901         /*
13902          * Maximum number of inputs into the transmit scheduler for this function.
13903          * The number of TX rings assigned to the function cannot exceed this value.
13904          */
13905         uint16_t        max_tx_scheduler_inputs;
13906         uint16_t        flags;
13907         /*
13908          * When this bit is '1', it indicates that VF_RESOURCE_CFG supports
13909          * feature to reserve all minimum resources when minimum >= 1, otherwise
13910          * returns an error.
13911          */
13912         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED \
13913                 UINT32_C(0x1)
13914         uint8_t unused_0[5];
13915         /*
13916          * This field is used in Output records to indicate that the output
13917          * is completely written to RAM.  This field should be read as '1'
13918          * to indicate that the output has been completely written.
13919          * When writing a command completion or response to an internal processor,
13920          * the order of writes has to be such that this field is written last.
13921          */
13922         uint8_t valid;
13923 } __rte_packed;
13924
13925 /*****************************
13926  * hwrm_func_vf_resource_cfg *
13927  *****************************/
13928
13929
13930 /* hwrm_func_vf_resource_cfg_input (size:448b/56B) */
13931 struct hwrm_func_vf_resource_cfg_input {
13932         /* The HWRM command request type. */
13933         uint16_t        req_type;
13934         /*
13935          * The completion ring to send the completion event on. This should
13936          * be the NQ ID returned from the `nq_alloc` HWRM command.
13937          */
13938         uint16_t        cmpl_ring;
13939         /*
13940          * The sequence ID is used by the driver for tracking multiple
13941          * commands. This ID is treated as opaque data by the firmware and
13942          * the value is returned in the `hwrm_resp_hdr` upon completion.
13943          */
13944         uint16_t        seq_id;
13945         /*
13946          * The target ID of the command:
13947          * * 0x0-0xFFF8 - The function ID
13948          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13949          * * 0xFFFD - Reserved for user-space HWRM interface
13950          * * 0xFFFF - HWRM
13951          */
13952         uint16_t        target_id;
13953         /*
13954          * A physical address pointer pointing to a host buffer that the
13955          * command's response data will be written. This can be either a host
13956          * physical address (HPA) or a guest physical address (GPA) and must
13957          * point to a physically contiguous block of memory.
13958          */
13959         uint64_t        resp_addr;
13960         /* VF ID that is being configured by PF */
13961         uint16_t        vf_id;
13962         /* Maximum guaranteed number of MSI-X vectors for the function */
13963         uint16_t        max_msix;
13964         /* Minimum guaranteed number of RSS/COS contexts */
13965         uint16_t        min_rsscos_ctx;
13966         /* Maximum non-guaranteed number of RSS/COS contexts */
13967         uint16_t        max_rsscos_ctx;
13968         /* Minimum guaranteed number of completion rings */
13969         uint16_t        min_cmpl_rings;
13970         /* Maximum non-guaranteed number of completion rings */
13971         uint16_t        max_cmpl_rings;
13972         /* Minimum guaranteed number of transmit rings */
13973         uint16_t        min_tx_rings;
13974         /* Maximum non-guaranteed number of transmit rings */
13975         uint16_t        max_tx_rings;
13976         /* Minimum guaranteed number of receive rings */
13977         uint16_t        min_rx_rings;
13978         /* Maximum non-guaranteed number of receive rings */
13979         uint16_t        max_rx_rings;
13980         /* Minimum guaranteed number of L2 contexts */
13981         uint16_t        min_l2_ctxs;
13982         /* Maximum non-guaranteed number of L2 contexts */
13983         uint16_t        max_l2_ctxs;
13984         /* Minimum guaranteed number of VNICs */
13985         uint16_t        min_vnics;
13986         /* Maximum non-guaranteed number of VNICs */
13987         uint16_t        max_vnics;
13988         /* Minimum guaranteed number of statistic contexts */
13989         uint16_t        min_stat_ctx;
13990         /* Maximum non-guaranteed number of statistic contexts */
13991         uint16_t        max_stat_ctx;
13992         /* Minimum guaranteed number of ring groups */
13993         uint16_t        min_hw_ring_grps;
13994         /* Maximum non-guaranteed number of ring groups */
13995         uint16_t        max_hw_ring_grps;
13996         uint16_t        flags;
13997         /*
13998          * If this bit is set, all minimum resources requested should be
13999          * reserved if minimum >= 1, otherwise return error. In case of
14000          * error, keep all existing reservations before the call.
14001          */
14002         #define HWRM_FUNC_VF_RESOURCE_CFG_INPUT_FLAGS_MIN_GUARANTEED \
14003                 UINT32_C(0x1)
14004         uint8_t unused_0[2];
14005 } __rte_packed;
14006
14007 /* hwrm_func_vf_resource_cfg_output (size:256b/32B) */
14008 struct hwrm_func_vf_resource_cfg_output {
14009         /* The specific error status for the command. */
14010         uint16_t        error_code;
14011         /* The HWRM command request type. */
14012         uint16_t        req_type;
14013         /* The sequence ID from the original command. */
14014         uint16_t        seq_id;
14015         /* The length of the response data in number of bytes. */
14016         uint16_t        resp_len;
14017         /* Reserved number of RSS/COS contexts */
14018         uint16_t        reserved_rsscos_ctx;
14019         /* Reserved number of completion rings */
14020         uint16_t        reserved_cmpl_rings;
14021         /* Reserved number of transmit rings */
14022         uint16_t        reserved_tx_rings;
14023         /* Reserved number of receive rings */
14024         uint16_t        reserved_rx_rings;
14025         /* Reserved number of L2 contexts */
14026         uint16_t        reserved_l2_ctxs;
14027         /* Reserved number of VNICs */
14028         uint16_t        reserved_vnics;
14029         /* Reserved number of statistic contexts */
14030         uint16_t        reserved_stat_ctx;
14031         /* Reserved number of ring groups */
14032         uint16_t        reserved_hw_ring_grps;
14033         uint8_t unused_0[7];
14034         /*
14035          * This field is used in Output records to indicate that the output
14036          * is completely written to RAM.  This field should be read as '1'
14037          * to indicate that the output has been completely written.
14038          * When writing a command completion or response to an internal processor,
14039          * the order of writes has to be such that this field is written last.
14040          */
14041         uint8_t valid;
14042 } __rte_packed;
14043
14044 /*********************************
14045  * hwrm_func_backing_store_qcaps *
14046  *********************************/
14047
14048
14049 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
14050 struct hwrm_func_backing_store_qcaps_input {
14051         /* The HWRM command request type. */
14052         uint16_t        req_type;
14053         /*
14054          * The completion ring to send the completion event on. This should
14055          * be the NQ ID returned from the `nq_alloc` HWRM command.
14056          */
14057         uint16_t        cmpl_ring;
14058         /*
14059          * The sequence ID is used by the driver for tracking multiple
14060          * commands. This ID is treated as opaque data by the firmware and
14061          * the value is returned in the `hwrm_resp_hdr` upon completion.
14062          */
14063         uint16_t        seq_id;
14064         /*
14065          * The target ID of the command:
14066          * * 0x0-0xFFF8 - The function ID
14067          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14068          * * 0xFFFD - Reserved for user-space HWRM interface
14069          * * 0xFFFF - HWRM
14070          */
14071         uint16_t        target_id;
14072         /*
14073          * A physical address pointer pointing to a host buffer that the
14074          * command's response data will be written. This can be either a host
14075          * physical address (HPA) or a guest physical address (GPA) and must
14076          * point to a physically contiguous block of memory.
14077          */
14078         uint64_t        resp_addr;
14079 } __rte_packed;
14080
14081 /* hwrm_func_backing_store_qcaps_output (size:704b/88B) */
14082 struct hwrm_func_backing_store_qcaps_output {
14083         /* The specific error status for the command. */
14084         uint16_t        error_code;
14085         /* The HWRM command request type. */
14086         uint16_t        req_type;
14087         /* The sequence ID from the original command. */
14088         uint16_t        seq_id;
14089         /* The length of the response data in number of bytes. */
14090         uint16_t        resp_len;
14091         /* Maximum number of QP context entries supported for this function. */
14092         uint32_t        qp_max_entries;
14093         /*
14094          * Minimum number of QP context entries that are needed to be reserved
14095          * for QP1 for the PF and its VFs. PF drivers must allocate at least
14096          * this many QP context entries, even if RoCE will not be used.
14097          */
14098         uint16_t        qp_min_qp1_entries;
14099         /* Maximum number of QP context entries that can be used for L2. */
14100         uint16_t        qp_max_l2_entries;
14101         /* Number of bytes that must be allocated for each context entry. */
14102         uint16_t        qp_entry_size;
14103         /* Maximum number of SRQ context entries that can be used for L2. */
14104         uint16_t        srq_max_l2_entries;
14105         /* Maximum number of SRQ context entries supported for this function. */
14106         uint32_t        srq_max_entries;
14107         /* Number of bytes that must be allocated for each context entry. */
14108         uint16_t        srq_entry_size;
14109         /* Maximum number of CQ context entries that can be used for L2. */
14110         uint16_t        cq_max_l2_entries;
14111         /* Maximum number of CQ context entries supported for this function. */
14112         uint32_t        cq_max_entries;
14113         /* Number of bytes that must be allocated for each context entry. */
14114         uint16_t        cq_entry_size;
14115         /* Maximum number of VNIC context entries supported for this function. */
14116         uint16_t        vnic_max_vnic_entries;
14117         /* Maximum number of Ring table context entries supported for this function. */
14118         uint16_t        vnic_max_ring_table_entries;
14119         /* Number of bytes that must be allocated for each context entry. */
14120         uint16_t        vnic_entry_size;
14121         /* Maximum number of statistic context entries supported for this function. */
14122         uint32_t        stat_max_entries;
14123         /* Number of bytes that must be allocated for each context entry. */
14124         uint16_t        stat_entry_size;
14125         /* Number of bytes that must be allocated for each context entry. */
14126         uint16_t        tqm_entry_size;
14127         /* Minimum number of TQM context entries required per ring. */
14128         uint32_t        tqm_min_entries_per_ring;
14129         /*
14130          * Maximum number of TQM context entries supported per ring. This is
14131          * actually a recommended TQM queue size based on worst case usage of
14132          * the TQM queue.
14133          *
14134          * TQM fastpath rings should be sized large enough to accommodate the
14135          * maximum number of QPs (either L2 or RoCE, or both if shared)
14136          * that can be enqueued to the TQM ring.
14137          *
14138          * TQM slowpath rings should be sized as follows:
14139          *
14140          * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
14141          *
14142          * Where:
14143          *   num_vnics is the number of VNICs allocated in the VNIC backing store
14144          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
14145          *   num_roce_qps is the number of RoCE QPs in the QP backing store
14146          *   tqm_min_size is tqm_min_entries_per_ring reported by
14147          *     HWRM_FUNC_BACKING_STORE_QCAPS
14148          *
14149          * Note that TQM ring sizes cannot be extended while the system is
14150          * operational. If a PF driver needs to extend a TQM ring, it needs
14151          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
14152          * the backing store.
14153          */
14154         uint32_t        tqm_max_entries_per_ring;
14155         /*
14156          * Maximum number of MR plus AV context entries supported for this
14157          * function.
14158          */
14159         uint32_t        mrav_max_entries;
14160         /* Number of bytes that must be allocated for each context entry. */
14161         uint16_t        mrav_entry_size;
14162         /* Number of bytes that must be allocated for each context entry. */
14163         uint16_t        tim_entry_size;
14164         /* Maximum number of Timer context entries supported for this function. */
14165         uint32_t        tim_max_entries;
14166         /*
14167          * When this field is zero, the 32b `mrav_num_entries` field in the
14168          * `backing_store_cfg` and `backing_store_qcfg` commands represents
14169          * the total number of MR plus AV entries allowed in the MR/AV backing
14170          * store PBL.
14171          *
14172          * When this field is non-zero, the 32b `mrav_num_entries` field in
14173          * the `backing_store_cfg` and `backing_store_qcfg` commands is
14174          * logically divided into two 16b fields. Bits `[31:16]` represents
14175          * the `mr_num_entries` and bits `[15:0]` represents `av_num_entries`.
14176          * Both of these values are represented in a unit granularity
14177          * specified by this field. For example, if this field is 16 and
14178          * `mrav_num_entries` is `0x02000100`, then the number of MR entries
14179          * is 8192 and the number of AV entries is 4096.
14180          */
14181         uint16_t        mrav_num_entries_units;
14182         /*
14183          * The number of entries specified for any TQM ring must be a
14184          * multiple of this value to prevent any resource allocation
14185          * limitations.
14186          */
14187         uint8_t tqm_entries_multiple;
14188         /*
14189          * Initializer to be used by drivers
14190          * to initialize context memory to ensure
14191          * context subsystem flags an error for an attack
14192          * before the first time context load.
14193          */
14194         uint8_t ctx_kind_initializer;
14195         /*
14196          * Specifies which context kinds need to be initialized with the
14197          * ctx_kind_initializer.
14198          */
14199         uint16_t        ctx_init_mask;
14200         /*
14201          * If this bit is '1' then this context type should be initialized
14202          * with the ctx_kind_initializer at the specified offset.
14203          */
14204         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_QP \
14205                 UINT32_C(0x1)
14206         /*
14207          * If this bit is '1' then this context type should be initialized
14208          * with the ctx_kind_initializer at the specified offset.
14209          */
14210         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_SRQ \
14211                 UINT32_C(0x2)
14212         /*
14213          * If this bit is '1' then this context type should be initialized
14214          * with the ctx_kind_initializer at the specified offset.
14215          */
14216         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_CQ \
14217                 UINT32_C(0x4)
14218         /*
14219          * If this bit is '1' then this context type should be initialized
14220          * with the ctx_kind_initializer at the specified offset.
14221          */
14222         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_VNIC \
14223                 UINT32_C(0x8)
14224         /*
14225          * If this bit is '1' then this context type should be initialized
14226          * with the ctx_kind_initializer at the specified offset.
14227          */
14228         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_STAT \
14229                 UINT32_C(0x10)
14230         /*
14231          * If this bit is '1' then this context type should be initialized
14232          * with the ctx_kind_initializer at the specified offset.
14233          */
14234         #define HWRM_FUNC_BACKING_STORE_QCAPS_OUTPUT_CTX_INIT_MASK_MRAV \
14235                 UINT32_C(0x20)
14236         /*
14237          * Specifies the doubleword offset of ctx_kind_initializer for this
14238          * context type.
14239          */
14240         uint8_t qp_init_offset;
14241         /*
14242          * Specifies the doubleword offset of ctx_kind_initializer for this
14243          * context type.
14244          */
14245         uint8_t srq_init_offset;
14246         /*
14247          * Specifies the doubleword offset of ctx_kind_initializer for this
14248          * context type.
14249          */
14250         uint8_t cq_init_offset;
14251         /*
14252          * Specifies the doubleword offset of ctx_kind_initializer for this
14253          * context type.
14254          */
14255         uint8_t vnic_init_offset;
14256         /*
14257          * Count of TQM fastpath rings to be used for allocating backing store.
14258          * Backing store configuration must be specified for each TQM ring from
14259          * this count in `backing_store_cfg`.
14260          * Only first 8 TQM FP rings will be advertised with this field.
14261          */
14262         uint8_t tqm_fp_rings_count;
14263         /*
14264          * Specifies the doubleword offset of ctx_kind_initializer for this
14265          * context type.
14266          */
14267         uint8_t stat_init_offset;
14268         /*
14269          * Specifies the doubleword offset of ctx_kind_initializer for this
14270          * context type.
14271          */
14272         uint8_t mrav_init_offset;
14273         /*
14274          * Count of TQM extended fastpath rings to be used for allocating
14275          * backing store beyond 8 rings(rings 9,10,11)
14276          * Backing store configuration must be specified for each TQM ring from
14277          * this count in `backing_store_cfg`.
14278          */
14279         uint8_t tqm_fp_rings_count_ext;
14280         /* Reserved for future. */
14281         uint8_t rsvd[5];
14282         /*
14283          * This field is used in Output records to indicate that the output
14284          * is completely written to RAM.  This field should be read as '1'
14285          * to indicate that the output has been completely written.
14286          * When writing a command completion or response to an internal processor,
14287          * the order of writes has to be such that this field is written last.
14288          */
14289         uint8_t valid;
14290 } __rte_packed;
14291
14292 /* tqm_fp_ring_cfg (size:128b/16B) */
14293 struct tqm_fp_ring_cfg {
14294         /* TQM ring page size and level. */
14295         uint8_t tqm_ring_pg_size_tqm_ring_lvl;
14296         /* TQM ring PBL indirect levels. */
14297         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_MASK \
14298                 UINT32_C(0xf)
14299         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_SFT       0
14300         /* PBL pointer is physical start address. */
14301         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_0 \
14302                 UINT32_C(0x0)
14303         /* PBL pointer points to PTE table. */
14304         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_1 \
14305                 UINT32_C(0x1)
14306         /*
14307          * PBL pointer points to PDE table with each entry pointing to
14308          * PTE tables.
14309          */
14310         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_2 \
14311                 UINT32_C(0x2)
14312         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LAST \
14313                 TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_LVL_LVL_2
14314         /* TQM ring page size. */
14315         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_MASK \
14316                 UINT32_C(0xf0)
14317         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_SFT   4
14318         /* 4KB. */
14319         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_4K \
14320                 (UINT32_C(0x0) << 4)
14321         /* 8KB. */
14322         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_8K \
14323                 (UINT32_C(0x1) << 4)
14324         /* 64KB. */
14325         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_64K \
14326                 (UINT32_C(0x2) << 4)
14327         /* 2MB. */
14328         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_2M \
14329                 (UINT32_C(0x3) << 4)
14330         /* 8MB. */
14331         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_8M \
14332                 (UINT32_C(0x4) << 4)
14333         /* 1GB. */
14334         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_1G \
14335                 (UINT32_C(0x5) << 4)
14336         #define TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_LAST \
14337                 TQM_FP_RING_CFG_TQM_RING_CFG_TQM_RING_PG_SIZE_PG_1G
14338         uint8_t unused[3];
14339         /* Number of TQM ring entries. */
14340         uint32_t        tqm_ring_num_entries;
14341         /* TQM ring page directory. */
14342         uint64_t        tqm_ring_page_dir;
14343 } __rte_packed;
14344
14345 /*******************************
14346  * hwrm_func_backing_store_cfg *
14347  *******************************/
14348
14349
14350 /* hwrm_func_backing_store_cfg_input (size:2432b/304B) */
14351 struct hwrm_func_backing_store_cfg_input {
14352         /* The HWRM command request type. */
14353         uint16_t        req_type;
14354         /*
14355          * The completion ring to send the completion event on. This should
14356          * be the NQ ID returned from the `nq_alloc` HWRM command.
14357          */
14358         uint16_t        cmpl_ring;
14359         /*
14360          * The sequence ID is used by the driver for tracking multiple
14361          * commands. This ID is treated as opaque data by the firmware and
14362          * the value is returned in the `hwrm_resp_hdr` upon completion.
14363          */
14364         uint16_t        seq_id;
14365         /*
14366          * The target ID of the command:
14367          * * 0x0-0xFFF8 - The function ID
14368          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14369          * * 0xFFFD - Reserved for user-space HWRM interface
14370          * * 0xFFFF - HWRM
14371          */
14372         uint16_t        target_id;
14373         /*
14374          * A physical address pointer pointing to a host buffer that the
14375          * command's response data will be written. This can be either a host
14376          * physical address (HPA) or a guest physical address (GPA) and must
14377          * point to a physically contiguous block of memory.
14378          */
14379         uint64_t        resp_addr;
14380         uint32_t        flags;
14381         /*
14382          * When set, the firmware only uses on-chip resources and does not
14383          * expect any backing store to be provided by the host driver. This
14384          * mode provides minimal L2 functionality (e.g. limited L2 resources,
14385          * no RoCE).
14386          */
14387         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE \
14388                 UINT32_C(0x1)
14389         /*
14390          * When set, the 32b `mrav_num_entries` field is logically divided
14391          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
14392          */
14393         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_MRAV_RESERVATION_SPLIT \
14394                 UINT32_C(0x2)
14395         uint32_t        enables;
14396         /*
14397          * This bit must be '1' for the qp fields to be
14398          * configured.
14399          */
14400         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP \
14401                 UINT32_C(0x1)
14402         /*
14403          * This bit must be '1' for the srq fields to be
14404          * configured.
14405          */
14406         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ \
14407                 UINT32_C(0x2)
14408         /*
14409          * This bit must be '1' for the cq fields to be
14410          * configured.
14411          */
14412         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ \
14413                 UINT32_C(0x4)
14414         /*
14415          * This bit must be '1' for the vnic fields to be
14416          * configured.
14417          */
14418         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC \
14419                 UINT32_C(0x8)
14420         /*
14421          * This bit must be '1' for the stat fields to be
14422          * configured.
14423          */
14424         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT \
14425                 UINT32_C(0x10)
14426         /*
14427          * This bit must be '1' for the tqm_sp fields to be
14428          * configured.
14429          */
14430         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP \
14431                 UINT32_C(0x20)
14432         /*
14433          * This bit must be '1' for the tqm_ring0 fields to be
14434          * configured.
14435          */
14436         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0 \
14437                 UINT32_C(0x40)
14438         /*
14439          * This bit must be '1' for the tqm_ring1 fields to be
14440          * configured.
14441          */
14442         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1 \
14443                 UINT32_C(0x80)
14444         /*
14445          * This bit must be '1' for the tqm_ring2 fields to be
14446          * configured.
14447          */
14448         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2 \
14449                 UINT32_C(0x100)
14450         /*
14451          * This bit must be '1' for the tqm_ring3 fields to be
14452          * configured.
14453          */
14454         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3 \
14455                 UINT32_C(0x200)
14456         /*
14457          * This bit must be '1' for the tqm_ring4 fields to be
14458          * configured.
14459          */
14460         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4 \
14461                 UINT32_C(0x400)
14462         /*
14463          * This bit must be '1' for the tqm_ring5 fields to be
14464          * configured.
14465          */
14466         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5 \
14467                 UINT32_C(0x800)
14468         /*
14469          * This bit must be '1' for the tqm_ring6 fields to be
14470          * configured.
14471          */
14472         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6 \
14473                 UINT32_C(0x1000)
14474         /*
14475          * This bit must be '1' for the tqm_ring7 fields to be
14476          * configured.
14477          */
14478         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7 \
14479                 UINT32_C(0x2000)
14480         /*
14481          * This bit must be '1' for the mrav fields to be
14482          * configured.
14483          */
14484         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV \
14485                 UINT32_C(0x4000)
14486         /*
14487          * This bit must be '1' for the tim fields to be
14488          * configured.
14489          */
14490         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM \
14491                 UINT32_C(0x8000)
14492         /*
14493          * This bit must be '1' for the tqm_ring8 fields to be
14494          * configured.
14495          */
14496         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING8 \
14497                 UINT32_C(0x10000)
14498         /*
14499          * This bit must be '1' for the tqm_ring9 fields to be
14500          * configured.
14501          */
14502         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING9 \
14503                 UINT32_C(0x20000)
14504         /*
14505          * This bit must be '1' for the tqm_ring10 fields to be
14506          * configured.
14507          */
14508         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING10 \
14509                 UINT32_C(0x40000)
14510         /* QPC page size and level. */
14511         uint8_t qpc_pg_size_qpc_lvl;
14512         /* QPC PBL indirect levels. */
14513         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK \
14514                 UINT32_C(0xf)
14515         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT       0
14516         /* PBL pointer is physical start address. */
14517         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0 \
14518                 UINT32_C(0x0)
14519         /* PBL pointer points to PTE table. */
14520         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1 \
14521                 UINT32_C(0x1)
14522         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14523         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 \
14524                 UINT32_C(0x2)
14525         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST \
14526                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
14527         /* QPC page size. */
14528         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK \
14529                 UINT32_C(0xf0)
14530         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT   4
14531         /* 4KB. */
14532         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K \
14533                 (UINT32_C(0x0) << 4)
14534         /* 8KB. */
14535         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K \
14536                 (UINT32_C(0x1) << 4)
14537         /* 64KB. */
14538         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K \
14539                 (UINT32_C(0x2) << 4)
14540         /* 2MB. */
14541         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M \
14542                 (UINT32_C(0x3) << 4)
14543         /* 8MB. */
14544         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M \
14545                 (UINT32_C(0x4) << 4)
14546         /* 1GB. */
14547         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G \
14548                 (UINT32_C(0x5) << 4)
14549         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST \
14550                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
14551         /* SRQ page size and level. */
14552         uint8_t srq_pg_size_srq_lvl;
14553         /* SRQ PBL indirect levels. */
14554         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK \
14555                 UINT32_C(0xf)
14556         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT       0
14557         /* PBL pointer is physical start address. */
14558         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0 \
14559                 UINT32_C(0x0)
14560         /* PBL pointer points to PTE table. */
14561         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1 \
14562                 UINT32_C(0x1)
14563         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14564         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 \
14565                 UINT32_C(0x2)
14566         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST \
14567                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
14568         /* SRQ page size. */
14569         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK \
14570                 UINT32_C(0xf0)
14571         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT   4
14572         /* 4KB. */
14573         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K \
14574                 (UINT32_C(0x0) << 4)
14575         /* 8KB. */
14576         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K \
14577                 (UINT32_C(0x1) << 4)
14578         /* 64KB. */
14579         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K \
14580                 (UINT32_C(0x2) << 4)
14581         /* 2MB. */
14582         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M \
14583                 (UINT32_C(0x3) << 4)
14584         /* 8MB. */
14585         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M \
14586                 (UINT32_C(0x4) << 4)
14587         /* 1GB. */
14588         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G \
14589                 (UINT32_C(0x5) << 4)
14590         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST \
14591                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
14592         /* CQ page size and level. */
14593         uint8_t cq_pg_size_cq_lvl;
14594         /* CQ PBL indirect levels. */
14595         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK \
14596                 UINT32_C(0xf)
14597         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT       0
14598         /* PBL pointer is physical start address. */
14599         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0 \
14600                 UINT32_C(0x0)
14601         /* PBL pointer points to PTE table. */
14602         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1 \
14603                 UINT32_C(0x1)
14604         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14605         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 \
14606                 UINT32_C(0x2)
14607         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST \
14608                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
14609         /* CQ page size. */
14610         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK \
14611                 UINT32_C(0xf0)
14612         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT   4
14613         /* 4KB. */
14614         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K \
14615                 (UINT32_C(0x0) << 4)
14616         /* 8KB. */
14617         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K \
14618                 (UINT32_C(0x1) << 4)
14619         /* 64KB. */
14620         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K \
14621                 (UINT32_C(0x2) << 4)
14622         /* 2MB. */
14623         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M \
14624                 (UINT32_C(0x3) << 4)
14625         /* 8MB. */
14626         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M \
14627                 (UINT32_C(0x4) << 4)
14628         /* 1GB. */
14629         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G \
14630                 (UINT32_C(0x5) << 4)
14631         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST \
14632                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
14633         /* VNIC page size and level. */
14634         uint8_t vnic_pg_size_vnic_lvl;
14635         /* VNIC PBL indirect levels. */
14636         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK \
14637                 UINT32_C(0xf)
14638         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT       0
14639         /* PBL pointer is physical start address. */
14640         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0 \
14641                 UINT32_C(0x0)
14642         /* PBL pointer points to PTE table. */
14643         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1 \
14644                 UINT32_C(0x1)
14645         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14646         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 \
14647                 UINT32_C(0x2)
14648         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST \
14649                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
14650         /* VNIC page size. */
14651         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK \
14652                 UINT32_C(0xf0)
14653         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT   4
14654         /* 4KB. */
14655         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K \
14656                 (UINT32_C(0x0) << 4)
14657         /* 8KB. */
14658         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K \
14659                 (UINT32_C(0x1) << 4)
14660         /* 64KB. */
14661         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K \
14662                 (UINT32_C(0x2) << 4)
14663         /* 2MB. */
14664         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M \
14665                 (UINT32_C(0x3) << 4)
14666         /* 8MB. */
14667         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M \
14668                 (UINT32_C(0x4) << 4)
14669         /* 1GB. */
14670         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G \
14671                 (UINT32_C(0x5) << 4)
14672         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST \
14673                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
14674         /* Stat page size and level. */
14675         uint8_t stat_pg_size_stat_lvl;
14676         /* Stat PBL indirect levels. */
14677         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK \
14678                 UINT32_C(0xf)
14679         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT       0
14680         /* PBL pointer is physical start address. */
14681         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0 \
14682                 UINT32_C(0x0)
14683         /* PBL pointer points to PTE table. */
14684         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1 \
14685                 UINT32_C(0x1)
14686         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14687         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 \
14688                 UINT32_C(0x2)
14689         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST \
14690                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
14691         /* Stat page size. */
14692         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK \
14693                 UINT32_C(0xf0)
14694         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT   4
14695         /* 4KB. */
14696         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K \
14697                 (UINT32_C(0x0) << 4)
14698         /* 8KB. */
14699         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K \
14700                 (UINT32_C(0x1) << 4)
14701         /* 64KB. */
14702         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K \
14703                 (UINT32_C(0x2) << 4)
14704         /* 2MB. */
14705         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M \
14706                 (UINT32_C(0x3) << 4)
14707         /* 8MB. */
14708         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M \
14709                 (UINT32_C(0x4) << 4)
14710         /* 1GB. */
14711         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G \
14712                 (UINT32_C(0x5) << 4)
14713         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST \
14714                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
14715         /* TQM slow path page size and level. */
14716         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
14717         /* TQM slow path PBL indirect levels. */
14718         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK \
14719                 UINT32_C(0xf)
14720         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT       0
14721         /* PBL pointer is physical start address. */
14722         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0 \
14723                 UINT32_C(0x0)
14724         /* PBL pointer points to PTE table. */
14725         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1 \
14726                 UINT32_C(0x1)
14727         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14728         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 \
14729                 UINT32_C(0x2)
14730         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST \
14731                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
14732         /* TQM slow path page size. */
14733         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK \
14734                 UINT32_C(0xf0)
14735         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT   4
14736         /* 4KB. */
14737         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K \
14738                 (UINT32_C(0x0) << 4)
14739         /* 8KB. */
14740         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K \
14741                 (UINT32_C(0x1) << 4)
14742         /* 64KB. */
14743         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K \
14744                 (UINT32_C(0x2) << 4)
14745         /* 2MB. */
14746         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M \
14747                 (UINT32_C(0x3) << 4)
14748         /* 8MB. */
14749         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M \
14750                 (UINT32_C(0x4) << 4)
14751         /* 1GB. */
14752         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G \
14753                 (UINT32_C(0x5) << 4)
14754         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST \
14755                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
14756         /* TQM ring 0 page size and level. */
14757         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
14758         /* TQM ring 0 PBL indirect levels. */
14759         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK \
14760                 UINT32_C(0xf)
14761         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT       0
14762         /* PBL pointer is physical start address. */
14763         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0 \
14764                 UINT32_C(0x0)
14765         /* PBL pointer points to PTE table. */
14766         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1 \
14767                 UINT32_C(0x1)
14768         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14769         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 \
14770                 UINT32_C(0x2)
14771         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST \
14772                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
14773         /* TQM ring 0 page size. */
14774         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK \
14775                 UINT32_C(0xf0)
14776         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT   4
14777         /* 4KB. */
14778         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K \
14779                 (UINT32_C(0x0) << 4)
14780         /* 8KB. */
14781         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K \
14782                 (UINT32_C(0x1) << 4)
14783         /* 64KB. */
14784         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K \
14785                 (UINT32_C(0x2) << 4)
14786         /* 2MB. */
14787         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M \
14788                 (UINT32_C(0x3) << 4)
14789         /* 8MB. */
14790         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M \
14791                 (UINT32_C(0x4) << 4)
14792         /* 1GB. */
14793         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G \
14794                 (UINT32_C(0x5) << 4)
14795         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST \
14796                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
14797         /* TQM ring 1 page size and level. */
14798         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
14799         /* TQM ring 1 PBL indirect levels. */
14800         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK \
14801                 UINT32_C(0xf)
14802         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT       0
14803         /* PBL pointer is physical start address. */
14804         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0 \
14805                 UINT32_C(0x0)
14806         /* PBL pointer points to PTE table. */
14807         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1 \
14808                 UINT32_C(0x1)
14809         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14810         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 \
14811                 UINT32_C(0x2)
14812         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST \
14813                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
14814         /* TQM ring 1 page size. */
14815         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK \
14816                 UINT32_C(0xf0)
14817         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT   4
14818         /* 4KB. */
14819         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K \
14820                 (UINT32_C(0x0) << 4)
14821         /* 8KB. */
14822         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K \
14823                 (UINT32_C(0x1) << 4)
14824         /* 64KB. */
14825         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K \
14826                 (UINT32_C(0x2) << 4)
14827         /* 2MB. */
14828         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M \
14829                 (UINT32_C(0x3) << 4)
14830         /* 8MB. */
14831         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M \
14832                 (UINT32_C(0x4) << 4)
14833         /* 1GB. */
14834         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G \
14835                 (UINT32_C(0x5) << 4)
14836         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST \
14837                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
14838         /* TQM ring 2 page size and level. */
14839         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
14840         /* TQM ring 2 PBL indirect levels. */
14841         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK \
14842                 UINT32_C(0xf)
14843         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT       0
14844         /* PBL pointer is physical start address. */
14845         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0 \
14846                 UINT32_C(0x0)
14847         /* PBL pointer points to PTE table. */
14848         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1 \
14849                 UINT32_C(0x1)
14850         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14851         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 \
14852                 UINT32_C(0x2)
14853         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST \
14854                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
14855         /* TQM ring 2 page size. */
14856         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK \
14857                 UINT32_C(0xf0)
14858         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT   4
14859         /* 4KB. */
14860         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K \
14861                 (UINT32_C(0x0) << 4)
14862         /* 8KB. */
14863         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K \
14864                 (UINT32_C(0x1) << 4)
14865         /* 64KB. */
14866         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K \
14867                 (UINT32_C(0x2) << 4)
14868         /* 2MB. */
14869         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M \
14870                 (UINT32_C(0x3) << 4)
14871         /* 8MB. */
14872         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M \
14873                 (UINT32_C(0x4) << 4)
14874         /* 1GB. */
14875         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G \
14876                 (UINT32_C(0x5) << 4)
14877         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST \
14878                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
14879         /* TQM ring 3 page size and level. */
14880         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
14881         /* TQM ring 3 PBL indirect levels. */
14882         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK \
14883                 UINT32_C(0xf)
14884         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT       0
14885         /* PBL pointer is physical start address. */
14886         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0 \
14887                 UINT32_C(0x0)
14888         /* PBL pointer points to PTE table. */
14889         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1 \
14890                 UINT32_C(0x1)
14891         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14892         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 \
14893                 UINT32_C(0x2)
14894         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST \
14895                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
14896         /* TQM ring 3 page size. */
14897         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK \
14898                 UINT32_C(0xf0)
14899         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT   4
14900         /* 4KB. */
14901         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K \
14902                 (UINT32_C(0x0) << 4)
14903         /* 8KB. */
14904         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K \
14905                 (UINT32_C(0x1) << 4)
14906         /* 64KB. */
14907         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K \
14908                 (UINT32_C(0x2) << 4)
14909         /* 2MB. */
14910         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M \
14911                 (UINT32_C(0x3) << 4)
14912         /* 8MB. */
14913         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M \
14914                 (UINT32_C(0x4) << 4)
14915         /* 1GB. */
14916         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G \
14917                 (UINT32_C(0x5) << 4)
14918         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST \
14919                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
14920         /* TQM ring 4 page size and level. */
14921         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
14922         /* TQM ring 4 PBL indirect levels. */
14923         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK \
14924                 UINT32_C(0xf)
14925         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT       0
14926         /* PBL pointer is physical start address. */
14927         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0 \
14928                 UINT32_C(0x0)
14929         /* PBL pointer points to PTE table. */
14930         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1 \
14931                 UINT32_C(0x1)
14932         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14933         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 \
14934                 UINT32_C(0x2)
14935         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST \
14936                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
14937         /* TQM ring 4 page size. */
14938         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK \
14939                 UINT32_C(0xf0)
14940         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT   4
14941         /* 4KB. */
14942         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K \
14943                 (UINT32_C(0x0) << 4)
14944         /* 8KB. */
14945         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K \
14946                 (UINT32_C(0x1) << 4)
14947         /* 64KB. */
14948         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K \
14949                 (UINT32_C(0x2) << 4)
14950         /* 2MB. */
14951         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M \
14952                 (UINT32_C(0x3) << 4)
14953         /* 8MB. */
14954         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M \
14955                 (UINT32_C(0x4) << 4)
14956         /* 1GB. */
14957         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G \
14958                 (UINT32_C(0x5) << 4)
14959         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST \
14960                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
14961         /* TQM ring 5 page size and level. */
14962         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
14963         /* TQM ring 5 PBL indirect levels. */
14964         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK \
14965                 UINT32_C(0xf)
14966         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT       0
14967         /* PBL pointer is physical start address. */
14968         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0 \
14969                 UINT32_C(0x0)
14970         /* PBL pointer points to PTE table. */
14971         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1 \
14972                 UINT32_C(0x1)
14973         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
14974         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 \
14975                 UINT32_C(0x2)
14976         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST \
14977                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
14978         /* TQM ring 5 page size. */
14979         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK \
14980                 UINT32_C(0xf0)
14981         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT   4
14982         /* 4KB. */
14983         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K \
14984                 (UINT32_C(0x0) << 4)
14985         /* 8KB. */
14986         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K \
14987                 (UINT32_C(0x1) << 4)
14988         /* 64KB. */
14989         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K \
14990                 (UINT32_C(0x2) << 4)
14991         /* 2MB. */
14992         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M \
14993                 (UINT32_C(0x3) << 4)
14994         /* 8MB. */
14995         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M \
14996                 (UINT32_C(0x4) << 4)
14997         /* 1GB. */
14998         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G \
14999                 (UINT32_C(0x5) << 4)
15000         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST \
15001                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
15002         /* TQM ring 6 page size and level. */
15003         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
15004         /* TQM ring 6 PBL indirect levels. */
15005         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK \
15006                 UINT32_C(0xf)
15007         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT       0
15008         /* PBL pointer is physical start address. */
15009         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0 \
15010                 UINT32_C(0x0)
15011         /* PBL pointer points to PTE table. */
15012         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1 \
15013                 UINT32_C(0x1)
15014         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15015         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 \
15016                 UINT32_C(0x2)
15017         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST \
15018                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
15019         /* TQM ring 6 page size. */
15020         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK \
15021                 UINT32_C(0xf0)
15022         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT   4
15023         /* 4KB. */
15024         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K \
15025                 (UINT32_C(0x0) << 4)
15026         /* 8KB. */
15027         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K \
15028                 (UINT32_C(0x1) << 4)
15029         /* 64KB. */
15030         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K \
15031                 (UINT32_C(0x2) << 4)
15032         /* 2MB. */
15033         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M \
15034                 (UINT32_C(0x3) << 4)
15035         /* 8MB. */
15036         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M \
15037                 (UINT32_C(0x4) << 4)
15038         /* 1GB. */
15039         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G \
15040                 (UINT32_C(0x5) << 4)
15041         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST \
15042                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
15043         /* TQM ring 7 page size and level. */
15044         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
15045         /* TQM ring 7 PBL indirect levels. */
15046         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK \
15047                 UINT32_C(0xf)
15048         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT       0
15049         /* PBL pointer is physical start address. */
15050         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0 \
15051                 UINT32_C(0x0)
15052         /* PBL pointer points to PTE table. */
15053         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1 \
15054                 UINT32_C(0x1)
15055         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15056         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 \
15057                 UINT32_C(0x2)
15058         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST \
15059                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
15060         /* TQM ring 7 page size. */
15061         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK \
15062                 UINT32_C(0xf0)
15063         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT   4
15064         /* 4KB. */
15065         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K \
15066                 (UINT32_C(0x0) << 4)
15067         /* 8KB. */
15068         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K \
15069                 (UINT32_C(0x1) << 4)
15070         /* 64KB. */
15071         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K \
15072                 (UINT32_C(0x2) << 4)
15073         /* 2MB. */
15074         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M \
15075                 (UINT32_C(0x3) << 4)
15076         /* 8MB. */
15077         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M \
15078                 (UINT32_C(0x4) << 4)
15079         /* 1GB. */
15080         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G \
15081                 (UINT32_C(0x5) << 4)
15082         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST \
15083                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
15084         /* MR/AV page size and level. */
15085         uint8_t mrav_pg_size_mrav_lvl;
15086         /* MR/AV PBL indirect levels. */
15087         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK \
15088                 UINT32_C(0xf)
15089         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT       0
15090         /* PBL pointer is physical start address. */
15091         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0 \
15092                 UINT32_C(0x0)
15093         /* PBL pointer points to PTE table. */
15094         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1 \
15095                 UINT32_C(0x1)
15096         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15097         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 \
15098                 UINT32_C(0x2)
15099         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST \
15100                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
15101         /* MR/AV page size. */
15102         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK \
15103                 UINT32_C(0xf0)
15104         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT   4
15105         /* 4KB. */
15106         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K \
15107                 (UINT32_C(0x0) << 4)
15108         /* 8KB. */
15109         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K \
15110                 (UINT32_C(0x1) << 4)
15111         /* 64KB. */
15112         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K \
15113                 (UINT32_C(0x2) << 4)
15114         /* 2MB. */
15115         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M \
15116                 (UINT32_C(0x3) << 4)
15117         /* 8MB. */
15118         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M \
15119                 (UINT32_C(0x4) << 4)
15120         /* 1GB. */
15121         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G \
15122                 (UINT32_C(0x5) << 4)
15123         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST \
15124                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
15125         /* Timer page size and level. */
15126         uint8_t tim_pg_size_tim_lvl;
15127         /* Timer PBL indirect levels. */
15128         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK \
15129                 UINT32_C(0xf)
15130         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT       0
15131         /* PBL pointer is physical start address. */
15132         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0 \
15133                 UINT32_C(0x0)
15134         /* PBL pointer points to PTE table. */
15135         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1 \
15136                 UINT32_C(0x1)
15137         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15138         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 \
15139                 UINT32_C(0x2)
15140         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST \
15141                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
15142         /* Timer page size. */
15143         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK \
15144                 UINT32_C(0xf0)
15145         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT   4
15146         /* 4KB. */
15147         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K \
15148                 (UINT32_C(0x0) << 4)
15149         /* 8KB. */
15150         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K \
15151                 (UINT32_C(0x1) << 4)
15152         /* 64KB. */
15153         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K \
15154                 (UINT32_C(0x2) << 4)
15155         /* 2MB. */
15156         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M \
15157                 (UINT32_C(0x3) << 4)
15158         /* 8MB. */
15159         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M \
15160                 (UINT32_C(0x4) << 4)
15161         /* 1GB. */
15162         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G \
15163                 (UINT32_C(0x5) << 4)
15164         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST \
15165                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
15166         /* QP page directory. */
15167         uint64_t        qpc_page_dir;
15168         /* SRQ page directory. */
15169         uint64_t        srq_page_dir;
15170         /* CQ page directory. */
15171         uint64_t        cq_page_dir;
15172         /* VNIC page directory. */
15173         uint64_t        vnic_page_dir;
15174         /* Stat page directory. */
15175         uint64_t        stat_page_dir;
15176         /* TQM slowpath page directory. */
15177         uint64_t        tqm_sp_page_dir;
15178         /* TQM ring 0 page directory. */
15179         uint64_t        tqm_ring0_page_dir;
15180         /* TQM ring 1 page directory. */
15181         uint64_t        tqm_ring1_page_dir;
15182         /* TQM ring 2 page directory. */
15183         uint64_t        tqm_ring2_page_dir;
15184         /* TQM ring 3 page directory. */
15185         uint64_t        tqm_ring3_page_dir;
15186         /* TQM ring 4 page directory. */
15187         uint64_t        tqm_ring4_page_dir;
15188         /* TQM ring 5 page directory. */
15189         uint64_t        tqm_ring5_page_dir;
15190         /* TQM ring 6 page directory. */
15191         uint64_t        tqm_ring6_page_dir;
15192         /* TQM ring 7 page directory. */
15193         uint64_t        tqm_ring7_page_dir;
15194         /* MR/AV page directory. */
15195         uint64_t        mrav_page_dir;
15196         /* Timer page directory. */
15197         uint64_t        tim_page_dir;
15198         /* Number of QPs. */
15199         uint32_t        qp_num_entries;
15200         /* Number of SRQs. */
15201         uint32_t        srq_num_entries;
15202         /* Number of CQs. */
15203         uint32_t        cq_num_entries;
15204         /* Number of Stats. */
15205         uint32_t        stat_num_entries;
15206         /*
15207          * Number of TQM slowpath entries.
15208          *
15209          * TQM slowpath rings should be sized as follows:
15210          *
15211          * num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size
15212          *
15213          * Where:
15214          *   num_vnics is the number of VNICs allocated in the VNIC backing store
15215          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
15216          *   num_roce_qps is the number of RoCE QPs in the QP backing store
15217          *   tqm_min_size is tqm_min_entries_per_ring reported by
15218          *     HWRM_FUNC_BACKING_STORE_QCAPS
15219          *
15220          * Note that TQM ring sizes cannot be extended while the system is
15221          * operational. If a PF driver needs to extend a TQM ring, it needs
15222          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15223          * the backing store.
15224          */
15225         uint32_t        tqm_sp_num_entries;
15226         /*
15227          * Number of TQM ring 0 entries.
15228          *
15229          * TQM fastpath rings should be sized large enough to accommodate the
15230          * maximum number of QPs (either L2 or RoCE, or both if shared)
15231          * that can be enqueued to the TQM ring.
15232          *
15233          * Note that TQM ring sizes cannot be extended while the system is
15234          * operational. If a PF driver needs to extend a TQM ring, it needs
15235          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15236          * the backing store.
15237          */
15238         uint32_t        tqm_ring0_num_entries;
15239         /*
15240          * Number of TQM ring 1 entries.
15241          *
15242          * TQM fastpath rings should be sized large enough to accommodate the
15243          * maximum number of QPs (either L2 or RoCE, or both if shared)
15244          * that can be enqueued to the TQM ring.
15245          *
15246          * Note that TQM ring sizes cannot be extended while the system is
15247          * operational. If a PF driver needs to extend a TQM ring, it needs
15248          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15249          * the backing store.
15250          */
15251         uint32_t        tqm_ring1_num_entries;
15252         /*
15253          * Number of TQM ring 2 entries.
15254          *
15255          * TQM fastpath rings should be sized large enough to accommodate the
15256          * maximum number of QPs (either L2 or RoCE, or both if shared)
15257          * that can be enqueued to the TQM ring.
15258          *
15259          * Note that TQM ring sizes cannot be extended while the system is
15260          * operational. If a PF driver needs to extend a TQM ring, it needs
15261          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15262          * the backing store.
15263          */
15264         uint32_t        tqm_ring2_num_entries;
15265         /*
15266          * Number of TQM ring 3 entries.
15267          *
15268          * TQM fastpath rings should be sized large enough to accommodate the
15269          * maximum number of QPs (either L2 or RoCE, or both if shared)
15270          * that can be enqueued to the TQM ring.
15271          *
15272          * Note that TQM ring sizes cannot be extended while the system is
15273          * operational. If a PF driver needs to extend a TQM ring, it needs
15274          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15275          * the backing store.
15276          */
15277         uint32_t        tqm_ring3_num_entries;
15278         /*
15279          * Number of TQM ring 4 entries.
15280          *
15281          * TQM fastpath rings should be sized large enough to accommodate the
15282          * maximum number of QPs (either L2 or RoCE, or both if shared)
15283          * that can be enqueued to the TQM ring.
15284          *
15285          * Note that TQM ring sizes cannot be extended while the system is
15286          * operational. If a PF driver needs to extend a TQM ring, it needs
15287          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15288          * the backing store.
15289          */
15290         uint32_t        tqm_ring4_num_entries;
15291         /*
15292          * Number of TQM ring 5 entries.
15293          *
15294          * TQM fastpath rings should be sized large enough to accommodate the
15295          * maximum number of QPs (either L2 or RoCE, or both if shared)
15296          * that can be enqueued to the TQM ring.
15297          *
15298          * Note that TQM ring sizes cannot be extended while the system is
15299          * operational. If a PF driver needs to extend a TQM ring, it needs
15300          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15301          * the backing store.
15302          */
15303         uint32_t        tqm_ring5_num_entries;
15304         /*
15305          * Number of TQM ring 6 entries.
15306          *
15307          * TQM fastpath rings should be sized large enough to accommodate the
15308          * maximum number of QPs (either L2 or RoCE, or both if shared)
15309          * that can be enqueued to the TQM ring.
15310          *
15311          * Note that TQM ring sizes cannot be extended while the system is
15312          * operational. If a PF driver needs to extend a TQM ring, it needs
15313          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15314          * the backing store.
15315          */
15316         uint32_t        tqm_ring6_num_entries;
15317         /*
15318          * Number of TQM ring 7 entries.
15319          *
15320          * TQM fastpath rings should be sized large enough to accommodate the
15321          * maximum number of QPs (either L2 or RoCE, or both if shared)
15322          * that can be enqueued to the TQM ring.
15323          *
15324          * Note that TQM ring sizes cannot be extended while the system is
15325          * operational. If a PF driver needs to extend a TQM ring, it needs
15326          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
15327          * the backing store.
15328          */
15329         uint32_t        tqm_ring7_num_entries;
15330         /*
15331          * If the MR/AV split reservation flag is not set, then this field
15332          * represents the total number of MR plus AV entries. For versions
15333          * of firmware that support the split reservation, when it is not
15334          * specified half of the entries will be reserved for MRs and the
15335          * other half for AVs.
15336          *
15337          * If the MR/AV split reservation flag is set, then this
15338          * field is logically divided into two 16b fields. Bits `[31:16]`
15339          * represents the `mr_num_entries` and bits `[15:0]` represents
15340          * `av_num_entries`. The granularity of these values is defined by
15341          * the `mrav_num_entries_unit` field returned by the
15342          * `backing_store_qcaps` command.
15343          */
15344         uint32_t        mrav_num_entries;
15345         /* Number of Timer entries. */
15346         uint32_t        tim_num_entries;
15347         /* Number of entries to reserve for QP1 */
15348         uint16_t        qp_num_qp1_entries;
15349         /* Number of entries to reserve for L2 */
15350         uint16_t        qp_num_l2_entries;
15351         /* Number of bytes that have been allocated for each context entry. */
15352         uint16_t        qp_entry_size;
15353         /* Number of entries to reserve for L2 */
15354         uint16_t        srq_num_l2_entries;
15355         /* Number of bytes that have been allocated for each context entry. */
15356         uint16_t        srq_entry_size;
15357         /* Number of entries to reserve for L2 */
15358         uint16_t        cq_num_l2_entries;
15359         /* Number of bytes that have been allocated for each context entry. */
15360         uint16_t        cq_entry_size;
15361         /* Number of entries to reserve for VNIC entries */
15362         uint16_t        vnic_num_vnic_entries;
15363         /* Number of entries to reserve for Ring table entries */
15364         uint16_t        vnic_num_ring_table_entries;
15365         /* Number of bytes that have been allocated for each context entry. */
15366         uint16_t        vnic_entry_size;
15367         /* Number of bytes that have been allocated for each context entry. */
15368         uint16_t        stat_entry_size;
15369         /* Number of bytes that have been allocated for each context entry. */
15370         uint16_t        tqm_entry_size;
15371         /* Number of bytes that have been allocated for each context entry. */
15372         uint16_t        mrav_entry_size;
15373         /* Number of bytes that have been allocated for each context entry. */
15374         uint16_t        tim_entry_size;
15375         /* TQM ring page size and level. */
15376         uint8_t tqm_ring8_pg_size_tqm_ring_lvl;
15377         /* TQM ring PBL indirect levels. */
15378         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_MASK \
15379                 UINT32_C(0xf)
15380         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_SFT \
15381                 0
15382         /* PBL pointer is physical start address. */
15383         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_0 \
15384                 UINT32_C(0x0)
15385         /* PBL pointer points to PTE table. */
15386         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_1 \
15387                 UINT32_C(0x1)
15388         /*
15389          * PBL pointer points to PDE table with each entry pointing to
15390          * PTE tables.
15391          */
15392         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_2 \
15393                 UINT32_C(0x2)
15394         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LAST \
15395                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_LVL_LVL_2
15396         /* TQM ring page size. */
15397         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_MASK \
15398                 UINT32_C(0xf0)
15399         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_SFT \
15400                 4
15401         /* 4KB. */
15402         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_4K \
15403                 (UINT32_C(0x0) << 4)
15404         /* 8KB. */
15405         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_8K \
15406                 (UINT32_C(0x1) << 4)
15407         /* 64KB. */
15408         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_64K \
15409                 (UINT32_C(0x2) << 4)
15410         /* 2MB. */
15411         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_2M \
15412                 (UINT32_C(0x3) << 4)
15413         /* 8MB. */
15414         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_8M \
15415                 (UINT32_C(0x4) << 4)
15416         /* 1GB. */
15417         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_1G \
15418                 (UINT32_C(0x5) << 4)
15419         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_LAST \
15420                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING8_TQM_RING_PG_SIZE_PG_1G
15421         uint8_t ring8_unused[3];
15422         /* Number of TQM ring entries. */
15423         uint32_t        tqm_ring8_num_entries;
15424         /* TQM ring page directory. */
15425         uint64_t        tqm_ring8_page_dir;
15426         /* TQM ring page size and level. */
15427         uint8_t tqm_ring9_pg_size_tqm_ring_lvl;
15428         /* TQM ring PBL indirect levels. */
15429         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_MASK \
15430                 UINT32_C(0xf)
15431         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_SFT \
15432                 0
15433         /* PBL pointer is physical start address. */
15434         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_0 \
15435                 UINT32_C(0x0)
15436         /* PBL pointer points to PTE table. */
15437         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_1 \
15438                 UINT32_C(0x1)
15439         /*
15440          * PBL pointer points to PDE table with each entry pointing to
15441          * PTE tables.
15442          */
15443         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_2 \
15444                 UINT32_C(0x2)
15445         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LAST \
15446                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_LVL_LVL_2
15447         /* TQM ring page size. */
15448         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_MASK \
15449                 UINT32_C(0xf0)
15450         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_SFT \
15451                 4
15452         /* 4KB. */
15453         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_4K \
15454                 (UINT32_C(0x0) << 4)
15455         /* 8KB. */
15456         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_8K \
15457                 (UINT32_C(0x1) << 4)
15458         /* 64KB. */
15459         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_64K \
15460                 (UINT32_C(0x2) << 4)
15461         /* 2MB. */
15462         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_2M \
15463                 (UINT32_C(0x3) << 4)
15464         /* 8MB. */
15465         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_8M \
15466                 (UINT32_C(0x4) << 4)
15467         /* 1GB. */
15468         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_1G \
15469                 (UINT32_C(0x5) << 4)
15470         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_LAST \
15471                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING9_TQM_RING_PG_SIZE_PG_1G
15472         uint8_t ring9_unused[3];
15473         /* Number of TQM ring entries. */
15474         uint32_t        tqm_ring9_num_entries;
15475         /* TQM ring page directory. */
15476         uint64_t        tqm_ring9_page_dir;
15477         /* TQM ring page size and level. */
15478         uint8_t tqm_ring10_pg_size_tqm_ring_lvl;
15479         /* TQM ring PBL indirect levels. */
15480         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_MASK \
15481                 UINT32_C(0xf)
15482         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_SFT \
15483                 0
15484         /* PBL pointer is physical start address. */
15485         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_0 \
15486                 UINT32_C(0x0)
15487         /* PBL pointer points to PTE table. */
15488         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_1 \
15489                 UINT32_C(0x1)
15490         /*
15491          * PBL pointer points to PDE table with each entry pointing to
15492          * PTE tables.
15493          */
15494         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_2 \
15495                 UINT32_C(0x2)
15496         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LAST \
15497                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_LVL_LVL_2
15498         /* TQM ring page size. */
15499         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_MASK \
15500                 UINT32_C(0xf0)
15501         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_SFT \
15502                 4
15503         /* 4KB. */
15504         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_4K \
15505                 (UINT32_C(0x0) << 4)
15506         /* 8KB. */
15507         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_8K \
15508                 (UINT32_C(0x1) << 4)
15509         /* 64KB. */
15510         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_64K \
15511                 (UINT32_C(0x2) << 4)
15512         /* 2MB. */
15513         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_2M \
15514                 (UINT32_C(0x3) << 4)
15515         /* 8MB. */
15516         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_8M \
15517                 (UINT32_C(0x4) << 4)
15518         /* 1GB. */
15519         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_1G \
15520                 (UINT32_C(0x5) << 4)
15521         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_LAST \
15522                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_RING10_TQM_RING_PG_SIZE_PG_1G
15523         uint8_t ring10_unused[3];
15524         /* Number of TQM ring entries. */
15525         uint32_t        tqm_ring10_num_entries;
15526         /* TQM ring page directory. */
15527         uint64_t        tqm_ring10_page_dir;
15528 } __rte_packed;
15529
15530 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
15531 struct hwrm_func_backing_store_cfg_output {
15532         /* The specific error status for the command. */
15533         uint16_t        error_code;
15534         /* The HWRM command request type. */
15535         uint16_t        req_type;
15536         /* The sequence ID from the original command. */
15537         uint16_t        seq_id;
15538         /* The length of the response data in number of bytes. */
15539         uint16_t        resp_len;
15540         uint8_t unused_0[7];
15541         /*
15542          * This field is used in Output records to indicate that the output
15543          * is completely written to RAM.  This field should be read as '1'
15544          * to indicate that the output has been completely written.
15545          * When writing a command completion or response to an internal processor,
15546          * the order of writes has to be such that this field is written last.
15547          */
15548         uint8_t valid;
15549 } __rte_packed;
15550
15551 /********************************
15552  * hwrm_func_backing_store_qcfg *
15553  ********************************/
15554
15555
15556 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
15557 struct hwrm_func_backing_store_qcfg_input {
15558         /* The HWRM command request type. */
15559         uint16_t        req_type;
15560         /*
15561          * The completion ring to send the completion event on. This should
15562          * be the NQ ID returned from the `nq_alloc` HWRM command.
15563          */
15564         uint16_t        cmpl_ring;
15565         /*
15566          * The sequence ID is used by the driver for tracking multiple
15567          * commands. This ID is treated as opaque data by the firmware and
15568          * the value is returned in the `hwrm_resp_hdr` upon completion.
15569          */
15570         uint16_t        seq_id;
15571         /*
15572          * The target ID of the command:
15573          * * 0x0-0xFFF8 - The function ID
15574          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15575          * * 0xFFFD - Reserved for user-space HWRM interface
15576          * * 0xFFFF - HWRM
15577          */
15578         uint16_t        target_id;
15579         /*
15580          * A physical address pointer pointing to a host buffer that the
15581          * command's response data will be written. This can be either a host
15582          * physical address (HPA) or a guest physical address (GPA) and must
15583          * point to a physically contiguous block of memory.
15584          */
15585         uint64_t        resp_addr;
15586 } __rte_packed;
15587
15588 /* hwrm_func_backing_store_qcfg_output (size:2304b/288B) */
15589 struct hwrm_func_backing_store_qcfg_output {
15590         /* The specific error status for the command. */
15591         uint16_t        error_code;
15592         /* The HWRM command request type. */
15593         uint16_t        req_type;
15594         /* The sequence ID from the original command. */
15595         uint16_t        seq_id;
15596         /* The length of the response data in number of bytes. */
15597         uint16_t        resp_len;
15598         uint32_t        flags;
15599         /*
15600          * When set, the firmware only uses on-chip resources and does not
15601          * expect any backing store to be provided by the host driver. This
15602          * mode provides minimal L2 functionality (e.g. limited L2 resources,
15603          * no RoCE).
15604          */
15605         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE \
15606                 UINT32_C(0x1)
15607         /*
15608          * When set, the 32b `mrav_num_entries` field is logically divided
15609          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
15610          */
15611         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_MRAV_RESERVATION_SPLIT \
15612                 UINT32_C(0x2)
15613         uint32_t        enables;
15614         /*
15615          * This bit must be '1' for the qp fields to be
15616          * configured.
15617          */
15618         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_QP \
15619                 UINT32_C(0x1)
15620         /*
15621          * This bit must be '1' for the srq fields to be
15622          * configured.
15623          */
15624         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_SRQ \
15625                 UINT32_C(0x2)
15626         /*
15627          * This bit must be '1' for the cq fields to be
15628          * configured.
15629          */
15630         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_CQ \
15631                 UINT32_C(0x4)
15632         /*
15633          * This bit must be '1' for the vnic fields to be
15634          * configured.
15635          */
15636         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_VNIC \
15637                 UINT32_C(0x8)
15638         /*
15639          * This bit must be '1' for the stat fields to be
15640          * configured.
15641          */
15642         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_STAT \
15643                 UINT32_C(0x10)
15644         /*
15645          * This bit must be '1' for the tqm_sp fields to be
15646          * configured.
15647          */
15648         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_SP \
15649                 UINT32_C(0x20)
15650         /*
15651          * This bit must be '1' for the tqm_ring0 fields to be
15652          * configured.
15653          */
15654         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING0 \
15655                 UINT32_C(0x40)
15656         /*
15657          * This bit must be '1' for the tqm_ring1 fields to be
15658          * configured.
15659          */
15660         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING1 \
15661                 UINT32_C(0x80)
15662         /*
15663          * This bit must be '1' for the tqm_ring2 fields to be
15664          * configured.
15665          */
15666         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING2 \
15667                 UINT32_C(0x100)
15668         /*
15669          * This bit must be '1' for the tqm_ring3 fields to be
15670          * configured.
15671          */
15672         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING3 \
15673                 UINT32_C(0x200)
15674         /*
15675          * This bit must be '1' for the tqm_ring4 fields to be
15676          * configured.
15677          */
15678         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING4 \
15679                 UINT32_C(0x400)
15680         /*
15681          * This bit must be '1' for the tqm_ring5 fields to be
15682          * configured.
15683          */
15684         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING5 \
15685                 UINT32_C(0x800)
15686         /*
15687          * This bit must be '1' for the tqm_ring6 fields to be
15688          * configured.
15689          */
15690         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING6 \
15691                 UINT32_C(0x1000)
15692         /*
15693          * This bit must be '1' for the tqm_ring7 fields to be
15694          * configured.
15695          */
15696         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING7 \
15697                 UINT32_C(0x2000)
15698         /*
15699          * This bit must be '1' for the mrav fields to be
15700          * configured.
15701          */
15702         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_MRAV \
15703                 UINT32_C(0x4000)
15704         /*
15705          * This bit must be '1' for the tim fields to be
15706          * configured.
15707          */
15708         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TIM \
15709                 UINT32_C(0x8000)
15710         /*
15711          * This bit must be '1' for the tqm_ring8 fields to be
15712          * configured.
15713          */
15714         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING8 \
15715                 UINT32_C(0x10000)
15716         /*
15717          * This bit must be '1' for the tqm_ring9 fields to be
15718          * configured.
15719          */
15720         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING9 \
15721                 UINT32_C(0x20000)
15722         /*
15723          * This bit must be '1' for the tqm_ring10 fields to be
15724          * configured.
15725          */
15726         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_ENABLES_TQM_RING10 \
15727                 UINT32_C(0x40000)
15728         /* QPC page size and level. */
15729         uint8_t qpc_pg_size_qpc_lvl;
15730         /* QPC PBL indirect levels. */
15731         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK \
15732                 UINT32_C(0xf)
15733         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT       0
15734         /* PBL pointer is physical start address. */
15735         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0 \
15736                 UINT32_C(0x0)
15737         /* PBL pointer points to PTE table. */
15738         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1 \
15739                 UINT32_C(0x1)
15740         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15741         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 \
15742                 UINT32_C(0x2)
15743         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST \
15744                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
15745         /* QPC page size. */
15746         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK \
15747                 UINT32_C(0xf0)
15748         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT   4
15749         /* 4KB. */
15750         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K \
15751                 (UINT32_C(0x0) << 4)
15752         /* 8KB. */
15753         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K \
15754                 (UINT32_C(0x1) << 4)
15755         /* 64KB. */
15756         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K \
15757                 (UINT32_C(0x2) << 4)
15758         /* 2MB. */
15759         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M \
15760                 (UINT32_C(0x3) << 4)
15761         /* 8MB. */
15762         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M \
15763                 (UINT32_C(0x4) << 4)
15764         /* 1GB. */
15765         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G \
15766                 (UINT32_C(0x5) << 4)
15767         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST \
15768                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
15769         /* SRQ page size and level. */
15770         uint8_t srq_pg_size_srq_lvl;
15771         /* SRQ PBL indirect levels. */
15772         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK \
15773                 UINT32_C(0xf)
15774         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT       0
15775         /* PBL pointer is physical start address. */
15776         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0 \
15777                 UINT32_C(0x0)
15778         /* PBL pointer points to PTE table. */
15779         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1 \
15780                 UINT32_C(0x1)
15781         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15782         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 \
15783                 UINT32_C(0x2)
15784         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST \
15785                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
15786         /* SRQ page size. */
15787         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK \
15788                 UINT32_C(0xf0)
15789         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT   4
15790         /* 4KB. */
15791         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K \
15792                 (UINT32_C(0x0) << 4)
15793         /* 8KB. */
15794         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K \
15795                 (UINT32_C(0x1) << 4)
15796         /* 64KB. */
15797         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K \
15798                 (UINT32_C(0x2) << 4)
15799         /* 2MB. */
15800         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M \
15801                 (UINT32_C(0x3) << 4)
15802         /* 8MB. */
15803         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M \
15804                 (UINT32_C(0x4) << 4)
15805         /* 1GB. */
15806         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G \
15807                 (UINT32_C(0x5) << 4)
15808         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST \
15809                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
15810         /* CQ page size and level. */
15811         uint8_t cq_pg_size_cq_lvl;
15812         /* CQ PBL indirect levels. */
15813         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK \
15814                 UINT32_C(0xf)
15815         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT       0
15816         /* PBL pointer is physical start address. */
15817         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0 \
15818                 UINT32_C(0x0)
15819         /* PBL pointer points to PTE table. */
15820         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1 \
15821                 UINT32_C(0x1)
15822         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15823         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 \
15824                 UINT32_C(0x2)
15825         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST \
15826                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
15827         /* CQ page size. */
15828         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK \
15829                 UINT32_C(0xf0)
15830         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT   4
15831         /* 4KB. */
15832         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K \
15833                 (UINT32_C(0x0) << 4)
15834         /* 8KB. */
15835         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K \
15836                 (UINT32_C(0x1) << 4)
15837         /* 64KB. */
15838         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K \
15839                 (UINT32_C(0x2) << 4)
15840         /* 2MB. */
15841         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M \
15842                 (UINT32_C(0x3) << 4)
15843         /* 8MB. */
15844         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M \
15845                 (UINT32_C(0x4) << 4)
15846         /* 1GB. */
15847         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G \
15848                 (UINT32_C(0x5) << 4)
15849         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST \
15850                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
15851         /* VNIC page size and level. */
15852         uint8_t vnic_pg_size_vnic_lvl;
15853         /* VNIC PBL indirect levels. */
15854         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK \
15855                 UINT32_C(0xf)
15856         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT       0
15857         /* PBL pointer is physical start address. */
15858         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0 \
15859                 UINT32_C(0x0)
15860         /* PBL pointer points to PTE table. */
15861         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1 \
15862                 UINT32_C(0x1)
15863         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15864         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 \
15865                 UINT32_C(0x2)
15866         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST \
15867                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
15868         /* VNIC page size. */
15869         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK \
15870                 UINT32_C(0xf0)
15871         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT   4
15872         /* 4KB. */
15873         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K \
15874                 (UINT32_C(0x0) << 4)
15875         /* 8KB. */
15876         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K \
15877                 (UINT32_C(0x1) << 4)
15878         /* 64KB. */
15879         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K \
15880                 (UINT32_C(0x2) << 4)
15881         /* 2MB. */
15882         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M \
15883                 (UINT32_C(0x3) << 4)
15884         /* 8MB. */
15885         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M \
15886                 (UINT32_C(0x4) << 4)
15887         /* 1GB. */
15888         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G \
15889                 (UINT32_C(0x5) << 4)
15890         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST \
15891                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
15892         /* Stat page size and level. */
15893         uint8_t stat_pg_size_stat_lvl;
15894         /* Stat PBL indirect levels. */
15895         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK \
15896                 UINT32_C(0xf)
15897         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT       0
15898         /* PBL pointer is physical start address. */
15899         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0 \
15900                 UINT32_C(0x0)
15901         /* PBL pointer points to PTE table. */
15902         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1 \
15903                 UINT32_C(0x1)
15904         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15905         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 \
15906                 UINT32_C(0x2)
15907         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST \
15908                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
15909         /* Stat page size. */
15910         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK \
15911                 UINT32_C(0xf0)
15912         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT   4
15913         /* 4KB. */
15914         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K \
15915                 (UINT32_C(0x0) << 4)
15916         /* 8KB. */
15917         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K \
15918                 (UINT32_C(0x1) << 4)
15919         /* 64KB. */
15920         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K \
15921                 (UINT32_C(0x2) << 4)
15922         /* 2MB. */
15923         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M \
15924                 (UINT32_C(0x3) << 4)
15925         /* 8MB. */
15926         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M \
15927                 (UINT32_C(0x4) << 4)
15928         /* 1GB. */
15929         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G \
15930                 (UINT32_C(0x5) << 4)
15931         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST \
15932                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
15933         /* TQM slow path page size and level. */
15934         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
15935         /* TQM slow path PBL indirect levels. */
15936         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK \
15937                 UINT32_C(0xf)
15938         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT       0
15939         /* PBL pointer is physical start address. */
15940         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0 \
15941                 UINT32_C(0x0)
15942         /* PBL pointer points to PTE table. */
15943         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1 \
15944                 UINT32_C(0x1)
15945         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15946         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 \
15947                 UINT32_C(0x2)
15948         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST \
15949                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
15950         /* TQM slow path page size. */
15951         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK \
15952                 UINT32_C(0xf0)
15953         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT   4
15954         /* 4KB. */
15955         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K \
15956                 (UINT32_C(0x0) << 4)
15957         /* 8KB. */
15958         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K \
15959                 (UINT32_C(0x1) << 4)
15960         /* 64KB. */
15961         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K \
15962                 (UINT32_C(0x2) << 4)
15963         /* 2MB. */
15964         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M \
15965                 (UINT32_C(0x3) << 4)
15966         /* 8MB. */
15967         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M \
15968                 (UINT32_C(0x4) << 4)
15969         /* 1GB. */
15970         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G \
15971                 (UINT32_C(0x5) << 4)
15972         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST \
15973                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
15974         /* TQM ring 0 page size and level. */
15975         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
15976         /* TQM ring 0 PBL indirect levels. */
15977         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK \
15978                 UINT32_C(0xf)
15979         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT       0
15980         /* PBL pointer is physical start address. */
15981         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0 \
15982                 UINT32_C(0x0)
15983         /* PBL pointer points to PTE table. */
15984         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1 \
15985                 UINT32_C(0x1)
15986         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
15987         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 \
15988                 UINT32_C(0x2)
15989         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST \
15990                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
15991         /* TQM ring 0 page size. */
15992         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK \
15993                 UINT32_C(0xf0)
15994         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT   4
15995         /* 4KB. */
15996         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K \
15997                 (UINT32_C(0x0) << 4)
15998         /* 8KB. */
15999         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K \
16000                 (UINT32_C(0x1) << 4)
16001         /* 64KB. */
16002         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K \
16003                 (UINT32_C(0x2) << 4)
16004         /* 2MB. */
16005         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M \
16006                 (UINT32_C(0x3) << 4)
16007         /* 8MB. */
16008         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M \
16009                 (UINT32_C(0x4) << 4)
16010         /* 1GB. */
16011         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G \
16012                 (UINT32_C(0x5) << 4)
16013         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST \
16014                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
16015         /* TQM ring 1 page size and level. */
16016         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
16017         /* TQM ring 1 PBL indirect levels. */
16018         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK \
16019                 UINT32_C(0xf)
16020         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT       0
16021         /* PBL pointer is physical start address. */
16022         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0 \
16023                 UINT32_C(0x0)
16024         /* PBL pointer points to PTE table. */
16025         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1 \
16026                 UINT32_C(0x1)
16027         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16028         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 \
16029                 UINT32_C(0x2)
16030         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST \
16031                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
16032         /* TQM ring 1 page size. */
16033         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK \
16034                 UINT32_C(0xf0)
16035         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT   4
16036         /* 4KB. */
16037         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K \
16038                 (UINT32_C(0x0) << 4)
16039         /* 8KB. */
16040         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K \
16041                 (UINT32_C(0x1) << 4)
16042         /* 64KB. */
16043         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K \
16044                 (UINT32_C(0x2) << 4)
16045         /* 2MB. */
16046         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M \
16047                 (UINT32_C(0x3) << 4)
16048         /* 8MB. */
16049         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M \
16050                 (UINT32_C(0x4) << 4)
16051         /* 1GB. */
16052         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G \
16053                 (UINT32_C(0x5) << 4)
16054         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST \
16055                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
16056         /* TQM ring 2 page size and level. */
16057         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
16058         /* TQM ring 2 PBL indirect levels. */
16059         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK \
16060                 UINT32_C(0xf)
16061         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT       0
16062         /* PBL pointer is physical start address. */
16063         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0 \
16064                 UINT32_C(0x0)
16065         /* PBL pointer points to PTE table. */
16066         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1 \
16067                 UINT32_C(0x1)
16068         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16069         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 \
16070                 UINT32_C(0x2)
16071         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST \
16072                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
16073         /* TQM ring 2 page size. */
16074         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK \
16075                 UINT32_C(0xf0)
16076         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT   4
16077         /* 4KB. */
16078         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K \
16079                 (UINT32_C(0x0) << 4)
16080         /* 8KB. */
16081         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K \
16082                 (UINT32_C(0x1) << 4)
16083         /* 64KB. */
16084         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K \
16085                 (UINT32_C(0x2) << 4)
16086         /* 2MB. */
16087         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M \
16088                 (UINT32_C(0x3) << 4)
16089         /* 8MB. */
16090         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M \
16091                 (UINT32_C(0x4) << 4)
16092         /* 1GB. */
16093         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G \
16094                 (UINT32_C(0x5) << 4)
16095         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST \
16096                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
16097         /* TQM ring 3 page size and level. */
16098         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
16099         /* TQM ring 3 PBL indirect levels. */
16100         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK \
16101                 UINT32_C(0xf)
16102         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT       0
16103         /* PBL pointer is physical start address. */
16104         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0 \
16105                 UINT32_C(0x0)
16106         /* PBL pointer points to PTE table. */
16107         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1 \
16108                 UINT32_C(0x1)
16109         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16110         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 \
16111                 UINT32_C(0x2)
16112         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST \
16113                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
16114         /* TQM ring 3 page size. */
16115         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK \
16116                 UINT32_C(0xf0)
16117         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT   4
16118         /* 4KB. */
16119         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K \
16120                 (UINT32_C(0x0) << 4)
16121         /* 8KB. */
16122         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K \
16123                 (UINT32_C(0x1) << 4)
16124         /* 64KB. */
16125         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K \
16126                 (UINT32_C(0x2) << 4)
16127         /* 2MB. */
16128         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M \
16129                 (UINT32_C(0x3) << 4)
16130         /* 8MB. */
16131         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M \
16132                 (UINT32_C(0x4) << 4)
16133         /* 1GB. */
16134         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G \
16135                 (UINT32_C(0x5) << 4)
16136         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST \
16137                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
16138         /* TQM ring 4 page size and level. */
16139         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
16140         /* TQM ring 4 PBL indirect levels. */
16141         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK \
16142                 UINT32_C(0xf)
16143         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT       0
16144         /* PBL pointer is physical start address. */
16145         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0 \
16146                 UINT32_C(0x0)
16147         /* PBL pointer points to PTE table. */
16148         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1 \
16149                 UINT32_C(0x1)
16150         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16151         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 \
16152                 UINT32_C(0x2)
16153         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST \
16154                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
16155         /* TQM ring 4 page size. */
16156         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK \
16157                 UINT32_C(0xf0)
16158         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT   4
16159         /* 4KB. */
16160         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K \
16161                 (UINT32_C(0x0) << 4)
16162         /* 8KB. */
16163         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K \
16164                 (UINT32_C(0x1) << 4)
16165         /* 64KB. */
16166         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K \
16167                 (UINT32_C(0x2) << 4)
16168         /* 2MB. */
16169         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M \
16170                 (UINT32_C(0x3) << 4)
16171         /* 8MB. */
16172         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M \
16173                 (UINT32_C(0x4) << 4)
16174         /* 1GB. */
16175         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G \
16176                 (UINT32_C(0x5) << 4)
16177         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST \
16178                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
16179         /* TQM ring 5 page size and level. */
16180         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
16181         /* TQM ring 5 PBL indirect levels. */
16182         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK \
16183                 UINT32_C(0xf)
16184         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT       0
16185         /* PBL pointer is physical start address. */
16186         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0 \
16187                 UINT32_C(0x0)
16188         /* PBL pointer points to PTE table. */
16189         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1 \
16190                 UINT32_C(0x1)
16191         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16192         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 \
16193                 UINT32_C(0x2)
16194         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST \
16195                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
16196         /* TQM ring 5 page size. */
16197         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK \
16198                 UINT32_C(0xf0)
16199         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT   4
16200         /* 4KB. */
16201         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K \
16202                 (UINT32_C(0x0) << 4)
16203         /* 8KB. */
16204         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K \
16205                 (UINT32_C(0x1) << 4)
16206         /* 64KB. */
16207         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K \
16208                 (UINT32_C(0x2) << 4)
16209         /* 2MB. */
16210         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M \
16211                 (UINT32_C(0x3) << 4)
16212         /* 8MB. */
16213         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M \
16214                 (UINT32_C(0x4) << 4)
16215         /* 1GB. */
16216         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G \
16217                 (UINT32_C(0x5) << 4)
16218         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST \
16219                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
16220         /* TQM ring 6 page size and level. */
16221         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
16222         /* TQM ring 6 PBL indirect levels. */
16223         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK \
16224                 UINT32_C(0xf)
16225         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT       0
16226         /* PBL pointer is physical start address. */
16227         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0 \
16228                 UINT32_C(0x0)
16229         /* PBL pointer points to PTE table. */
16230         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1 \
16231                 UINT32_C(0x1)
16232         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16233         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 \
16234                 UINT32_C(0x2)
16235         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST \
16236                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
16237         /* TQM ring 6 page size. */
16238         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK \
16239                 UINT32_C(0xf0)
16240         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT   4
16241         /* 4KB. */
16242         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K \
16243                 (UINT32_C(0x0) << 4)
16244         /* 8KB. */
16245         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K \
16246                 (UINT32_C(0x1) << 4)
16247         /* 64KB. */
16248         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K \
16249                 (UINT32_C(0x2) << 4)
16250         /* 2MB. */
16251         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M \
16252                 (UINT32_C(0x3) << 4)
16253         /* 8MB. */
16254         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M \
16255                 (UINT32_C(0x4) << 4)
16256         /* 1GB. */
16257         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G \
16258                 (UINT32_C(0x5) << 4)
16259         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST \
16260                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
16261         /* TQM ring 7 page size and level. */
16262         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
16263         /* TQM ring 7 PBL indirect levels. */
16264         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK \
16265                 UINT32_C(0xf)
16266         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT       0
16267         /* PBL pointer is physical start address. */
16268         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0 \
16269                 UINT32_C(0x0)
16270         /* PBL pointer points to PTE table. */
16271         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1 \
16272                 UINT32_C(0x1)
16273         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16274         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 \
16275                 UINT32_C(0x2)
16276         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST \
16277                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
16278         /* TQM ring 7 page size. */
16279         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK \
16280                 UINT32_C(0xf0)
16281         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT   4
16282         /* 4KB. */
16283         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K \
16284                 (UINT32_C(0x0) << 4)
16285         /* 8KB. */
16286         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K \
16287                 (UINT32_C(0x1) << 4)
16288         /* 64KB. */
16289         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K \
16290                 (UINT32_C(0x2) << 4)
16291         /* 2MB. */
16292         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M \
16293                 (UINT32_C(0x3) << 4)
16294         /* 8MB. */
16295         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M \
16296                 (UINT32_C(0x4) << 4)
16297         /* 1GB. */
16298         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G \
16299                 (UINT32_C(0x5) << 4)
16300         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST \
16301                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
16302         /* MR/AV page size and level. */
16303         uint8_t mrav_pg_size_mrav_lvl;
16304         /* MR/AV PBL indirect levels. */
16305         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK \
16306                 UINT32_C(0xf)
16307         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT       0
16308         /* PBL pointer is physical start address. */
16309         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0 \
16310                 UINT32_C(0x0)
16311         /* PBL pointer points to PTE table. */
16312         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1 \
16313                 UINT32_C(0x1)
16314         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16315         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 \
16316                 UINT32_C(0x2)
16317         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST \
16318                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
16319         /* MR/AV page size. */
16320         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK \
16321                 UINT32_C(0xf0)
16322         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT   4
16323         /* 4KB. */
16324         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K \
16325                 (UINT32_C(0x0) << 4)
16326         /* 8KB. */
16327         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K \
16328                 (UINT32_C(0x1) << 4)
16329         /* 64KB. */
16330         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K \
16331                 (UINT32_C(0x2) << 4)
16332         /* 2MB. */
16333         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M \
16334                 (UINT32_C(0x3) << 4)
16335         /* 8MB. */
16336         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M \
16337                 (UINT32_C(0x4) << 4)
16338         /* 1GB. */
16339         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G \
16340                 (UINT32_C(0x5) << 4)
16341         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST \
16342                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
16343         /* Timer page size and level. */
16344         uint8_t tim_pg_size_tim_lvl;
16345         /* Timer PBL indirect levels. */
16346         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK \
16347                 UINT32_C(0xf)
16348         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT       0
16349         /* PBL pointer is physical start address. */
16350         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0 \
16351                 UINT32_C(0x0)
16352         /* PBL pointer points to PTE table. */
16353         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1 \
16354                 UINT32_C(0x1)
16355         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
16356         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 \
16357                 UINT32_C(0x2)
16358         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST \
16359                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
16360         /* Timer page size. */
16361         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK \
16362                 UINT32_C(0xf0)
16363         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT   4
16364         /* 4KB. */
16365         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K \
16366                 (UINT32_C(0x0) << 4)
16367         /* 8KB. */
16368         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K \
16369                 (UINT32_C(0x1) << 4)
16370         /* 64KB. */
16371         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K \
16372                 (UINT32_C(0x2) << 4)
16373         /* 2MB. */
16374         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M \
16375                 (UINT32_C(0x3) << 4)
16376         /* 8MB. */
16377         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M \
16378                 (UINT32_C(0x4) << 4)
16379         /* 1GB. */
16380         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G \
16381                 (UINT32_C(0x5) << 4)
16382         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST \
16383                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
16384         /* QP page directory. */
16385         uint64_t        qpc_page_dir;
16386         /* SRQ page directory. */
16387         uint64_t        srq_page_dir;
16388         /* CQ page directory. */
16389         uint64_t        cq_page_dir;
16390         /* VNIC page directory. */
16391         uint64_t        vnic_page_dir;
16392         /* Stat page directory. */
16393         uint64_t        stat_page_dir;
16394         /* TQM slowpath page directory. */
16395         uint64_t        tqm_sp_page_dir;
16396         /* TQM ring 0 page directory. */
16397         uint64_t        tqm_ring0_page_dir;
16398         /* TQM ring 1 page directory. */
16399         uint64_t        tqm_ring1_page_dir;
16400         /* TQM ring 2 page directory. */
16401         uint64_t        tqm_ring2_page_dir;
16402         /* TQM ring 3 page directory. */
16403         uint64_t        tqm_ring3_page_dir;
16404         /* TQM ring 4 page directory. */
16405         uint64_t        tqm_ring4_page_dir;
16406         /* TQM ring 5 page directory. */
16407         uint64_t        tqm_ring5_page_dir;
16408         /* TQM ring 6 page directory. */
16409         uint64_t        tqm_ring6_page_dir;
16410         /* TQM ring 7 page directory. */
16411         uint64_t        tqm_ring7_page_dir;
16412         /* MR/AV page directory. */
16413         uint64_t        mrav_page_dir;
16414         /* Timer page directory. */
16415         uint64_t        tim_page_dir;
16416         /* Number of entries to reserve for QP1 */
16417         uint16_t        qp_num_qp1_entries;
16418         /* Number of entries to reserve for L2 */
16419         uint16_t        qp_num_l2_entries;
16420         /* Number of QPs. */
16421         uint32_t        qp_num_entries;
16422         /* Number of SRQs. */
16423         uint32_t        srq_num_entries;
16424         /* Number of entries to reserve for L2 */
16425         uint16_t        srq_num_l2_entries;
16426         /* Number of entries to reserve for L2 */
16427         uint16_t        cq_num_l2_entries;
16428         /* Number of CQs. */
16429         uint32_t        cq_num_entries;
16430         /* Number of entries to reserve for VNIC entries */
16431         uint16_t        vnic_num_vnic_entries;
16432         /* Number of entries to reserve for Ring table entries */
16433         uint16_t        vnic_num_ring_table_entries;
16434         /* Number of Stats. */
16435         uint32_t        stat_num_entries;
16436         /* Number of TQM slowpath entries. */
16437         uint32_t        tqm_sp_num_entries;
16438         /* Number of TQM ring 0 entries. */
16439         uint32_t        tqm_ring0_num_entries;
16440         /* Number of TQM ring 1 entries. */
16441         uint32_t        tqm_ring1_num_entries;
16442         /* Number of TQM ring 2 entries. */
16443         uint32_t        tqm_ring2_num_entries;
16444         /* Number of TQM ring 3 entries. */
16445         uint32_t        tqm_ring3_num_entries;
16446         /* Number of TQM ring 4 entries. */
16447         uint32_t        tqm_ring4_num_entries;
16448         /* Number of TQM ring 5 entries. */
16449         uint32_t        tqm_ring5_num_entries;
16450         /* Number of TQM ring 6 entries. */
16451         uint32_t        tqm_ring6_num_entries;
16452         /* Number of TQM ring 7 entries. */
16453         uint32_t        tqm_ring7_num_entries;
16454         /*
16455          * If the MR/AV split reservation flag is not set, then this field
16456          * represents the total number of MR plus AV entries. For versions
16457          * of firmware that support the split reservation, when it is not
16458          * specified half of the entries will be reserved for MRs and the
16459          * other half for AVs.
16460          *
16461          * If the MR/AV split reservation flag is set, then this
16462          * field is logically divided into two 16b fields. Bits `[31:16]`
16463          * represents the `mr_num_entries` and bits `[15:0]` represents
16464          * `av_num_entries`. The granularity of these values is defined by
16465          * the `mrav_num_entries_unit` field returned by the
16466          * `backing_store_qcaps` command.
16467          */
16468         uint32_t        mrav_num_entries;
16469         /* Number of Timer entries. */
16470         uint32_t        tim_num_entries;
16471         /* TQM ring page size and level. */
16472         uint8_t tqm_ring8_pg_size_tqm_ring_lvl;
16473         /* TQM ring PBL indirect levels. */
16474         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_MASK \
16475                 UINT32_C(0xf)
16476         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_SFT \
16477                 0
16478         /* PBL pointer is physical start address. */
16479         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_0 \
16480                 UINT32_C(0x0)
16481         /* PBL pointer points to PTE table. */
16482         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_1 \
16483                 UINT32_C(0x1)
16484         /*
16485          * PBL pointer points to PDE table with each entry pointing to
16486          * PTE tables.
16487          */
16488         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_2 \
16489                 UINT32_C(0x2)
16490         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LAST \
16491                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_LVL_LVL_2
16492         /* TQM ring page size. */
16493         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_MASK \
16494                 UINT32_C(0xf0)
16495         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_SFT \
16496                 4
16497         /* 4KB. */
16498         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_4K \
16499                 (UINT32_C(0x0) << 4)
16500         /* 8KB. */
16501         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_8K \
16502                 (UINT32_C(0x1) << 4)
16503         /* 64KB. */
16504         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_64K \
16505                 (UINT32_C(0x2) << 4)
16506         /* 2MB. */
16507         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_2M \
16508                 (UINT32_C(0x3) << 4)
16509         /* 8MB. */
16510         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_8M \
16511                 (UINT32_C(0x4) << 4)
16512         /* 1GB. */
16513         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_1G \
16514                 (UINT32_C(0x5) << 4)
16515         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_LAST \
16516                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING8_TQM_RING_PG_SIZE_PG_1G
16517         uint8_t ring8_unused[3];
16518         /* Number of TQM ring entries. */
16519         uint32_t        tqm_ring8_num_entries;
16520         /* TQM ring page directory. */
16521         uint64_t        tqm_ring8_page_dir;
16522         /* TQM ring page size and level. */
16523         uint8_t tqm_ring9_pg_size_tqm_ring_lvl;
16524         /* TQM ring PBL indirect levels. */
16525         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_MASK \
16526                 UINT32_C(0xf)
16527         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_SFT \
16528                 0
16529         /* PBL pointer is physical start address. */
16530         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_0 \
16531                 UINT32_C(0x0)
16532         /* PBL pointer points to PTE table. */
16533         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_1 \
16534                 UINT32_C(0x1)
16535         /*
16536          * PBL pointer points to PDE table with each entry pointing to
16537          * PTE tables.
16538          */
16539         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_2 \
16540                 UINT32_C(0x2)
16541         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LAST \
16542                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_LVL_LVL_2
16543         /* TQM ring page size. */
16544         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_MASK \
16545                 UINT32_C(0xf0)
16546         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_SFT \
16547                 4
16548         /* 4KB. */
16549         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_4K \
16550                 (UINT32_C(0x0) << 4)
16551         /* 8KB. */
16552         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_8K \
16553                 (UINT32_C(0x1) << 4)
16554         /* 64KB. */
16555         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_64K \
16556                 (UINT32_C(0x2) << 4)
16557         /* 2MB. */
16558         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_2M \
16559                 (UINT32_C(0x3) << 4)
16560         /* 8MB. */
16561         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_8M \
16562                 (UINT32_C(0x4) << 4)
16563         /* 1GB. */
16564         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_1G \
16565                 (UINT32_C(0x5) << 4)
16566         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_LAST \
16567                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING9_TQM_RING_PG_SIZE_PG_1G
16568         uint8_t ring9_unused[3];
16569         /* Number of TQM ring entries. */
16570         uint32_t        tqm_ring9_num_entries;
16571         /* TQM ring page directory. */
16572         uint64_t        tqm_ring9_page_dir;
16573         /* TQM ring page size and level. */
16574         uint8_t tqm_ring10_pg_size_tqm_ring_lvl;
16575         /* TQM ring PBL indirect levels. */
16576         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_MASK \
16577                 UINT32_C(0xf)
16578         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_SFT \
16579                 0
16580         /* PBL pointer is physical start address. */
16581         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_0 \
16582                 UINT32_C(0x0)
16583         /* PBL pointer points to PTE table. */
16584         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_1 \
16585                 UINT32_C(0x1)
16586         /*
16587          * PBL pointer points to PDE table with each entry pointing to
16588          * PTE tables.
16589          */
16590         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_2 \
16591                 UINT32_C(0x2)
16592         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LAST \
16593                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_LVL_LVL_2
16594         /* TQM ring page size. */
16595         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_MASK \
16596                 UINT32_C(0xf0)
16597         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_SFT \
16598                 4
16599         /* 4KB. */
16600         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_4K \
16601                 (UINT32_C(0x0) << 4)
16602         /* 8KB. */
16603         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_8K \
16604                 (UINT32_C(0x1) << 4)
16605         /* 64KB. */
16606         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_64K \
16607                 (UINT32_C(0x2) << 4)
16608         /* 2MB. */
16609         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_2M \
16610                 (UINT32_C(0x3) << 4)
16611         /* 8MB. */
16612         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_8M \
16613                 (UINT32_C(0x4) << 4)
16614         /* 1GB. */
16615         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_1G \
16616                 (UINT32_C(0x5) << 4)
16617         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_LAST \
16618                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_RING10_TQM_RING_PG_SIZE_PG_1G
16619         uint8_t ring10_unused[3];
16620         /* Number of TQM ring entries. */
16621         uint32_t        tqm_ring10_num_entries;
16622         /* TQM ring page directory. */
16623         uint64_t        tqm_ring10_page_dir;
16624         uint8_t unused_1[7];
16625         /*
16626          * This field is used in Output records to indicate that the output
16627          * is completely written to RAM.  This field should be read as 1
16628          * to indicate that the output has been completely written.
16629          * When writing a command completion or response to an internal
16630          * processor, the order of writes has to be such that this field
16631          * is written last.
16632          */
16633         uint8_t valid;
16634 } __rte_packed;
16635
16636 /****************************
16637  * hwrm_error_recovery_qcfg *
16638  ****************************/
16639
16640
16641 /* hwrm_error_recovery_qcfg_input (size:192b/24B) */
16642 struct hwrm_error_recovery_qcfg_input {
16643         /* The HWRM command request type. */
16644         uint16_t        req_type;
16645         /*
16646          * The completion ring to send the completion event on. This should
16647          * be the NQ ID returned from the `nq_alloc` HWRM command.
16648          */
16649         uint16_t        cmpl_ring;
16650         /*
16651          * The sequence ID is used by the driver for tracking multiple
16652          * commands. This ID is treated as opaque data by the firmware and
16653          * the value is returned in the `hwrm_resp_hdr` upon completion.
16654          */
16655         uint16_t        seq_id;
16656         /*
16657          * The target ID of the command:
16658          * * 0x0-0xFFF8 - The function ID
16659          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16660          * * 0xFFFD - Reserved for user-space HWRM interface
16661          * * 0xFFFF - HWRM
16662          */
16663         uint16_t        target_id;
16664         /*
16665          * A physical address pointer pointing to a host buffer that the
16666          * command's response data will be written. This can be either a host
16667          * physical address (HPA) or a guest physical address (GPA) and must
16668          * point to a physically contiguous block of memory.
16669          */
16670         uint64_t        resp_addr;
16671         uint8_t unused_0[8];
16672 } __rte_packed;
16673
16674 /* hwrm_error_recovery_qcfg_output (size:1664b/208B) */
16675 struct hwrm_error_recovery_qcfg_output {
16676         /* The specific error status for the command. */
16677         uint16_t        error_code;
16678         /* The HWRM command request type. */
16679         uint16_t        req_type;
16680         /* The sequence ID from the original command. */
16681         uint16_t        seq_id;
16682         /* The length of the response data in number of bytes. */
16683         uint16_t        resp_len;
16684         uint32_t        flags;
16685         /*
16686          * When this flag is set to 1, error recovery will be initiated
16687          * through master function driver.
16688          */
16689         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST       UINT32_C(0x1)
16690         /*
16691          * When this flag is set to 1, error recovery will be performed
16692          * through Co processor.
16693          */
16694         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU     UINT32_C(0x2)
16695         /*
16696          * Driver Polling frequency. This value is in units of 100msec.
16697          * Typical value would be 10 to indicate 1sec.
16698          * Drivers can poll FW health status, Heartbeat, reset_counter with
16699          * this frequency.
16700          */
16701         uint32_t        driver_polling_freq;
16702         /*
16703          * This value is in units of 100msec.
16704          * Typical value would be 30 to indicate 3sec.
16705          * Master function wait period from detecting a fatal error to
16706          * initiating reset. In this time period Master PF expects every
16707          * active driver will detect fatal error.
16708          */
16709         uint32_t        master_func_wait_period;
16710         /*
16711          * This value is in units of 100msec.
16712          * Typical value would be 50 to indicate 5sec.
16713          * Normal function wait period from fatal error detection to
16714          * polling FW health status. In this time period, drivers should not
16715          * do any PCIe MMIO transaction and should not send any HWRM commands.
16716          */
16717         uint32_t        normal_func_wait_period;
16718         /*
16719          * This value is in units of 100msec.
16720          * Typical value would be 20 to indicate 2sec.
16721          * This field indicates that, master function wait period after chip
16722          * reset. After this time, master function should reinitialize with
16723          * FW.
16724          */
16725         uint32_t        master_func_wait_period_after_reset;
16726         /*
16727          * This value is in units of 100msec.
16728          * Typical value would be 60 to indicate 6sec.
16729          * This field is applicable to both master and normal functions.
16730          * Even after chip reset, if FW status not changed to ready,
16731          * then all the functions can poll for this much time and bailout.
16732          */
16733         uint32_t        max_bailout_time_after_reset;
16734         /*
16735          * FW health status register.
16736          * Lower 2 bits indicates address space location and upper 30 bits
16737          * indicates upper 30bits of the register address.
16738          * A value of 0xFFFF-FFFF indicates this register does not exist.
16739          */
16740         uint32_t        fw_health_status_reg;
16741         /* Lower 2 bits indicates address space location. */
16742         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_MASK \
16743                 UINT32_C(0x3)
16744         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_SFT \
16745                 0
16746         /*
16747          * If value is 0, this register is located in PCIe config space.
16748          * Drivers have to map appropriate window to access this
16749          * register.
16750          */
16751         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_PCIE_CFG \
16752                 UINT32_C(0x0)
16753         /*
16754          * If value is 1, this register is located in GRC address space.
16755          * Drivers have to map appropriate window to access this
16756          * register.
16757          */
16758         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_GRC \
16759                 UINT32_C(0x1)
16760         /*
16761          * If value is 2, this register is located in first BAR address
16762          * space. Drivers have to map appropriate window to access this
16763          * register.
16764          */
16765         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR0 \
16766                 UINT32_C(0x2)
16767         /*
16768          * If value is 3, this register is located in second BAR address
16769          * space. Drivers have to map appropriate window to access this
16770          * Drivers have to map appropriate window to access this
16771          * register.
16772          */
16773         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1 \
16774                 UINT32_C(0x3)
16775         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_LAST \
16776                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1
16777         /* Upper 30bits of the register address. */
16778         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_MASK \
16779                 UINT32_C(0xfffffffc)
16780         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SFT \
16781                 2
16782         /*
16783          * FW HeartBeat register.
16784          * Lower 2 bits indicates address space location and upper 30 bits
16785          * indicates actual address.
16786          * A value of 0xFFFF-FFFF indicates this register does not exist.
16787          */
16788         uint32_t        fw_heartbeat_reg;
16789         /* Lower 2 bits indicates address space location. */
16790         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_MASK \
16791                 UINT32_C(0x3)
16792         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_SFT \
16793                 0
16794         /*
16795          * If value is 0, this register is located in PCIe config space.
16796          * Drivers have to map appropriate window to access this
16797          * register.
16798          */
16799         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_PCIE_CFG \
16800                 UINT32_C(0x0)
16801         /*
16802          * If value is 1, this register is located in GRC address space.
16803          * Drivers have to map appropriate window to access this
16804          * register.
16805          */
16806         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_GRC \
16807                 UINT32_C(0x1)
16808         /*
16809          * If value is 2, this register is located in first BAR address
16810          * space. Drivers have to map appropriate window to access this
16811          * register.
16812          */
16813         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR0 \
16814                 UINT32_C(0x2)
16815         /*
16816          * If value is 3, this register is located in second BAR address
16817          * space. Drivers have to map appropriate window to access this
16818          * register.
16819          */
16820         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1 \
16821                 UINT32_C(0x3)
16822         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_LAST \
16823                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1
16824         /* Upper 30bits of the register address. */
16825         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_MASK \
16826                 UINT32_C(0xfffffffc)
16827         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SFT \
16828                 2
16829         /*
16830          * FW reset counter.
16831          * Lower 2 bits indicates address space location and upper 30 bits
16832          * indicates actual address.
16833          * A value of 0xFFFF-FFFF indicates this register does not exist.
16834          */
16835         uint32_t        fw_reset_cnt_reg;
16836         /* Lower 2 bits indicates address space location. */
16837         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_MASK \
16838                 UINT32_C(0x3)
16839         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_SFT \
16840                 0
16841         /*
16842          * If value is 0, this register is located in PCIe config space.
16843          * Drivers have to map appropriate window to access this
16844          * register.
16845          */
16846         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_PCIE_CFG \
16847                 UINT32_C(0x0)
16848         /*
16849          * If value is 1, this register is located in GRC address space.
16850          * Drivers have to map appropriate window to access this
16851          * register.
16852          */
16853         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_GRC \
16854                 UINT32_C(0x1)
16855         /*
16856          * If value is 2, this register is located in first BAR address
16857          * space. Drivers have to map appropriate window to access this
16858          * register.
16859          */
16860         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR0 \
16861                 UINT32_C(0x2)
16862         /*
16863          * If value is 3, this register is located in second BAR address
16864          * space. Drivers have to map appropriate window to access this
16865          * register.
16866          */
16867         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1 \
16868                 UINT32_C(0x3)
16869         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_LAST \
16870                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1
16871         /* Upper 30bits of the register address. */
16872         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_MASK \
16873                 UINT32_C(0xfffffffc)
16874         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SFT \
16875                 2
16876         /*
16877          * Reset Inprogress Register address for PFs.
16878          * Lower 2 bits indicates address space location and upper 30 bits
16879          * indicates actual address.
16880          * A value of 0xFFFF-FFFF indicates this register does not exist.
16881          */
16882         uint32_t        reset_inprogress_reg;
16883         /* Lower 2 bits indicates address space location. */
16884         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_MASK \
16885                 UINT32_C(0x3)
16886         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_SFT \
16887                 0
16888         /*
16889          * If value is 0, this register is located in PCIe config space.
16890          * Drivers have to map appropriate window to access this
16891          * register.
16892          */
16893         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_PCIE_CFG \
16894                 UINT32_C(0x0)
16895         /*
16896          * If value is 1, this register is located in GRC address space.
16897          * Drivers have to map appropriate window to access this
16898          * register.
16899          */
16900         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_GRC \
16901                 UINT32_C(0x1)
16902         /*
16903          * If value is 2, this register is located in first BAR address
16904          * space. Drivers have to map appropriate window to access this
16905          * register.
16906          */
16907         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR0 \
16908                 UINT32_C(0x2)
16909         /*
16910          * If value is 3, this register is located in second BAR address
16911          * space. Drivers have to map appropriate window to access this
16912          * register.
16913          */
16914         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1 \
16915                 UINT32_C(0x3)
16916         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_LAST \
16917                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1
16918         /* Upper 30bits of the register address. */
16919         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_MASK \
16920                 UINT32_C(0xfffffffc)
16921         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SFT \
16922                 2
16923         /* This field indicates the mask value for reset_inprogress_reg. */
16924         uint32_t        reset_inprogress_reg_mask;
16925         uint8_t unused_0[3];
16926         /*
16927          * Array of registers and value count to reset the Chip
16928          * Each array count has reset_reg, reset_reg_val, delay_after_reset
16929          * in TLV format. Depending upon Chip type, number of reset registers
16930          * will vary. Drivers have to write reset_reg_val in the reset_reg
16931          * location in the same sequence in order to recover from a fatal
16932          * error.
16933          */
16934         uint8_t reg_array_cnt;
16935         /*
16936          * Reset register.
16937          * Lower 2 bits indicates address space location and upper 30 bits
16938          * indicates actual address.
16939          * A value of 0xFFFF-FFFF indicates this register does not exist.
16940          */
16941         uint32_t        reset_reg[16];
16942         /* Lower 2 bits indicates address space location. */
16943         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_MASK \
16944                 UINT32_C(0x3)
16945         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_SFT     0
16946         /*
16947          * If value is 0, this register is located in PCIe config space.
16948          * Drivers have to map appropriate window to access this
16949          * register.
16950          */
16951         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_PCIE_CFG \
16952                 UINT32_C(0x0)
16953         /*
16954          * If value is 1, this register is located in GRC address space.
16955          * Drivers have to map appropriate window to access this
16956          * register.
16957          */
16958         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_GRC \
16959                 UINT32_C(0x1)
16960         /*
16961          * If value is 2, this register is located in first BAR address
16962          * space. Drivers have to map appropriate window to access this
16963          * register.
16964          */
16965         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR0 \
16966                 UINT32_C(0x2)
16967         /*
16968          * If value is 3, this register is located in second BAR address
16969          * space. Drivers have to map appropriate window to access this
16970          * register.
16971          */
16972         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1 \
16973                 UINT32_C(0x3)
16974         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_LAST \
16975                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1
16976         /* Upper 30bits of the register address. */
16977         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_MASK \
16978                 UINT32_C(0xfffffffc)
16979         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SFT           2
16980         /* Value to be written in reset_reg to reset the controller. */
16981         uint32_t        reset_reg_val[16];
16982         /*
16983          * This value is in units of 1msec.
16984          * Typical value would be 10 to indicate 10msec.
16985          * Some of the operations like Core reset require delay before
16986          * accessing PCIE MMIO register space.
16987          * If this value is non-zero, drivers have to wait for
16988          * this much time after writing reset_reg_val in reset_reg.
16989          */
16990         uint8_t delay_after_reset[16];
16991         /*
16992          * Error recovery counter.
16993          * Lower 2 bits indicates address space location and upper 30 bits
16994          * indicates actual address.
16995          * A value of 0xFFFF-FFFF indicates this register does not exist.
16996          */
16997         uint32_t        err_recovery_cnt_reg;
16998         /* Lower 2 bits indicates address space location. */
16999         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_MASK \
17000                 UINT32_C(0x3)
17001         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_SFT \
17002                 0
17003         /*
17004          * If value is 0, this register is located in PCIe config space.
17005          * Drivers have to map appropriate window to access this
17006          * register.
17007          */
17008         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_PCIE_CFG \
17009                 UINT32_C(0x0)
17010         /*
17011          * If value is 1, this register is located in GRC address space.
17012          * Drivers have to map appropriate window to access this
17013          * register.
17014          */
17015         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_GRC \
17016                 UINT32_C(0x1)
17017         /*
17018          * If value is 2, this register is located in first BAR address
17019          * space. Drivers have to map appropriate window to access this
17020          * register.
17021          */
17022         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR0 \
17023                 UINT32_C(0x2)
17024         /*
17025          * If value is 3, this register is located in second BAR address
17026          * space. Drivers have to map appropriate window to access this
17027          * register.
17028          */
17029         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1 \
17030                 UINT32_C(0x3)
17031         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_LAST \
17032                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SPACE_BAR1
17033         /* Upper 30bits of the register address. */
17034         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_MASK \
17035                 UINT32_C(0xfffffffc)
17036         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_ERR_RECOVERY_CNT_REG_ADDR_SFT \
17037                 2
17038         uint8_t unused_1[3];
17039         /*
17040          * This field is used in Output records to indicate that the output
17041          * is completely written to RAM.  This field should be read as '1'
17042          * to indicate that the output has been completely written.
17043          * When writing a command completion or response to an internal
17044          * processor, the order of writes has to be such that this field
17045          * is written last.
17046          */
17047         uint8_t valid;
17048 } __rte_packed;
17049
17050 /***************************
17051  * hwrm_func_echo_response *
17052  ****************************/
17053
17054
17055 /* hwrm_func_echo_response_input (size:192b/24B) */
17056 struct hwrm_func_echo_response_input {
17057         /* The HWRM command request type. */
17058         uint16_t        req_type;
17059         /*
17060          * The completion ring to send the completion event on. This should
17061          * be the NQ ID returned from the `nq_alloc` HWRM command.
17062          */
17063         uint16_t        cmpl_ring;
17064         /*
17065          * The sequence ID is used by the driver for tracking multiple
17066          * commands. This ID is treated as opaque data by the firmware and
17067          * the value is returned in the `hwrm_resp_hdr` upon completion.
17068          */
17069         uint16_t        seq_id;
17070         /*
17071          * The target ID of the command:
17072          * 0x0-0xFFF8 - The function ID
17073          * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17074          * 0xFFFD - Reserved for user-space HWRM interface
17075          * 0xFFFF - HWRM
17076          */
17077         uint16_t        target_id;
17078         /*
17079          * A physical address pointer pointing to a host buffer that the
17080          * command's response data will be written. This can be either a host
17081          * physical address (HPA) or a guest physical address (GPA) and must
17082          * point to a physically contiguous block of memory.
17083          */
17084         uint64_t        resp_addr;
17085         uint32_t        event_data1;
17086         uint32_t        event_data2;
17087 } __rte_packed;
17088
17089 /* hwrm_func_echo_response_output (size:128b/16B) */
17090 struct hwrm_func_echo_response_output {
17091         /* The specific error status for the command. */
17092         uint16_t        error_code;
17093         /* The HWRM command request type. */
17094         uint16_t        req_type;
17095         /* The sequence ID from the original command. */
17096         uint16_t        seq_id;
17097         /* The length of the response data in number of bytes. */
17098         uint16_t        resp_len;
17099         uint8_t unused_0[7];
17100         /*
17101          * This field is used in Output records to indicate that the output
17102          * is completely written to RAM.  This field should be read as '1'
17103          * to indicate that the output has been completely written.
17104          * When writing a command completion or response to an internal processor,
17105          * the order of writes has to be such that this field is written last.
17106          */
17107         uint8_t valid;
17108 } __rte_packed;
17109
17110 /***********************
17111  * hwrm_func_vlan_qcfg *
17112  ***********************/
17113
17114
17115 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
17116 struct hwrm_func_vlan_qcfg_input {
17117         /* The HWRM command request type. */
17118         uint16_t        req_type;
17119         /*
17120          * The completion ring to send the completion event on. This should
17121          * be the NQ ID returned from the `nq_alloc` HWRM command.
17122          */
17123         uint16_t        cmpl_ring;
17124         /*
17125          * The sequence ID is used by the driver for tracking multiple
17126          * commands. This ID is treated as opaque data by the firmware and
17127          * the value is returned in the `hwrm_resp_hdr` upon completion.
17128          */
17129         uint16_t        seq_id;
17130         /*
17131          * The target ID of the command:
17132          * * 0x0-0xFFF8 - The function ID
17133          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17134          * * 0xFFFD - Reserved for user-space HWRM interface
17135          * * 0xFFFF - HWRM
17136          */
17137         uint16_t        target_id;
17138         /*
17139          * A physical address pointer pointing to a host buffer that the
17140          * command's response data will be written. This can be either a host
17141          * physical address (HPA) or a guest physical address (GPA) and must
17142          * point to a physically contiguous block of memory.
17143          */
17144         uint64_t        resp_addr;
17145         /*
17146          * Function ID of the function that is being
17147          * configured.
17148          * If set to 0xFF... (All Fs), then the configuration is
17149          * for the requesting function.
17150          */
17151         uint16_t        fid;
17152         uint8_t unused_0[6];
17153 } __rte_packed;
17154
17155 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
17156 struct hwrm_func_vlan_qcfg_output {
17157         /* The specific error status for the command. */
17158         uint16_t        error_code;
17159         /* The HWRM command request type. */
17160         uint16_t        req_type;
17161         /* The sequence ID from the original command. */
17162         uint16_t        seq_id;
17163         /* The length of the response data in number of bytes. */
17164         uint16_t        resp_len;
17165         uint64_t        unused_0;
17166         /* S-TAG VLAN identifier configured for the function. */
17167         uint16_t        stag_vid;
17168         /* S-TAG PCP value configured for the function. */
17169         uint8_t stag_pcp;
17170         uint8_t unused_1;
17171         /*
17172          * S-TAG TPID value configured for the function. This field is specified in
17173          * network byte order.
17174          */
17175         uint16_t        stag_tpid;
17176         /* C-TAG VLAN identifier configured for the function. */
17177         uint16_t        ctag_vid;
17178         /* C-TAG PCP value configured for the function. */
17179         uint8_t ctag_pcp;
17180         uint8_t unused_2;
17181         /*
17182          * C-TAG TPID value configured for the function. This field is specified in
17183          * network byte order.
17184          */
17185         uint16_t        ctag_tpid;
17186         /* Future use. */
17187         uint32_t        rsvd2;
17188         /* Future use. */
17189         uint32_t        rsvd3;
17190         uint8_t unused_3[3];
17191         /*
17192          * This field is used in Output records to indicate that the output
17193          * is completely written to RAM.  This field should be read as '1'
17194          * to indicate that the output has been completely written.
17195          * When writing a command completion or response to an internal processor,
17196          * the order of writes has to be such that this field is written last.
17197          */
17198         uint8_t valid;
17199 } __rte_packed;
17200
17201 /**********************
17202  * hwrm_func_vlan_cfg *
17203  **********************/
17204
17205
17206 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
17207 struct hwrm_func_vlan_cfg_input {
17208         /* The HWRM command request type. */
17209         uint16_t        req_type;
17210         /*
17211          * The completion ring to send the completion event on. This should
17212          * be the NQ ID returned from the `nq_alloc` HWRM command.
17213          */
17214         uint16_t        cmpl_ring;
17215         /*
17216          * The sequence ID is used by the driver for tracking multiple
17217          * commands. This ID is treated as opaque data by the firmware and
17218          * the value is returned in the `hwrm_resp_hdr` upon completion.
17219          */
17220         uint16_t        seq_id;
17221         /*
17222          * The target ID of the command:
17223          * * 0x0-0xFFF8 - The function ID
17224          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17225          * * 0xFFFD - Reserved for user-space HWRM interface
17226          * * 0xFFFF - HWRM
17227          */
17228         uint16_t        target_id;
17229         /*
17230          * A physical address pointer pointing to a host buffer that the
17231          * command's response data will be written. This can be either a host
17232          * physical address (HPA) or a guest physical address (GPA) and must
17233          * point to a physically contiguous block of memory.
17234          */
17235         uint64_t        resp_addr;
17236         /*
17237          * Function ID of the function that is being
17238          * configured.
17239          * If set to 0xFF... (All Fs), then the configuration is
17240          * for the requesting function.
17241          */
17242         uint16_t        fid;
17243         uint8_t unused_0[2];
17244         uint32_t        enables;
17245         /*
17246          * This bit must be '1' for the stag_vid field to be
17247          * configured.
17248          */
17249         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID      UINT32_C(0x1)
17250         /*
17251          * This bit must be '1' for the ctag_vid field to be
17252          * configured.
17253          */
17254         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID      UINT32_C(0x2)
17255         /*
17256          * This bit must be '1' for the stag_pcp field to be
17257          * configured.
17258          */
17259         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP      UINT32_C(0x4)
17260         /*
17261          * This bit must be '1' for the ctag_pcp field to be
17262          * configured.
17263          */
17264         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP      UINT32_C(0x8)
17265         /*
17266          * This bit must be '1' for the stag_tpid field to be
17267          * configured.
17268          */
17269         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID     UINT32_C(0x10)
17270         /*
17271          * This bit must be '1' for the ctag_tpid field to be
17272          * configured.
17273          */
17274         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID     UINT32_C(0x20)
17275         /* S-TAG VLAN identifier configured for the function. */
17276         uint16_t        stag_vid;
17277         /* S-TAG PCP value configured for the function. */
17278         uint8_t stag_pcp;
17279         uint8_t unused_1;
17280         /*
17281          * S-TAG TPID value configured for the function. This field is specified in
17282          * network byte order.
17283          */
17284         uint16_t        stag_tpid;
17285         /* C-TAG VLAN identifier configured for the function. */
17286         uint16_t        ctag_vid;
17287         /* C-TAG PCP value configured for the function. */
17288         uint8_t ctag_pcp;
17289         uint8_t unused_2;
17290         /*
17291          * C-TAG TPID value configured for the function. This field is specified in
17292          * network byte order.
17293          */
17294         uint16_t        ctag_tpid;
17295         /* Future use. */
17296         uint32_t        rsvd1;
17297         /* Future use. */
17298         uint32_t        rsvd2;
17299         uint8_t unused_3[4];
17300 } __rte_packed;
17301
17302 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
17303 struct hwrm_func_vlan_cfg_output {
17304         /* The specific error status for the command. */
17305         uint16_t        error_code;
17306         /* The HWRM command request type. */
17307         uint16_t        req_type;
17308         /* The sequence ID from the original command. */
17309         uint16_t        seq_id;
17310         /* The length of the response data in number of bytes. */
17311         uint16_t        resp_len;
17312         uint8_t unused_0[7];
17313         /*
17314          * This field is used in Output records to indicate that the output
17315          * is completely written to RAM.  This field should be read as '1'
17316          * to indicate that the output has been completely written.
17317          * When writing a command completion or response to an internal processor,
17318          * the order of writes has to be such that this field is written last.
17319          */
17320         uint8_t valid;
17321 } __rte_packed;
17322
17323 /*******************************
17324  * hwrm_func_vf_vnic_ids_query *
17325  *******************************/
17326
17327
17328 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
17329 struct hwrm_func_vf_vnic_ids_query_input {
17330         /* The HWRM command request type. */
17331         uint16_t        req_type;
17332         /*
17333          * The completion ring to send the completion event on. This should
17334          * be the NQ ID returned from the `nq_alloc` HWRM command.
17335          */
17336         uint16_t        cmpl_ring;
17337         /*
17338          * The sequence ID is used by the driver for tracking multiple
17339          * commands. This ID is treated as opaque data by the firmware and
17340          * the value is returned in the `hwrm_resp_hdr` upon completion.
17341          */
17342         uint16_t        seq_id;
17343         /*
17344          * The target ID of the command:
17345          * * 0x0-0xFFF8 - The function ID
17346          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17347          * * 0xFFFD - Reserved for user-space HWRM interface
17348          * * 0xFFFF - HWRM
17349          */
17350         uint16_t        target_id;
17351         /*
17352          * A physical address pointer pointing to a host buffer that the
17353          * command's response data will be written. This can be either a host
17354          * physical address (HPA) or a guest physical address (GPA) and must
17355          * point to a physically contiguous block of memory.
17356          */
17357         uint64_t        resp_addr;
17358         /*
17359          * This value is used to identify a Virtual Function (VF).
17360          * The scope of VF ID is local within a PF.
17361          */
17362         uint16_t        vf_id;
17363         uint8_t unused_0[2];
17364         /* Max number of vnic ids in vnic id table */
17365         uint32_t        max_vnic_id_cnt;
17366         /* This is the address for VF VNIC ID table */
17367         uint64_t        vnic_id_tbl_addr;
17368 } __rte_packed;
17369
17370 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
17371 struct hwrm_func_vf_vnic_ids_query_output {
17372         /* The specific error status for the command. */
17373         uint16_t        error_code;
17374         /* The HWRM command request type. */
17375         uint16_t        req_type;
17376         /* The sequence ID from the original command. */
17377         uint16_t        seq_id;
17378         /* The length of the response data in number of bytes. */
17379         uint16_t        resp_len;
17380         /*
17381          * Actual number of vnic ids
17382          *
17383          * Each VNIC ID is written as a 32-bit number.
17384          */
17385         uint32_t        vnic_id_cnt;
17386         uint8_t unused_0[3];
17387         /*
17388          * This field is used in Output records to indicate that the output
17389          * is completely written to RAM.  This field should be read as '1'
17390          * to indicate that the output has been completely written.
17391          * When writing a command completion or response to an internal processor,
17392          * the order of writes has to be such that this field is written last.
17393          */
17394         uint8_t valid;
17395 } __rte_packed;
17396
17397 /***********************
17398  * hwrm_func_vf_bw_cfg *
17399  ***********************/
17400
17401
17402 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */
17403 struct hwrm_func_vf_bw_cfg_input {
17404         /* The HWRM command request type. */
17405         uint16_t        req_type;
17406         /*
17407          * The completion ring to send the completion event on. This should
17408          * be the NQ ID returned from the `nq_alloc` HWRM command.
17409          */
17410         uint16_t        cmpl_ring;
17411         /*
17412          * The sequence ID is used by the driver for tracking multiple
17413          * commands. This ID is treated as opaque data by the firmware and
17414          * the value is returned in the `hwrm_resp_hdr` upon completion.
17415          */
17416         uint16_t        seq_id;
17417         /*
17418          * The target ID of the command:
17419          * * 0x0-0xFFF8 - The function ID
17420          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17421          * * 0xFFFD - Reserved for user-space HWRM interface
17422          * * 0xFFFF - HWRM
17423          */
17424         uint16_t        target_id;
17425         /*
17426          * A physical address pointer pointing to a host buffer that the
17427          * command's response data will be written. This can be either a host
17428          * physical address (HPA) or a guest physical address (GPA) and must
17429          * point to a physically contiguous block of memory.
17430          */
17431         uint64_t        resp_addr;
17432         /*
17433          * The number of VF functions that are being configured.
17434          * The cmd space allows up to 50 VFs' BW to be configured with one cmd.
17435          */
17436         uint16_t        num_vfs;
17437         uint16_t        unused[3];
17438         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
17439         uint16_t        vfn[48];
17440         /* The physical VF id the adjustment will be made to. */
17441         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK     UINT32_C(0xfff)
17442         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT      0
17443         /*
17444          * This field configures the rate scale percentage of the VF as specified
17445          * by the physical VF id.
17446          */
17447         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK     UINT32_C(0xf000)
17448         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT      12
17449         /* 0% of the max tx rate */
17450         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0 \
17451                 (UINT32_C(0x0) << 12)
17452         /* 6.66% of the max tx rate */
17453         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66 \
17454                 (UINT32_C(0x1) << 12)
17455         /* 13.33% of the max tx rate */
17456         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33 \
17457                 (UINT32_C(0x2) << 12)
17458         /* 20% of the max tx rate */
17459         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20 \
17460                 (UINT32_C(0x3) << 12)
17461         /* 26.66% of the max tx rate */
17462         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66 \
17463                 (UINT32_C(0x4) << 12)
17464         /* 33% of the max tx rate */
17465         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33 \
17466                 (UINT32_C(0x5) << 12)
17467         /* 40% of the max tx rate */
17468         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40 \
17469                 (UINT32_C(0x6) << 12)
17470         /* 46.66% of the max tx rate */
17471         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66 \
17472                 (UINT32_C(0x7) << 12)
17473         /* 53.33% of the max tx rate */
17474         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33 \
17475                 (UINT32_C(0x8) << 12)
17476         /* 60% of the max tx rate */
17477         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60 \
17478                 (UINT32_C(0x9) << 12)
17479         /* 66.66% of the max tx rate */
17480         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66 \
17481                 (UINT32_C(0xa) << 12)
17482         /* 53.33% of the max tx rate */
17483         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33 \
17484                 (UINT32_C(0xb) << 12)
17485         /* 80% of the max tx rate */
17486         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80 \
17487                 (UINT32_C(0xc) << 12)
17488         /* 86.66% of the max tx rate */
17489         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66 \
17490                 (UINT32_C(0xd) << 12)
17491         /* 93.33% of the max tx rate */
17492         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33 \
17493                 (UINT32_C(0xe) << 12)
17494         /* 100% of the max tx rate */
17495         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100 \
17496                 (UINT32_C(0xf) << 12)
17497         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST \
17498                 HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
17499 } __rte_packed;
17500
17501 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
17502 struct hwrm_func_vf_bw_cfg_output {
17503         /* The specific error status for the command. */
17504         uint16_t        error_code;
17505         /* The HWRM command request type. */
17506         uint16_t        req_type;
17507         /* The sequence ID from the original command. */
17508         uint16_t        seq_id;
17509         /* The length of the response data in number of bytes. */
17510         uint16_t        resp_len;
17511         uint8_t unused_0[7];
17512         /*
17513          * This field is used in Output records to indicate that the output
17514          * is completely written to RAM.  This field should be read as '1'
17515          * to indicate that the output has been completely written.
17516          * When writing a command completion or response to an internal processor,
17517          * the order of writes has to be such that this field is written last.
17518          */
17519         uint8_t valid;
17520 } __rte_packed;
17521
17522 /************************
17523  * hwrm_func_vf_bw_qcfg *
17524  ************************/
17525
17526
17527 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */
17528 struct hwrm_func_vf_bw_qcfg_input {
17529         /* The HWRM command request type. */
17530         uint16_t        req_type;
17531         /*
17532          * The completion ring to send the completion event on. This should
17533          * be the NQ ID returned from the `nq_alloc` HWRM command.
17534          */
17535         uint16_t        cmpl_ring;
17536         /*
17537          * The sequence ID is used by the driver for tracking multiple
17538          * commands. This ID is treated as opaque data by the firmware and
17539          * the value is returned in the `hwrm_resp_hdr` upon completion.
17540          */
17541         uint16_t        seq_id;
17542         /*
17543          * The target ID of the command:
17544          * * 0x0-0xFFF8 - The function ID
17545          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17546          * * 0xFFFD - Reserved for user-space HWRM interface
17547          * * 0xFFFF - HWRM
17548          */
17549         uint16_t        target_id;
17550         /*
17551          * A physical address pointer pointing to a host buffer that the
17552          * command's response data will be written. This can be either a host
17553          * physical address (HPA) or a guest physical address (GPA) and must
17554          * point to a physically contiguous block of memory.
17555          */
17556         uint64_t        resp_addr;
17557         /*
17558          * The number of VF functions that are being queried.
17559          * The inline response space allows the host to query up to 50 VFs'
17560          * rate scale percentage
17561          */
17562         uint16_t        num_vfs;
17563         uint16_t        unused[3];
17564         /* These 16-bit fields contain the VF fid */
17565         uint16_t        vfn[48];
17566         /* The physical VF id of interest */
17567         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
17568         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
17569 } __rte_packed;
17570
17571 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
17572 struct hwrm_func_vf_bw_qcfg_output {
17573         /* The specific error status for the command. */
17574         uint16_t        error_code;
17575         /* The HWRM command request type. */
17576         uint16_t        req_type;
17577         /* The sequence ID from the original command. */
17578         uint16_t        seq_id;
17579         /* The length of the response data in number of bytes. */
17580         uint16_t        resp_len;
17581         /*
17582          * The number of VF functions that are being queried.
17583          * The inline response space allows the host to query up to 50 VFs' rate
17584          * scale percentage
17585          */
17586         uint16_t        num_vfs;
17587         uint16_t        unused[3];
17588         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
17589         uint16_t        vfn[48];
17590         /* The physical VF id the adjustment will be made to. */
17591         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK     UINT32_C(0xfff)
17592         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT      0
17593         /*
17594          * This field configures the rate scale percentage of the VF as specified
17595          * by the physical VF id.
17596          */
17597         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK     UINT32_C(0xf000)
17598         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT      12
17599         /* 0% of the max tx rate */
17600         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0 \
17601                 (UINT32_C(0x0) << 12)
17602         /* 6.66% of the max tx rate */
17603         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66 \
17604                 (UINT32_C(0x1) << 12)
17605         /* 13.33% of the max tx rate */
17606         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33 \
17607                 (UINT32_C(0x2) << 12)
17608         /* 20% of the max tx rate */
17609         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20 \
17610                 (UINT32_C(0x3) << 12)
17611         /* 26.66% of the max tx rate */
17612         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66 \
17613                 (UINT32_C(0x4) << 12)
17614         /* 33% of the max tx rate */
17615         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33 \
17616                 (UINT32_C(0x5) << 12)
17617         /* 40% of the max tx rate */
17618         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40 \
17619                 (UINT32_C(0x6) << 12)
17620         /* 46.66% of the max tx rate */
17621         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66 \
17622                 (UINT32_C(0x7) << 12)
17623         /* 53.33% of the max tx rate */
17624         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33 \
17625                 (UINT32_C(0x8) << 12)
17626         /* 60% of the max tx rate */
17627         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60 \
17628                 (UINT32_C(0x9) << 12)
17629         /* 66.66% of the max tx rate */
17630         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66 \
17631                 (UINT32_C(0xa) << 12)
17632         /* 53.33% of the max tx rate */
17633         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33 \
17634                 (UINT32_C(0xb) << 12)
17635         /* 80% of the max tx rate */
17636         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80 \
17637                 (UINT32_C(0xc) << 12)
17638         /* 86.66% of the max tx rate */
17639         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66 \
17640                 (UINT32_C(0xd) << 12)
17641         /* 93.33% of the max tx rate */
17642         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33 \
17643                 (UINT32_C(0xe) << 12)
17644         /* 100% of the max tx rate */
17645         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100 \
17646                 (UINT32_C(0xf) << 12)
17647         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST \
17648                 HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100
17649         uint8_t unused_0[7];
17650         /*
17651          * This field is used in Output records to indicate that the output
17652          * is completely written to RAM.  This field should be read as '1'
17653          * to indicate that the output has been completely written.
17654          * When writing a command completion or response to an internal processor,
17655          * the order of writes has to be such that this field is written last.
17656          */
17657         uint8_t valid;
17658 } __rte_packed;
17659
17660 /***************************
17661  * hwrm_func_drv_if_change *
17662  ***************************/
17663
17664
17665 /* hwrm_func_drv_if_change_input (size:192b/24B) */
17666 struct hwrm_func_drv_if_change_input {
17667         /* The HWRM command request type. */
17668         uint16_t        req_type;
17669         /*
17670          * The completion ring to send the completion event on. This should
17671          * be the NQ ID returned from the `nq_alloc` HWRM command.
17672          */
17673         uint16_t        cmpl_ring;
17674         /*
17675          * The sequence ID is used by the driver for tracking multiple
17676          * commands. This ID is treated as opaque data by the firmware and
17677          * the value is returned in the `hwrm_resp_hdr` upon completion.
17678          */
17679         uint16_t        seq_id;
17680         /*
17681          * The target ID of the command:
17682          * * 0x0-0xFFF8 - The function ID
17683          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17684          * * 0xFFFD - Reserved for user-space HWRM interface
17685          * * 0xFFFF - HWRM
17686          */
17687         uint16_t        target_id;
17688         /*
17689          * A physical address pointer pointing to a host buffer that the
17690          * command's response data will be written. This can be either a host
17691          * physical address (HPA) or a guest physical address (GPA) and must
17692          * point to a physically contiguous block of memory.
17693          */
17694         uint64_t        resp_addr;
17695         uint32_t        flags;
17696         /*
17697          * When this bit is '1', the function driver is indicating
17698          * that the IF state is changing to UP state.  The call should
17699          * be made at the beginning of the driver's open call before
17700          * resources are allocated.  After making the call, the driver
17701          * should check the response to see if any resources may have
17702          * changed (see the response below).  If the driver fails
17703          * the open call, the driver should make this call again with
17704          * this bit cleared to indicate that the IF state is not UP.
17705          * During the driver's close call when the IF state is changing
17706          * to DOWN, the driver should make this call with the bit cleared
17707          * after all resources have been freed.
17708          */
17709         #define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP     UINT32_C(0x1)
17710         uint32_t        unused;
17711 } __rte_packed;
17712
17713 /* hwrm_func_drv_if_change_output (size:128b/16B) */
17714 struct hwrm_func_drv_if_change_output {
17715         /* The specific error status for the command. */
17716         uint16_t        error_code;
17717         /* The HWRM command request type. */
17718         uint16_t        req_type;
17719         /* The sequence ID from the original command. */
17720         uint16_t        seq_id;
17721         /* The length of the response data in number of bytes. */
17722         uint16_t        resp_len;
17723         uint32_t        flags;
17724         /*
17725          * When this bit is '1', it indicates that the resources reserved
17726          * for this function may have changed.  The driver should check
17727          * resource capabilities and reserve resources again before
17728          * allocating resources.
17729          */
17730         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE \
17731                 UINT32_C(0x1)
17732         /*
17733          * When this bit is '1', it indicates that the firmware got changed / reset.
17734          * The driver should do complete re-initialization when that bit is set.
17735          */
17736         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE \
17737                 UINT32_C(0x2)
17738         uint8_t unused_0[3];
17739         /*
17740          * This field is used in Output records to indicate that the output
17741          * is completely written to RAM.  This field should be read as '1'
17742          * to indicate that the output has been completely written.
17743          * When writing a command completion or response to an internal processor,
17744          * the order of writes has to be such that this field is written last.
17745          */
17746         uint8_t valid;
17747 } __rte_packed;
17748
17749 /*******************************
17750  * hwrm_func_host_pf_ids_query *
17751  *******************************/
17752
17753
17754 /* hwrm_func_host_pf_ids_query_input (size:192b/24B) */
17755 struct hwrm_func_host_pf_ids_query_input {
17756         /* The HWRM command request type. */
17757         uint16_t        req_type;
17758         /*
17759          * The completion ring to send the completion event on. This should
17760          * be the NQ ID returned from the `nq_alloc` HWRM command.
17761          */
17762         uint16_t        cmpl_ring;
17763         /*
17764          * The sequence ID is used by the driver for tracking multiple
17765          * commands. This ID is treated as opaque data by the firmware and
17766          * the value is returned in the `hwrm_resp_hdr` upon completion.
17767          */
17768         uint16_t        seq_id;
17769         /*
17770          * The target ID of the command:
17771          * * 0x0-0xFFF8 - The function ID
17772          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17773          * * 0xFFFD - Reserved for user-space HWRM interface
17774          * * 0xFFFF - HWRM
17775          */
17776         uint16_t        target_id;
17777         /*
17778          * A physical address pointer pointing to a host buffer that the
17779          * command's response data will be written. This can be either a host
17780          * physical address (HPA) or a guest physical address (GPA) and must
17781          * point to a physically contiguous block of memory.
17782          */
17783         uint64_t        resp_addr;
17784         uint8_t host;
17785         /*
17786          * # If this bit is set to '1', the query will contain PF(s)
17787          * belongs to SOC host.
17788          */
17789         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_SOC      UINT32_C(0x1)
17790         /*
17791          * # If this bit is set to '1', the query will contain PF(s)
17792          * belongs to EP0 host.
17793          */
17794         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_0     UINT32_C(0x2)
17795         /*
17796          * # If this bit is set to '1', the query will contain PF(s)
17797          * belongs to EP1 host.
17798          */
17799         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_1     UINT32_C(0x4)
17800         /*
17801          * # If this bit is set to '1', the query will contain PF(s)
17802          * belongs to EP2 host.
17803          */
17804         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_2     UINT32_C(0x8)
17805         /*
17806          * # If this bit is set to '1', the query will contain PF(s)
17807          * belongs to EP3 host.
17808          */
17809         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_3     UINT32_C(0x10)
17810         /*
17811          * This provides a filter of what PF(s) will be returned in the
17812          * query..
17813          */
17814         uint8_t filter;
17815         /*
17816          * all available PF(s) belong to the host(s) (defined in the
17817          * host field). This includes the hidden PFs.
17818          */
17819         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ALL  UINT32_C(0x0)
17820         /*
17821          * all available PF(s) belong to the host(s) (defined in the
17822          * host field) that is available for L2 traffic.
17823          */
17824         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_L2   UINT32_C(0x1)
17825         /*
17826          * all available PF(s) belong to the host(s) (defined in the
17827          * host field) that is available for ROCE traffic.
17828          */
17829         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE UINT32_C(0x2)
17830         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_LAST \
17831                 HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE
17832         uint8_t unused_1[6];
17833 } __rte_packed;
17834
17835 /* hwrm_func_host_pf_ids_query_output (size:128b/16B) */
17836 struct hwrm_func_host_pf_ids_query_output {
17837         /* The specific error status for the command. */
17838         uint16_t        error_code;
17839         /* The HWRM command request type. */
17840         uint16_t        req_type;
17841         /* The sequence ID from the original command. */
17842         uint16_t        seq_id;
17843         /* The length of the response data in number of bytes. */
17844         uint16_t        resp_len;
17845         /* This provides the first PF ID of the device. */
17846         uint16_t        first_pf_id;
17847         uint16_t        pf_ordinal_mask;
17848         /*
17849          * When this bit is '1', it indicates first PF belongs to one of
17850          * the hosts defined in the input request.
17851          */
17852         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_0 \
17853                 UINT32_C(0x1)
17854         /*
17855          * When this bit is '1', it indicates 2nd PF belongs to one of the
17856          * hosts defined in the input request.
17857          */
17858         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_1 \
17859                 UINT32_C(0x2)
17860         /*
17861          * When this bit is '1', it indicates 3rd PF belongs to one of the
17862          * hosts defined in the input request.
17863          */
17864         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_2 \
17865                 UINT32_C(0x4)
17866         /*
17867          * When this bit is '1', it indicates 4th PF belongs to one of the
17868          * hosts defined in the input request.
17869          */
17870         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_3 \
17871                 UINT32_C(0x8)
17872         /*
17873          * When this bit is '1', it indicates 5th PF belongs to one of the
17874          * hosts defined in the input request.
17875          */
17876         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_4 \
17877                 UINT32_C(0x10)
17878         /*
17879          * When this bit is '1', it indicates 6th PF belongs to one of the
17880          * hosts defined in the input request.
17881          */
17882         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_5 \
17883                 UINT32_C(0x20)
17884         /*
17885          * When this bit is '1', it indicates 7th PF belongs to one of the
17886          * hosts defined in the input request.
17887          */
17888         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_6 \
17889                 UINT32_C(0x40)
17890         /*
17891          * When this bit is '1', it indicates 8th PF belongs to one of the
17892          * hosts defined in the input request.
17893          */
17894         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_7 \
17895                 UINT32_C(0x80)
17896         /*
17897          * When this bit is '1', it indicates 9th PF belongs to one of the
17898          * hosts defined in the input request.
17899          */
17900         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_8 \
17901                 UINT32_C(0x100)
17902         /*
17903          * When this bit is '1', it indicates 10th PF belongs to one of the
17904          * hosts defined in the input request.
17905          */
17906         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_9 \
17907                 UINT32_C(0x200)
17908         /*
17909          * When this bit is '1', it indicates 11th PF belongs to one of the
17910          * hosts defined in the input request.
17911          */
17912         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_10 \
17913                 UINT32_C(0x400)
17914         /*
17915          * When this bit is '1', it indicates 12th PF belongs to one of the
17916          * hosts defined in the input request.
17917          */
17918         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_11 \
17919                 UINT32_C(0x800)
17920         /*
17921          * When this bit is '1', it indicates 13th PF belongs to one of the
17922          * hosts defined in the input request.
17923          */
17924         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_12 \
17925                 UINT32_C(0x1000)
17926         /*
17927          * When this bit is '1', it indicates 14th PF belongs to one of the
17928          * hosts defined in the input request.
17929          */
17930         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_13 \
17931                 UINT32_C(0x2000)
17932         /*
17933          * When this bit is '1', it indicates 15th PF belongs to one of the
17934          * hosts defined in the input request.
17935          */
17936         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_14 \
17937                 UINT32_C(0x4000)
17938         /*
17939          * When this bit is '1', it indicates 16th PF belongs to one of the
17940          * hosts defined in the input request.
17941          */
17942         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_15 \
17943                 UINT32_C(0x8000)
17944         uint8_t unused_1[3];
17945         /*
17946          * This field is used in Output records to indicate that the output
17947          * is completely written to RAM.  This field should be read as '1'
17948          * to indicate that the output has been completely written.
17949          * When writing a command completion or response to an internal processor,
17950          * the order of writes has to be such that this field is written last.
17951          */
17952         uint8_t valid;
17953 } __rte_packed;
17954
17955 /*********************
17956  * hwrm_func_spd_cfg *
17957  *********************/
17958
17959
17960 /* hwrm_func_spd_cfg_input (size:384b/48B) */
17961 struct hwrm_func_spd_cfg_input {
17962         /* The HWRM command request type. */
17963         uint16_t        req_type;
17964         /*
17965          * The completion ring to send the completion event on. This should
17966          * be the NQ ID returned from the `nq_alloc` HWRM command.
17967          */
17968         uint16_t        cmpl_ring;
17969         /*
17970          * The sequence ID is used by the driver for tracking multiple
17971          * commands. This ID is treated as opaque data by the firmware and
17972          * the value is returned in the `hwrm_resp_hdr` upon completion.
17973          */
17974         uint16_t        seq_id;
17975         /*
17976          * The target ID of the command:
17977          * * 0x0-0xFFF8 - The function ID
17978          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17979          * * 0xFFFD - Reserved for user-space HWRM interface
17980          * * 0xFFFF - HWRM
17981          */
17982         uint16_t        target_id;
17983         /*
17984          * A physical address pointer pointing to a host buffer that the
17985          * command's response data will be written. This can be either a host
17986          * physical address (HPA) or a guest physical address (GPA) and must
17987          * point to a physically contiguous block of memory.
17988          */
17989         uint64_t        resp_addr;
17990         uint32_t        flags;
17991         /* Set this bit is '1' to enable the SPD datapath forwarding. */
17992         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_FWD_ENABLE       UINT32_C(0x1)
17993         /* Set this bit is '1' to disable the SPD datapath forwarding. */
17994         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_FWD_DISABLE      UINT32_C(0x2)
17995         /*
17996          * Set this bit is '1' to enable the SPD datapath checksum
17997          * feature.
17998          */
17999         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_CSUM_ENABLE      UINT32_C(0x4)
18000         /*
18001          * Set this bit is '1' to disable the SPD datapath checksum
18002          * feature.
18003          */
18004         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_CSUM_DISABLE     UINT32_C(0x8)
18005         /*
18006          * Set this bit is '1' to enable the SPD datapath debug
18007          * feature.
18008          */
18009         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_DBG_ENABLE       UINT32_C(0x10)
18010         /*
18011          * Set this bit is '1' to disable the SPD datapath debug
18012          * feature.
18013          */
18014         #define HWRM_FUNC_SPD_CFG_INPUT_FLAGS_DBG_DISABLE      UINT32_C(0x20)
18015         uint32_t        enables;
18016         /*
18017          * This bit must be '1' for the ethertype field to be
18018          * configured.
18019          */
18020         #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_ETHERTYPE \
18021                 UINT32_C(0x1)
18022         /*
18023          * This bit must be '1' for the hash_mode_flags field to be
18024          * configured.
18025          */
18026         #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_MODE_FLAGS \
18027                 UINT32_C(0x2)
18028         /*
18029          * This bit must be '1' for the hash_type field to be
18030          * configured.
18031          */
18032         #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_TYPE \
18033                 UINT32_C(0x4)
18034         /*
18035          * This bit must be '1' for the ring_tbl_addr field to be
18036          * configured.
18037          */
18038         #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_RING_TBL_ADDR \
18039                 UINT32_C(0x8)
18040         /*
18041          * This bit must be '1' for the hash_key_tbl_addr field to be
18042          * configured.
18043          */
18044         #define HWRM_FUNC_SPD_CFG_INPUT_ENABLES_HASH_KEY_TBL_ADDR \
18045                 UINT32_C(0x10)
18046         /*
18047          * Ethertype value used in the encapsulated SPD packet header.
18048          * The user must choose a value that is not conflicting with
18049          * publicly defined ethertype values. By default, the ethertype
18050          * value of 0xffff is used if there is no user specified value.
18051          */
18052         uint16_t        ethertype;
18053         /* Flags to specify different RSS hash modes. */
18054         uint8_t hash_mode_flags;
18055         /*
18056          * When this bit is '1', it indicates using current RSS
18057          * hash mode setting configured in the device.
18058          */
18059         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \
18060                 UINT32_C(0x1)
18061         /*
18062          * When this bit is '1', it indicates requesting support of
18063          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
18064          * l4.src, l4.dest} for tunnel packets. For none-tunnel
18065          * packets, the RSS hash is computed over the normal
18066          * src/dest l3 and src/dest l4 headers.
18067          */
18068         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \
18069                 UINT32_C(0x2)
18070         /*
18071          * When this bit is '1', it indicates requesting support of
18072          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
18073          * tunnel packets. For none-tunnel packets, the RSS hash is
18074          * computed over the normal src/dest l3 headers.
18075          */
18076         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \
18077                 UINT32_C(0x4)
18078         /*
18079          * When this bit is '1', it indicates requesting support of
18080          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
18081          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
18082          * packets, the RSS hash is computed over the normal
18083          * src/dest l3 and src/dest l4 headers.
18084          */
18085         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
18086                 UINT32_C(0x8)
18087         /*
18088          * When this bit is '1', it indicates requesting support of
18089          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
18090          * tunnel packets. For none-tunnel packets, the RSS hash is
18091          * computed over the normal src/dest l3 headers.
18092          */
18093         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
18094                 UINT32_C(0x10)
18095         uint8_t unused_1;
18096         uint32_t        hash_type;
18097         /*
18098          * When this bit is '1', the RSS hash shall be computed
18099          * over source and destination IPv4 addresses of IPv4
18100          * packets.
18101          */
18102         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
18103         /*
18104          * When this bit is '1', the RSS hash shall be computed
18105          * over source/destination IPv4 addresses and
18106          * source/destination ports of TCP/IPv4 packets.
18107          */
18108         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
18109         /*
18110          * When this bit is '1', the RSS hash shall be computed
18111          * over source/destination IPv4 addresses and
18112          * source/destination ports of UDP/IPv4 packets.
18113          */
18114         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
18115         /*
18116          * When this bit is '1', the RSS hash shall be computed
18117          * over source and destination IPv4 addresses of IPv6
18118          * packets.
18119          */
18120         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
18121         /*
18122          * When this bit is '1', the RSS hash shall be computed
18123          * over source/destination IPv6 addresses and
18124          * source/destination ports of TCP/IPv6 packets.
18125          */
18126         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
18127         /*
18128          * When this bit is '1', the RSS hash shall be computed
18129          * over source/destination IPv6 addresses and
18130          * source/destination ports of UDP/IPv6 packets.
18131          */
18132         #define HWRM_FUNC_SPD_CFG_INPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
18133         /* This is the address for rss ring group table */
18134         uint64_t        ring_grp_tbl_addr;
18135         /* This is the address for rss hash key table */
18136         uint64_t        hash_key_tbl_addr;
18137 } __rte_packed;
18138
18139 /* hwrm_func_spd_cfg_output (size:128b/16B) */
18140 struct hwrm_func_spd_cfg_output {
18141         /* The specific error status for the command. */
18142         uint16_t        error_code;
18143         /* The HWRM command request type. */
18144         uint16_t        req_type;
18145         /* The sequence ID from the original command. */
18146         uint16_t        seq_id;
18147         /* The length of the response data in number of bytes. */
18148         uint16_t        resp_len;
18149         uint8_t unused_0[7];
18150         /*
18151          * This field is used in Output records to indicate that the output
18152          * is completely written to RAM.  This field should be read as '1'
18153          * to indicate that the output has been completely written.
18154          * When writing a command completion or response to an internal processor,
18155          * the order of writes has to be such that this field is written last.
18156          */
18157         uint8_t valid;
18158 } __rte_packed;
18159
18160 /**********************
18161  * hwrm_func_spd_qcfg *
18162  **********************/
18163
18164
18165 /* hwrm_func_spd_qcfg_input (size:128b/16B) */
18166 struct hwrm_func_spd_qcfg_input {
18167         /* The HWRM command request type. */
18168         uint16_t        req_type;
18169         /*
18170          * The completion ring to send the completion event on. This should
18171          * be the NQ ID returned from the `nq_alloc` HWRM command.
18172          */
18173         uint16_t        cmpl_ring;
18174         /*
18175          * The sequence ID is used by the driver for tracking multiple
18176          * commands. This ID is treated as opaque data by the firmware and
18177          * the value is returned in the `hwrm_resp_hdr` upon completion.
18178          */
18179         uint16_t        seq_id;
18180         /*
18181          * The target ID of the command:
18182          * * 0x0-0xFFF8 - The function ID
18183          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18184          * * 0xFFFD - Reserved for user-space HWRM interface
18185          * * 0xFFFF - HWRM
18186          */
18187         uint16_t        target_id;
18188         /*
18189          * A physical address pointer pointing to a host buffer that the
18190          * command's response data will be written. This can be either a host
18191          * physical address (HPA) or a guest physical address (GPA) and must
18192          * point to a physically contiguous block of memory.
18193          */
18194         uint64_t        resp_addr;
18195 } __rte_packed;
18196
18197 /* hwrm_func_spd_qcfg_output (size:512b/64B) */
18198 struct hwrm_func_spd_qcfg_output {
18199         /* The specific error status for the command. */
18200         uint16_t        error_code;
18201         /* The HWRM command request type. */
18202         uint16_t        req_type;
18203         /* The sequence ID from the original command. */
18204         uint16_t        seq_id;
18205         /* The length of the response data in number of bytes. */
18206         uint16_t        resp_len;
18207         uint32_t        flags;
18208         /*
18209          * The SPD datapath forwarding is currently enabled when this
18210          * flag is set to '1'.
18211          */
18212         #define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_FWD_ENABLED      UINT32_C(0x1)
18213         /*
18214          * The SPD datapath checksum feature is currently enabled when
18215          * this flag is set to '1'.
18216          */
18217         #define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_CSUM_ENABLED     UINT32_C(0x2)
18218         /*
18219          * The SPD datapath debug feature is currently enabled when
18220          * this flag is set to '1'.
18221          */
18222         #define HWRM_FUNC_SPD_QCFG_OUTPUT_FLAGS_DBG_ENABLED      UINT32_C(0x4)
18223         uint32_t        hash_type;
18224         /*
18225          * When this bit is '1', the RSS hash shall be computed
18226          * over source and destination IPv4 addresses of IPv4
18227          * packets.
18228          */
18229         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
18230         /*
18231          * When this bit is '1', the RSS hash shall be computed
18232          * over source/destination IPv4 addresses and
18233          * source/destination ports of TCP/IPv4 packets.
18234          */
18235         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
18236         /*
18237          * When this bit is '1', the RSS hash shall be computed
18238          * over source/destination IPv4 addresses and
18239          * source/destination ports of UDP/IPv4 packets.
18240          */
18241         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
18242         /*
18243          * When this bit is '1', the RSS hash shall be computed
18244          * over source and destination IPv4 addresses of IPv6
18245          * packets.
18246          */
18247         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
18248         /*
18249          * When this bit is '1', the RSS hash shall be computed
18250          * over source/destination IPv6 addresses and
18251          * source/destination ports of TCP/IPv6 packets.
18252          */
18253         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
18254         /*
18255          * When this bit is '1', the RSS hash shall be computed
18256          * over source/destination IPv6 addresses and
18257          * source/destination ports of UDP/IPv6 packets.
18258          */
18259         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
18260         /* This is the value of rss hash key */
18261         uint32_t        hash_key[10];
18262         /* Flags to specify different RSS hash modes. */
18263         uint8_t hash_mode_flags;
18264         /*
18265          * When this bit is '1', it indicates using current RSS
18266          * hash mode setting configured in the device.
18267          */
18268         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \
18269                 UINT32_C(0x1)
18270         /*
18271          * When this bit is '1', it indicates requesting support of
18272          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
18273          * l4.src, l4.dest} for tunnel packets. For none-tunnel
18274          * packets, the RSS hash is computed over the normal
18275          * src/dest l3 and src/dest l4 headers.
18276          */
18277         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \
18278                 UINT32_C(0x2)
18279         /*
18280          * When this bit is '1', it indicates requesting support of
18281          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
18282          * tunnel packets. For none-tunnel packets, the RSS hash is
18283          * computed over the normal src/dest l3 headers.
18284          */
18285         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \
18286                 UINT32_C(0x4)
18287         /*
18288          * When this bit is '1', it indicates requesting support of
18289          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
18290          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
18291          * packets, the RSS hash is computed over the normal
18292          * src/dest l3 and src/dest l4 headers.
18293          */
18294         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
18295                 UINT32_C(0x8)
18296         /*
18297          * When this bit is '1', it indicates requesting support of
18298          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
18299          * tunnel packets. For none-tunnel packets, the RSS hash is
18300          * computed over the normal src/dest l3 headers.
18301          */
18302         #define HWRM_FUNC_SPD_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
18303                 UINT32_C(0x10)
18304         uint8_t unused_1;
18305         /*
18306          * Ethertype value used in the encapsulated SPD packet header.
18307          * The user must choose a value that is not conflicting with
18308          * publicly defined ethertype values. By default, the ethertype
18309          * value of 0xffff is used if there is no user specified value.
18310          */
18311         uint16_t        ethertype;
18312         uint8_t unused_2[3];
18313         /*
18314          * This field is used in Output records to indicate that the output
18315          * is completely written to RAM.  This field should be read as '1'
18316          * to indicate that the output has been completely written.
18317          * When writing a command completion or response to an internal processor,
18318          * the order of writes has to be such that this field is written last.
18319          */
18320         uint8_t valid;
18321 } __rte_packed;
18322
18323 /*********************
18324  * hwrm_port_phy_cfg *
18325  *********************/
18326
18327
18328 /* hwrm_port_phy_cfg_input (size:448b/56B) */
18329 struct hwrm_port_phy_cfg_input {
18330         /* The HWRM command request type. */
18331         uint16_t        req_type;
18332         /*
18333          * The completion ring to send the completion event on. This should
18334          * be the NQ ID returned from the `nq_alloc` HWRM command.
18335          */
18336         uint16_t        cmpl_ring;
18337         /*
18338          * The sequence ID is used by the driver for tracking multiple
18339          * commands. This ID is treated as opaque data by the firmware and
18340          * the value is returned in the `hwrm_resp_hdr` upon completion.
18341          */
18342         uint16_t        seq_id;
18343         /*
18344          * The target ID of the command:
18345          * * 0x0-0xFFF8 - The function ID
18346          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18347          * * 0xFFFD - Reserved for user-space HWRM interface
18348          * * 0xFFFF - HWRM
18349          */
18350         uint16_t        target_id;
18351         /*
18352          * A physical address pointer pointing to a host buffer that the
18353          * command's response data will be written. This can be either a host
18354          * physical address (HPA) or a guest physical address (GPA) and must
18355          * point to a physically contiguous block of memory.
18356          */
18357         uint64_t        resp_addr;
18358         uint32_t        flags;
18359         /*
18360          * When this bit is set to '1', the PHY for the port shall
18361          * be reset.
18362          *
18363          * # If this bit is set to 1, then the HWRM shall reset the
18364          * PHY after applying PHY configuration changes specified
18365          * in this command.
18366          * # In order to guarantee that PHY configuration changes
18367          * specified in this command take effect, the HWRM
18368          * client should set this flag to 1.
18369          * # If this bit is not set to 1, then the HWRM may reset
18370          * the PHY depending on the current PHY configuration and
18371          * settings specified in this command.
18372          */
18373         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY \
18374                 UINT32_C(0x1)
18375         /* deprecated bit.  Do not use!!! */
18376         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED \
18377                 UINT32_C(0x2)
18378         /*
18379          * When this bit is set to '1', and the force_pam4_link_speed
18380          * bit in the 'enables' field is '0', the link shall be forced
18381          * to the force_link_speed value.
18382          *
18383          * When this bit is set to '1', and the force_pam4_link_speed
18384          * bit in the 'enables' field is '1', the link shall be forced
18385          * to the force_pam4_link_speed value.
18386          *
18387          * When this bit is set to '1', the HWRM client should
18388          * not enable any of the auto negotiation related
18389          * fields represented by auto_XXX fields in this command.
18390          * When this bit is set to '1' and the HWRM client has
18391          * enabled a auto_XXX field in this command, then the
18392          * HWRM shall ignore the enabled auto_XXX field.
18393          *
18394          * When this bit is set to zero, the link
18395          * shall be allowed to autoneg.
18396          */
18397         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE \
18398                 UINT32_C(0x4)
18399         /*
18400          * When this bit is set to '1', the auto-negotiation process
18401          * shall be restarted on the link.
18402          */
18403         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG \
18404                 UINT32_C(0x8)
18405         /*
18406          * When this bit is set to '1', Energy Efficient Ethernet
18407          * (EEE) is requested to be enabled on this link.
18408          * If EEE is not supported on this port, then this flag
18409          * shall be ignored by the HWRM.
18410          */
18411         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE \
18412                 UINT32_C(0x10)
18413         /*
18414          * When this bit is set to '1', Energy Efficient Ethernet
18415          * (EEE) is requested to be disabled on this link.
18416          * If EEE is not supported on this port, then this flag
18417          * shall be ignored by the HWRM.
18418          */
18419         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE \
18420                 UINT32_C(0x20)
18421         /*
18422          * When this bit is set to '1' and EEE is enabled on this
18423          * link, then TX LPI is requested to be enabled on the link.
18424          * If EEE is not supported on this port, then this flag
18425          * shall be ignored by the HWRM.
18426          * If EEE is disabled on this port, then this flag shall be
18427          * ignored by the HWRM.
18428          */
18429         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE \
18430                 UINT32_C(0x40)
18431         /*
18432          * When this bit is set to '1' and EEE is enabled on this
18433          * link, then TX LPI is requested to be disabled on the link.
18434          * If EEE is not supported on this port, then this flag
18435          * shall be ignored by the HWRM.
18436          * If EEE is disabled on this port, then this flag shall be
18437          * ignored by the HWRM.
18438          */
18439         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE \
18440                 UINT32_C(0x80)
18441         /*
18442          * When set to 1, then the HWRM shall enable FEC autonegotitation
18443          * on this port if supported.  When enabled, at least one of the
18444          * FEC modes must be advertised by enabling the fec_clause_74_enable,
18445          * fec_clause_91_enable, fec_rs544_1xn_enable, fec_rs544_ieee_enable,
18446          * fec_rs272_1xn_enable, or fec_rs272_ieee_enable flag.  If none
18447          * of the FEC mode is currently enabled, the HWRM shall choose
18448          * a default advertisement setting.
18449          * The default advertisement setting can be queried by calling
18450          * hwrm_port_phy_qcfg.  Note that the link speed must be
18451          * in autonegotiation mode for FEC autonegotiation to take effect.
18452          * When set to 0, then this flag shall be ignored.
18453          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
18454          * flag.
18455          */
18456         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE \
18457                 UINT32_C(0x100)
18458         /*
18459          * When set to 1, then the HWRM shall disable FEC autonegotiation
18460          * on this port and use forced FEC mode.  In forced FEC mode, one
18461          * or more FEC forced settings under the same clause can be set.
18462          * When set to 0, then this flag shall be ignored.
18463          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
18464          * flag.
18465          */
18466         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
18467                 UINT32_C(0x200)
18468         /*
18469          * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
18470          * on this port if supported, by advertising FEC CLAUSE 74 if
18471          * FEC autonegotiation is enabled or force enabled otherwise.
18472          * When set to 0, then this flag shall be ignored.
18473          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
18474          * flag.
18475          */
18476         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
18477                 UINT32_C(0x400)
18478         /*
18479          * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
18480          * on this port if supported, by not advertising FEC CLAUSE 74 if
18481          * FEC autonegotiation is enabled or force disabled otherwise.
18482          * When set to 0, then this flag shall be ignored.
18483          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
18484          * flag.
18485          */
18486         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
18487                 UINT32_C(0x800)
18488         /*
18489          * When set to 1, then the HWRM shall enable FEC CLAUSE 91
18490          * (Reed Solomon RS(528,514) for NRZ) on this port if supported,
18491          * by advertising FEC RS(528,514) if FEC autonegotiation is enabled
18492          * or force enabled otherwise.  In forced FEC mode, this flag
18493          * will only take effect if the speed is NRZ.  Additional
18494          * RS544 or RS272 flags (also under clause 91) may be set for PAM4
18495          * in forced FEC mode.
18496          * When set to 0, then this flag shall be ignored.
18497          * If FEC RS(528,514) is not supported, then the HWRM shall ignore
18498          * this flag.
18499          */
18500         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
18501                 UINT32_C(0x1000)
18502         /*
18503          * When set to 1, then the HWRM shall disable FEC CLAUSE 91
18504          * (Reed Solomon RS(528,514) for NRZ) on this port if supported, by
18505          * not advertising RS(528,514) if FEC autonegotiation is enabled or
18506          * force disabled otherwise.  When set to 0, then this flag shall be
18507          * ignored.  If FEC RS(528,514) is not supported, then the HWRM
18508          * shall ignore this flag.
18509          */
18510         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
18511                 UINT32_C(0x2000)
18512         /*
18513          * When this bit is set to '1', the link shall be forced to
18514          * be taken down.
18515          *
18516          * # When this bit is set to '1", all other
18517          * command input settings related to the link speed shall
18518          * be ignored.
18519          * Once the link state is forced down, it can be
18520          * explicitly cleared from that state by setting this flag
18521          * to '0'.
18522          * # If this flag is set to '0', then the link shall be
18523          * cleared from forced down state if the link is in forced
18524          * down state.
18525          * There may be conditions (e.g. out-of-band or sideband
18526          * configuration changes for the link) outside the scope
18527          * of the HWRM implementation that may clear forced down
18528          * link state.
18529          */
18530         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN \
18531                 UINT32_C(0x4000)
18532         /*
18533          * When set to 1, then the HWRM shall enable FEC RS544_1XN
18534          * on this port if supported, by advertising FEC RS544_1XN if
18535          * FEC autonegotiation is enabled or force enabled otherwise.
18536          * In forced mode, this flag will only take effect if the speed is
18537          * PAM4.  If this flag and fec_rs544_ieee_enable are set, the
18538          * HWRM shall choose one of the RS544 modes.
18539          * When set to 0, then this flag shall be ignored.
18540          * If FEC RS544_1XN is not supported, then the HWRM shall ignore this
18541          * flag.
18542          */
18543         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_ENABLE \
18544                 UINT32_C(0x8000)
18545         /*
18546          * When set to 1, then the HWRM shall disable FEC RS544_1XN
18547          * on this port if supported, by not advertising FEC RS544_1XN if
18548          * FEC autonegotiation is enabled or force disabled otherwise.
18549          * When set to 0, then this flag shall be ignored.
18550          * If FEC RS544_1XN  is not supported, then the HWRM shall ignore this
18551          * flag.
18552          */
18553         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_1XN_DISABLE \
18554                 UINT32_C(0x10000)
18555         /*
18556          * When set to 1, then the HWRM shall enable FEC RS(544,514)
18557          * on this port if supported, by advertising FEC RS(544,514) if
18558          * FEC autonegotiation is enabled or force enabled otherwise.
18559          * In forced mode, this flag will only take effect if the speed is
18560          * PAM4.  If this flag and fec_rs544_1xn_enable are set, the
18561          * HWRM shall choose one of the RS544 modes.
18562          * When set to 0, then this flag shall be ignored.
18563          * If FEC RS(544,514) is not supported, then the HWRM shall ignore
18564          * this flag.
18565          */
18566         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_IEEE_ENABLE \
18567                 UINT32_C(0x20000)
18568         /*
18569          * When set to 1, then the HWRM shall disable FEC RS(544,514)
18570          * on this port if supported, by not advertising FEC RS(544,514) if
18571          * FEC autonegotiation is enabled or force disabled otherwise.
18572          * When set to 0, then this flag shall be ignored.
18573          * If FEC RS(544,514) is not supported, then the HWRM shall ignore
18574          * this flag.
18575          */
18576         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS544_IEEE_DISABLE \
18577                 UINT32_C(0x40000)
18578         /*
18579          * When set to 1, then the HWRM shall enable FEC RS272_1XN
18580          * on this port if supported, by advertising FEC RS272_1XN if
18581          * FEC autonegotiation is enabled or force enabled otherwise.
18582          * In forced mode, this flag will only take effect if the speed is
18583          * PAM4.  If this flag and fec_rs272_ieee_enable are set, the
18584          * HWRM shall choose one of the RS272 modes.  Note that RS272
18585          * and RS544 modes cannot be set at the same time in forced FEC mode.
18586          * When set to 0, then this flag shall be ignored.
18587          * If FEC RS272_1XN is not supported, then the HWRM shall ignore this
18588          * flag.
18589          */
18590         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_1XN_ENABLE \
18591                 UINT32_C(0x80000)
18592         /*
18593          * When set to 1, then the HWRM shall disable FEC RS272_1XN
18594          * on this port if supported, by not advertising FEC RS272_1XN if
18595          * FEC autonegotiation is enabled or force disabled otherwise.
18596          * When set to 0, then this flag shall be ignored.
18597          * If FEC RS272_1XN is not supported, then the HWRM shall ignore
18598          * this flag.
18599          */
18600         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_1XN_DISABLE \
18601                 UINT32_C(0x100000)
18602         /*
18603          * When set to 1, then the HWRM shall enable FEC RS(272,257)
18604          * on this port if supported, by advertising FEC RS(272,257) if
18605          * FEC autonegotiation is enabled or force enabled otherwise.
18606          * In forced mode, this flag will only take effect if the speed is
18607          * PAM4.  If this flag and fec_rs272_1xn_enable are set, the
18608          * HWRM shall choose one of the RS272 modes.  Note that RS272
18609          * and RS544 modes cannot be set at the same time in forced FEC mode.
18610          * When set to 0, then this flag shall be ignored.
18611          * If FEC RS(272,257) is not supported, then the HWRM shall ignore
18612          * this flag.
18613          */
18614         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_IEEE_ENABLE \
18615                 UINT32_C(0x200000)
18616         /*
18617          * When set to 1, then the HWRM shall disable FEC RS(272,257)
18618          * on this port if supported, by not advertising FEC RS(272,257) if
18619          * FEC autonegotiation is enabled or force disabled otherwise.
18620          * When set to 0, then this flag shall be ignored.
18621          * If FEC RS(272,257) is not supported, then the HWRM shall ignore
18622          * this flag.
18623          */
18624         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_RS272_IEEE_DISABLE \
18625                 UINT32_C(0x400000)
18626         uint32_t        enables;
18627         /*
18628          * This bit must be '1' for the auto_mode field to be
18629          * configured.
18630          */
18631         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE \
18632                 UINT32_C(0x1)
18633         /*
18634          * This bit must be '1' for the auto_duplex field to be
18635          * configured.
18636          */
18637         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX \
18638                 UINT32_C(0x2)
18639         /*
18640          * This bit must be '1' for the auto_pause field to be
18641          * configured.
18642          */
18643         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE \
18644                 UINT32_C(0x4)
18645         /*
18646          * This bit must be '1' for the auto_link_speed field to be
18647          * configured.
18648          */
18649         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED \
18650                 UINT32_C(0x8)
18651         /*
18652          * This bit must be '1' for the auto_link_speed_mask field to be
18653          * configured.
18654          */
18655         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
18656                 UINT32_C(0x10)
18657         /*
18658          * This bit must be '1' for the wirespeed field to be
18659          * configured.
18660          */
18661         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED \
18662                 UINT32_C(0x20)
18663         /*
18664          * This bit must be '1' for the lpbk field to be
18665          * configured.
18666          */
18667         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK \
18668                 UINT32_C(0x40)
18669         /*
18670          * This bit must be '1' for the preemphasis field to be
18671          * configured.
18672          */
18673         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS \
18674                 UINT32_C(0x80)
18675         /*
18676          * This bit must be '1' for the force_pause field to be
18677          * configured.
18678          */
18679         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE \
18680                 UINT32_C(0x100)
18681         /*
18682          * This bit must be '1' for the eee_link_speed_mask field to be
18683          * configured.
18684          */
18685         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
18686                 UINT32_C(0x200)
18687         /*
18688          * This bit must be '1' for the tx_lpi_timer field to be
18689          * configured.
18690          */
18691         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER \
18692                 UINT32_C(0x400)
18693         /*
18694          * This bit must be '1' for the force_pam4_link_speed field to be
18695          * configured.
18696          */
18697         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAM4_LINK_SPEED \
18698                 UINT32_C(0x800)
18699         /*
18700          * This bit must be '1' for the auto_pam4_link_speed_mask field to
18701          * be configured.
18702          */
18703         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAM4_LINK_SPEED_MASK \
18704                 UINT32_C(0x1000)
18705         /* Port ID of port that is to be configured. */
18706         uint16_t        port_id;
18707         /*
18708          * This is the speed that will be used if the force
18709          * bit is '1'.  If unsupported speed is selected, an error
18710          * will be generated.
18711          */
18712         uint16_t        force_link_speed;
18713         /* 100Mb link speed */
18714         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
18715         /* 1Gb link speed */
18716         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
18717         /* 2Gb link speed */
18718         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
18719         /* 25Gb link speed */
18720         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
18721         /* 10Gb link speed */
18722         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
18723         /* 20Mb link speed */
18724         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
18725         /* 25Gb link speed */
18726         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
18727         /* 40Gb link speed */
18728         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
18729         /* 50Gb link speed */
18730         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
18731         /* 100Gb link speed */
18732         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
18733         /* 10Mb link speed */
18734         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
18735         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST \
18736                 HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
18737         /*
18738          * This value is used to identify what autoneg mode is
18739          * used when the link speed is not being forced.
18740          */
18741         uint8_t auto_mode;
18742         /* Disable autoneg or autoneg disabled. No speeds are selected. */
18743         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE         UINT32_C(0x0)
18744         /* Select all possible speeds for autoneg mode. */
18745         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
18746         /*
18747          * Select only the auto_link_speed speed for autoneg mode. This mode has
18748          * been DEPRECATED. An HWRM client should not use this mode.
18749          */
18750         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
18751         /*
18752          * Select the auto_link_speed or any speed below that speed for autoneg.
18753          * This mode has been DEPRECATED. An HWRM client should not use this mode.
18754          */
18755         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
18756         /*
18757          * Select the speeds based on the corresponding link speed mask values
18758          * that are provided. The included speeds are specified in the
18759          * auto_link_speed and auto_pam4_link_speed fields.
18760          */
18761         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
18762         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST \
18763                 HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
18764         /*
18765          * This is the duplex setting that will be used if the autoneg_mode
18766          * is "one_speed" or "one_or_below".
18767          */
18768         uint8_t auto_duplex;
18769         /* Half Duplex will be requested. */
18770         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
18771         /* Full duplex will be requested. */
18772         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
18773         /* Both Half and Full dupex will be requested. */
18774         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
18775         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST \
18776                 HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
18777         /*
18778          * This value is used to configure the pause that will be
18779          * used for autonegotiation.
18780          * Add text on the usage of auto_pause and force_pause.
18781          */
18782         uint8_t auto_pause;
18783         /*
18784          * When this bit is '1', Generation of tx pause messages
18785          * has been requested. Disabled otherwise.
18786          */
18787         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX \
18788                 UINT32_C(0x1)
18789         /*
18790          * When this bit is '1', Reception of rx pause messages
18791          * has been requested. Disabled otherwise.
18792          */
18793         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX \
18794                 UINT32_C(0x2)
18795         /*
18796          * When set to 1, the advertisement of pause is enabled.
18797          *
18798          * # When the auto_mode is not set to none and this flag is
18799          * set to 1, then the auto_pause bits on this port are being
18800          * advertised and autoneg pause results are being interpreted.
18801          * # When the auto_mode is not set to none and this
18802          * flag is set to 0, the pause is forced as indicated in
18803          * force_pause, and also advertised as auto_pause bits, but
18804          * the autoneg results are not interpreted since the pause
18805          * configuration is being forced.
18806          * # When the auto_mode is set to none and this flag is set to
18807          * 1, auto_pause bits should be ignored and should be set to 0.
18808          */
18809         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE \
18810                 UINT32_C(0x4)
18811         uint8_t unused_0;
18812         /*
18813          * This is the speed that will be used if the autoneg_mode
18814          * is "one_speed" or "one_or_below".  If an unsupported speed
18815          * is selected, an error will be generated.
18816          */
18817         uint16_t        auto_link_speed;
18818         /* 100Mb link speed */
18819         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
18820         /* 1Gb link speed */
18821         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
18822         /* 2Gb link speed */
18823         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
18824         /* 25Gb link speed */
18825         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
18826         /* 10Gb link speed */
18827         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
18828         /* 20Mb link speed */
18829         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
18830         /* 25Gb link speed */
18831         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
18832         /* 40Gb link speed */
18833         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
18834         /* 50Gb link speed */
18835         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
18836         /* 100Gb link speed */
18837         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
18838         /* 10Mb link speed */
18839         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
18840         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST \
18841                 HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
18842         /*
18843          * This is a mask of link speeds that will be used if
18844          * autoneg_mode is "mask".  If unsupported speed is enabled
18845          * an error will be generated.
18846          */
18847         uint16_t        auto_link_speed_mask;
18848         /* 100Mb link speed (Half-duplex) */
18849         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
18850                 UINT32_C(0x1)
18851         /* 100Mb link speed (Full-duplex) */
18852         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
18853                 UINT32_C(0x2)
18854         /* 1Gb link speed (Half-duplex) */
18855         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
18856                 UINT32_C(0x4)
18857         /* 1Gb link speed (Full-duplex) */
18858         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
18859                 UINT32_C(0x8)
18860         /* 2Gb link speed */
18861         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
18862                 UINT32_C(0x10)
18863         /* 25Gb link speed */
18864         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
18865                 UINT32_C(0x20)
18866         /* 10Gb link speed */
18867         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
18868                 UINT32_C(0x40)
18869         /* 20Gb link speed */
18870         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
18871                 UINT32_C(0x80)
18872         /* 25Gb link speed */
18873         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
18874                 UINT32_C(0x100)
18875         /* 40Gb link speed */
18876         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
18877                 UINT32_C(0x200)
18878         /* 50Gb link speed */
18879         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
18880                 UINT32_C(0x400)
18881         /* 100Gb link speed */
18882         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
18883                 UINT32_C(0x800)
18884         /* 10Mb link speed (Half-duplex) */
18885         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
18886                 UINT32_C(0x1000)
18887         /* 10Mb link speed (Full-duplex) */
18888         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
18889                 UINT32_C(0x2000)
18890         /* This value controls the wirespeed feature. */
18891         uint8_t wirespeed;
18892         /* Wirespeed feature is disabled. */
18893         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
18894         /* Wirespeed feature is enabled. */
18895         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON  UINT32_C(0x1)
18896         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST \
18897                 HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
18898         /* This value controls the loopback setting for the PHY. */
18899         uint8_t lpbk;
18900         /* No loopback is selected.  Normal operation. */
18901         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE     UINT32_C(0x0)
18902         /*
18903          * The HW will be configured with local loopback such that
18904          * host data is sent back to the host without modification.
18905          */
18906         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL    UINT32_C(0x1)
18907         /*
18908          * The HW will be configured with remote loopback such that
18909          * port logic will send packets back out the transmitter that
18910          * are received.
18911          */
18912         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE   UINT32_C(0x2)
18913         /*
18914          * The HW will be configured with external loopback such that
18915          * host data is sent on the transmitter and based on the external
18916          * loopback connection the data will be received without modification.
18917          */
18918         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
18919         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST \
18920                 HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
18921         /*
18922          * This value is used to configure the pause that will be
18923          * used for force mode.
18924          */
18925         uint8_t force_pause;
18926         /*
18927          * When this bit is '1', Generation of tx pause messages
18928          * is supported. Disabled otherwise.
18929          */
18930         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
18931         /*
18932          * When this bit is '1', Reception of rx pause messages
18933          * is supported. Disabled otherwise.
18934          */
18935         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
18936         uint8_t unused_1;
18937         /*
18938          * This value controls the pre-emphasis to be used for the
18939          * link.  Driver should not set this value (use
18940          * enable.preemphasis = 0) unless driver is sure of setting.
18941          * Normally HWRM FW will determine proper pre-emphasis.
18942          */
18943         uint32_t        preemphasis;
18944         /*
18945          * Setting for link speed mask that is used to
18946          * advertise speeds during autonegotiation when EEE is enabled.
18947          * This field is valid only when EEE is enabled.
18948          * The speeds specified in this field shall be a subset of
18949          * speeds specified in auto_link_speed_mask.
18950          * If EEE is enabled,then at least one speed shall be provided
18951          * in this mask.
18952          */
18953         uint16_t        eee_link_speed_mask;
18954         /* Reserved */
18955         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 \
18956                 UINT32_C(0x1)
18957         /* 100Mb link speed (Full-duplex) */
18958         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB \
18959                 UINT32_C(0x2)
18960         /* Reserved */
18961         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 \
18962                 UINT32_C(0x4)
18963         /* 1Gb link speed (Full-duplex) */
18964         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB \
18965                 UINT32_C(0x8)
18966         /* Reserved */
18967         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
18968                 UINT32_C(0x10)
18969         /* Reserved */
18970         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
18971                 UINT32_C(0x20)
18972         /* 10Gb link speed */
18973         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
18974                 UINT32_C(0x40)
18975         /*
18976          * This is the speed that will be used if the force and force_pam4
18977          * bits are '1'.  If unsupported speed is selected, an error
18978          * will be generated.
18979          */
18980         uint16_t        force_pam4_link_speed;
18981         /* 50Gb link speed */
18982         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB \
18983                 UINT32_C(0x1f4)
18984         /* 100Gb link speed */
18985         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB \
18986                 UINT32_C(0x3e8)
18987         /* 200Gb link speed */
18988         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB \
18989                 UINT32_C(0x7d0)
18990         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_LAST \
18991                 HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB
18992         /*
18993          * Requested setting of TX LPI timer in microseconds.
18994          * This field is valid only when EEE is enabled and TX LPI is
18995          * enabled.
18996          */
18997         uint32_t        tx_lpi_timer;
18998         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
18999         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
19000         /* This field specifies which PAM4 speeds are enabled for auto mode. */
19001         uint16_t        auto_link_pam4_speed_mask;
19002         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_50G \
19003                 UINT32_C(0x1)
19004         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_100G \
19005                 UINT32_C(0x2)
19006         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_PAM4_SPEED_MASK_200G \
19007                 UINT32_C(0x4)
19008         uint8_t unused_2[2];
19009 } __rte_packed;
19010
19011 /* hwrm_port_phy_cfg_output (size:128b/16B) */
19012 struct hwrm_port_phy_cfg_output {
19013         /* The specific error status for the command. */
19014         uint16_t        error_code;
19015         /* The HWRM command request type. */
19016         uint16_t        req_type;
19017         /* The sequence ID from the original command. */
19018         uint16_t        seq_id;
19019         /* The length of the response data in number of bytes. */
19020         uint16_t        resp_len;
19021         uint8_t unused_0[7];
19022         /*
19023          * This field is used in Output records to indicate that the output
19024          * is completely written to RAM.  This field should be read as '1'
19025          * to indicate that the output has been completely written.
19026          * When writing a command completion or response to an internal processor,
19027          * the order of writes has to be such that this field is written last.
19028          */
19029         uint8_t valid;
19030 } __rte_packed;
19031
19032 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
19033 struct hwrm_port_phy_cfg_cmd_err {
19034         /*
19035          * command specific error codes that goes to
19036          * the cmd_err field in Common HWRM Error Response.
19037          */
19038         uint8_t code;
19039         /* Unknown error */
19040         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
19041         /* Unable to complete operation due to invalid speed */
19042         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
19043         /*
19044          * retry the command since the phy is not ready.
19045          * retry count is returned in opaque_0.
19046          * This is only valid for the first command and
19047          * this value will not change for successive calls.
19048          * but if a 0 is returned at any time then this should
19049          * be treated as an un recoverable failure,
19050          *
19051          * retry interval in milli seconds is returned in opaque_1.
19052          * This specifies the time that user should wait before
19053          * issuing the next port_phy_cfg command.
19054          */
19055         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY         UINT32_C(0x2)
19056         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST \
19057                 HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
19058         uint8_t unused_0[7];
19059 } __rte_packed;
19060
19061 /**********************
19062  * hwrm_port_phy_qcfg *
19063  **********************/
19064
19065
19066 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
19067 struct hwrm_port_phy_qcfg_input {
19068         /* The HWRM command request type. */
19069         uint16_t        req_type;
19070         /*
19071          * The completion ring to send the completion event on. This should
19072          * be the NQ ID returned from the `nq_alloc` HWRM command.
19073          */
19074         uint16_t        cmpl_ring;
19075         /*
19076          * The sequence ID is used by the driver for tracking multiple
19077          * commands. This ID is treated as opaque data by the firmware and
19078          * the value is returned in the `hwrm_resp_hdr` upon completion.
19079          */
19080         uint16_t        seq_id;
19081         /*
19082          * The target ID of the command:
19083          * * 0x0-0xFFF8 - The function ID
19084          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19085          * * 0xFFFD - Reserved for user-space HWRM interface
19086          * * 0xFFFF - HWRM
19087          */
19088         uint16_t        target_id;
19089         /*
19090          * A physical address pointer pointing to a host buffer that the
19091          * command's response data will be written. This can be either a host
19092          * physical address (HPA) or a guest physical address (GPA) and must
19093          * point to a physically contiguous block of memory.
19094          */
19095         uint64_t        resp_addr;
19096         /* Port ID of port that is to be queried. */
19097         uint16_t        port_id;
19098         uint8_t unused_0[6];
19099 } __rte_packed;
19100
19101 /* hwrm_port_phy_qcfg_output (size:768b/96B) */
19102 struct hwrm_port_phy_qcfg_output {
19103         /* The specific error status for the command. */
19104         uint16_t        error_code;
19105         /* The HWRM command request type. */
19106         uint16_t        req_type;
19107         /* The sequence ID from the original command. */
19108         uint16_t        seq_id;
19109         /* The length of the response data in number of bytes. */
19110         uint16_t        resp_len;
19111         /* This value indicates the current link status. */
19112         uint8_t link;
19113         /* There is no link or cable detected. */
19114         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
19115         /* There is no link, but a cable has been detected. */
19116         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL  UINT32_C(0x1)
19117         /* There is a link. */
19118         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK    UINT32_C(0x2)
19119         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST \
19120                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
19121         uint8_t active_fec_signal_mode;
19122         /*
19123          * This value indicates the current link signaling mode of the
19124          * connection.
19125          */
19126         #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_MASK \
19127                 UINT32_C(0xf)
19128         #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_SFT                 0
19129         /* NRZ signaling */
19130         #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_NRZ \
19131                 UINT32_C(0x0)
19132         /* PAM4 signaling */
19133         #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4 \
19134                 UINT32_C(0x1)
19135         #define HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_LAST \
19136                 HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4
19137         /* This value indicates the current active FEC mode. */
19138         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_MASK \
19139                 UINT32_C(0xf0)
19140         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_SFT                  4
19141         /* No active FEC */
19142         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_NONE_ACTIVE \
19143                 (UINT32_C(0x0) << 4)
19144         /* FEC CLAUSE 74 (Fire Code) active, autonegotiated or forced. */
19145         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_CLAUSE74_ACTIVE \
19146                 (UINT32_C(0x1) << 4)
19147         /* FEC CLAUSE 91 RS(528,514) active, autonegoatiated or forced. */
19148         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_CLAUSE91_ACTIVE \
19149                 (UINT32_C(0x2) << 4)
19150         /* FEC RS544_1XN active, autonegoatiated or forced. */
19151         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS544_1XN_ACTIVE \
19152                 (UINT32_C(0x3) << 4)
19153         /* FEC RS(544,528) active, autonegoatiated or forced. */
19154         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS544_IEEE_ACTIVE \
19155                 (UINT32_C(0x4) << 4)
19156         /* FEC RS272_1XN active, autonegotiated or forced. */
19157         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_1XN_ACTIVE \
19158                 (UINT32_C(0x5) << 4)
19159         /* FEC RS(272,257) active, autonegoatiated or forced. */
19160         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE \
19161                 (UINT32_C(0x6) << 4)
19162         #define HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_LAST \
19163                 HWRM_PORT_PHY_QCFG_OUTPUT_ACTIVE_FEC_FEC_RS272_IEEE_ACTIVE
19164         /*
19165          * This value indicates the current link speed of the connection.
19166          * The signal_mode field indicates if the link is using
19167          * NRZ or PAM4 signaling.
19168          */
19169         uint16_t        link_speed;
19170         /* 100Mb link speed */
19171         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
19172         /* 1Gb link speed */
19173         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB   UINT32_C(0xa)
19174         /* 2Gb link speed */
19175         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB   UINT32_C(0x14)
19176         /* 25Gb link speed */
19177         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
19178         /* 10Gb link speed */
19179         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB  UINT32_C(0x64)
19180         /* 20Mb link speed */
19181         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB  UINT32_C(0xc8)
19182         /* 25Gb link speed */
19183         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB  UINT32_C(0xfa)
19184         /* 40Gb link speed */
19185         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB  UINT32_C(0x190)
19186         /* 50Gb link speed */
19187         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB  UINT32_C(0x1f4)
19188         /* 100Gb link speed */
19189         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
19190         /* 200Gb link speed */
19191         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB UINT32_C(0x7d0)
19192         /* 10Mb link speed */
19193         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB  UINT32_C(0xffff)
19194         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST \
19195                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
19196         /*
19197          * This value is indicates the duplex of the current
19198          * configuration.
19199          */
19200         uint8_t duplex_cfg;
19201         /* Half Duplex connection. */
19202         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
19203         /* Full duplex connection. */
19204         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
19205         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST \
19206                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
19207         /*
19208          * This value is used to indicate the current
19209          * pause configuration. When autoneg is enabled, this value
19210          * represents the autoneg results of pause configuration.
19211          */
19212         uint8_t pause;
19213         /*
19214          * When this bit is '1', Generation of tx pause messages
19215          * is supported. Disabled otherwise.
19216          */
19217         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX     UINT32_C(0x1)
19218         /*
19219          * When this bit is '1', Reception of rx pause messages
19220          * is supported. Disabled otherwise.
19221          */
19222         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX     UINT32_C(0x2)
19223         /*
19224          * The supported speeds for the port. This is a bit mask.
19225          * For each speed that is supported, the corresponding
19226          * bit will be set to '1'.
19227          */
19228         uint16_t        support_speeds;
19229         /* 100Mb link speed (Half-duplex) */
19230         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD \
19231                 UINT32_C(0x1)
19232         /* 100Mb link speed (Full-duplex) */
19233         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB \
19234                 UINT32_C(0x2)
19235         /* 1Gb link speed (Half-duplex) */
19236         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD \
19237                 UINT32_C(0x4)
19238         /* 1Gb link speed (Full-duplex) */
19239         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB \
19240                 UINT32_C(0x8)
19241         /* 2Gb link speed */
19242         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB \
19243                 UINT32_C(0x10)
19244         /* 25Gb link speed */
19245         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB \
19246                 UINT32_C(0x20)
19247         /* 10Gb link speed */
19248         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB \
19249                 UINT32_C(0x40)
19250         /* 20Gb link speed */
19251         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB \
19252                 UINT32_C(0x80)
19253         /* 25Gb link speed */
19254         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB \
19255                 UINT32_C(0x100)
19256         /* 40Gb link speed */
19257         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB \
19258                 UINT32_C(0x200)
19259         /* 50Gb link speed */
19260         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB \
19261                 UINT32_C(0x400)
19262         /* 100Gb link speed */
19263         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB \
19264                 UINT32_C(0x800)
19265         /* 10Mb link speed (Half-duplex) */
19266         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD \
19267                 UINT32_C(0x1000)
19268         /* 10Mb link speed (Full-duplex) */
19269         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB \
19270                 UINT32_C(0x2000)
19271         /*
19272          * Current setting of forced link speed.
19273          * When the link speed is not being forced, this
19274          * value shall be set to 0.
19275          */
19276         uint16_t        force_link_speed;
19277         /* 100Mb link speed */
19278         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
19279         /* 1Gb link speed */
19280         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
19281         /* 2Gb link speed */
19282         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
19283         /* 25Gb link speed */
19284         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
19285         /* 10Gb link speed */
19286         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
19287         /* 20Mb link speed */
19288         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
19289         /* 25Gb link speed */
19290         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
19291         /* 40Gb link speed */
19292         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB \
19293                 UINT32_C(0x190)
19294         /* 50Gb link speed */
19295         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB \
19296                 UINT32_C(0x1f4)
19297         /* 100Gb link speed */
19298         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB \
19299                 UINT32_C(0x3e8)
19300         /* 10Mb link speed */
19301         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB \
19302                 UINT32_C(0xffff)
19303         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST \
19304                 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
19305         /* Current setting of auto negotiation mode. */
19306         uint8_t auto_mode;
19307         /* Disable autoneg or autoneg disabled. No speeds are selected. */
19308         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE         UINT32_C(0x0)
19309         /* Select all possible speeds for autoneg mode. */
19310         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
19311         /*
19312          * Select only the auto_link_speed speed for autoneg mode. This mode has
19313          * been DEPRECATED. An HWRM client should not use this mode.
19314          */
19315         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
19316         /*
19317          * Select the auto_link_speed or any speed below that speed for autoneg.
19318          * This mode has been DEPRECATED. An HWRM client should not use this mode.
19319          */
19320         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
19321         /*
19322          * Select the speeds based on the corresponding link speed mask value
19323          * that is provided.
19324          */
19325         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
19326         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST \
19327                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
19328         /*
19329          * Current setting of pause autonegotiation.
19330          * Move autoneg_pause flag here.
19331          */
19332         uint8_t auto_pause;
19333         /*
19334          * When this bit is '1', Generation of tx pause messages
19335          * has been requested. Disabled otherwise.
19336          */
19337         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX \
19338                 UINT32_C(0x1)
19339         /*
19340          * When this bit is '1', Reception of rx pause messages
19341          * has been requested. Disabled otherwise.
19342          */
19343         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX \
19344                 UINT32_C(0x2)
19345         /*
19346          * When set to 1, the advertisement of pause is enabled.
19347          *
19348          * # When the auto_mode is not set to none and this flag is
19349          * set to 1, then the auto_pause bits on this port are being
19350          * advertised and autoneg pause results are being interpreted.
19351          * # When the auto_mode is not set to none and this
19352          * flag is set to 0, the pause is forced as indicated in
19353          * force_pause, and also advertised as auto_pause bits, but
19354          * the autoneg results are not interpreted since the pause
19355          * configuration is being forced.
19356          * # When the auto_mode is set to none and this flag is set to
19357          * 1, auto_pause bits should be ignored and should be set to 0.
19358          */
19359         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE \
19360                 UINT32_C(0x4)
19361         /*
19362          * Current setting for auto_link_speed. This field is only
19363          * valid when auto_mode is set to "one_speed" or "one_or_below".
19364          */
19365         uint16_t        auto_link_speed;
19366         /* 100Mb link speed */
19367         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
19368         /* 1Gb link speed */
19369         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
19370         /* 2Gb link speed */
19371         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
19372         /* 25Gb link speed */
19373         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
19374         /* 10Gb link speed */
19375         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
19376         /* 20Mb link speed */
19377         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
19378         /* 25Gb link speed */
19379         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
19380         /* 40Gb link speed */
19381         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
19382         /* 50Gb link speed */
19383         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
19384         /* 100Gb link speed */
19385         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
19386         /* 10Mb link speed */
19387         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB \
19388                 UINT32_C(0xffff)
19389         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST \
19390                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
19391         /*
19392          * Current setting for auto_link_speed_mask that is used to
19393          * advertise speeds during autonegotiation.
19394          * This field is only valid when auto_mode is set to "mask".
19395          * The speeds specified in this field shall be a subset of
19396          * supported speeds on this port.
19397          */
19398         uint16_t        auto_link_speed_mask;
19399         /* 100Mb link speed (Half-duplex) */
19400         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
19401                 UINT32_C(0x1)
19402         /* 100Mb link speed (Full-duplex) */
19403         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
19404                 UINT32_C(0x2)
19405         /* 1Gb link speed (Half-duplex) */
19406         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
19407                 UINT32_C(0x4)
19408         /* 1Gb link speed (Full-duplex) */
19409         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB \
19410                 UINT32_C(0x8)
19411         /* 2Gb link speed */
19412         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
19413                 UINT32_C(0x10)
19414         /* 25Gb link speed */
19415         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
19416                 UINT32_C(0x20)
19417         /* 10Gb link speed */
19418         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
19419                 UINT32_C(0x40)
19420         /* 20Gb link speed */
19421         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
19422                 UINT32_C(0x80)
19423         /* 25Gb link speed */
19424         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
19425                 UINT32_C(0x100)
19426         /* 40Gb link speed */
19427         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
19428                 UINT32_C(0x200)
19429         /* 50Gb link speed */
19430         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
19431                 UINT32_C(0x400)
19432         /* 100Gb link speed */
19433         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
19434                 UINT32_C(0x800)
19435         /* 10Mb link speed (Half-duplex) */
19436         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
19437                 UINT32_C(0x1000)
19438         /* 10Mb link speed (Full-duplex) */
19439         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
19440                 UINT32_C(0x2000)
19441         /* Current setting for wirespeed. */
19442         uint8_t wirespeed;
19443         /* Wirespeed feature is disabled. */
19444         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
19445         /* Wirespeed feature is enabled. */
19446         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON  UINT32_C(0x1)
19447         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST \
19448                 HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
19449         /* Current setting for loopback. */
19450         uint8_t lpbk;
19451         /* No loopback is selected.  Normal operation. */
19452         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE     UINT32_C(0x0)
19453         /*
19454          * The HW will be configured with local loopback such that
19455          * host data is sent back to the host without modification.
19456          */
19457         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL    UINT32_C(0x1)
19458         /*
19459          * The HW will be configured with remote loopback such that
19460          * port logic will send packets back out the transmitter that
19461          * are received.
19462          */
19463         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE   UINT32_C(0x2)
19464         /*
19465          * The HW will be configured with external loopback such that
19466          * host data is sent on the transmitter and based on the external
19467          * loopback connection the data will be received without modification.
19468          */
19469         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
19470         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST \
19471                 HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
19472         /*
19473          * Current setting of forced pause.
19474          * When the pause configuration is not being forced, then
19475          * this value shall be set to 0.
19476          */
19477         uint8_t force_pause;
19478         /*
19479          * When this bit is '1', Generation of tx pause messages
19480          * is supported. Disabled otherwise.
19481          */
19482         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
19483         /*
19484          * When this bit is '1', Reception of rx pause messages
19485          * is supported. Disabled otherwise.
19486          */
19487         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
19488         /*
19489          * This value indicates the current status of the optics module on
19490          * this port.
19491          */
19492         uint8_t module_status;
19493         /* Module is inserted and accepted */
19494         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE \
19495                 UINT32_C(0x0)
19496         /* Module is rejected and transmit side Laser is disabled. */
19497         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX \
19498                 UINT32_C(0x1)
19499         /* Module mismatch warning. */
19500         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG \
19501                 UINT32_C(0x2)
19502         /* Module is rejected and powered down. */
19503         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN \
19504                 UINT32_C(0x3)
19505         /* Module is not inserted. */
19506         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
19507                 UINT32_C(0x4)
19508         /* Module is powered down because of over current fault. */
19509         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_CURRENTFAULT \
19510                 UINT32_C(0x5)
19511         /* Module status is not applicable. */
19512         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
19513                 UINT32_C(0xff)
19514         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST \
19515                 HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
19516         /* Current setting for preemphasis. */
19517         uint32_t        preemphasis;
19518         /* This field represents the major version of the PHY. */
19519         uint8_t phy_maj;
19520         /* This field represents the minor version of the PHY. */
19521         uint8_t phy_min;
19522         /* This field represents the build version of the PHY. */
19523         uint8_t phy_bld;
19524         /* This value represents a PHY type. */
19525         uint8_t phy_type;
19526         /* Unknown */
19527         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN \
19528                 UINT32_C(0x0)
19529         /* BASE-CR */
19530         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR \
19531                 UINT32_C(0x1)
19532         /* BASE-KR4 (Deprecated) */
19533         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 \
19534                 UINT32_C(0x2)
19535         /* BASE-LR */
19536         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR \
19537                 UINT32_C(0x3)
19538         /* BASE-SR */
19539         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR \
19540                 UINT32_C(0x4)
19541         /* BASE-KR2 (Deprecated) */
19542         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 \
19543                 UINT32_C(0x5)
19544         /* BASE-KX */
19545         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX \
19546                 UINT32_C(0x6)
19547         /* BASE-KR */
19548         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR \
19549                 UINT32_C(0x7)
19550         /* BASE-T */
19551         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET \
19552                 UINT32_C(0x8)
19553         /* EEE capable BASE-T */
19554         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE \
19555                 UINT32_C(0x9)
19556         /* SGMII connected external PHY */
19557         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY \
19558                 UINT32_C(0xa)
19559         /* 25G_BASECR_CA_L */
19560         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L \
19561                 UINT32_C(0xb)
19562         /* 25G_BASECR_CA_S */
19563         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S \
19564                 UINT32_C(0xc)
19565         /* 25G_BASECR_CA_N */
19566         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N \
19567                 UINT32_C(0xd)
19568         /* 25G_BASESR */
19569         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR \
19570                 UINT32_C(0xe)
19571         /* 100G_BASECR4 */
19572         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 \
19573                 UINT32_C(0xf)
19574         /* 100G_BASESR4 */
19575         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 \
19576                 UINT32_C(0x10)
19577         /* 100G_BASELR4 */
19578         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 \
19579                 UINT32_C(0x11)
19580         /* 100G_BASEER4 */
19581         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 \
19582                 UINT32_C(0x12)
19583         /* 100G_BASESR10 */
19584         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 \
19585                 UINT32_C(0x13)
19586         /* 40G_BASECR4 */
19587         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 \
19588                 UINT32_C(0x14)
19589         /* 40G_BASESR4 */
19590         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 \
19591                 UINT32_C(0x15)
19592         /* 40G_BASELR4 */
19593         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 \
19594                 UINT32_C(0x16)
19595         /* 40G_BASEER4 */
19596         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 \
19597                 UINT32_C(0x17)
19598         /* 40G_ACTIVE_CABLE */
19599         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
19600                 UINT32_C(0x18)
19601         /* 1G_baseT */
19602         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET \
19603                 UINT32_C(0x19)
19604         /* 1G_baseSX */
19605         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX \
19606                 UINT32_C(0x1a)
19607         /* 1G_baseCX */
19608         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX \
19609                 UINT32_C(0x1b)
19610         /* 100G_BASECR4 */
19611         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4 \
19612                 UINT32_C(0x1c)
19613         /* 100G_BASESR4 */
19614         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4 \
19615                 UINT32_C(0x1d)
19616         /* 100G_BASELR4 */
19617         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4 \
19618                 UINT32_C(0x1e)
19619         /* 100G_BASEER4 */
19620         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4 \
19621                 UINT32_C(0x1f)
19622         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST \
19623                 HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4
19624         /* This value represents a media type. */
19625         uint8_t media_type;
19626         /* Unknown */
19627         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
19628         /* Twisted Pair */
19629         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP      UINT32_C(0x1)
19630         /* Direct Attached Copper */
19631         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC     UINT32_C(0x2)
19632         /* Fiber */
19633         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE   UINT32_C(0x3)
19634         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST \
19635                 HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
19636         /* This value represents a transceiver type. */
19637         uint8_t xcvr_pkg_type;
19638         /* PHY and MAC are in the same package */
19639         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
19640                 UINT32_C(0x1)
19641         /* PHY and MAC are in different packages */
19642         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
19643                 UINT32_C(0x2)
19644         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST \
19645                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
19646         uint8_t eee_config_phy_addr;
19647         /* This field represents PHY address. */
19648         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK \
19649                 UINT32_C(0x1f)
19650         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT               0
19651         /*
19652          * This field represents flags related to EEE configuration.
19653          * These EEE configuration flags are valid only when the
19654          * auto_mode is not set to none (in other words autonegotiation
19655          * is enabled).
19656          */
19657         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK \
19658                 UINT32_C(0xe0)
19659         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT             5
19660         /*
19661          * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
19662          * Speeds for autoneg with EEE mode enabled
19663          * are based on eee_link_speed_mask.
19664          */
19665         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED \
19666                 UINT32_C(0x20)
19667         /*
19668          * This flag is valid only when eee_enabled is set to 1.
19669          *
19670          * # If eee_enabled is set to 0, then EEE mode is disabled
19671          * and this flag shall be ignored.
19672          * # If eee_enabled is set to 1 and this flag is set to 1,
19673          * then Energy Efficient Ethernet (EEE) mode is enabled
19674          * and in use.
19675          * # If eee_enabled is set to 1 and this flag is set to 0,
19676          * then Energy Efficient Ethernet (EEE) mode is enabled
19677          * but is currently not in use.
19678          */
19679         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE \
19680                 UINT32_C(0x40)
19681         /*
19682          * This flag is valid only when eee_enabled is set to 1.
19683          *
19684          * # If eee_enabled is set to 0, then EEE mode is disabled
19685          * and this flag shall be ignored.
19686          * # If eee_enabled is set to 1 and this flag is set to 1,
19687          * then Energy Efficient Ethernet (EEE) mode is enabled
19688          * and TX LPI is enabled.
19689          * # If eee_enabled is set to 1 and this flag is set to 0,
19690          * then Energy Efficient Ethernet (EEE) mode is enabled
19691          * but TX LPI is disabled.
19692          */
19693         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI \
19694                 UINT32_C(0x80)
19695         /*
19696          * When set to 1, the parallel detection is used to determine
19697          * the speed of the link partner.
19698          *
19699          * Parallel detection is used when a autonegotiation capable
19700          * device is connected to a link parter that is not capable
19701          * of autonegotiation.
19702          */
19703         uint8_t parallel_detect;
19704         /*
19705          * When set to 1, the parallel detection is used to determine
19706          * the speed of the link partner.
19707          *
19708          * Parallel detection is used when a autonegotiation capable
19709          * device is connected to a link parter that is not capable
19710          * of autonegotiation.
19711          */
19712         #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT     UINT32_C(0x1)
19713         /*
19714          * The advertised speeds for the port by the link partner.
19715          * Each advertised speed will be set to '1'.
19716          */
19717         uint16_t        link_partner_adv_speeds;
19718         /* 100Mb link speed (Half-duplex) */
19719         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
19720                 UINT32_C(0x1)
19721         /* 100Mb link speed (Full-duplex) */
19722         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
19723                 UINT32_C(0x2)
19724         /* 1Gb link speed (Half-duplex) */
19725         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
19726                 UINT32_C(0x4)
19727         /* 1Gb link speed (Full-duplex) */
19728         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
19729                 UINT32_C(0x8)
19730         /* 2Gb link speed */
19731         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
19732                 UINT32_C(0x10)
19733         /* 25Gb link speed */
19734         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
19735                 UINT32_C(0x20)
19736         /* 10Gb link speed */
19737         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
19738                 UINT32_C(0x40)
19739         /* 20Gb link speed */
19740         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
19741                 UINT32_C(0x80)
19742         /* 25Gb link speed */
19743         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
19744                 UINT32_C(0x100)
19745         /* 40Gb link speed */
19746         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
19747                 UINT32_C(0x200)
19748         /* 50Gb link speed */
19749         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
19750                 UINT32_C(0x400)
19751         /* 100Gb link speed */
19752         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
19753                 UINT32_C(0x800)
19754         /* 10Mb link speed (Half-duplex) */
19755         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
19756                 UINT32_C(0x1000)
19757         /* 10Mb link speed (Full-duplex) */
19758         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
19759                 UINT32_C(0x2000)
19760         /*
19761          * The advertised autoneg for the port by the link partner.
19762          * This field is deprecated and should be set to 0.
19763          */
19764         uint8_t link_partner_adv_auto_mode;
19765         /* Disable autoneg or autoneg disabled. No speeds are selected. */
19766         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
19767                 UINT32_C(0x0)
19768         /* Select all possible speeds for autoneg mode. */
19769         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
19770                 UINT32_C(0x1)
19771         /*
19772          * Select only the auto_link_speed speed for autoneg mode. This mode has
19773          * been DEPRECATED. An HWRM client should not use this mode.
19774          */
19775         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
19776                 UINT32_C(0x2)
19777         /*
19778          * Select the auto_link_speed or any speed below that speed for autoneg.
19779          * This mode has been DEPRECATED. An HWRM client should not use this mode.
19780          */
19781         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
19782                 UINT32_C(0x3)
19783         /*
19784          * Select the speeds based on the corresponding link speed mask value
19785          * that is provided.
19786          */
19787         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
19788                 UINT32_C(0x4)
19789         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST \
19790                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
19791         /* The advertised pause settings on the port by the link partner. */
19792         uint8_t link_partner_adv_pause;
19793         /*
19794          * When this bit is '1', Generation of tx pause messages
19795          * is supported. Disabled otherwise.
19796          */
19797         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
19798                 UINT32_C(0x1)
19799         /*
19800          * When this bit is '1', Reception of rx pause messages
19801          * is supported. Disabled otherwise.
19802          */
19803         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
19804                 UINT32_C(0x2)
19805         /*
19806          * Current setting for link speed mask that is used to
19807          * advertise speeds during autonegotiation when EEE is enabled.
19808          * This field is valid only when eee_enabled flags is set to 1.
19809          * The speeds specified in this field shall be a subset of
19810          * speeds specified in auto_link_speed_mask.
19811          */
19812         uint16_t        adv_eee_link_speed_mask;
19813         /* Reserved */
19814         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
19815                 UINT32_C(0x1)
19816         /* 100Mb link speed (Full-duplex) */
19817         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
19818                 UINT32_C(0x2)
19819         /* Reserved */
19820         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
19821                 UINT32_C(0x4)
19822         /* 1Gb link speed (Full-duplex) */
19823         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
19824                 UINT32_C(0x8)
19825         /* Reserved */
19826         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
19827                 UINT32_C(0x10)
19828         /* Reserved */
19829         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
19830                 UINT32_C(0x20)
19831         /* 10Gb link speed */
19832         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
19833                 UINT32_C(0x40)
19834         /*
19835          * Current setting for link speed mask that is advertised by
19836          * the link partner when EEE is enabled.
19837          * This field is valid only when eee_enabled flags is set to 1.
19838          */
19839         uint16_t        link_partner_adv_eee_link_speed_mask;
19840         /* Reserved */
19841         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
19842                 UINT32_C(0x1)
19843         /* 100Mb link speed (Full-duplex) */
19844         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
19845                 UINT32_C(0x2)
19846         /* Reserved */
19847         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
19848                 UINT32_C(0x4)
19849         /* 1Gb link speed (Full-duplex) */
19850         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
19851                 UINT32_C(0x8)
19852         /* Reserved */
19853         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
19854                 UINT32_C(0x10)
19855         /* Reserved */
19856         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
19857                 UINT32_C(0x20)
19858         /* 10Gb link speed */
19859         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
19860                 UINT32_C(0x40)
19861         uint32_t        xcvr_identifier_type_tx_lpi_timer;
19862         /*
19863          * Current setting of TX LPI timer in microseconds.
19864          * This field is valid only when_eee_enabled flag is set to 1
19865          * and tx_lpi_enabled is set to 1.
19866          */
19867         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK \
19868                 UINT32_C(0xffffff)
19869         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT             0
19870         /* This value represents transceiver identifier type. */
19871         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
19872                 UINT32_C(0xff000000)
19873         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT     24
19874         /* Unknown */
19875         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
19876                 (UINT32_C(0x0) << 24)
19877         /* SFP/SFP+/SFP28 */
19878         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
19879                 (UINT32_C(0x3) << 24)
19880         /* QSFP+ */
19881         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
19882                 (UINT32_C(0xc) << 24)
19883         /* QSFP+ */
19884         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
19885                 (UINT32_C(0xd) << 24)
19886         /* QSFP28 */
19887         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
19888                 (UINT32_C(0x11) << 24)
19889         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST \
19890                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28
19891         /*
19892          * This value represents the current configuration of
19893          * Forward Error Correction (FEC) on the port.
19894          */
19895         uint16_t        fec_cfg;
19896         /*
19897          * When set to 1, then FEC is not supported on this port. If this flag
19898          * is set to 1, then all other FEC configuration flags shall be ignored.
19899          * When set to 0, then FEC is supported as indicated by other
19900          * configuration flags.
19901          */
19902         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
19903                 UINT32_C(0x1)
19904         /*
19905          * When set to 1, then FEC autonegotiation is supported on this port.
19906          * When set to 0, then FEC autonegotiation is not supported on this port.
19907          */
19908         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
19909                 UINT32_C(0x2)
19910         /*
19911          * When set to 1, then FEC autonegotiation is enabled on this port.
19912          * When set to 0, then FEC autonegotiation is disabled if supported.
19913          * This flag should be ignored if FEC autonegotiation is not supported on this port.
19914          */
19915         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
19916                 UINT32_C(0x4)
19917         /*
19918          * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port.
19919          * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port.
19920          */
19921         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
19922                 UINT32_C(0x8)
19923         /*
19924          * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this
19925          * port. This means that FEC CLAUSE 74 is either advertised if
19926          * FEC autonegotiation is enabled or FEC CLAUSE 74 is force enabled.
19927          * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported.
19928          * This flag should be ignored if FEC CLAUSE 74 is not supported on this port.
19929          */
19930         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
19931                 UINT32_C(0x10)
19932         /*
19933          * When set to 1, then FEC CLAUSE 91 (Reed Solomon RS(528,514) for
19934          * NRZ) is supported on this port.
19935          * When set to 0, then FEC RS(528,418) is not supported on this port.
19936          */
19937         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
19938                 UINT32_C(0x20)
19939         /*
19940          * When set to 1, then FEC CLAUSE 91 (Reed Solomon RS(528,514) for
19941          * NRZ) is enabled on this port. This means that FEC RS(528,514) is
19942          * either advertised if FEC autonegotiation is enabled or FEC
19943          * RS(528,514) is force enabled.  When set to 0, then FEC RS(528,514)
19944          * is disabled if supported.
19945          * This flag should be ignored if FEC CLAUSE 91 is not supported on this port.
19946          */
19947         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
19948                 UINT32_C(0x40)
19949         /*
19950          * When set to 1, then FEC RS544_1XN is supported on this port.
19951          * When set to 0, then FEC RS544_1XN is not supported on this port.
19952          */
19953         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_SUPPORTED \
19954                 UINT32_C(0x80)
19955         /*
19956          * When set to 1, then RS544_1XN is enabled on this
19957          * port. This means that FEC RS544_1XN is either advertised if
19958          * FEC autonegotiation is enabled or FEC RS544_1XN is force enabled.
19959          * When set to 0, then FEC RS544_1XN is disabled if supported.
19960          * This flag should be ignored if FEC RS544_1XN is not supported on this port.
19961          */
19962         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_1XN_ENABLED \
19963                 UINT32_C(0x100)
19964         /*
19965          * When set to 1, then FEC RS(544,514) is supported on this port.
19966          * When set to 0, then FEC RS(544,514) is not supported on this port.
19967          */
19968         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_IEEE_SUPPORTED \
19969                 UINT32_C(0x200)
19970         /*
19971          * When set to 1, then RS(544,514) is enabled on this
19972          * port. This means that FEC RS(544,514) is either advertised if
19973          * FEC autonegotiation is enabled or FEC RS(544,514) is force
19974          * enabled.  When set to 0, then FEC RS(544,514) is disabled if supported.
19975          * This flag should be ignored if FEC RS(544,514) is not supported on this port.
19976          */
19977         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS544_IEEE_ENABLED \
19978                 UINT32_C(0x400)
19979         /*
19980          * When set to 1, then FEC RS272_1XN is supported on this port.
19981          * When set to 0, then FEC RS272_1XN is not supported on this port.
19982          */
19983         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_1XN_SUPPORTED \
19984                 UINT32_C(0x800)
19985         /*
19986          * When set to 1, then RS272_1XN is enabled on this
19987          * port. This means that FEC RS272_1XN is either advertised if
19988          * FEC autonegotiation is enabled or FEC RS272_1XN is force
19989          * enabled.  When set to 0, then FEC RS272_1XN is disabled if supported.
19990          * This flag should be ignored if FEC RS272_1XN is not supported on this port.
19991          */
19992         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_1XN_ENABLED \
19993                 UINT32_C(0x1000)
19994         /*
19995          * When set to 1, then FEC RS(272,514) is supported on this port.
19996          * When set to 0, then FEC RS(272,514) is not supported on this port.
19997          */
19998         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_IEEE_SUPPORTED \
19999                 UINT32_C(0x2000)
20000         /*
20001          * When set to 1, then RS(272,257) is enabled on this
20002          * port. This means that FEC RS(272,257) is either advertised if
20003          * FEC autonegotiation is enabled or FEC RS(272,257) is force
20004          * enabled.  When set to 0, then FEC RS(272,257) is disabled if supported.
20005          * This flag should be ignored if FEC RS(272,257) is not supported on this port.
20006          */
20007         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_RS272_IEEE_ENABLED \
20008                 UINT32_C(0x4000)
20009         /*
20010          * This value is indicates the duplex of the current
20011          * connection state.
20012          */
20013         uint8_t duplex_state;
20014         /* Half Duplex connection. */
20015         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
20016         /* Full duplex connection. */
20017         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
20018         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST \
20019                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
20020         /* Option flags fields. */
20021         uint8_t option_flags;
20022         /* When this bit is '1', Media auto detect is enabled. */
20023         #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT \
20024                 UINT32_C(0x1)
20025         /*
20026          * When this bit is '1', active_fec_signal_mode can be
20027          * trusted.
20028          */
20029         #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_SIGNAL_MODE_KNOWN \
20030                 UINT32_C(0x2)
20031         /*
20032          * Up to 16 bytes of null padded ASCII string representing
20033          * PHY vendor.
20034          * If the string is set to null, then the vendor name is not
20035          * available.
20036          */
20037         char    phy_vendor_name[16];
20038         /*
20039          * Up to 16 bytes of null padded ASCII string that
20040          * identifies vendor specific part number of the PHY.
20041          * If the string is set to null, then the vendor specific
20042          * part number is not available.
20043          */
20044         char    phy_vendor_partnumber[16];
20045         /*
20046          * The supported PAM4 speeds for the port. This is a bit mask.
20047          * For each speed that is supported, the corresponding
20048          * bit will be set to '1'.
20049          */
20050         uint16_t        support_pam4_speeds;
20051         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_50G \
20052                 UINT32_C(0x1)
20053         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_100G \
20054                 UINT32_C(0x2)
20055         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_200G \
20056                 UINT32_C(0x4)
20057         /*
20058          * Current setting of forced PAM4 link speed.
20059          * When the link speed is not being forced, this
20060          * value shall be set to 0.
20061          */
20062         uint16_t        force_pam4_link_speed;
20063         /* 50Gb link speed */
20064         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_50GB \
20065                 UINT32_C(0x1f4)
20066         /* 100Gb link speed */
20067         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_100GB \
20068                 UINT32_C(0x3e8)
20069         /* 200Gb link speed */
20070         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_200GB \
20071                 UINT32_C(0x7d0)
20072         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_LAST \
20073                 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAM4_LINK_SPEED_200GB
20074         /*
20075          * Current setting for auto_pam4_link_speed_mask that is used to
20076          * advertise speeds during autonegotiation.
20077          * This field is only valid when auto_mode is set to "mask".
20078          * The speeds specified in this field shall be a subset of
20079          * supported speeds on this port.
20080          */
20081         uint16_t        auto_pam4_link_speed_mask;
20082         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_50G \
20083                 UINT32_C(0x1)
20084         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_100G \
20085                 UINT32_C(0x2)
20086         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAM4_LINK_SPEED_MASK_200G \
20087                 UINT32_C(0x4)
20088         /*
20089          * The advertised PAM4 speeds for the port by the link partner.
20090          * Each advertised speed will be set to '1'.
20091          */
20092         uint8_t link_partner_pam4_adv_speeds;
20093         /* 50Gb link speed */
20094         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_50GB \
20095                 UINT32_C(0x1)
20096         /* 100Gb link speed */
20097         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_100GB \
20098                 UINT32_C(0x2)
20099         /* 200Gb link speed */
20100         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_PAM4_ADV_SPEEDS_200GB \
20101                 UINT32_C(0x4)
20102         /*
20103          * This field is used in Output records to indicate that the output
20104          * is completely written to RAM.  This field should be read as '1'
20105          * to indicate that the output has been completely written.
20106          * When writing a command completion or response to an internal processor,
20107          * the order of writes has to be such that this field is written last.
20108          */
20109         uint8_t valid;
20110 } __rte_packed;
20111
20112 /*********************
20113  * hwrm_port_mac_cfg *
20114  *********************/
20115
20116
20117 /* hwrm_port_mac_cfg_input (size:384b/48B) */
20118 struct hwrm_port_mac_cfg_input {
20119         /* The HWRM command request type. */
20120         uint16_t        req_type;
20121         /*
20122          * The completion ring to send the completion event on. This should
20123          * be the NQ ID returned from the `nq_alloc` HWRM command.
20124          */
20125         uint16_t        cmpl_ring;
20126         /*
20127          * The sequence ID is used by the driver for tracking multiple
20128          * commands. This ID is treated as opaque data by the firmware and
20129          * the value is returned in the `hwrm_resp_hdr` upon completion.
20130          */
20131         uint16_t        seq_id;
20132         /*
20133          * The target ID of the command:
20134          * * 0x0-0xFFF8 - The function ID
20135          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20136          * * 0xFFFD - Reserved for user-space HWRM interface
20137          * * 0xFFFF - HWRM
20138          */
20139         uint16_t        target_id;
20140         /*
20141          * A physical address pointer pointing to a host buffer that the
20142          * command's response data will be written. This can be either a host
20143          * physical address (HPA) or a guest physical address (GPA) and must
20144          * point to a physically contiguous block of memory.
20145          */
20146         uint64_t        resp_addr;
20147         /*
20148          * In this field, there are a number of CoS mappings related flags
20149          * that are used to configure CoS mappings and their corresponding
20150          * priorities in the hardware.
20151          * For the priorities of CoS mappings, the HWRM uses the following
20152          * priority order (high to low) by default:
20153          * # vlan pri
20154          * # ip_dscp
20155          * # tunnel_vlan_pri
20156          * # default cos
20157          *
20158          * A subset of CoS mappings can be enabled.
20159          * If a priority is not specified for an enabled CoS mapping, the
20160          * priority will be assigned in the above order for the enabled CoS
20161          * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
20162          * enabled and their priorities are not specified, the following
20163          * priority order (high to low) will be used by the HWRM:
20164          * # vlan_pri
20165          * # ip_dscp
20166          * # default cos
20167          *
20168          * vlan_pri CoS mapping together with default CoS with lower priority
20169          * are enabled by default by the HWRM.
20170          */
20171         uint32_t        flags;
20172         /*
20173          * When this bit is '1', this command will configure
20174          * the MAC to match the current link state of the PHY.
20175          * If the link is not established on the PHY, then this
20176          * bit has no effect.
20177          */
20178         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK \
20179                 UINT32_C(0x1)
20180         /*
20181          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
20182          * is requested to be enabled.
20183          */
20184         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE \
20185                 UINT32_C(0x2)
20186         /*
20187          * When this bit is set to '1', tunnel VLAN PRI field to
20188          * CoS mapping is requested to be enabled.
20189          */
20190         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
20191                 UINT32_C(0x4)
20192         /*
20193          * When this bit is set to '1', the IP DSCP to CoS mapping is
20194          * requested to be enabled.
20195          */
20196         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE \
20197                 UINT32_C(0x8)
20198         /*
20199          * When this bit is '1', the HWRM is requested to
20200          * enable timestamp capture capability on the receive side
20201          * of this port.
20202          */
20203         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
20204                 UINT32_C(0x10)
20205         /*
20206          * When this bit is '1', the HWRM is requested to
20207          * disable timestamp capture capability on the receive side
20208          * of this port.
20209          */
20210         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE \
20211                 UINT32_C(0x20)
20212         /*
20213          * When this bit is '1', the HWRM is requested to
20214          * enable timestamp capture capability on the transmit side
20215          * of this port.
20216          */
20217         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
20218                 UINT32_C(0x40)
20219         /*
20220          * When this bit is '1', the HWRM is requested to
20221          * disable timestamp capture capability on the transmit side
20222          * of this port.
20223          */
20224         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE \
20225                 UINT32_C(0x80)
20226         /*
20227          * When this bit is '1', the Out-Of-Box WoL is requested to
20228          * be enabled on this port.
20229          */
20230         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE \
20231                 UINT32_C(0x100)
20232         /*
20233          * When this bit is '1', the Out-Of-Box WoL is requested to
20234          * be disabled on this port.
20235          */
20236         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE \
20237                 UINT32_C(0x200)
20238         /*
20239          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
20240          * is requested to be disabled.
20241          */
20242         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE \
20243                 UINT32_C(0x400)
20244         /*
20245          * When this bit is set to '1', tunnel VLAN PRI field to
20246          * CoS mapping is requested to be disabled.
20247          */
20248         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE \
20249                 UINT32_C(0x800)
20250         /*
20251          * When this bit is set to '1', the IP DSCP to CoS mapping is
20252          * requested to be disabled.
20253          */
20254         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE \
20255                 UINT32_C(0x1000)
20256         /*
20257          * When this bit is set to '1', and the ptp_tx_ts_capture_enable
20258          * bit is set, then the device uses one step Tx timestamping.
20259          * This bit is temporary and used for experimental purposes.
20260          */
20261         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_ONE_STEP_TX_TS \
20262                 UINT32_C(0x2000)
20263         uint32_t        enables;
20264         /*
20265          * This bit must be '1' for the ipg field to be
20266          * configured.
20267          */
20268         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG \
20269                 UINT32_C(0x1)
20270         /*
20271          * This bit must be '1' for the lpbk field to be
20272          * configured.
20273          */
20274         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK \
20275                 UINT32_C(0x2)
20276         /*
20277          * This bit must be '1' for the vlan_pri2cos_map_pri field to be
20278          * configured.
20279          */
20280         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI \
20281                 UINT32_C(0x4)
20282         /*
20283          * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
20284          * configured.
20285          */
20286         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI \
20287                 UINT32_C(0x10)
20288         /*
20289          * This bit must be '1' for the dscp2cos_map_pri field to be
20290          * configured.
20291          */
20292         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI \
20293                 UINT32_C(0x20)
20294         /*
20295          * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
20296          * configured.
20297          */
20298         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE \
20299                 UINT32_C(0x40)
20300         /*
20301          * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
20302          * configured.
20303          */
20304         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE \
20305                 UINT32_C(0x80)
20306         /*
20307          * This bit must be '1' for the cos_field_cfg field to be
20308          * configured.
20309          */
20310         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG \
20311                 UINT32_C(0x100)
20312         /*
20313          * This bit must be '1' for the ptp_freq_adj_ppb field to be
20314          * configured.
20315          */
20316         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_PPB \
20317                 UINT32_C(0x200)
20318         /* Port ID of port that is to be configured. */
20319         uint16_t        port_id;
20320         /*
20321          * This value is used to configure the minimum IPG that will
20322          * be sent between packets by this port.
20323          */
20324         uint8_t ipg;
20325         /* This value controls the loopback setting for the MAC. */
20326         uint8_t lpbk;
20327         /* No loopback is selected.  Normal operation. */
20328         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE   UINT32_C(0x0)
20329         /*
20330          * The HW will be configured with local loopback such that
20331          * host data is sent back to the host without modification.
20332          */
20333         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL  UINT32_C(0x1)
20334         /*
20335          * The HW will be configured with remote loopback such that
20336          * port logic will send packets back out the transmitter that
20337          * are received.
20338          */
20339         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
20340         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST \
20341                 HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
20342         /*
20343          * This value controls the priority setting of VLAN PRI to CoS
20344          * mapping based on VLAN Tags of inner packet headers of
20345          * tunneled packets or packet headers of non-tunneled packets.
20346          *
20347          * # Each XXX_pri variable shall have a unique priority value
20348          * when it is being specified.
20349          * # When comparing priorities of mappings, higher value
20350          * indicates higher priority.
20351          * For example, a value of 0-3 is returned where 0 is being
20352          * the lowest priority and 3 is being the highest priority.
20353          */
20354         uint8_t vlan_pri2cos_map_pri;
20355         /* Reserved field. */
20356         uint8_t reserved1;
20357         /*
20358          * This value controls the priority setting of VLAN PRI to CoS
20359          * mapping based on VLAN Tags of tunneled header.
20360          * This mapping only applies when tunneled headers
20361          * are present.
20362          *
20363          * # Each XXX_pri variable shall have a unique priority value
20364          * when it is being specified.
20365          * # When comparing priorities of mappings, higher value
20366          * indicates higher priority.
20367          * For example, a value of 0-3 is returned where 0 is being
20368          * the lowest priority and 3 is being the highest priority.
20369          */
20370         uint8_t tunnel_pri2cos_map_pri;
20371         /*
20372          * This value controls the priority setting of IP DSCP to CoS
20373          * mapping based on inner IP header of tunneled packets or
20374          * IP header of non-tunneled packets.
20375          *
20376          * # Each XXX_pri variable shall have a unique priority value
20377          * when it is being specified.
20378          * # When comparing priorities of mappings, higher value
20379          * indicates higher priority.
20380          * For example, a value of 0-3 is returned where 0 is being
20381          * the lowest priority and 3 is being the highest priority.
20382          */
20383         uint8_t dscp2pri_map_pri;
20384         /*
20385          * This is a 16-bit bit mask that is used to request a
20386          * specific configuration of time stamp capture of PTP messages
20387          * on the receive side of this port.
20388          * This field shall be ignored if the ptp_rx_ts_capture_enable
20389          * flag is not set in this command.
20390          * Otherwise, if bit 'i' is set, then the HWRM is being
20391          * requested to configure the receive side of the port to
20392          * capture the time stamp of every received PTP message
20393          * with messageType field value set to i.
20394          */
20395         uint16_t        rx_ts_capture_ptp_msg_type;
20396         /*
20397          * This is a 16-bit bit mask that is used to request a
20398          * specific configuration of time stamp capture of PTP messages
20399          * on the transmit side of this port.
20400          * This field shall be ignored if the ptp_tx_ts_capture_enable
20401          * flag is not set in this command.
20402          * Otherwise, if bit 'i' is set, then the HWRM is being
20403          * requested to configure the transmit side of the port to
20404          * capture the time stamp of every transmitted PTP message
20405          * with messageType field value set to i.
20406          */
20407         uint16_t        tx_ts_capture_ptp_msg_type;
20408         /* Configuration of CoS fields. */
20409         uint8_t cos_field_cfg;
20410         /* Reserved */
20411         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1 \
20412                 UINT32_C(0x1)
20413         /*
20414          * This field is used to specify selection of VLAN PRI value
20415          * based on whether one or two VLAN Tags are present in
20416          * the inner packet headers of tunneled packets or
20417          * non-tunneled packets.
20418          * This field is valid only if inner VLAN PRI to CoS mapping
20419          * is enabled.
20420          * If VLAN PRI to CoS mapping is not enabled, then this
20421          * field shall be ignored.
20422          */
20423         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
20424                 UINT32_C(0x6)
20425         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
20426                 1
20427         /*
20428          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
20429          * present in the inner packet headers
20430          */
20431         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
20432                 (UINT32_C(0x0) << 1)
20433         /*
20434          * Select outer VLAN Tag PRI when 2 VLAN Tags are
20435          * present in the inner packet headers.
20436          * No VLAN PRI shall be selected for this configuration
20437          * if only one VLAN Tag is present in the inner
20438          * packet headers.
20439          */
20440         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
20441                 (UINT32_C(0x1) << 1)
20442         /*
20443          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
20444          * are present in the inner packet headers
20445          */
20446         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
20447                 (UINT32_C(0x2) << 1)
20448         /* Unspecified */
20449         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
20450                 (UINT32_C(0x3) << 1)
20451         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
20452                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
20453         /*
20454          * This field is used to specify selection of tunnel VLAN
20455          * PRI value based on whether one or two VLAN Tags are
20456          * present in tunnel headers.
20457          * This field is valid only if tunnel VLAN PRI to CoS mapping
20458          * is enabled.
20459          * If tunnel VLAN PRI to CoS mapping is not enabled, then this
20460          * field shall be ignored.
20461          */
20462         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
20463                 UINT32_C(0x18)
20464         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
20465                 3
20466         /*
20467          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
20468          * present in the tunnel packet headers
20469          */
20470         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
20471                 (UINT32_C(0x0) << 3)
20472         /*
20473          * Select outer VLAN Tag PRI when 2 VLAN Tags are
20474          * present in the tunnel packet headers.
20475          * No tunnel VLAN PRI shall be selected for this
20476          * configuration if only one VLAN Tag is present in
20477          * the tunnel packet headers.
20478          */
20479         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
20480                 (UINT32_C(0x1) << 3)
20481         /*
20482          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
20483          * are present in the tunnel packet headers
20484          */
20485         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
20486                 (UINT32_C(0x2) << 3)
20487         /* Unspecified */
20488         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
20489                 (UINT32_C(0x3) << 3)
20490         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
20491                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
20492         /*
20493          * This field shall be used to provide default CoS value
20494          * that has been configured on this port.
20495          * This field is valid only if default CoS mapping
20496          * is enabled.
20497          * If default CoS mapping is not enabled, then this
20498          * field shall be ignored.
20499          */
20500         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
20501                 UINT32_C(0xe0)
20502         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
20503                 5
20504         uint8_t unused_0[3];
20505         /*
20506          * This signed field specifies by how much to adjust the frequency
20507          * of sync timer updates (measured in parts per billion).
20508          */
20509         int32_t ptp_freq_adj_ppb;
20510         uint8_t unused_1[4];
20511 } __rte_packed;
20512
20513 /* hwrm_port_mac_cfg_output (size:128b/16B) */
20514 struct hwrm_port_mac_cfg_output {
20515         /* The specific error status for the command. */
20516         uint16_t        error_code;
20517         /* The HWRM command request type. */
20518         uint16_t        req_type;
20519         /* The sequence ID from the original command. */
20520         uint16_t        seq_id;
20521         /* The length of the response data in number of bytes. */
20522         uint16_t        resp_len;
20523         /*
20524          * This is the configured maximum length of Ethernet packet
20525          * payload that is allowed to be received on the port.
20526          * This value does not include the number of bytes used by
20527          * Ethernet header and trailer (CRC).
20528          */
20529         uint16_t        mru;
20530         /*
20531          * This is the configured maximum length of Ethernet packet
20532          * payload that is allowed to be transmitted on the port.
20533          * This value does not include the number of bytes used by
20534          * Ethernet header and trailer (CRC).
20535          */
20536         uint16_t        mtu;
20537         /* Current configuration of the IPG value. */
20538         uint8_t ipg;
20539         /* Current value of the loopback value. */
20540         uint8_t lpbk;
20541         /* No loopback is selected.  Normal operation. */
20542         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
20543         /*
20544          * The HW will be configured with local loopback such that
20545          * host data is sent back to the host without modification.
20546          */
20547         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
20548         /*
20549          * The HW will be configured with remote loopback such that
20550          * port logic will send packets back out the transmitter that
20551          * are received.
20552          */
20553         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
20554         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST \
20555                 HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
20556         uint8_t unused_0;
20557         /*
20558          * This field is used in Output records to indicate that the output
20559          * is completely written to RAM.  This field should be read as '1'
20560          * to indicate that the output has been completely written.
20561          * When writing a command completion or response to an internal processor,
20562          * the order of writes has to be such that this field is written last.
20563          */
20564         uint8_t valid;
20565 } __rte_packed;
20566
20567 /**********************
20568  * hwrm_port_mac_qcfg *
20569  **********************/
20570
20571
20572 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
20573 struct hwrm_port_mac_qcfg_input {
20574         /* The HWRM command request type. */
20575         uint16_t        req_type;
20576         /*
20577          * The completion ring to send the completion event on. This should
20578          * be the NQ ID returned from the `nq_alloc` HWRM command.
20579          */
20580         uint16_t        cmpl_ring;
20581         /*
20582          * The sequence ID is used by the driver for tracking multiple
20583          * commands. This ID is treated as opaque data by the firmware and
20584          * the value is returned in the `hwrm_resp_hdr` upon completion.
20585          */
20586         uint16_t        seq_id;
20587         /*
20588          * The target ID of the command:
20589          * * 0x0-0xFFF8 - The function ID
20590          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20591          * * 0xFFFD - Reserved for user-space HWRM interface
20592          * * 0xFFFF - HWRM
20593          */
20594         uint16_t        target_id;
20595         /*
20596          * A physical address pointer pointing to a host buffer that the
20597          * command's response data will be written. This can be either a host
20598          * physical address (HPA) or a guest physical address (GPA) and must
20599          * point to a physically contiguous block of memory.
20600          */
20601         uint64_t        resp_addr;
20602         /* Port ID of port that is to be configured. */
20603         uint16_t        port_id;
20604         uint8_t unused_0[6];
20605 } __rte_packed;
20606
20607 /* hwrm_port_mac_qcfg_output (size:256b/32B) */
20608 struct hwrm_port_mac_qcfg_output {
20609         /* The specific error status for the command. */
20610         uint16_t        error_code;
20611         /* The HWRM command request type. */
20612         uint16_t        req_type;
20613         /* The sequence ID from the original command. */
20614         uint16_t        seq_id;
20615         /* The length of the response data in number of bytes. */
20616         uint16_t        resp_len;
20617         /*
20618          * This is the configured maximum length of Ethernet packet
20619          * payload that is allowed to be received on the port.
20620          * This value does not include the number of bytes used by the
20621          * Ethernet header and trailer (CRC).
20622          */
20623         uint16_t        mru;
20624         /*
20625          * This is the configured maximum length of Ethernet packet
20626          * payload that is allowed to be transmitted on the port.
20627          * This value does not include the number of bytes used by the
20628          * Ethernet header and trailer (CRC).
20629          */
20630         uint16_t        mtu;
20631         /*
20632          * The minimum IPG that will
20633          * be sent between packets by this port.
20634          */
20635         uint8_t ipg;
20636         /* The loopback setting for the MAC. */
20637         uint8_t lpbk;
20638         /* No loopback is selected.  Normal operation. */
20639         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
20640         /*
20641          * The HW will be configured with local loopback such that
20642          * host data is sent back to the host without modification.
20643          */
20644         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
20645         /*
20646          * The HW will be configured with remote loopback such that
20647          * port logic will send packets back out the transmitter that
20648          * are received.
20649          */
20650         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
20651         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST \
20652                 HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
20653         /*
20654          * Priority setting for VLAN PRI to CoS mapping.
20655          * # Each XXX_pri variable shall have a unique priority value
20656          * when it is being used.
20657          * # When comparing priorities of mappings, higher value
20658          * indicates higher priority.
20659          * For example, a value of 0-3 is returned where 0 is being
20660          * the lowest priority and 3 is being the highest priority.
20661          * # If the correspoding CoS mapping is not enabled, then this
20662          * field should be ignored.
20663          * # This value indicates the normalized priority value retained
20664          * in the HWRM.
20665          */
20666         uint8_t vlan_pri2cos_map_pri;
20667         /*
20668          * In this field, a number of CoS mappings related flags
20669          * are used to indicate configured CoS mappings.
20670          */
20671         uint8_t flags;
20672         /*
20673          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
20674          * is enabled.
20675          */
20676         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE \
20677                 UINT32_C(0x1)
20678         /*
20679          * When this bit is set to '1', tunnel VLAN PRI field to
20680          * CoS mapping is enabled.
20681          */
20682         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
20683                 UINT32_C(0x2)
20684         /*
20685          * When this bit is set to '1', the IP DSCP to CoS mapping is
20686          * enabled.
20687          */
20688         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE \
20689                 UINT32_C(0x4)
20690         /*
20691          * When this bit is '1', the Out-Of-Box WoL is enabled on this
20692          * port.
20693          */
20694         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE \
20695                 UINT32_C(0x8)
20696         /* When this bit is '1', PTP is enabled for RX on this port. */
20697         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
20698                 UINT32_C(0x10)
20699         /* When this bit is '1', PTP is enabled for TX on this port. */
20700         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
20701                 UINT32_C(0x20)
20702         /*
20703          * Priority setting for tunnel VLAN PRI to CoS mapping.
20704          * # Each XXX_pri variable shall have a unique priority value
20705          * when it is being used.
20706          * # When comparing priorities of mappings, higher value
20707          * indicates higher priority.
20708          * For example, a value of 0-3 is returned where 0 is being
20709          * the lowest priority and 3 is being the highest priority.
20710          * # If the correspoding CoS mapping is not enabled, then this
20711          * field should be ignored.
20712          * # This value indicates the normalized priority value retained
20713          * in the HWRM.
20714          */
20715         uint8_t tunnel_pri2cos_map_pri;
20716         /*
20717          * Priority setting for DSCP to PRI mapping.
20718          * # Each XXX_pri variable shall have a unique priority value
20719          * when it is being used.
20720          * # When comparing priorities of mappings, higher value
20721          * indicates higher priority.
20722          * For example, a value of 0-3 is returned where 0 is being
20723          * the lowest priority and 3 is being the highest priority.
20724          * # If the correspoding CoS mapping is not enabled, then this
20725          * field should be ignored.
20726          * # This value indicates the normalized priority value retained
20727          * in the HWRM.
20728          */
20729         uint8_t dscp2pri_map_pri;
20730         /*
20731          * This is a 16-bit bit mask that represents the
20732          * current configuration of time stamp capture of PTP messages
20733          * on the receive side of this port.
20734          * If bit 'i' is set, then the receive side of the port
20735          * is configured to capture the time stamp of every
20736          * received PTP message with messageType field value set
20737          * to i.
20738          * If all bits are set to 0 (i.e. field value set 0),
20739          * then the receive side of the port is not configured
20740          * to capture timestamp for PTP messages.
20741          * If all bits are set to 1, then the receive side of the
20742          * port is configured to capture timestamp for all PTP
20743          * messages.
20744          */
20745         uint16_t        rx_ts_capture_ptp_msg_type;
20746         /*
20747          * This is a 16-bit bit mask that represents the
20748          * current configuration of time stamp capture of PTP messages
20749          * on the transmit side of this port.
20750          * If bit 'i' is set, then the transmit side of the port
20751          * is configured to capture the time stamp of every
20752          * received PTP message with messageType field value set
20753          * to i.
20754          * If all bits are set to 0 (i.e. field value set 0),
20755          * then the transmit side of the port is not configured
20756          * to capture timestamp for PTP messages.
20757          * If all bits are set to 1, then the transmit side of the
20758          * port is configured to capture timestamp for all PTP
20759          * messages.
20760          */
20761         uint16_t        tx_ts_capture_ptp_msg_type;
20762         /* Configuration of CoS fields. */
20763         uint8_t cos_field_cfg;
20764         /* Reserved */
20765         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD \
20766                 UINT32_C(0x1)
20767         /*
20768          * This field is used for selecting VLAN PRI value
20769          * based on whether one or two VLAN Tags are present in
20770          * the inner packet headers of tunneled packets or
20771          * non-tunneled packets.
20772          */
20773         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
20774                 UINT32_C(0x6)
20775         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
20776                 1
20777         /*
20778          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
20779          * present in the inner packet headers
20780          */
20781         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
20782                 (UINT32_C(0x0) << 1)
20783         /*
20784          * Select outer VLAN Tag PRI when 2 VLAN Tags are
20785          * present in the inner packet headers.
20786          * No VLAN PRI is selected for this configuration
20787          * if only one VLAN Tag is present in the inner
20788          * packet headers.
20789          */
20790         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
20791                 (UINT32_C(0x1) << 1)
20792         /*
20793          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
20794          * are present in the inner packet headers
20795          */
20796         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
20797                 (UINT32_C(0x2) << 1)
20798         /* Unspecified */
20799         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
20800                 (UINT32_C(0x3) << 1)
20801         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
20802                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
20803         /*
20804          * This field is used for selecting tunnel VLAN PRI value
20805          * based on whether one or two VLAN Tags are present in
20806          * the tunnel headers of tunneled packets. This selection
20807          * does not apply to non-tunneled packets.
20808          */
20809         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
20810                 UINT32_C(0x18)
20811         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
20812                 3
20813         /*
20814          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
20815          * present in the tunnel packet headers
20816          */
20817         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
20818                 (UINT32_C(0x0) << 3)
20819         /*
20820          * Select outer VLAN Tag PRI when 2 VLAN Tags are
20821          * present in the tunnel packet headers.
20822          * No VLAN PRI is selected for this configuration
20823          * if only one VLAN Tag is present in the tunnel
20824          * packet headers.
20825          */
20826         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
20827                 (UINT32_C(0x1) << 3)
20828         /*
20829          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
20830          * are present in the tunnel packet headers
20831          */
20832         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
20833                 (UINT32_C(0x2) << 3)
20834         /* Unspecified */
20835         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
20836                 (UINT32_C(0x3) << 3)
20837         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
20838                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
20839         /*
20840          * This field is used to provide default CoS value that
20841          * has been configured on this port.
20842          */
20843         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
20844                 UINT32_C(0xe0)
20845         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
20846                 5
20847         uint8_t unused_1;
20848         uint16_t        port_svif_info;
20849         /*
20850          * This field specifies the source virtual interface of the port being
20851          * queried. Drivers can use this to program port svif field in the
20852          * L2 context table
20853          */
20854         #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_MASK \
20855                 UINT32_C(0x7fff)
20856         #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_SFT       0
20857         /* This field specifies whether port_svif is valid or not */
20858         #define HWRM_PORT_MAC_QCFG_OUTPUT_PORT_SVIF_INFO_PORT_SVIF_VALID \
20859                 UINT32_C(0x8000)
20860         uint8_t unused_2[5];
20861         /*
20862          * This field is used in Output records to indicate that the output
20863          * is completely written to RAM.  This field should be read as '1'
20864          * to indicate that the output has been completely written.
20865          * When writing a command completion or response to an internal processor,
20866          * the order of writes has to be such that this field is written last.
20867          */
20868         uint8_t valid;
20869 } __rte_packed;
20870
20871 /**************************
20872  * hwrm_port_mac_ptp_qcfg *
20873  **************************/
20874
20875
20876 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
20877 struct hwrm_port_mac_ptp_qcfg_input {
20878         /* The HWRM command request type. */
20879         uint16_t        req_type;
20880         /*
20881          * The completion ring to send the completion event on. This should
20882          * be the NQ ID returned from the `nq_alloc` HWRM command.
20883          */
20884         uint16_t        cmpl_ring;
20885         /*
20886          * The sequence ID is used by the driver for tracking multiple
20887          * commands. This ID is treated as opaque data by the firmware and
20888          * the value is returned in the `hwrm_resp_hdr` upon completion.
20889          */
20890         uint16_t        seq_id;
20891         /*
20892          * The target ID of the command:
20893          * * 0x0-0xFFF8 - The function ID
20894          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
20895          * * 0xFFFD - Reserved for user-space HWRM interface
20896          * * 0xFFFF - HWRM
20897          */
20898         uint16_t        target_id;
20899         /*
20900          * A physical address pointer pointing to a host buffer that the
20901          * command's response data will be written. This can be either a host
20902          * physical address (HPA) or a guest physical address (GPA) and must
20903          * point to a physically contiguous block of memory.
20904          */
20905         uint64_t        resp_addr;
20906         /* Port ID of port that is being queried. */
20907         uint16_t        port_id;
20908         uint8_t unused_0[6];
20909 } __rte_packed;
20910
20911 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */
20912 struct hwrm_port_mac_ptp_qcfg_output {
20913         /* The specific error status for the command. */
20914         uint16_t        error_code;
20915         /* The HWRM command request type. */
20916         uint16_t        req_type;
20917         /* The sequence ID from the original command. */
20918         uint16_t        seq_id;
20919         /* The length of the response data in number of bytes. */
20920         uint16_t        resp_len;
20921         /*
20922          * In this field, a number of PTP related flags
20923          * are used to indicate configured PTP capabilities.
20924          */
20925         uint8_t flags;
20926         /*
20927          * When this bit is set to '1', the PTP related registers are
20928          * directly accessible by the host.
20929          */
20930         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS \
20931                 UINT32_C(0x1)
20932         /*
20933          * When this bit is set to '1', the device supports one-step
20934          * Tx timestamping.
20935          */
20936         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS \
20937                 UINT32_C(0x4)
20938         /*
20939          * When this bit is set to '1', the PTP information is accessible
20940          * via HWRM commands.
20941          */
20942         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS \
20943                 UINT32_C(0x8)
20944         uint8_t unused_0[3];
20945         /* Offset of the PTP register for the lower 32 bits of timestamp for RX. */
20946         uint32_t        rx_ts_reg_off_lower;
20947         /* Offset of the PTP register for the upper 32 bits of timestamp for RX. */
20948         uint32_t        rx_ts_reg_off_upper;
20949         /* Offset of the PTP register for the sequence ID for RX. */
20950         uint32_t        rx_ts_reg_off_seq_id;
20951         /* Offset of the first PTP source ID for RX. */
20952         uint32_t        rx_ts_reg_off_src_id_0;
20953         /* Offset of the second PTP source ID for RX. */
20954         uint32_t        rx_ts_reg_off_src_id_1;
20955         /* Offset of the third PTP source ID for RX. */
20956         uint32_t        rx_ts_reg_off_src_id_2;
20957         /* Offset of the domain ID for RX. */
20958         uint32_t        rx_ts_reg_off_domain_id;
20959         /* Offset of the PTP FIFO register for RX. */
20960         uint32_t        rx_ts_reg_off_fifo;
20961         /* Offset of the PTP advance FIFO register for RX. */
20962         uint32_t        rx_ts_reg_off_fifo_adv;
20963         /* PTP timestamp granularity for RX. */
20964         uint32_t        rx_ts_reg_off_granularity;
20965         /* Offset of the PTP register for the lower 32 bits of timestamp for TX. */
20966         uint32_t        tx_ts_reg_off_lower;
20967         /* Offset of the PTP register for the upper 32 bits of timestamp for TX. */
20968         uint32_t        tx_ts_reg_off_upper;
20969         /* Offset of the PTP register for the sequence ID for TX. */
20970         uint32_t        tx_ts_reg_off_seq_id;
20971         /* Offset of the PTP FIFO register for TX. */
20972         uint32_t        tx_ts_reg_off_fifo;
20973         /* PTP timestamp granularity for TX. */
20974         uint32_t        tx_ts_reg_off_granularity;
20975         uint8_t unused_1[7];
20976         /*
20977          * This field is used in Output records to indicate that the output
20978          * is completely written to RAM.  This field should be read as '1'
20979          * to indicate that the output has been completely written.
20980          * When writing a command completion or response to an internal processor,
20981          * the order of writes has to be such that this field is written last.
20982          */
20983         uint8_t valid;
20984 } __rte_packed;
20985
20986 /* Port Tx Statistics Format */
20987 /* tx_port_stats (size:3264b/408B) */
20988 struct tx_port_stats {
20989         /* Total Number of 64 Bytes frames transmitted */
20990         uint64_t        tx_64b_frames;
20991         /* Total Number of 65-127 Bytes frames transmitted */
20992         uint64_t        tx_65b_127b_frames;
20993         /* Total Number of 128-255 Bytes frames transmitted */
20994         uint64_t        tx_128b_255b_frames;
20995         /* Total Number of 256-511 Bytes frames transmitted */
20996         uint64_t        tx_256b_511b_frames;
20997         /* Total Number of 512-1023 Bytes frames transmitted */
20998         uint64_t        tx_512b_1023b_frames;
20999         /* Total Number of 1024-1518 Bytes frames transmitted */
21000         uint64_t        tx_1024b_1518b_frames;
21001         /*
21002          * Total Number of each good VLAN (exludes FCS errors)
21003          * frame transmitted which is 1519 to 1522 bytes in length
21004          * inclusive (excluding framing bits but including FCS bytes).
21005          */
21006         uint64_t        tx_good_vlan_frames;
21007         /* Total Number of 1519-2047 Bytes frames transmitted */
21008         uint64_t        tx_1519b_2047b_frames;
21009         /* Total Number of 2048-4095 Bytes frames transmitted */
21010         uint64_t        tx_2048b_4095b_frames;
21011         /* Total Number of 4096-9216 Bytes frames transmitted */
21012         uint64_t        tx_4096b_9216b_frames;
21013         /* Total Number of 9217-16383 Bytes frames transmitted */
21014         uint64_t        tx_9217b_16383b_frames;
21015         /* Total Number of good frames transmitted */
21016         uint64_t        tx_good_frames;
21017         /* Total Number of frames transmitted */
21018         uint64_t        tx_total_frames;
21019         /* Total number of unicast frames transmitted */
21020         uint64_t        tx_ucast_frames;
21021         /* Total number of multicast frames transmitted */
21022         uint64_t        tx_mcast_frames;
21023         /* Total number of broadcast frames transmitted */
21024         uint64_t        tx_bcast_frames;
21025         /* Total number of PAUSE control frames transmitted */
21026         uint64_t        tx_pause_frames;
21027         /*
21028          * Total number of PFC/per-priority PAUSE
21029          * control frames transmitted
21030          */
21031         uint64_t        tx_pfc_frames;
21032         /* Total number of jabber frames transmitted */
21033         uint64_t        tx_jabber_frames;
21034         /* Total number of frames transmitted with FCS error */
21035         uint64_t        tx_fcs_err_frames;
21036         /* Total number of control frames transmitted */
21037         uint64_t        tx_control_frames;
21038         /* Total number of over-sized frames transmitted */
21039         uint64_t        tx_oversz_frames;
21040         /* Total number of frames with single deferral */
21041         uint64_t        tx_single_dfrl_frames;
21042         /* Total number of frames with multiple deferrals */
21043         uint64_t        tx_multi_dfrl_frames;
21044         /* Total number of frames with single collision */
21045         uint64_t        tx_single_coll_frames;
21046         /* Total number of frames with multiple collisions */
21047         uint64_t        tx_multi_coll_frames;
21048         /* Total number of frames with late collisions */
21049         uint64_t        tx_late_coll_frames;
21050         /* Total number of frames with excessive collisions */
21051         uint64_t        tx_excessive_coll_frames;
21052         /* Total number of fragmented frames transmitted */
21053         uint64_t        tx_frag_frames;
21054         /* Total number of transmit errors */
21055         uint64_t        tx_err;
21056         /* Total number of single VLAN tagged frames transmitted */
21057         uint64_t        tx_tagged_frames;
21058         /* Total number of double VLAN tagged frames transmitted */
21059         uint64_t        tx_dbl_tagged_frames;
21060         /* Total number of runt frames transmitted */
21061         uint64_t        tx_runt_frames;
21062         /* Total number of TX FIFO under runs */
21063         uint64_t        tx_fifo_underruns;
21064         /*
21065          * Total number of PFC frames with PFC enabled bit for
21066          * Pri 0 transmitted
21067          */
21068         uint64_t        tx_pfc_ena_frames_pri0;
21069         /*
21070          * Total number of PFC frames with PFC enabled bit for
21071          * Pri 1 transmitted
21072          */
21073         uint64_t        tx_pfc_ena_frames_pri1;
21074         /*
21075          * Total number of PFC frames with PFC enabled bit for
21076          * Pri 2 transmitted
21077          */
21078         uint64_t        tx_pfc_ena_frames_pri2;
21079         /*
21080          * Total number of PFC frames with PFC enabled bit for
21081          * Pri 3 transmitted
21082          */
21083         uint64_t        tx_pfc_ena_frames_pri3;
21084         /*
21085          * Total number of PFC frames with PFC enabled bit for
21086          * Pri 4 transmitted
21087          */
21088         uint64_t        tx_pfc_ena_frames_pri4;
21089         /*
21090          * Total number of PFC frames with PFC enabled bit for
21091          * Pri 5 transmitted
21092          */
21093         uint64_t        tx_pfc_ena_frames_pri5;
21094         /*
21095          * Total number of PFC frames with PFC enabled bit for
21096          * Pri 6 transmitted
21097          */
21098         uint64_t        tx_pfc_ena_frames_pri6;
21099         /*
21100          * Total number of PFC frames with PFC enabled bit for
21101          * Pri 7 transmitted
21102          */
21103         uint64_t        tx_pfc_ena_frames_pri7;
21104         /* Total number of EEE LPI Events on TX */
21105         uint64_t        tx_eee_lpi_events;
21106         /* EEE LPI Duration Counter on TX */
21107         uint64_t        tx_eee_lpi_duration;
21108         /*
21109          * Total number of Link Level Flow Control (LLFC) messages
21110          * transmitted
21111          */
21112         uint64_t        tx_llfc_logical_msgs;
21113         /* Total number of HCFC messages transmitted */
21114         uint64_t        tx_hcfc_msgs;
21115         /* Total number of TX collisions */
21116         uint64_t        tx_total_collisions;
21117         /* Total number of transmitted bytes */
21118         uint64_t        tx_bytes;
21119         /* Total number of end-to-end HOL frames */
21120         uint64_t        tx_xthol_frames;
21121         /* Total Tx Drops per Port reported by STATS block */
21122         uint64_t        tx_stat_discard;
21123         /* Total Tx Error Drops per Port reported by STATS block */
21124         uint64_t        tx_stat_error;
21125 } __rte_packed;
21126
21127 /* Port Rx Statistics Format */
21128 /* rx_port_stats (size:4224b/528B) */
21129 struct rx_port_stats {
21130         /* Total Number of 64 Bytes frames received */
21131         uint64_t        rx_64b_frames;
21132         /* Total Number of 65-127 Bytes frames received */
21133         uint64_t        rx_65b_127b_frames;
21134         /* Total Number of 128-255 Bytes frames received */
21135         uint64_t        rx_128b_255b_frames;
21136         /* Total Number of 256-511 Bytes frames received */
21137         uint64_t        rx_256b_511b_frames;
21138         /* Total Number of 512-1023 Bytes frames received */
21139         uint64_t        rx_512b_1023b_frames;
21140         /* Total Number of 1024-1518 Bytes frames received */
21141         uint64_t        rx_1024b_1518b_frames;
21142         /*
21143          * Total Number of each good VLAN (exludes FCS errors)
21144          * frame received which is 1519 to 1522 bytes in length
21145          * inclusive (excluding framing bits but including FCS bytes).
21146          */
21147         uint64_t        rx_good_vlan_frames;
21148         /* Total Number of 1519-2047 Bytes frames received */
21149         uint64_t        rx_1519b_2047b_frames;
21150         /* Total Number of 2048-4095 Bytes frames received */
21151         uint64_t        rx_2048b_4095b_frames;
21152         /* Total Number of 4096-9216 Bytes frames received */
21153         uint64_t        rx_4096b_9216b_frames;
21154         /* Total Number of 9217-16383 Bytes frames received */
21155         uint64_t        rx_9217b_16383b_frames;
21156         /* Total number of frames received */
21157         uint64_t        rx_total_frames;
21158         /* Total number of unicast frames received */
21159         uint64_t        rx_ucast_frames;
21160         /* Total number of multicast frames received */
21161         uint64_t        rx_mcast_frames;
21162         /* Total number of broadcast frames received */
21163         uint64_t        rx_bcast_frames;
21164         /* Total number of received frames with FCS error */
21165         uint64_t        rx_fcs_err_frames;
21166         /* Total number of control frames received */
21167         uint64_t        rx_ctrl_frames;
21168         /* Total number of PAUSE frames received */
21169         uint64_t        rx_pause_frames;
21170         /* Total number of PFC frames received */
21171         uint64_t        rx_pfc_frames;
21172         /*
21173          * Total number of frames received with an unsupported
21174          * opcode
21175          */
21176         uint64_t        rx_unsupported_opcode_frames;
21177         /*
21178          * Total number of frames received with an unsupported
21179          * DA for pause and PFC
21180          */
21181         uint64_t        rx_unsupported_da_pausepfc_frames;
21182         /* Total number of frames received with an unsupported SA */
21183         uint64_t        rx_wrong_sa_frames;
21184         /* Total number of received packets with alignment error */
21185         uint64_t        rx_align_err_frames;
21186         /* Total number of received frames with out-of-range length */
21187         uint64_t        rx_oor_len_frames;
21188         /* Total number of received frames with error termination */
21189         uint64_t        rx_code_err_frames;
21190         /*
21191          * Total number of received frames with a false carrier is
21192          * detected during idle, as defined by RX_ER samples active
21193          * and RXD is 0xE. The event is reported along with the
21194          * statistics generated on the next received frame. Only
21195          * one false carrier condition can be detected and logged
21196          * between frames.
21197          *
21198          * Carrier event, valid for 10M/100M speed modes only.
21199          */
21200         uint64_t        rx_false_carrier_frames;
21201         /* Total number of over-sized frames received */
21202         uint64_t        rx_ovrsz_frames;
21203         /* Total number of jabber packets received */
21204         uint64_t        rx_jbr_frames;
21205         /* Total number of received frames with MTU error */
21206         uint64_t        rx_mtu_err_frames;
21207         /* Total number of received frames with CRC match */
21208         uint64_t        rx_match_crc_frames;
21209         /* Total number of frames received promiscuously */
21210         uint64_t        rx_promiscuous_frames;
21211         /*
21212          * Total number of received frames with one or two VLAN
21213          * tags
21214          */
21215         uint64_t        rx_tagged_frames;
21216         /* Total number of received frames with two VLAN tags */
21217         uint64_t        rx_double_tagged_frames;
21218         /* Total number of truncated frames received */
21219         uint64_t        rx_trunc_frames;
21220         /* Total number of good frames (without errors) received */
21221         uint64_t        rx_good_frames;
21222         /*
21223          * Total number of received PFC frames with transition from
21224          * XON to XOFF on Pri 0
21225          */
21226         uint64_t        rx_pfc_xon2xoff_frames_pri0;
21227         /*
21228          * Total number of received PFC frames with transition from
21229          * XON to XOFF on Pri 1
21230          */
21231         uint64_t        rx_pfc_xon2xoff_frames_pri1;
21232         /*
21233          * Total number of received PFC frames with transition from
21234          * XON to XOFF on Pri 2
21235          */
21236         uint64_t        rx_pfc_xon2xoff_frames_pri2;
21237         /*
21238          * Total number of received PFC frames with transition from
21239          * XON to XOFF on Pri 3
21240          */
21241         uint64_t        rx_pfc_xon2xoff_frames_pri3;
21242         /*
21243          * Total number of received PFC frames with transition from
21244          * XON to XOFF on Pri 4
21245          */
21246         uint64_t        rx_pfc_xon2xoff_frames_pri4;
21247         /*
21248          * Total number of received PFC frames with transition from
21249          * XON to XOFF on Pri 5
21250          */
21251         uint64_t        rx_pfc_xon2xoff_frames_pri5;
21252         /*
21253          * Total number of received PFC frames with transition from
21254          * XON to XOFF on Pri 6
21255          */
21256         uint64_t        rx_pfc_xon2xoff_frames_pri6;
21257         /*
21258          * Total number of received PFC frames with transition from
21259          * XON to XOFF on Pri 7
21260          */
21261         uint64_t        rx_pfc_xon2xoff_frames_pri7;
21262         /*
21263          * Total number of received PFC frames with PFC enabled
21264          * bit for Pri 0
21265          */
21266         uint64_t        rx_pfc_ena_frames_pri0;
21267         /*
21268          * Total number of received PFC frames with PFC enabled
21269          * bit for Pri 1
21270          */
21271         uint64_t        rx_pfc_ena_frames_pri1;
21272         /*
21273          * Total number of received PFC frames with PFC enabled
21274          * bit for Pri 2
21275          */
21276         uint64_t        rx_pfc_ena_frames_pri2;
21277         /*
21278          * Total number of received PFC frames with PFC enabled
21279          * bit for Pri 3
21280          */
21281         uint64_t        rx_pfc_ena_frames_pri3;
21282         /*
21283          * Total number of received PFC frames with PFC enabled
21284          * bit for Pri 4
21285          */
21286         uint64_t        rx_pfc_ena_frames_pri4;
21287         /*
21288          * Total number of received PFC frames with PFC enabled
21289          * bit for Pri 5
21290          */
21291         uint64_t        rx_pfc_ena_frames_pri5;
21292         /*
21293          * Total number of received PFC frames with PFC enabled
21294          * bit for Pri 6
21295          */
21296         uint64_t        rx_pfc_ena_frames_pri6;
21297         /*
21298          * Total number of received PFC frames with PFC enabled
21299          * bit for Pri 7
21300          */
21301         uint64_t        rx_pfc_ena_frames_pri7;
21302         /* Total Number of frames received with SCH CRC error */
21303         uint64_t        rx_sch_crc_err_frames;
21304         /* Total Number of under-sized frames received */
21305         uint64_t        rx_undrsz_frames;
21306         /* Total Number of fragmented frames received */
21307         uint64_t        rx_frag_frames;
21308         /* Total number of RX EEE LPI Events */
21309         uint64_t        rx_eee_lpi_events;
21310         /* EEE LPI Duration Counter on RX */
21311         uint64_t        rx_eee_lpi_duration;
21312         /*
21313          * Total number of physical type Link Level Flow Control
21314          * (LLFC) messages received
21315          */
21316         uint64_t        rx_llfc_physical_msgs;
21317         /*
21318          * Total number of logical type Link Level Flow Control
21319          * (LLFC) messages received
21320          */
21321         uint64_t        rx_llfc_logical_msgs;
21322         /*
21323          * Total number of logical type Link Level Flow Control
21324          * (LLFC) messages received with CRC error
21325          */
21326         uint64_t        rx_llfc_msgs_with_crc_err;
21327         /* Total number of HCFC messages received */
21328         uint64_t        rx_hcfc_msgs;
21329         /* Total number of HCFC messages received with CRC error */
21330         uint64_t        rx_hcfc_msgs_with_crc_err;
21331         /* Total number of received bytes */
21332         uint64_t        rx_bytes;
21333         /* Total number of bytes received in runt frames */
21334         uint64_t        rx_runt_bytes;
21335         /* Total number of runt frames received */
21336         uint64_t        rx_runt_frames;
21337         /* Total Rx Discards per Port reported by STATS block */
21338         uint64_t        rx_stat_discard;
21339         uint64_t        rx_stat_err;
21340 } __rte_packed;
21341
21342 /********************
21343  * hwrm_port_qstats *
21344  ********************/
21345
21346
21347 /* hwrm_port_qstats_input (size:320b/40B) */
21348 struct hwrm_port_qstats_input {
21349         /* The HWRM command request type. */
21350         uint16_t        req_type;
21351         /*
21352          * The completion ring to send the completion event on. This should
21353          * be the NQ ID returned from the `nq_alloc` HWRM command.
21354          */
21355         uint16_t        cmpl_ring;
21356         /*
21357          * The sequence ID is used by the driver for tracking multiple
21358          * commands. This ID is treated as opaque data by the firmware and
21359          * the value is returned in the `hwrm_resp_hdr` upon completion.
21360          */
21361         uint16_t        seq_id;
21362         /*
21363          * The target ID of the command:
21364          * * 0x0-0xFFF8 - The function ID
21365          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21366          * * 0xFFFD - Reserved for user-space HWRM interface
21367          * * 0xFFFF - HWRM
21368          */
21369         uint16_t        target_id;
21370         /*
21371          * A physical address pointer pointing to a host buffer that the
21372          * command's response data will be written. This can be either a host
21373          * physical address (HPA) or a guest physical address (GPA) and must
21374          * point to a physically contiguous block of memory.
21375          */
21376         uint64_t        resp_addr;
21377         /* Port ID of port that is being queried. */
21378         uint16_t        port_id;
21379         uint8_t flags;
21380         /* This value is not used to avoid backward compatibility issues. */
21381         #define HWRM_PORT_QSTATS_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
21382         /*
21383          * This bit is set to 1 when request is for a counter mask,
21384          * representing the width of each of the stats counters, rather
21385          * than counters themselves.
21386          */
21387         #define HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
21388         #define HWRM_PORT_QSTATS_INPUT_FLAGS_LAST \
21389                 HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK
21390         uint8_t unused_0[5];
21391         /*
21392          * This is the host address where
21393          * Tx port statistics will be stored
21394          */
21395         uint64_t        tx_stat_host_addr;
21396         /*
21397          * This is the host address where
21398          * Rx port statistics will be stored
21399          */
21400         uint64_t        rx_stat_host_addr;
21401 } __rte_packed;
21402
21403 /* hwrm_port_qstats_output (size:128b/16B) */
21404 struct hwrm_port_qstats_output {
21405         /* The specific error status for the command. */
21406         uint16_t        error_code;
21407         /* The HWRM command request type. */
21408         uint16_t        req_type;
21409         /* The sequence ID from the original command. */
21410         uint16_t        seq_id;
21411         /* The length of the response data in number of bytes. */
21412         uint16_t        resp_len;
21413         /* The size of TX port statistics block in bytes. */
21414         uint16_t        tx_stat_size;
21415         /* The size of RX port statistics block in bytes. */
21416         uint16_t        rx_stat_size;
21417         uint8_t unused_0[3];
21418         /*
21419          * This field is used in Output records to indicate that the output
21420          * is completely written to RAM.  This field should be read as '1'
21421          * to indicate that the output has been completely written.
21422          * When writing a command completion or response to an internal processor,
21423          * the order of writes has to be such that this field is written last.
21424          */
21425         uint8_t valid;
21426 } __rte_packed;
21427
21428 /* Port Tx Statistics extended Format */
21429 /* tx_port_stats_ext (size:2048b/256B) */
21430 struct tx_port_stats_ext {
21431         /* Total number of tx bytes count on cos queue 0 */
21432         uint64_t        tx_bytes_cos0;
21433         /* Total number of tx bytes count on cos queue 1 */
21434         uint64_t        tx_bytes_cos1;
21435         /* Total number of tx bytes count on cos queue 2 */
21436         uint64_t        tx_bytes_cos2;
21437         /* Total number of tx bytes count on cos queue 3 */
21438         uint64_t        tx_bytes_cos3;
21439         /* Total number of tx bytes count on cos queue 4 */
21440         uint64_t        tx_bytes_cos4;
21441         /* Total number of tx bytes count on cos queue 5 */
21442         uint64_t        tx_bytes_cos5;
21443         /* Total number of tx bytes count on cos queue 6 */
21444         uint64_t        tx_bytes_cos6;
21445         /* Total number of tx bytes count on cos queue 7 */
21446         uint64_t        tx_bytes_cos7;
21447         /* Total number of tx packets count on cos queue 0 */
21448         uint64_t        tx_packets_cos0;
21449         /* Total number of tx packets count on cos queue 1 */
21450         uint64_t        tx_packets_cos1;
21451         /* Total number of tx packets count on cos queue 2 */
21452         uint64_t        tx_packets_cos2;
21453         /* Total number of tx packets count on cos queue 3 */
21454         uint64_t        tx_packets_cos3;
21455         /* Total number of tx packets count on cos queue 4 */
21456         uint64_t        tx_packets_cos4;
21457         /* Total number of tx packets count on cos queue 5 */
21458         uint64_t        tx_packets_cos5;
21459         /* Total number of tx packets count on cos queue 6 */
21460         uint64_t        tx_packets_cos6;
21461         /* Total number of tx packets count on cos queue 7 */
21462         uint64_t        tx_packets_cos7;
21463         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
21464         uint64_t        pfc_pri0_tx_duration_us;
21465         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
21466         uint64_t        pfc_pri0_tx_transitions;
21467         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
21468         uint64_t        pfc_pri1_tx_duration_us;
21469         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
21470         uint64_t        pfc_pri1_tx_transitions;
21471         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
21472         uint64_t        pfc_pri2_tx_duration_us;
21473         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
21474         uint64_t        pfc_pri2_tx_transitions;
21475         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
21476         uint64_t        pfc_pri3_tx_duration_us;
21477         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
21478         uint64_t        pfc_pri3_tx_transitions;
21479         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
21480         uint64_t        pfc_pri4_tx_duration_us;
21481         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
21482         uint64_t        pfc_pri4_tx_transitions;
21483         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
21484         uint64_t        pfc_pri5_tx_duration_us;
21485         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
21486         uint64_t        pfc_pri5_tx_transitions;
21487         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
21488         uint64_t        pfc_pri6_tx_duration_us;
21489         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
21490         uint64_t        pfc_pri6_tx_transitions;
21491         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
21492         uint64_t        pfc_pri7_tx_duration_us;
21493         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
21494         uint64_t        pfc_pri7_tx_transitions;
21495 } __rte_packed;
21496
21497 /* Port Rx Statistics extended Format */
21498 /* rx_port_stats_ext (size:3648b/456B) */
21499 struct rx_port_stats_ext {
21500         /* Number of times link state changed to down */
21501         uint64_t        link_down_events;
21502         /* Number of times the idle rings with pause bit are found */
21503         uint64_t        continuous_pause_events;
21504         /* Number of times the active rings pause bit resumed back */
21505         uint64_t        resume_pause_events;
21506         /* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */
21507         uint64_t        continuous_roce_pause_events;
21508         /* Number of times, the ROCE cos queue PFC is enabled back */
21509         uint64_t        resume_roce_pause_events;
21510         /* Total number of rx bytes count on cos queue 0 */
21511         uint64_t        rx_bytes_cos0;
21512         /* Total number of rx bytes count on cos queue 1 */
21513         uint64_t        rx_bytes_cos1;
21514         /* Total number of rx bytes count on cos queue 2 */
21515         uint64_t        rx_bytes_cos2;
21516         /* Total number of rx bytes count on cos queue 3 */
21517         uint64_t        rx_bytes_cos3;
21518         /* Total number of rx bytes count on cos queue 4 */
21519         uint64_t        rx_bytes_cos4;
21520         /* Total number of rx bytes count on cos queue 5 */
21521         uint64_t        rx_bytes_cos5;
21522         /* Total number of rx bytes count on cos queue 6 */
21523         uint64_t        rx_bytes_cos6;
21524         /* Total number of rx bytes count on cos queue 7 */
21525         uint64_t        rx_bytes_cos7;
21526         /* Total number of rx packets count on cos queue 0 */
21527         uint64_t        rx_packets_cos0;
21528         /* Total number of rx packets count on cos queue 1 */
21529         uint64_t        rx_packets_cos1;
21530         /* Total number of rx packets count on cos queue 2 */
21531         uint64_t        rx_packets_cos2;
21532         /* Total number of rx packets count on cos queue 3 */
21533         uint64_t        rx_packets_cos3;
21534         /* Total number of rx packets count on cos queue 4 */
21535         uint64_t        rx_packets_cos4;
21536         /* Total number of rx packets count on cos queue 5 */
21537         uint64_t        rx_packets_cos5;
21538         /* Total number of rx packets count on cos queue 6 */
21539         uint64_t        rx_packets_cos6;
21540         /* Total number of rx packets count on cos queue 7 */
21541         uint64_t        rx_packets_cos7;
21542         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
21543         uint64_t        pfc_pri0_rx_duration_us;
21544         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
21545         uint64_t        pfc_pri0_rx_transitions;
21546         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
21547         uint64_t        pfc_pri1_rx_duration_us;
21548         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
21549         uint64_t        pfc_pri1_rx_transitions;
21550         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
21551         uint64_t        pfc_pri2_rx_duration_us;
21552         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
21553         uint64_t        pfc_pri2_rx_transitions;
21554         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
21555         uint64_t        pfc_pri3_rx_duration_us;
21556         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
21557         uint64_t        pfc_pri3_rx_transitions;
21558         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
21559         uint64_t        pfc_pri4_rx_duration_us;
21560         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
21561         uint64_t        pfc_pri4_rx_transitions;
21562         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
21563         uint64_t        pfc_pri5_rx_duration_us;
21564         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
21565         uint64_t        pfc_pri5_rx_transitions;
21566         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
21567         uint64_t        pfc_pri6_rx_duration_us;
21568         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
21569         uint64_t        pfc_pri6_rx_transitions;
21570         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
21571         uint64_t        pfc_pri7_rx_duration_us;
21572         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
21573         uint64_t        pfc_pri7_rx_transitions;
21574         /* Total number of received bits */
21575         uint64_t        rx_bits;
21576         /* The number of events where the port receive buffer was over 85% full */
21577         uint64_t        rx_buffer_passed_threshold;
21578         /*
21579          * The number of symbol errors that wasn't corrected by FEC correction
21580          * alogirithm
21581          */
21582         uint64_t        rx_pcs_symbol_err;
21583         /* The number of corrected bits on the port according to active FEC */
21584         uint64_t        rx_corrected_bits;
21585         /* Total number of rx discard bytes count on cos queue 0 */
21586         uint64_t        rx_discard_bytes_cos0;
21587         /* Total number of rx discard bytes count on cos queue 1 */
21588         uint64_t        rx_discard_bytes_cos1;
21589         /* Total number of rx discard bytes count on cos queue 2 */
21590         uint64_t        rx_discard_bytes_cos2;
21591         /* Total number of rx discard bytes count on cos queue 3 */
21592         uint64_t        rx_discard_bytes_cos3;
21593         /* Total number of rx discard bytes count on cos queue 4 */
21594         uint64_t        rx_discard_bytes_cos4;
21595         /* Total number of rx discard bytes count on cos queue 5 */
21596         uint64_t        rx_discard_bytes_cos5;
21597         /* Total number of rx discard bytes count on cos queue 6 */
21598         uint64_t        rx_discard_bytes_cos6;
21599         /* Total number of rx discard bytes count on cos queue 7 */
21600         uint64_t        rx_discard_bytes_cos7;
21601         /* Total number of rx discard packets count on cos queue 0 */
21602         uint64_t        rx_discard_packets_cos0;
21603         /* Total number of rx discard packets count on cos queue 1 */
21604         uint64_t        rx_discard_packets_cos1;
21605         /* Total number of rx discard packets count on cos queue 2 */
21606         uint64_t        rx_discard_packets_cos2;
21607         /* Total number of rx discard packets count on cos queue 3 */
21608         uint64_t        rx_discard_packets_cos3;
21609         /* Total number of rx discard packets count on cos queue 4 */
21610         uint64_t        rx_discard_packets_cos4;
21611         /* Total number of rx discard packets count on cos queue 5 */
21612         uint64_t        rx_discard_packets_cos5;
21613         /* Total number of rx discard packets count on cos queue 6 */
21614         uint64_t        rx_discard_packets_cos6;
21615         /* Total number of rx discard packets count on cos queue 7 */
21616         uint64_t        rx_discard_packets_cos7;
21617 } __rte_packed;
21618
21619 /*
21620  * Port Rx Statistics extended PFC WatchDog Format.
21621  * StormDetect and StormRevert event determination is based
21622  * on an integration period and a percentage threshold.
21623  * StormDetect event - when percentage of XOFF frames received
21624  * within an integration period exceeds the configured threshold.
21625  * StormRevert event - when percentage of XON frames received
21626  * within an integration period exceeds the configured threshold.
21627  * Actual number of XOFF/XON frames for the events to be triggered
21628  * depends on both configured integration period and sampling rate.
21629  * The statistics in this structure represent counts of specified
21630  * events from the moment the feature (PFC WatchDog) is enabled via
21631  * hwrm_queue_pfc_enable_cfg call.
21632  */
21633 /* rx_port_stats_ext_pfc_wd (size:5120b/640B) */
21634 struct rx_port_stats_ext_pfc_wd {
21635         /*
21636          * Total number of PFC WatchDog StormDetect events detected
21637          * for Pri 0
21638          */
21639         uint64_t        rx_pfc_watchdog_storms_detected_pri0;
21640         /*
21641          * Total number of PFC WatchDog StormDetect events detected
21642          * for Pri 1
21643          */
21644         uint64_t        rx_pfc_watchdog_storms_detected_pri1;
21645         /*
21646          * Total number of PFC WatchDog StormDetect events detected
21647          * for Pri 2
21648          */
21649         uint64_t        rx_pfc_watchdog_storms_detected_pri2;
21650         /*
21651          * Total number of PFC WatchDog StormDetect events detected
21652          * for Pri 3
21653          */
21654         uint64_t        rx_pfc_watchdog_storms_detected_pri3;
21655         /*
21656          * Total number of PFC WatchDog StormDetect events detected
21657          * for Pri 4
21658          */
21659         uint64_t        rx_pfc_watchdog_storms_detected_pri4;
21660         /*
21661          * Total number of PFC WatchDog StormDetect events detected
21662          * for Pri 5
21663          */
21664         uint64_t        rx_pfc_watchdog_storms_detected_pri5;
21665         /*
21666          * Total number of PFC WatchDog StormDetect events detected
21667          * for Pri 6
21668          */
21669         uint64_t        rx_pfc_watchdog_storms_detected_pri6;
21670         /*
21671          * Total number of PFC WatchDog StormDetect events detected
21672          * for Pri 7
21673          */
21674         uint64_t        rx_pfc_watchdog_storms_detected_pri7;
21675         /*
21676          * Total number of PFC WatchDog StormRevert events detected
21677          * for Pri 0
21678          */
21679         uint64_t        rx_pfc_watchdog_storms_reverted_pri0;
21680         /*
21681          * Total number of PFC WatchDog StormRevert events detected
21682          * for Pri 1
21683          */
21684         uint64_t        rx_pfc_watchdog_storms_reverted_pri1;
21685         /*
21686          * Total number of PFC WatchDog StormRevert events detected
21687          * for Pri 2
21688          */
21689         uint64_t        rx_pfc_watchdog_storms_reverted_pri2;
21690         /*
21691          * Total number of PFC WatchDog StormRevert events detected
21692          * for Pri 3
21693          */
21694         uint64_t        rx_pfc_watchdog_storms_reverted_pri3;
21695         /*
21696          * Total number of PFC WatchDog StormRevert events detected
21697          * for Pri 4
21698          */
21699         uint64_t        rx_pfc_watchdog_storms_reverted_pri4;
21700         /*
21701          * Total number of PFC WatchDog StormRevert events detected
21702          * for Pri 5
21703          */
21704         uint64_t        rx_pfc_watchdog_storms_reverted_pri5;
21705         /*
21706          * Total number of PFC WatchDog StormRevert events detected
21707          * for Pri 6
21708          */
21709         uint64_t        rx_pfc_watchdog_storms_reverted_pri6;
21710         /*
21711          * Total number of PFC WatchDog StormRevert events detected
21712          * for Pri 7
21713          */
21714         uint64_t        rx_pfc_watchdog_storms_reverted_pri7;
21715         /*
21716          * Total number of packets received during PFC watchdog storm
21717          * for pri 0
21718          */
21719         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri0;
21720         /*
21721          * Total number of packets received during PFC watchdog storm
21722          * for pri 1
21723          */
21724         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri1;
21725         /*
21726          * Total number of packets received during PFC watchdog storm
21727          *  for pri 2
21728          */
21729         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri2;
21730         /*
21731          * Total number of packets received during PFC watchdog storm
21732          *  for pri 3
21733          */
21734         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri3;
21735         /*
21736          * Total number of packets received during PFC watchdog storm
21737          *  for pri 4
21738          */
21739         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri4;
21740         /*
21741          * Total number of packets received during PFC watchdog storm
21742          *  for pri 5
21743          */
21744         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri5;
21745         /*
21746          * Total number of packets received during PFC watchdog storm
21747          *  for pri 6
21748          */
21749         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri6;
21750         /*
21751          * Total number of packets received during PFC watchdog storm
21752          *  for pri 7
21753          */
21754         uint64_t        rx_pfc_watchdog_storms_rx_packets_pri7;
21755         /*
21756          * Total number of bytes received during PFC watchdog storm
21757          * for pri 0
21758          */
21759         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri0;
21760         /*
21761          * Total number of bytes received during PFC watchdog storm
21762          * for pri 1
21763          */
21764         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri1;
21765         /*
21766          * Total number of bytes received during PFC watchdog storm
21767          *  for pri 2
21768          */
21769         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri2;
21770         /*
21771          * Total number of bytes received during PFC watchdog storm
21772          *  for pri 3
21773          */
21774         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri3;
21775         /*
21776          * Total number of bytes received during PFC watchdog storm
21777          *  for pri 4
21778          */
21779         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri4;
21780         /*
21781          * Total number of bytes received during PFC watchdog storm
21782          *  for pri 5
21783          */
21784         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri5;
21785         /*
21786          * Total number of bytes received during PFC watchdog storm
21787          *  for pri 6
21788          */
21789         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri6;
21790         /*
21791          * Total number of bytes received during PFC watchdog storm
21792          *  for pri 7
21793          */
21794         uint64_t        rx_pfc_watchdog_storms_rx_bytes_pri7;
21795         /*
21796          * Total number of packets dropped on rx during PFC watchdog storm
21797          * for pri 0
21798          */
21799         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri0;
21800         /*
21801          * Total number of packets dropped on rx during PFC watchdog storm
21802          * for pri 1
21803          */
21804         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri1;
21805         /*
21806          * Total number of packets dropped on rx during PFC watchdog storm
21807          *  for pri 2
21808          */
21809         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri2;
21810         /*
21811          * Total number of packets dropped on rx during PFC watchdog storm
21812          *  for pri 3
21813          */
21814         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri3;
21815         /*
21816          * Total number of packets dropped on rx during PFC watchdog storm
21817          *  for pri 4
21818          */
21819         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri4;
21820         /*
21821          * Total number of packets dropped on rx during PFC watchdog storm
21822          *  for pri 5
21823          */
21824         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri5;
21825         /*
21826          * Total number of packets dropped on rx during PFC watchdog storm
21827          *  for pri 6
21828          */
21829         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri6;
21830         /*
21831          * Total number of packets dropped on rx during PFC watchdog storm
21832          *  for pri 7
21833          */
21834         uint64_t        rx_pfc_watchdog_storms_rx_packets_dropped_pri7;
21835         /*
21836          * Total number of bytes dropped on rx during PFC watchdog storm
21837          * for pri 0
21838          */
21839         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri0;
21840         /*
21841          * Total number of bytes dropped on rx during PFC watchdog storm
21842          * for pri 1
21843          */
21844         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri1;
21845         /*
21846          * Total number of bytes dropped on rx during PFC watchdog storm
21847          *  for pri 2
21848          */
21849         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri2;
21850         /*
21851          * Total number of bytes dropped on rx during PFC watchdog storm
21852          *  for pri 3
21853          */
21854         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri3;
21855         /*
21856          * Total number of bytes dropped on rx during PFC watchdog storm
21857          *  for pri 4
21858          */
21859         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri4;
21860         /*
21861          * Total number of bytes dropped on rx during PFC watchdog storm
21862          *  for pri 5
21863          */
21864         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri5;
21865         /*
21866          * Total number of bytes dropped on rx during PFC watchdog storm
21867          *  for pri 6
21868          */
21869         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri6;
21870         /*
21871          * Total number of bytes dropped on rx during PFC watchdog storm
21872          *  for pri 7
21873          */
21874         uint64_t        rx_pfc_watchdog_storms_rx_bytes_dropped_pri7;
21875         /*
21876          * Number of packets received during last PFC watchdog storm
21877          * for pri 0
21878          */
21879         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri0;
21880         /*
21881          * Number of packets received during last PFC watchdog storm
21882          * for pri 1
21883          */
21884         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri1;
21885         /*
21886          * Number of packets received during last PFC watchdog storm
21887          *  for pri 2
21888          */
21889         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri2;
21890         /*
21891          * Number of packets received during last PFC watchdog storm
21892          *  for pri 3
21893          */
21894         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri3;
21895         /*
21896          * Number of packets received during last PFC watchdog storm
21897          *  for pri 4
21898          */
21899         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri4;
21900         /*
21901          * Number of packets received during last PFC watchdog storm
21902          *  for pri 5
21903          */
21904         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri5;
21905         /*
21906          * Number of packets received during last PFC watchdog storm
21907          *  for pri 6
21908          */
21909         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri6;
21910         /*
21911          * Number of packets received during last PFC watchdog storm
21912          *  for pri 7
21913          */
21914         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_pri7;
21915         /*
21916          * Number of bytes received during last PFC watchdog storm
21917          * for pri 0
21918          */
21919         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri0;
21920         /*
21921          * Number of bytes received during last PFC watchdog storm
21922          * for pri 1
21923          */
21924         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri1;
21925         /*
21926          * Number of bytes received during last PFC watchdog storm
21927          *  for pri 2
21928          */
21929         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri2;
21930         /*
21931          * Number of bytes received during last PFC watchdog storm
21932          *  for pri 3
21933          */
21934         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri3;
21935         /*
21936          * Number of bytes received during last PFC watchdog storm
21937          *  for pri 4
21938          */
21939         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri4;
21940         /*
21941          * Number of bytes received during last PFC watchdog storm
21942          *  for pri 5
21943          */
21944         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri5;
21945         /*
21946          * Number of bytes received during last PFC watchdog storm
21947          *  for pri 6
21948          */
21949         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri6;
21950         /*
21951          * Number of bytes received during last PFC watchdog storm
21952          *  for pri 7
21953          */
21954         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_pri7;
21955         /*
21956          * Number of packets dropped on rx during last PFC watchdog storm
21957          * for pri 0
21958          */
21959         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri0;
21960         /*
21961          * Number of packets dropped on rx during last PFC watchdog storm
21962          * for pri 1
21963          */
21964         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri1;
21965         /*
21966          * Number of packets dropped on rx during last PFC watchdog storm
21967          *  for pri 2
21968          */
21969         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri2;
21970         /*
21971          * Number of packets dropped on rx during last PFC watchdog storm
21972          *  for pri 3
21973          */
21974         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri3;
21975         /*
21976          * Number of packets dropped on rx during last PFC watchdog storm
21977          *  for pri 4
21978          */
21979         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri4;
21980         /*
21981          * Number of packets dropped on rx during last PFC watchdog storm
21982          *  for pri 5
21983          */
21984         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri5;
21985         /*
21986          * Number of packets dropped on rx during last PFC watchdog storm
21987          *  for pri 6
21988          */
21989         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri6;
21990         /*
21991          * Number of packets dropped on rx during last PFC watchdog storm
21992          *  for pri 7
21993          */
21994         uint64_t        rx_pfc_watchdog_last_storm_rx_packets_dropped_pri7;
21995         /*
21996          * Total number of bytes dropped on rx during PFC watchdog storm
21997          * for pri 0
21998          */
21999         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri0;
22000         /*
22001          * Number of bytes dropped on rx during last PFC watchdog storm
22002          * for pri 1
22003          */
22004         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri1;
22005         /*
22006          * Number of bytes dropped on rx during last PFC watchdog storm
22007          *  for pri 2
22008          */
22009         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri2;
22010         /*
22011          * Number of bytes dropped on rx during last PFC watchdog storm
22012          *  for pri 3
22013          */
22014         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri3;
22015         /*
22016          * Number of bytes dropped on rx during last PFC watchdog storm
22017          *  for pri 4
22018          */
22019         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri4;
22020         /*
22021          * Number of bytes dropped on rx during last PFC watchdog storm
22022          *  for pri 5
22023          */
22024         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri5;
22025         /*
22026          * Number of bytes dropped on rx during last PFC watchdog storm
22027          *  for pri 6
22028          */
22029         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri6;
22030         /*
22031          * Number of bytes dropped on rx during last PFC watchdog storm
22032          *  for pri 7
22033          */
22034         uint64_t        rx_pfc_watchdog_last_storm_rx_bytes_dropped_pri7;
22035 } __rte_packed;
22036
22037 /************************
22038  * hwrm_port_qstats_ext *
22039  ************************/
22040
22041
22042 /* hwrm_port_qstats_ext_input (size:320b/40B) */
22043 struct hwrm_port_qstats_ext_input {
22044         /* The HWRM command request type. */
22045         uint16_t        req_type;
22046         /*
22047          * The completion ring to send the completion event on. This should
22048          * be the NQ ID returned from the `nq_alloc` HWRM command.
22049          */
22050         uint16_t        cmpl_ring;
22051         /*
22052          * The sequence ID is used by the driver for tracking multiple
22053          * commands. This ID is treated as opaque data by the firmware and
22054          * the value is returned in the `hwrm_resp_hdr` upon completion.
22055          */
22056         uint16_t        seq_id;
22057         /*
22058          * The target ID of the command:
22059          * * 0x0-0xFFF8 - The function ID
22060          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22061          * * 0xFFFD - Reserved for user-space HWRM interface
22062          * * 0xFFFF - HWRM
22063          */
22064         uint16_t        target_id;
22065         /*
22066          * A physical address pointer pointing to a host buffer that the
22067          * command's response data will be written. This can be either a host
22068          * physical address (HPA) or a guest physical address (GPA) and must
22069          * point to a physically contiguous block of memory.
22070          */
22071         uint64_t        resp_addr;
22072         /* Port ID of port that is being queried. */
22073         uint16_t        port_id;
22074         /*
22075          * The size of TX port extended
22076          * statistics block in bytes.
22077          */
22078         uint16_t        tx_stat_size;
22079         /*
22080          * The size of RX port extended
22081          * statistics block in bytes
22082          */
22083         uint16_t        rx_stat_size;
22084         uint8_t flags;
22085         /* This value is not used to avoid backward compatibility issues. */
22086         #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
22087         /*
22088          * This bit is set to 1 when request is for the counter mask,
22089          * representing width of each of the stats counters, rather than
22090          * counters themselves.
22091          */
22092         #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
22093         #define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_LAST \
22094                 HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK
22095         uint8_t unused_0;
22096         /*
22097          * This is the host address where
22098          * Tx port statistics will be stored
22099          */
22100         uint64_t        tx_stat_host_addr;
22101         /*
22102          * This is the host address where
22103          * Rx port statistics will be stored
22104          */
22105         uint64_t        rx_stat_host_addr;
22106 } __rte_packed;
22107
22108 /* hwrm_port_qstats_ext_output (size:128b/16B) */
22109 struct hwrm_port_qstats_ext_output {
22110         /* The specific error status for the command. */
22111         uint16_t        error_code;
22112         /* The HWRM command request type. */
22113         uint16_t        req_type;
22114         /* The sequence ID from the original command. */
22115         uint16_t        seq_id;
22116         /* The length of the response data in number of bytes. */
22117         uint16_t        resp_len;
22118         /* The size of TX port statistics block in bytes. */
22119         uint16_t        tx_stat_size;
22120         /* The size of RX port statistics block in bytes. */
22121         uint16_t        rx_stat_size;
22122         /* Total number of active cos queues available. */
22123         uint16_t        total_active_cos_queues;
22124         uint8_t flags;
22125         /*
22126          * If set to 1, then this field indicates that clear
22127          * roce specific counters is supported.
22128          */
22129         #define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED \
22130                 UINT32_C(0x1)
22131         /*
22132          * This field is used in Output records to indicate that the output
22133          * is completely written to RAM.  This field should be read as '1'
22134          * to indicate that the output has been completely written.
22135          * When writing a command completion or response to an internal processor,
22136          * the order of writes has to be such that this field is written last.
22137          */
22138         uint8_t valid;
22139 } __rte_packed;
22140
22141 /*******************************
22142  * hwrm_port_qstats_ext_pfc_wd *
22143  *******************************/
22144
22145
22146 /* hwrm_port_qstats_ext_pfc_wd_input (size:256b/32B) */
22147 struct hwrm_port_qstats_ext_pfc_wd_input {
22148         /* The HWRM command request type. */
22149         uint16_t        req_type;
22150         /*
22151          * The completion ring to send the completion event on. This should
22152          * be the NQ ID returned from the `nq_alloc` HWRM command.
22153          */
22154         uint16_t        cmpl_ring;
22155         /*
22156          * The sequence ID is used by the driver for tracking multiple
22157          * commands. This ID is treated as opaque data by the firmware and
22158          * the value is returned in the `hwrm_resp_hdr` upon completion.
22159          */
22160         uint16_t        seq_id;
22161         /*
22162          * The target ID of the command:
22163          * * 0x0-0xFFF8 - The function ID
22164          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22165          * * 0xFFFD - Reserved for user-space HWRM interface
22166          * * 0xFFFF - HWRM
22167          */
22168         uint16_t        target_id;
22169         /*
22170          * A physical address pointer pointing to a host buffer that the
22171          * command's response data will be written. This can be either a host
22172          * physical address (HPA) or a guest physical address (GPA) and must
22173          * point to a physically contiguous block of memory.
22174          */
22175         uint64_t        resp_addr;
22176         /* Port ID of port that is being queried. */
22177         uint16_t        port_id;
22178         /*
22179          * The size of rx_port_stats_ext_pfc_wd
22180          * block in bytes
22181          */
22182         uint16_t        pfc_wd_stat_size;
22183         uint8_t unused_0[4];
22184         /*
22185          * This is the host address where
22186          * rx_port_stats_ext_pfc_wd will be stored
22187          */
22188         uint64_t        pfc_wd_stat_host_addr;
22189 } __rte_packed;
22190
22191 /* hwrm_port_qstats_ext_pfc_wd_output (size:128b/16B) */
22192 struct hwrm_port_qstats_ext_pfc_wd_output {
22193         /* The specific error status for the command. */
22194         uint16_t        error_code;
22195         /* The HWRM command request type. */
22196         uint16_t        req_type;
22197         /* The sequence ID from the original command. */
22198         uint16_t        seq_id;
22199         /* The length of the response data in number of bytes. */
22200         uint16_t        resp_len;
22201         /*
22202          * The size of rx_port_stats_ext_pfc_wd
22203          * statistics block in bytes.
22204          */
22205         uint16_t        pfc_wd_stat_size;
22206         uint8_t flags;
22207         /*
22208          * This field is used in Output records to indicate that the output
22209          * is completely written to RAM.  This field should be read as '1'
22210          * to indicate that the output has been completely written.
22211          * When writing a command completion or response to an internal processor,
22212          * the order of writes has to be such that this field is written last.
22213          */
22214         uint8_t valid;
22215         uint8_t unused_0[4];
22216 } __rte_packed;
22217
22218 /*************************
22219  * hwrm_port_lpbk_qstats *
22220  *************************/
22221
22222
22223 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */
22224 struct hwrm_port_lpbk_qstats_input {
22225         /* The HWRM command request type. */
22226         uint16_t        req_type;
22227         /*
22228          * The completion ring to send the completion event on. This should
22229          * be the NQ ID returned from the `nq_alloc` HWRM command.
22230          */
22231         uint16_t        cmpl_ring;
22232         /*
22233          * The sequence ID is used by the driver for tracking multiple
22234          * commands. This ID is treated as opaque data by the firmware and
22235          * the value is returned in the `hwrm_resp_hdr` upon completion.
22236          */
22237         uint16_t        seq_id;
22238         /*
22239          * The target ID of the command:
22240          * * 0x0-0xFFF8 - The function ID
22241          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22242          * * 0xFFFD - Reserved for user-space HWRM interface
22243          * * 0xFFFF - HWRM
22244          */
22245         uint16_t        target_id;
22246         /*
22247          * A physical address pointer pointing to a host buffer that the
22248          * command's response data will be written. This can be either a host
22249          * physical address (HPA) or a guest physical address (GPA) and must
22250          * point to a physically contiguous block of memory.
22251          */
22252         uint64_t        resp_addr;
22253 } __rte_packed;
22254
22255 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
22256 struct hwrm_port_lpbk_qstats_output {
22257         /* The specific error status for the command. */
22258         uint16_t        error_code;
22259         /* The HWRM command request type. */
22260         uint16_t        req_type;
22261         /* The sequence ID from the original command. */
22262         uint16_t        seq_id;
22263         /* The length of the response data in number of bytes. */
22264         uint16_t        resp_len;
22265         /* Number of transmitted unicast frames */
22266         uint64_t        lpbk_ucast_frames;
22267         /* Number of transmitted multicast frames */
22268         uint64_t        lpbk_mcast_frames;
22269         /* Number of transmitted broadcast frames */
22270         uint64_t        lpbk_bcast_frames;
22271         /* Number of transmitted bytes for unicast traffic */
22272         uint64_t        lpbk_ucast_bytes;
22273         /* Number of transmitted bytes for multicast traffic */
22274         uint64_t        lpbk_mcast_bytes;
22275         /* Number of transmitted bytes for broadcast traffic */
22276         uint64_t        lpbk_bcast_bytes;
22277         /* Total Tx Drops for loopback traffic reported by STATS block */
22278         uint64_t        tx_stat_discard;
22279         /* Total Tx Error Drops for loopback traffic reported by STATS block */
22280         uint64_t        tx_stat_error;
22281         /* Total Rx Drops for loopback traffic reported by STATS block */
22282         uint64_t        rx_stat_discard;
22283         /* Total Rx Error Drops for loopback traffic reported by STATS block */
22284         uint64_t        rx_stat_error;
22285         uint8_t unused_0[7];
22286         /*
22287          * This field is used in Output records to indicate that the output
22288          * is completely written to RAM.  This field should be read as '1'
22289          * to indicate that the output has been completely written.
22290          * When writing a command completion or response to an internal processor,
22291          * the order of writes has to be such that this field is written last.
22292          */
22293         uint8_t valid;
22294 } __rte_packed;
22295
22296 /************************
22297  * hwrm_port_ecn_qstats *
22298  ************************/
22299
22300
22301 /* hwrm_port_ecn_qstats_input (size:256b/32B) */
22302 struct hwrm_port_ecn_qstats_input {
22303         /* The HWRM command request type. */
22304         uint16_t        req_type;
22305         /*
22306          * The completion ring to send the completion event on. This should
22307          * be the NQ ID returned from the `nq_alloc` HWRM command.
22308          */
22309         uint16_t        cmpl_ring;
22310         /*
22311          * The sequence ID is used by the driver for tracking multiple
22312          * commands. This ID is treated as opaque data by the firmware and
22313          * the value is returned in the `hwrm_resp_hdr` upon completion.
22314          */
22315         uint16_t        seq_id;
22316         /*
22317          * The target ID of the command:
22318          * * 0x0-0xFFF8 - The function ID
22319          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22320          * * 0xFFFD - Reserved for user-space HWRM interface
22321          * * 0xFFFF - HWRM
22322          */
22323         uint16_t        target_id;
22324         /*
22325          * A physical address pointer pointing to a host buffer that the
22326          * command's response data will be written. This can be either a host
22327          * physical address (HPA) or a guest physical address (GPA) and must
22328          * point to a physically contiguous block of memory.
22329          */
22330         uint64_t        resp_addr;
22331         /*
22332          * Port ID of port that is being queried. Unused if NIC is in
22333          * multi-host mode.
22334          */
22335         uint16_t        port_id;
22336         /*
22337          * Size of the DMA buffer the caller has allocated for the firmware to
22338          * write into.
22339          */
22340         uint16_t        ecn_stat_buf_size;
22341         uint8_t flags;
22342         /* This value is not used to avoid backward compatibility issues. */
22343         #define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_UNUSED       UINT32_C(0x0)
22344         /*
22345          * This bit is set to 1 when request is for a counter mask,
22346          * representing the width of each of the stats counters, rather
22347          * than counters themselves.
22348          */
22349         #define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1)
22350         #define HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_LAST \
22351                 HWRM_PORT_ECN_QSTATS_INPUT_FLAGS_COUNTER_MASK
22352         uint8_t unused_0[3];
22353         /*
22354          * This is the host address where
22355          * ECN port statistics will be stored
22356          */
22357         uint64_t        ecn_stat_host_addr;
22358 } __rte_packed;
22359
22360 /* hwrm_port_ecn_qstats_output (size:128b/16B) */
22361 struct hwrm_port_ecn_qstats_output {
22362         /* The specific error status for the command. */
22363         uint16_t        error_code;
22364         /* The HWRM command request type. */
22365         uint16_t        req_type;
22366         /* The sequence ID from the original command. */
22367         uint16_t        seq_id;
22368         /* The length of the response data in number of bytes. */
22369         uint16_t        resp_len;
22370         /* Number of bytes of stats the firmware wrote to the DMA buffer. */
22371         uint16_t        ecn_stat_buf_size;
22372         /*
22373          * Bitmask that indicates which CoS queues have ECN marking enabled.
22374          * Bit i corresponds to CoS queue i.
22375          */
22376         uint8_t mark_en;
22377         uint8_t unused_0[4];
22378         /*
22379          * This field is used in Output records to indicate that the output
22380          * is completely written to RAM.  This field should be read as '1'
22381          * to indicate that the output has been completely written.
22382          * When writing a command completion or response to an internal processor,
22383          * the order of writes has to be such that this field is written last.
22384          */
22385         uint8_t valid;
22386 } __rte_packed;
22387
22388 /* ECN mark statistics format */
22389 /* port_stats_ecn (size:512b/64B) */
22390 struct port_stats_ecn {
22391         /*
22392          * Number of packets marked in CoS queue 0.
22393          * Or, if the driver requested counter masks, a mask to indicate the size
22394          * of the counter.
22395          */
22396         uint64_t        mark_cnt_cos0;
22397         /*
22398          * Number of packets marked in CoS queue 1.
22399          * Or, if the driver requested counter masks, a mask to indicate the size
22400          * of the counter.
22401          */
22402         uint64_t        mark_cnt_cos1;
22403         /*
22404          * Number of packets marked in CoS queue 2.
22405          * Or, if the driver requested counter masks, a mask to indicate the size
22406          * of the counter.
22407          */
22408         uint64_t        mark_cnt_cos2;
22409         /*
22410          * Number of packets marked in CoS queue 3.
22411          * Or, if the driver requested counter masks, a mask to indicate the size
22412          * of the counter.
22413          */
22414         uint64_t        mark_cnt_cos3;
22415         /*
22416          * Number of packets marked in CoS queue 4.
22417          * Or, if the driver requested counter masks, a mask to indicate the size
22418          * of the counter.
22419          */
22420         uint64_t        mark_cnt_cos4;
22421         /*
22422          * Number of packets marked in CoS queue 5.
22423          * Or, if the driver requested counter masks, a mask to indicate the size
22424          * of the counter.
22425          */
22426         uint64_t        mark_cnt_cos5;
22427         /*
22428          * Number of packets marked in CoS queue 6.
22429          * Or, if the driver requested counter masks, a mask to indicate the size
22430          * of the counter.
22431          */
22432         uint64_t        mark_cnt_cos6;
22433         /*
22434          * Number of packets marked in CoS queue 7.
22435          * Or, if the driver requested counter masks, a mask to indicate the size
22436          * of the counter.
22437          */
22438         uint64_t        mark_cnt_cos7;
22439 } __rte_packed;
22440
22441 /***********************
22442  * hwrm_port_clr_stats *
22443  ***********************/
22444
22445
22446 /* hwrm_port_clr_stats_input (size:192b/24B) */
22447 struct hwrm_port_clr_stats_input {
22448         /* The HWRM command request type. */
22449         uint16_t        req_type;
22450         /*
22451          * The completion ring to send the completion event on. This should
22452          * be the NQ ID returned from the `nq_alloc` HWRM command.
22453          */
22454         uint16_t        cmpl_ring;
22455         /*
22456          * The sequence ID is used by the driver for tracking multiple
22457          * commands. This ID is treated as opaque data by the firmware and
22458          * the value is returned in the `hwrm_resp_hdr` upon completion.
22459          */
22460         uint16_t        seq_id;
22461         /*
22462          * The target ID of the command:
22463          * * 0x0-0xFFF8 - The function ID
22464          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22465          * * 0xFFFD - Reserved for user-space HWRM interface
22466          * * 0xFFFF - HWRM
22467          */
22468         uint16_t        target_id;
22469         /*
22470          * A physical address pointer pointing to a host buffer that the
22471          * command's response data will be written. This can be either a host
22472          * physical address (HPA) or a guest physical address (GPA) and must
22473          * point to a physically contiguous block of memory.
22474          */
22475         uint64_t        resp_addr;
22476         /* Port ID of port that is being queried. */
22477         uint16_t        port_id;
22478         uint8_t flags;
22479         /*
22480          * If set to 1, then this field indicates clear the following RoCE
22481          * specific counters.
22482          * RoCE associated TX/RX cos counters
22483          * CNP associated TX/RX cos counters
22484          * RoCE/CNP specific TX/RX flow counters
22485          * Firmware will determine the RoCE/CNP cos queue based on qos profile.
22486          * This flag is honored only when RoCE is enabled on that port.
22487          */
22488         #define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS     UINT32_C(0x1)
22489         uint8_t unused_0[5];
22490 } __rte_packed;
22491
22492 /* hwrm_port_clr_stats_output (size:128b/16B) */
22493 struct hwrm_port_clr_stats_output {
22494         /* The specific error status for the command. */
22495         uint16_t        error_code;
22496         /* The HWRM command request type. */
22497         uint16_t        req_type;
22498         /* The sequence ID from the original command. */
22499         uint16_t        seq_id;
22500         /* The length of the response data in number of bytes. */
22501         uint16_t        resp_len;
22502         uint8_t unused_0[7];
22503         /*
22504          * This field is used in Output records to indicate that the output
22505          * is completely written to RAM.  This field should be read as '1'
22506          * to indicate that the output has been completely written.
22507          * When writing a command completion or response to an internal processor,
22508          * the order of writes has to be such that this field is written last.
22509          */
22510         uint8_t valid;
22511 } __rte_packed;
22512
22513 /***********************
22514  * hwrm_port_phy_qcaps *
22515  ***********************/
22516
22517
22518 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
22519 struct hwrm_port_phy_qcaps_input {
22520         /* The HWRM command request type. */
22521         uint16_t        req_type;
22522         /*
22523          * The completion ring to send the completion event on. This should
22524          * be the NQ ID returned from the `nq_alloc` HWRM command.
22525          */
22526         uint16_t        cmpl_ring;
22527         /*
22528          * The sequence ID is used by the driver for tracking multiple
22529          * commands. This ID is treated as opaque data by the firmware and
22530          * the value is returned in the `hwrm_resp_hdr` upon completion.
22531          */
22532         uint16_t        seq_id;
22533         /*
22534          * The target ID of the command:
22535          * * 0x0-0xFFF8 - The function ID
22536          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22537          * * 0xFFFD - Reserved for user-space HWRM interface
22538          * * 0xFFFF - HWRM
22539          */
22540         uint16_t        target_id;
22541         /*
22542          * A physical address pointer pointing to a host buffer that the
22543          * command's response data will be written. This can be either a host
22544          * physical address (HPA) or a guest physical address (GPA) and must
22545          * point to a physically contiguous block of memory.
22546          */
22547         uint64_t        resp_addr;
22548         /* Port ID of port that is being queried. */
22549         uint16_t        port_id;
22550         uint8_t unused_0[6];
22551 } __rte_packed;
22552
22553 /* hwrm_port_phy_qcaps_output (size:256b/32B) */
22554 struct hwrm_port_phy_qcaps_output {
22555         /* The specific error status for the command. */
22556         uint16_t        error_code;
22557         /* The HWRM command request type. */
22558         uint16_t        req_type;
22559         /* The sequence ID from the original command. */
22560         uint16_t        seq_id;
22561         /* The length of the response data in number of bytes. */
22562         uint16_t        resp_len;
22563         /* PHY capability flags */
22564         uint8_t flags;
22565         /*
22566          * If set to 1, then this field indicates that the
22567          * link is capable of supporting EEE.
22568          */
22569         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED \
22570                 UINT32_C(0x1)
22571         /*
22572          * If set to 1, then this field indicates that the
22573          * PHY is capable of supporting external loopback.
22574          */
22575         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED \
22576                 UINT32_C(0x2)
22577         /*
22578          * If set to 1, then this field indicates that the
22579          * PHY is capable of supporting loopback in autoneg mode.
22580          */
22581         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_AUTONEG_LPBK_SUPPORTED \
22582                 UINT32_C(0x4)
22583         /*
22584          * Indicates if the configuration of shared PHY settings is supported.
22585          * In cases where a physical port is shared by multiple functions
22586          * (e.g. NPAR, multihost, etc), the configuration of PHY
22587          * settings may not be allowed. Callers to HWRM_PORT_PHY_CFG will
22588          * get an HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED error in this case.
22589          */
22590         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_SHARED_PHY_CFG_SUPPORTED \
22591                 UINT32_C(0x8)
22592         /*
22593          * If set to 1, it indicates that the port counters and extended
22594          * port counters will not reset when the firmware shuts down or
22595          * resets the PHY.  These counters will only be reset during power
22596          * cycle or by calling HWRM_PORT_CLR_STATS.
22597          * If set to 0, the state of the counters is unspecified when
22598          * firmware shuts down or resets the PHY.
22599          */
22600         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_CUMULATIVE_COUNTERS_ON_RESET \
22601                 UINT32_C(0x10)
22602         /*
22603          * If set to 1, then this field indicates that the
22604          * local loopback is not supported on this controller.
22605          */
22606         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_LOCAL_LPBK_NOT_SUPPORTED \
22607                 UINT32_C(0x20)
22608         /*
22609          * If set to 1, then this field indicates that the
22610          * PHY/Link down policy during PF shutdown is totally
22611          * controlled by the firmware. It can shutdown the link
22612          * even when there are active VFs associated with the PF.
22613          * Host PF driver can send HWRM_PHY_CFG command to bring
22614          * down the PHY even when the port is shared between VFs
22615          * and PFs.
22616          */
22617         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_FW_MANAGED_LINK_DOWN \
22618                 UINT32_C(0x40)
22619         /*
22620          * If set to 1, this field indicates that the FCS may
22621          * be disabled for a given packet via the transmit
22622          * buffer descriptor.
22623          */
22624         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_NO_FCS \
22625                 UINT32_C(0x80)
22626         /* Number of front panel ports for this device. */
22627         uint8_t port_cnt;
22628         /* Not supported or unknown */
22629         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
22630         /* single port device */
22631         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1       UINT32_C(0x1)
22632         /* 2-port device */
22633         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2       UINT32_C(0x2)
22634         /* 3-port device */
22635         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3       UINT32_C(0x3)
22636         /* 4-port device */
22637         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4       UINT32_C(0x4)
22638         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST \
22639                 HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4
22640         /*
22641          * This is a bit mask to indicate what speeds are supported
22642          * as forced speeds on this link.
22643          * For each speed that can be forced on this link, the
22644          * corresponding mask bit shall be set to '1'.
22645          */
22646         uint16_t        supported_speeds_force_mode;
22647         /* 100Mb link speed (Half-duplex) */
22648         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD \
22649                 UINT32_C(0x1)
22650         /* 100Mb link speed (Full-duplex) */
22651         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB \
22652                 UINT32_C(0x2)
22653         /* 1Gb link speed (Half-duplex) */
22654         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD \
22655                 UINT32_C(0x4)
22656         /* 1Gb link speed (Full-duplex) */
22657         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB \
22658                 UINT32_C(0x8)
22659         /* 2Gb link speed */
22660         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB \
22661                 UINT32_C(0x10)
22662         /* 25Gb link speed */
22663         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB \
22664                 UINT32_C(0x20)
22665         /* 10Gb link speed */
22666         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB \
22667                 UINT32_C(0x40)
22668         /* 20Gb link speed */
22669         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB \
22670                 UINT32_C(0x80)
22671         /* 25Gb link speed */
22672         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB \
22673                 UINT32_C(0x100)
22674         /* 40Gb link speed */
22675         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB \
22676                 UINT32_C(0x200)
22677         /* 50Gb link speed */
22678         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB \
22679                 UINT32_C(0x400)
22680         /* 100Gb link speed */
22681         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB \
22682                 UINT32_C(0x800)
22683         /* 10Mb link speed (Half-duplex) */
22684         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD \
22685                 UINT32_C(0x1000)
22686         /* 10Mb link speed (Full-duplex) */
22687         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB \
22688                 UINT32_C(0x2000)
22689         /*
22690          * This is a bit mask to indicate what speeds are supported
22691          * for autonegotiation on this link.
22692          * For each speed that can be autonegotiated on this link, the
22693          * corresponding mask bit shall be set to '1'.
22694          */
22695         uint16_t        supported_speeds_auto_mode;
22696         /* 100Mb link speed (Half-duplex) */
22697         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD \
22698                 UINT32_C(0x1)
22699         /* 100Mb link speed (Full-duplex) */
22700         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB \
22701                 UINT32_C(0x2)
22702         /* 1Gb link speed (Half-duplex) */
22703         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD \
22704                 UINT32_C(0x4)
22705         /* 1Gb link speed (Full-duplex) */
22706         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB \
22707                 UINT32_C(0x8)
22708         /* 2Gb link speed */
22709         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB \
22710                 UINT32_C(0x10)
22711         /* 25Gb link speed */
22712         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB \
22713                 UINT32_C(0x20)
22714         /* 10Gb link speed */
22715         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB \
22716                 UINT32_C(0x40)
22717         /* 20Gb link speed */
22718         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB \
22719                 UINT32_C(0x80)
22720         /* 25Gb link speed */
22721         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB \
22722                 UINT32_C(0x100)
22723         /* 40Gb link speed */
22724         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB \
22725                 UINT32_C(0x200)
22726         /* 50Gb link speed */
22727         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB \
22728                 UINT32_C(0x400)
22729         /* 100Gb link speed */
22730         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB \
22731                 UINT32_C(0x800)
22732         /* 10Mb link speed (Half-duplex) */
22733         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD \
22734                 UINT32_C(0x1000)
22735         /* 10Mb link speed (Full-duplex) */
22736         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB \
22737                 UINT32_C(0x2000)
22738         /*
22739          * This is a bit mask to indicate what speeds are supported
22740          * for EEE on this link.
22741          * For each speed that can be autonegotiated when EEE is enabled
22742          * on this link, the corresponding mask bit shall be set to '1'.
22743          * This field is only valid when the eee_suppotred is set to '1'.
22744          */
22745         uint16_t        supported_speeds_eee_mode;
22746         /* Reserved */
22747         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 \
22748                 UINT32_C(0x1)
22749         /* 100Mb link speed (Full-duplex) */
22750         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB \
22751                 UINT32_C(0x2)
22752         /* Reserved */
22753         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 \
22754                 UINT32_C(0x4)
22755         /* 1Gb link speed (Full-duplex) */
22756         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB \
22757                 UINT32_C(0x8)
22758         /* Reserved */
22759         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 \
22760                 UINT32_C(0x10)
22761         /* Reserved */
22762         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 \
22763                 UINT32_C(0x20)
22764         /* 10Gb link speed */
22765         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB \
22766                 UINT32_C(0x40)
22767         uint32_t        tx_lpi_timer_low;
22768         /*
22769          * The lowest value of TX LPI timer that can be set on this link
22770          * when EEE is enabled. This value is in microseconds.
22771          * This field is valid only when_eee_supported is set to '1'.
22772          */
22773         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK \
22774                 UINT32_C(0xffffff)
22775         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
22776         /*
22777          * Reserved field. The HWRM shall set this field to 0.
22778          * An HWRM client shall ignore this field.
22779          */
22780         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK \
22781                 UINT32_C(0xff000000)
22782         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT            24
22783         uint32_t        valid_tx_lpi_timer_high;
22784         /*
22785          * The highest value of TX LPI timer that can be set on this link
22786          * when EEE is enabled. This value is in microseconds.
22787          * This field is valid only when_eee_supported is set to '1'.
22788          */
22789         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK \
22790                 UINT32_C(0xffffff)
22791         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
22792         /*
22793          * Reserved field. The HWRM shall set this field to 0.
22794          * An HWRM client shall ignore this field.
22795          */
22796         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD_MASK \
22797                 UINT32_C(0xff000000)
22798         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD_SFT              24
22799         /*
22800          * This field is used to advertise which PAM4 speeds are supported
22801          * in auto mode.
22802          */
22803         uint16_t        supported_pam4_speeds_auto_mode;
22804         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_50G \
22805                 UINT32_C(0x1)
22806         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_100G \
22807                 UINT32_C(0x2)
22808         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_AUTO_MODE_200G \
22809                 UINT32_C(0x4)
22810         /*
22811          * This field is used to advertise which PAM4 speeds are supported
22812          * in forced mode.
22813          */
22814         uint16_t        supported_pam4_speeds_force_mode;
22815         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_50G \
22816                 UINT32_C(0x1)
22817         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_100G \
22818                 UINT32_C(0x2)
22819         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_200G \
22820                 UINT32_C(0x4)
22821         uint8_t unused_0[3];
22822         /*
22823          * This field is used in Output records to indicate that the output
22824          * is completely written to RAM.  This field should be read as '1'
22825          * to indicate that the output has been completely written.
22826          * When writing a command completion or response to an internal processor,
22827          * the order of writes has to be such that this field is written last.
22828          */
22829         uint8_t valid;
22830 } __rte_packed;
22831
22832 /****************************
22833  * hwrm_port_phy_mdio_write *
22834  ****************************/
22835
22836
22837 /* hwrm_port_phy_mdio_write_input (size:320b/40B) */
22838 struct hwrm_port_phy_mdio_write_input {
22839         /* The HWRM command request type. */
22840         uint16_t        req_type;
22841         /*
22842          * The completion ring to send the completion event on. This should
22843          * be the NQ ID returned from the `nq_alloc` HWRM command.
22844          */
22845         uint16_t        cmpl_ring;
22846         /*
22847          * The sequence ID is used by the driver for tracking multiple
22848          * commands. This ID is treated as opaque data by the firmware and
22849          * the value is returned in the `hwrm_resp_hdr` upon completion.
22850          */
22851         uint16_t        seq_id;
22852         /*
22853          * The target ID of the command:
22854          * * 0x0-0xFFF8 - The function ID
22855          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22856          * * 0xFFFD - Reserved for user-space HWRM interface
22857          * * 0xFFFF - HWRM
22858          */
22859         uint16_t        target_id;
22860         /*
22861          * A physical address pointer pointing to a host buffer that the
22862          * command's response data will be written. This can be either a host
22863          * physical address (HPA) or a guest physical address (GPA) and must
22864          * point to a physically contiguous block of memory.
22865          */
22866         uint64_t        resp_addr;
22867         /* Reserved for future use. */
22868         uint32_t        unused_0[2];
22869         /* Port ID of port. */
22870         uint16_t        port_id;
22871         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
22872         uint8_t phy_addr;
22873         /* 8-bit device address. */
22874         uint8_t dev_addr;
22875         /* 16-bit register address. */
22876         uint16_t        reg_addr;
22877         /* 16-bit register data. */
22878         uint16_t        reg_data;
22879         /*
22880          * When this bit is set to 1 a Clause 45 mdio access is done.
22881          * when this bit is set to 0 a Clause 22 mdio access is done.
22882          */
22883         uint8_t cl45_mdio;
22884         /*  */
22885         uint8_t unused_1[7];
22886 } __rte_packed;
22887
22888 /* hwrm_port_phy_mdio_write_output (size:128b/16B) */
22889 struct hwrm_port_phy_mdio_write_output {
22890         /* The specific error status for the command. */
22891         uint16_t        error_code;
22892         /* The HWRM command request type. */
22893         uint16_t        req_type;
22894         /* The sequence ID from the original command. */
22895         uint16_t        seq_id;
22896         /* The length of the response data in number of bytes. */
22897         uint16_t        resp_len;
22898         uint8_t unused_0[7];
22899         /*
22900          * This field is used in Output records to indicate that the output
22901          * is completely written to RAM.  This field should be read as '1'
22902          * to indicate that the output has been completely written.
22903          * When writing a command completion or response to an internal processor,
22904          * the order of writes has to be such that this field is written last.
22905          */
22906         uint8_t valid;
22907 } __rte_packed;
22908
22909 /***************************
22910  * hwrm_port_phy_mdio_read *
22911  ***************************/
22912
22913
22914 /* hwrm_port_phy_mdio_read_input (size:256b/32B) */
22915 struct hwrm_port_phy_mdio_read_input {
22916         /* The HWRM command request type. */
22917         uint16_t        req_type;
22918         /*
22919          * The completion ring to send the completion event on. This should
22920          * be the NQ ID returned from the `nq_alloc` HWRM command.
22921          */
22922         uint16_t        cmpl_ring;
22923         /*
22924          * The sequence ID is used by the driver for tracking multiple
22925          * commands. This ID is treated as opaque data by the firmware and
22926          * the value is returned in the `hwrm_resp_hdr` upon completion.
22927          */
22928         uint16_t        seq_id;
22929         /*
22930          * The target ID of the command:
22931          * * 0x0-0xFFF8 - The function ID
22932          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22933          * * 0xFFFD - Reserved for user-space HWRM interface
22934          * * 0xFFFF - HWRM
22935          */
22936         uint16_t        target_id;
22937         /*
22938          * A physical address pointer pointing to a host buffer that the
22939          * command's response data will be written. This can be either a host
22940          * physical address (HPA) or a guest physical address (GPA) and must
22941          * point to a physically contiguous block of memory.
22942          */
22943         uint64_t        resp_addr;
22944         /* Reserved for future use. */
22945         uint32_t        unused_0[2];
22946         /* Port ID of port. */
22947         uint16_t        port_id;
22948         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
22949         uint8_t phy_addr;
22950         /* 8-bit device address. */
22951         uint8_t dev_addr;
22952         /* 16-bit register address. */
22953         uint16_t        reg_addr;
22954         /*
22955          * When this bit is set to 1 a Clause 45 mdio access is done.
22956          * when this bit is set to 0 a Clause 22 mdio access is done.
22957          */
22958         uint8_t cl45_mdio;
22959         /*  */
22960         uint8_t unused_1;
22961 } __rte_packed;
22962
22963 /* hwrm_port_phy_mdio_read_output (size:128b/16B) */
22964 struct hwrm_port_phy_mdio_read_output {
22965         /* The specific error status for the command. */
22966         uint16_t        error_code;
22967         /* The HWRM command request type. */
22968         uint16_t        req_type;
22969         /* The sequence ID from the original command. */
22970         uint16_t        seq_id;
22971         /* The length of the response data in number of bytes. */
22972         uint16_t        resp_len;
22973         /* 16-bit register data. */
22974         uint16_t        reg_data;
22975         uint8_t unused_0[5];
22976         /*
22977          * This field is used in Output records to indicate that the output
22978          * is completely written to RAM.  This field should be read as '1'
22979          * to indicate that the output has been completely written.
22980          * When writing a command completion or response to an internal processor,
22981          * the order of writes has to be such that this field is written last.
22982          */
22983         uint8_t valid;
22984 } __rte_packed;
22985
22986 /*********************
22987  * hwrm_port_led_cfg *
22988  *********************/
22989
22990
22991 /* hwrm_port_led_cfg_input (size:512b/64B) */
22992 struct hwrm_port_led_cfg_input {
22993         /* The HWRM command request type. */
22994         uint16_t        req_type;
22995         /*
22996          * The completion ring to send the completion event on. This should
22997          * be the NQ ID returned from the `nq_alloc` HWRM command.
22998          */
22999         uint16_t        cmpl_ring;
23000         /*
23001          * The sequence ID is used by the driver for tracking multiple
23002          * commands. This ID is treated as opaque data by the firmware and
23003          * the value is returned in the `hwrm_resp_hdr` upon completion.
23004          */
23005         uint16_t        seq_id;
23006         /*
23007          * The target ID of the command:
23008          * * 0x0-0xFFF8 - The function ID
23009          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23010          * * 0xFFFD - Reserved for user-space HWRM interface
23011          * * 0xFFFF - HWRM
23012          */
23013         uint16_t        target_id;
23014         /*
23015          * A physical address pointer pointing to a host buffer that the
23016          * command's response data will be written. This can be either a host
23017          * physical address (HPA) or a guest physical address (GPA) and must
23018          * point to a physically contiguous block of memory.
23019          */
23020         uint64_t        resp_addr;
23021         uint32_t        enables;
23022         /*
23023          * This bit must be '1' for the led0_id field to be
23024          * configured.
23025          */
23026         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID \
23027                 UINT32_C(0x1)
23028         /*
23029          * This bit must be '1' for the led0_state field to be
23030          * configured.
23031          */
23032         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE \
23033                 UINT32_C(0x2)
23034         /*
23035          * This bit must be '1' for the led0_color field to be
23036          * configured.
23037          */
23038         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR \
23039                 UINT32_C(0x4)
23040         /*
23041          * This bit must be '1' for the led0_blink_on field to be
23042          * configured.
23043          */
23044         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON \
23045                 UINT32_C(0x8)
23046         /*
23047          * This bit must be '1' for the led0_blink_off field to be
23048          * configured.
23049          */
23050         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF \
23051                 UINT32_C(0x10)
23052         /*
23053          * This bit must be '1' for the led0_group_id field to be
23054          * configured.
23055          */
23056         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID \
23057                 UINT32_C(0x20)
23058         /*
23059          * This bit must be '1' for the led1_id field to be
23060          * configured.
23061          */
23062         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID \
23063                 UINT32_C(0x40)
23064         /*
23065          * This bit must be '1' for the led1_state field to be
23066          * configured.
23067          */
23068         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE \
23069                 UINT32_C(0x80)
23070         /*
23071          * This bit must be '1' for the led1_color field to be
23072          * configured.
23073          */
23074         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR \
23075                 UINT32_C(0x100)
23076         /*
23077          * This bit must be '1' for the led1_blink_on field to be
23078          * configured.
23079          */
23080         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON \
23081                 UINT32_C(0x200)
23082         /*
23083          * This bit must be '1' for the led1_blink_off field to be
23084          * configured.
23085          */
23086         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF \
23087                 UINT32_C(0x400)
23088         /*
23089          * This bit must be '1' for the led1_group_id field to be
23090          * configured.
23091          */
23092         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID \
23093                 UINT32_C(0x800)
23094         /*
23095          * This bit must be '1' for the led2_id field to be
23096          * configured.
23097          */
23098         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID \
23099                 UINT32_C(0x1000)
23100         /*
23101          * This bit must be '1' for the led2_state field to be
23102          * configured.
23103          */
23104         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE \
23105                 UINT32_C(0x2000)
23106         /*
23107          * This bit must be '1' for the led2_color field to be
23108          * configured.
23109          */
23110         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR \
23111                 UINT32_C(0x4000)
23112         /*
23113          * This bit must be '1' for the led2_blink_on field to be
23114          * configured.
23115          */
23116         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON \
23117                 UINT32_C(0x8000)
23118         /*
23119          * This bit must be '1' for the led2_blink_off field to be
23120          * configured.
23121          */
23122         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF \
23123                 UINT32_C(0x10000)
23124         /*
23125          * This bit must be '1' for the led2_group_id field to be
23126          * configured.
23127          */
23128         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID \
23129                 UINT32_C(0x20000)
23130         /*
23131          * This bit must be '1' for the led3_id field to be
23132          * configured.
23133          */
23134         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID \
23135                 UINT32_C(0x40000)
23136         /*
23137          * This bit must be '1' for the led3_state field to be
23138          * configured.
23139          */
23140         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE \
23141                 UINT32_C(0x80000)
23142         /*
23143          * This bit must be '1' for the led3_color field to be
23144          * configured.
23145          */
23146         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR \
23147                 UINT32_C(0x100000)
23148         /*
23149          * This bit must be '1' for the led3_blink_on field to be
23150          * configured.
23151          */
23152         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON \
23153                 UINT32_C(0x200000)
23154         /*
23155          * This bit must be '1' for the led3_blink_off field to be
23156          * configured.
23157          */
23158         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \
23159                 UINT32_C(0x400000)
23160         /*
23161          * This bit must be '1' for the led3_group_id field to be
23162          * configured.
23163          */
23164         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID \
23165                 UINT32_C(0x800000)
23166         /* Port ID of port whose LEDs are configured. */
23167         uint16_t        port_id;
23168         /*
23169          * The number of LEDs that are being configured.
23170          * Up to 4 LEDs can be configured with this command.
23171          */
23172         uint8_t num_leds;
23173         /* Reserved field. */
23174         uint8_t rsvd;
23175         /* An identifier for the LED #0. */
23176         uint8_t led0_id;
23177         /* The requested state of the LED #0. */
23178         uint8_t led0_state;
23179         /* Default state of the LED */
23180         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
23181         /* Off */
23182         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF      UINT32_C(0x1)
23183         /* On */
23184         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON       UINT32_C(0x2)
23185         /* Blink */
23186         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK    UINT32_C(0x3)
23187         /* Blink Alternately */
23188         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
23189         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST \
23190                 HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
23191         /* The requested color of LED #0. */
23192         uint8_t led0_color;
23193         /* Default */
23194         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
23195         /* Amber */
23196         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
23197         /* Green */
23198         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
23199         /* Green or Amber */
23200         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
23201         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST \
23202                 HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
23203         uint8_t unused_0;
23204         /*
23205          * If the LED #0 state is "blink" or "blinkalt", then
23206          * this field represents the requested time in milliseconds
23207          * to keep LED on between cycles.
23208          */
23209         uint16_t        led0_blink_on;
23210         /*
23211          * If the LED #0 state is "blink" or "blinkalt", then
23212          * this field represents the requested time in milliseconds
23213          * to keep LED off between cycles.
23214          */
23215         uint16_t        led0_blink_off;
23216         /*
23217          * An identifier for the group of LEDs that LED #0 belongs
23218          * to.
23219          * If set to 0, then the LED #0 shall not be grouped and
23220          * shall be treated as an individual resource.
23221          * For all other non-zero values of this field, LED #0 shall
23222          * be grouped together with the LEDs with the same group ID
23223          * value.
23224          */
23225         uint8_t led0_group_id;
23226         /* Reserved field. */
23227         uint8_t rsvd0;
23228         /* An identifier for the LED #1. */
23229         uint8_t led1_id;
23230         /* The requested state of the LED #1. */
23231         uint8_t led1_state;
23232         /* Default state of the LED */
23233         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
23234         /* Off */
23235         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF      UINT32_C(0x1)
23236         /* On */
23237         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON       UINT32_C(0x2)
23238         /* Blink */
23239         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK    UINT32_C(0x3)
23240         /* Blink Alternately */
23241         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
23242         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST \
23243                 HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
23244         /* The requested color of LED #1. */
23245         uint8_t led1_color;
23246         /* Default */
23247         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
23248         /* Amber */
23249         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
23250         /* Green */
23251         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
23252         /* Green or Amber */
23253         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
23254         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST \
23255                 HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
23256         uint8_t unused_1;
23257         /*
23258          * If the LED #1 state is "blink" or "blinkalt", then
23259          * this field represents the requested time in milliseconds
23260          * to keep LED on between cycles.
23261          */
23262         uint16_t        led1_blink_on;
23263         /*
23264          * If the LED #1 state is "blink" or "blinkalt", then
23265          * this field represents the requested time in milliseconds
23266          * to keep LED off between cycles.
23267          */
23268         uint16_t        led1_blink_off;
23269         /*
23270          * An identifier for the group of LEDs that LED #1 belongs
23271          * to.
23272          * If set to 0, then the LED #1 shall not be grouped and
23273          * shall be treated as an individual resource.
23274          * For all other non-zero values of this field, LED #1 shall
23275          * be grouped together with the LEDs with the same group ID
23276          * value.
23277          */
23278         uint8_t led1_group_id;
23279         /* Reserved field. */
23280         uint8_t rsvd1;
23281         /* An identifier for the LED #2. */
23282         uint8_t led2_id;
23283         /* The requested state of the LED #2. */
23284         uint8_t led2_state;
23285         /* Default state of the LED */
23286         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
23287         /* Off */
23288         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF      UINT32_C(0x1)
23289         /* On */
23290         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON       UINT32_C(0x2)
23291         /* Blink */
23292         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK    UINT32_C(0x3)
23293         /* Blink Alternately */
23294         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
23295         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST \
23296                 HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
23297         /* The requested color of LED #2. */
23298         uint8_t led2_color;
23299         /* Default */
23300         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
23301         /* Amber */
23302         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
23303         /* Green */
23304         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
23305         /* Green or Amber */
23306         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
23307         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST \
23308                 HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
23309         uint8_t unused_2;
23310         /*
23311          * If the LED #2 state is "blink" or "blinkalt", then
23312          * this field represents the requested time in milliseconds
23313          * to keep LED on between cycles.
23314          */
23315         uint16_t        led2_blink_on;
23316         /*
23317          * If the LED #2 state is "blink" or "blinkalt", then
23318          * this field represents the requested time in milliseconds
23319          * to keep LED off between cycles.
23320          */
23321         uint16_t        led2_blink_off;
23322         /*
23323          * An identifier for the group of LEDs that LED #2 belongs
23324          * to.
23325          * If set to 0, then the LED #2 shall not be grouped and
23326          * shall be treated as an individual resource.
23327          * For all other non-zero values of this field, LED #2 shall
23328          * be grouped together with the LEDs with the same group ID
23329          * value.
23330          */
23331         uint8_t led2_group_id;
23332         /* Reserved field. */
23333         uint8_t rsvd2;
23334         /* An identifier for the LED #3. */
23335         uint8_t led3_id;
23336         /* The requested state of the LED #3. */
23337         uint8_t led3_state;
23338         /* Default state of the LED */
23339         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
23340         /* Off */
23341         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF      UINT32_C(0x1)
23342         /* On */
23343         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON       UINT32_C(0x2)
23344         /* Blink */
23345         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK    UINT32_C(0x3)
23346         /* Blink Alternately */
23347         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
23348         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST \
23349                 HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
23350         /* The requested color of LED #3. */
23351         uint8_t led3_color;
23352         /* Default */
23353         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
23354         /* Amber */
23355         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
23356         /* Green */
23357         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
23358         /* Green or Amber */
23359         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
23360         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST \
23361                 HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
23362         uint8_t unused_3;
23363         /*
23364          * If the LED #3 state is "blink" or "blinkalt", then
23365          * this field represents the requested time in milliseconds
23366          * to keep LED on between cycles.
23367          */
23368         uint16_t        led3_blink_on;
23369         /*
23370          * If the LED #3 state is "blink" or "blinkalt", then
23371          * this field represents the requested time in milliseconds
23372          * to keep LED off between cycles.
23373          */
23374         uint16_t        led3_blink_off;
23375         /*
23376          * An identifier for the group of LEDs that LED #3 belongs
23377          * to.
23378          * If set to 0, then the LED #3 shall not be grouped and
23379          * shall be treated as an individual resource.
23380          * For all other non-zero values of this field, LED #3 shall
23381          * be grouped together with the LEDs with the same group ID
23382          * value.
23383          */
23384         uint8_t led3_group_id;
23385         /* Reserved field. */
23386         uint8_t rsvd3;
23387 } __rte_packed;
23388
23389 /* hwrm_port_led_cfg_output (size:128b/16B) */
23390 struct hwrm_port_led_cfg_output {
23391         /* The specific error status for the command. */
23392         uint16_t        error_code;
23393         /* The HWRM command request type. */
23394         uint16_t        req_type;
23395         /* The sequence ID from the original command. */
23396         uint16_t        seq_id;
23397         /* The length of the response data in number of bytes. */
23398         uint16_t        resp_len;
23399         uint8_t unused_0[7];
23400         /*
23401          * This field is used in Output records to indicate that the output
23402          * is completely written to RAM.  This field should be read as '1'
23403          * to indicate that the output has been completely written.
23404          * When writing a command completion or response to an internal processor,
23405          * the order of writes has to be such that this field is written last.
23406          */
23407         uint8_t valid;
23408 } __rte_packed;
23409
23410 /**********************
23411  * hwrm_port_led_qcfg *
23412  **********************/
23413
23414
23415 /* hwrm_port_led_qcfg_input (size:192b/24B) */
23416 struct hwrm_port_led_qcfg_input {
23417         /* The HWRM command request type. */
23418         uint16_t        req_type;
23419         /*
23420          * The completion ring to send the completion event on. This should
23421          * be the NQ ID returned from the `nq_alloc` HWRM command.
23422          */
23423         uint16_t        cmpl_ring;
23424         /*
23425          * The sequence ID is used by the driver for tracking multiple
23426          * commands. This ID is treated as opaque data by the firmware and
23427          * the value is returned in the `hwrm_resp_hdr` upon completion.
23428          */
23429         uint16_t        seq_id;
23430         /*
23431          * The target ID of the command:
23432          * * 0x0-0xFFF8 - The function ID
23433          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23434          * * 0xFFFD - Reserved for user-space HWRM interface
23435          * * 0xFFFF - HWRM
23436          */
23437         uint16_t        target_id;
23438         /*
23439          * A physical address pointer pointing to a host buffer that the
23440          * command's response data will be written. This can be either a host
23441          * physical address (HPA) or a guest physical address (GPA) and must
23442          * point to a physically contiguous block of memory.
23443          */
23444         uint64_t        resp_addr;
23445         /* Port ID of port whose LED configuration is being queried. */
23446         uint16_t        port_id;
23447         uint8_t unused_0[6];
23448 } __rte_packed;
23449
23450 /* hwrm_port_led_qcfg_output (size:448b/56B) */
23451 struct hwrm_port_led_qcfg_output {
23452         /* The specific error status for the command. */
23453         uint16_t        error_code;
23454         /* The HWRM command request type. */
23455         uint16_t        req_type;
23456         /* The sequence ID from the original command. */
23457         uint16_t        seq_id;
23458         /* The length of the response data in number of bytes. */
23459         uint16_t        resp_len;
23460         /*
23461          * The number of LEDs that are configured on this port.
23462          * Up to 4 LEDs can be returned in the response.
23463          */
23464         uint8_t num_leds;
23465         /* An identifier for the LED #0. */
23466         uint8_t led0_id;
23467         /* The type of LED #0. */
23468         uint8_t led0_type;
23469         /* Speed LED */
23470         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
23471         /* Activity LED */
23472         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
23473         /* Invalid */
23474         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
23475         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST \
23476                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
23477         /* The current state of the LED #0. */
23478         uint8_t led0_state;
23479         /* Default state of the LED */
23480         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
23481         /* Off */
23482         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF      UINT32_C(0x1)
23483         /* On */
23484         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON       UINT32_C(0x2)
23485         /* Blink */
23486         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK    UINT32_C(0x3)
23487         /* Blink Alternately */
23488         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
23489         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST \
23490                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
23491         /* The color of LED #0. */
23492         uint8_t led0_color;
23493         /* Default */
23494         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
23495         /* Amber */
23496         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
23497         /* Green */
23498         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
23499         /* Green or Amber */
23500         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
23501         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST \
23502                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
23503         uint8_t unused_0;
23504         /*
23505          * If the LED #0 state is "blink" or "blinkalt", then
23506          * this field represents the requested time in milliseconds
23507          * to keep LED on between cycles.
23508          */
23509         uint16_t        led0_blink_on;
23510         /*
23511          * If the LED #0 state is "blink" or "blinkalt", then
23512          * this field represents the requested time in milliseconds
23513          * to keep LED off between cycles.
23514          */
23515         uint16_t        led0_blink_off;
23516         /*
23517          * An identifier for the group of LEDs that LED #0 belongs
23518          * to.
23519          * If set to 0, then the LED #0 is not grouped.
23520          * For all other non-zero values of this field, LED #0 is
23521          * grouped together with the LEDs with the same group ID
23522          * value.
23523          */
23524         uint8_t led0_group_id;
23525         /* An identifier for the LED #1. */
23526         uint8_t led1_id;
23527         /* The type of LED #1. */
23528         uint8_t led1_type;
23529         /* Speed LED */
23530         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
23531         /* Activity LED */
23532         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
23533         /* Invalid */
23534         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
23535         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST \
23536                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
23537         /* The current state of the LED #1. */
23538         uint8_t led1_state;
23539         /* Default state of the LED */
23540         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
23541         /* Off */
23542         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF      UINT32_C(0x1)
23543         /* On */
23544         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON       UINT32_C(0x2)
23545         /* Blink */
23546         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK    UINT32_C(0x3)
23547         /* Blink Alternately */
23548         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
23549         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST \
23550                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
23551         /* The color of LED #1. */
23552         uint8_t led1_color;
23553         /* Default */
23554         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
23555         /* Amber */
23556         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
23557         /* Green */
23558         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
23559         /* Green or Amber */
23560         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
23561         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST \
23562                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
23563         uint8_t unused_1;
23564         /*
23565          * If the LED #1 state is "blink" or "blinkalt", then
23566          * this field represents the requested time in milliseconds
23567          * to keep LED on between cycles.
23568          */
23569         uint16_t        led1_blink_on;
23570         /*
23571          * If the LED #1 state is "blink" or "blinkalt", then
23572          * this field represents the requested time in milliseconds
23573          * to keep LED off between cycles.
23574          */
23575         uint16_t        led1_blink_off;
23576         /*
23577          * An identifier for the group of LEDs that LED #1 belongs
23578          * to.
23579          * If set to 0, then the LED #1 is not grouped.
23580          * For all other non-zero values of this field, LED #1 is
23581          * grouped together with the LEDs with the same group ID
23582          * value.
23583          */
23584         uint8_t led1_group_id;
23585         /* An identifier for the LED #2. */
23586         uint8_t led2_id;
23587         /* The type of LED #2. */
23588         uint8_t led2_type;
23589         /* Speed LED */
23590         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
23591         /* Activity LED */
23592         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
23593         /* Invalid */
23594         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
23595         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST \
23596                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
23597         /* The current state of the LED #2. */
23598         uint8_t led2_state;
23599         /* Default state of the LED */
23600         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
23601         /* Off */
23602         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF      UINT32_C(0x1)
23603         /* On */
23604         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON       UINT32_C(0x2)
23605         /* Blink */
23606         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK    UINT32_C(0x3)
23607         /* Blink Alternately */
23608         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
23609         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST \
23610                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
23611         /* The color of LED #2. */
23612         uint8_t led2_color;
23613         /* Default */
23614         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
23615         /* Amber */
23616         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
23617         /* Green */
23618         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
23619         /* Green or Amber */
23620         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
23621         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST \
23622                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
23623         uint8_t unused_2;
23624         /*
23625          * If the LED #2 state is "blink" or "blinkalt", then
23626          * this field represents the requested time in milliseconds
23627          * to keep LED on between cycles.
23628          */
23629         uint16_t        led2_blink_on;
23630         /*
23631          * If the LED #2 state is "blink" or "blinkalt", then
23632          * this field represents the requested time in milliseconds
23633          * to keep LED off between cycles.
23634          */
23635         uint16_t        led2_blink_off;
23636         /*
23637          * An identifier for the group of LEDs that LED #2 belongs
23638          * to.
23639          * If set to 0, then the LED #2 is not grouped.
23640          * For all other non-zero values of this field, LED #2 is
23641          * grouped together with the LEDs with the same group ID
23642          * value.
23643          */
23644         uint8_t led2_group_id;
23645         /* An identifier for the LED #3. */
23646         uint8_t led3_id;
23647         /* The type of LED #3. */
23648         uint8_t led3_type;
23649         /* Speed LED */
23650         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
23651         /* Activity LED */
23652         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
23653         /* Invalid */
23654         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
23655         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST \
23656                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
23657         /* The current state of the LED #3. */
23658         uint8_t led3_state;
23659         /* Default state of the LED */
23660         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
23661         /* Off */
23662         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF      UINT32_C(0x1)
23663         /* On */
23664         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON       UINT32_C(0x2)
23665         /* Blink */
23666         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK    UINT32_C(0x3)
23667         /* Blink Alternately */
23668         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
23669         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST \
23670                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
23671         /* The color of LED #3. */
23672         uint8_t led3_color;
23673         /* Default */
23674         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
23675         /* Amber */
23676         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
23677         /* Green */
23678         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
23679         /* Green or Amber */
23680         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
23681         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST \
23682                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
23683         uint8_t unused_3;
23684         /*
23685          * If the LED #3 state is "blink" or "blinkalt", then
23686          * this field represents the requested time in milliseconds
23687          * to keep LED on between cycles.
23688          */
23689         uint16_t        led3_blink_on;
23690         /*
23691          * If the LED #3 state is "blink" or "blinkalt", then
23692          * this field represents the requested time in milliseconds
23693          * to keep LED off between cycles.
23694          */
23695         uint16_t        led3_blink_off;
23696         /*
23697          * An identifier for the group of LEDs that LED #3 belongs
23698          * to.
23699          * If set to 0, then the LED #3 is not grouped.
23700          * For all other non-zero values of this field, LED #3 is
23701          * grouped together with the LEDs with the same group ID
23702          * value.
23703          */
23704         uint8_t led3_group_id;
23705         uint8_t unused_4[6];
23706         /*
23707          * This field is used in Output records to indicate that the output
23708          * is completely written to RAM.  This field should be read as '1'
23709          * to indicate that the output has been completely written.
23710          * When writing a command completion or response to an internal processor,
23711          * the order of writes has to be such that this field is written last.
23712          */
23713         uint8_t valid;
23714 } __rte_packed;
23715
23716 /***********************
23717  * hwrm_port_led_qcaps *
23718  ***********************/
23719
23720
23721 /* hwrm_port_led_qcaps_input (size:192b/24B) */
23722 struct hwrm_port_led_qcaps_input {
23723         /* The HWRM command request type. */
23724         uint16_t        req_type;
23725         /*
23726          * The completion ring to send the completion event on. This should
23727          * be the NQ ID returned from the `nq_alloc` HWRM command.
23728          */
23729         uint16_t        cmpl_ring;
23730         /*
23731          * The sequence ID is used by the driver for tracking multiple
23732          * commands. This ID is treated as opaque data by the firmware and
23733          * the value is returned in the `hwrm_resp_hdr` upon completion.
23734          */
23735         uint16_t        seq_id;
23736         /*
23737          * The target ID of the command:
23738          * * 0x0-0xFFF8 - The function ID
23739          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23740          * * 0xFFFD - Reserved for user-space HWRM interface
23741          * * 0xFFFF - HWRM
23742          */
23743         uint16_t        target_id;
23744         /*
23745          * A physical address pointer pointing to a host buffer that the
23746          * command's response data will be written. This can be either a host
23747          * physical address (HPA) or a guest physical address (GPA) and must
23748          * point to a physically contiguous block of memory.
23749          */
23750         uint64_t        resp_addr;
23751         /* Port ID of port whose LED configuration is being queried. */
23752         uint16_t        port_id;
23753         uint8_t unused_0[6];
23754 } __rte_packed;
23755
23756 /* hwrm_port_led_qcaps_output (size:384b/48B) */
23757 struct hwrm_port_led_qcaps_output {
23758         /* The specific error status for the command. */
23759         uint16_t        error_code;
23760         /* The HWRM command request type. */
23761         uint16_t        req_type;
23762         /* The sequence ID from the original command. */
23763         uint16_t        seq_id;
23764         /* The length of the response data in number of bytes. */
23765         uint16_t        resp_len;
23766         /*
23767          * The number of LEDs that are configured on this port.
23768          * Up to 4 LEDs can be returned in the response.
23769          */
23770         uint8_t num_leds;
23771         /* Reserved for future use. */
23772         uint8_t unused[3];
23773         /* An identifier for the LED #0. */
23774         uint8_t led0_id;
23775         /* The type of LED #0. */
23776         uint8_t led0_type;
23777         /* Speed LED */
23778         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
23779         /* Activity LED */
23780         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
23781         /* Invalid */
23782         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
23783         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST \
23784                 HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
23785         /*
23786          * An identifier for the group of LEDs that LED #0 belongs
23787          * to.
23788          * If set to 0, then the LED #0 cannot be grouped.
23789          * For all other non-zero values of this field, LED #0 is
23790          * grouped together with the LEDs with the same group ID
23791          * value.
23792          */
23793         uint8_t led0_group_id;
23794         uint8_t unused_0;
23795         /* The states supported by LED #0. */
23796         uint16_t        led0_state_caps;
23797         /*
23798          * If set to 1, this LED is enabled.
23799          * If set to 0, this LED is disabled.
23800          */
23801         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED \
23802                 UINT32_C(0x1)
23803         /*
23804          * If set to 1, off state is supported on this LED.
23805          * If set to 0, off state is not supported on this LED.
23806          */
23807         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \
23808                 UINT32_C(0x2)
23809         /*
23810          * If set to 1, on state is supported on this LED.
23811          * If set to 0, on state is not supported on this LED.
23812          */
23813         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \
23814                 UINT32_C(0x4)
23815         /*
23816          * If set to 1, blink state is supported on this LED.
23817          * If set to 0, blink state is not supported on this LED.
23818          */
23819         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \
23820                 UINT32_C(0x8)
23821         /*
23822          * If set to 1, blink_alt state is supported on this LED.
23823          * If set to 0, blink_alt state is not supported on this LED.
23824          */
23825         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \
23826                 UINT32_C(0x10)
23827         /* The colors supported by LED #0. */
23828         uint16_t        led0_color_caps;
23829         /* reserved. */
23830         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD \
23831                 UINT32_C(0x1)
23832         /*
23833          * If set to 1, Amber color is supported on this LED.
23834          * If set to 0, Amber color is not supported on this LED.
23835          */
23836         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \
23837                 UINT32_C(0x2)
23838         /*
23839          * If set to 1, Green color is supported on this LED.
23840          * If set to 0, Green color is not supported on this LED.
23841          */
23842         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \
23843                 UINT32_C(0x4)
23844         /* An identifier for the LED #1. */
23845         uint8_t led1_id;
23846         /* The type of LED #1. */
23847         uint8_t led1_type;
23848         /* Speed LED */
23849         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
23850         /* Activity LED */
23851         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
23852         /* Invalid */
23853         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
23854         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST \
23855                 HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
23856         /*
23857          * An identifier for the group of LEDs that LED #1 belongs
23858          * to.
23859          * If set to 0, then the LED #0 cannot be grouped.
23860          * For all other non-zero values of this field, LED #0 is
23861          * grouped together with the LEDs with the same group ID
23862          * value.
23863          */
23864         uint8_t led1_group_id;
23865         uint8_t unused_1;
23866         /* The states supported by LED #1. */
23867         uint16_t        led1_state_caps;
23868         /*
23869          * If set to 1, this LED is enabled.
23870          * If set to 0, this LED is disabled.
23871          */
23872         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED \
23873                 UINT32_C(0x1)
23874         /*
23875          * If set to 1, off state is supported on this LED.
23876          * If set to 0, off state is not supported on this LED.
23877          */
23878         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \
23879                 UINT32_C(0x2)
23880         /*
23881          * If set to 1, on state is supported on this LED.
23882          * If set to 0, on state is not supported on this LED.
23883          */
23884         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \
23885                 UINT32_C(0x4)
23886         /*
23887          * If set to 1, blink state is supported on this LED.
23888          * If set to 0, blink state is not supported on this LED.
23889          */
23890         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \
23891                 UINT32_C(0x8)
23892         /*
23893          * If set to 1, blink_alt state is supported on this LED.
23894          * If set to 0, blink_alt state is not supported on this LED.
23895          */
23896         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \
23897                 UINT32_C(0x10)
23898         /* The colors supported by LED #1. */
23899         uint16_t        led1_color_caps;
23900         /* reserved. */
23901         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD \
23902                 UINT32_C(0x1)
23903         /*
23904          * If set to 1, Amber color is supported on this LED.
23905          * If set to 0, Amber color is not supported on this LED.
23906          */
23907         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \
23908                 UINT32_C(0x2)
23909         /*
23910          * If set to 1, Green color is supported on this LED.
23911          * If set to 0, Green color is not supported on this LED.
23912          */
23913         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \
23914                 UINT32_C(0x4)
23915         /* An identifier for the LED #2. */
23916         uint8_t led2_id;
23917         /* The type of LED #2. */
23918         uint8_t led2_type;
23919         /* Speed LED */
23920         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
23921         /* Activity LED */
23922         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
23923         /* Invalid */
23924         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
23925         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST \
23926                 HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
23927         /*
23928          * An identifier for the group of LEDs that LED #0 belongs
23929          * to.
23930          * If set to 0, then the LED #0 cannot be grouped.
23931          * For all other non-zero values of this field, LED #0 is
23932          * grouped together with the LEDs with the same group ID
23933          * value.
23934          */
23935         uint8_t led2_group_id;
23936         uint8_t unused_2;
23937         /* The states supported by LED #2. */
23938         uint16_t        led2_state_caps;
23939         /*
23940          * If set to 1, this LED is enabled.
23941          * If set to 0, this LED is disabled.
23942          */
23943         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED \
23944                 UINT32_C(0x1)
23945         /*
23946          * If set to 1, off state is supported on this LED.
23947          * If set to 0, off state is not supported on this LED.
23948          */
23949         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \
23950                 UINT32_C(0x2)
23951         /*
23952          * If set to 1, on state is supported on this LED.
23953          * If set to 0, on state is not supported on this LED.
23954          */
23955         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \
23956                 UINT32_C(0x4)
23957         /*
23958          * If set to 1, blink state is supported on this LED.
23959          * If set to 0, blink state is not supported on this LED.
23960          */
23961         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \
23962                 UINT32_C(0x8)
23963         /*
23964          * If set to 1, blink_alt state is supported on this LED.
23965          * If set to 0, blink_alt state is not supported on this LED.
23966          */
23967         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \
23968                 UINT32_C(0x10)
23969         /* The colors supported by LED #2. */
23970         uint16_t        led2_color_caps;
23971         /* reserved. */
23972         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD \
23973                 UINT32_C(0x1)
23974         /*
23975          * If set to 1, Amber color is supported on this LED.
23976          * If set to 0, Amber color is not supported on this LED.
23977          */
23978         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \
23979                 UINT32_C(0x2)
23980         /*
23981          * If set to 1, Green color is supported on this LED.
23982          * If set to 0, Green color is not supported on this LED.
23983          */
23984         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \
23985                 UINT32_C(0x4)
23986         /* An identifier for the LED #3. */
23987         uint8_t led3_id;
23988         /* The type of LED #3. */
23989         uint8_t led3_type;
23990         /* Speed LED */
23991         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
23992         /* Activity LED */
23993         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
23994         /* Invalid */
23995         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
23996         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST \
23997                 HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
23998         /*
23999          * An identifier for the group of LEDs that LED #3 belongs
24000          * to.
24001          * If set to 0, then the LED #0 cannot be grouped.
24002          * For all other non-zero values of this field, LED #0 is
24003          * grouped together with the LEDs with the same group ID
24004          * value.
24005          */
24006         uint8_t led3_group_id;
24007         uint8_t unused_3;
24008         /* The states supported by LED #3. */
24009         uint16_t        led3_state_caps;
24010         /*
24011          * If set to 1, this LED is enabled.
24012          * If set to 0, this LED is disabled.
24013          */
24014         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED \
24015                 UINT32_C(0x1)
24016         /*
24017          * If set to 1, off state is supported on this LED.
24018          * If set to 0, off state is not supported on this LED.
24019          */
24020         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \
24021                 UINT32_C(0x2)
24022         /*
24023          * If set to 1, on state is supported on this LED.
24024          * If set to 0, on state is not supported on this LED.
24025          */
24026         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \
24027                 UINT32_C(0x4)
24028         /*
24029          * If set to 1, blink state is supported on this LED.
24030          * If set to 0, blink state is not supported on this LED.
24031          */
24032         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \
24033                 UINT32_C(0x8)
24034         /*
24035          * If set to 1, blink_alt state is supported on this LED.
24036          * If set to 0, blink_alt state is not supported on this LED.
24037          */
24038         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \
24039                 UINT32_C(0x10)
24040         /* The colors supported by LED #3. */
24041         uint16_t        led3_color_caps;
24042         /* reserved. */
24043         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD \
24044                 UINT32_C(0x1)
24045         /*
24046          * If set to 1, Amber color is supported on this LED.
24047          * If set to 0, Amber color is not supported on this LED.
24048          */
24049         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \
24050                 UINT32_C(0x2)
24051         /*
24052          * If set to 1, Green color is supported on this LED.
24053          * If set to 0, Green color is not supported on this LED.
24054          */
24055         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \
24056                 UINT32_C(0x4)
24057         uint8_t unused_4[3];
24058         /*
24059          * This field is used in Output records to indicate that the output
24060          * is completely written to RAM.  This field should be read as '1'
24061          * to indicate that the output has been completely written.
24062          * When writing a command completion or response to an internal processor,
24063          * the order of writes has to be such that this field is written last.
24064          */
24065         uint8_t valid;
24066 } __rte_packed;
24067
24068 /***********************
24069  * hwrm_port_prbs_test *
24070  ***********************/
24071
24072
24073 /* hwrm_port_prbs_test_input (size:384b/48B) */
24074 struct hwrm_port_prbs_test_input {
24075         /* The HWRM command request type. */
24076         uint16_t        req_type;
24077         /*
24078          * The completion ring to send the completion event on. This should
24079          * be the NQ ID returned from the `nq_alloc` HWRM command.
24080          */
24081         uint16_t        cmpl_ring;
24082         /*
24083          * The sequence ID is used by the driver for tracking multiple
24084          * commands. This ID is treated as opaque data by the firmware and
24085          * the value is returned in the `hwrm_resp_hdr` upon completion.
24086          */
24087         uint16_t        seq_id;
24088         /*
24089          * The target ID of the command:
24090          * * 0x0-0xFFF8 - The function ID
24091          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24092          * * 0xFFFD - Reserved for user-space HWRM interface
24093          * * 0xFFFF - HWRM
24094          */
24095         uint16_t        target_id;
24096         /*
24097          * A physical address pointer pointing to a host buffer that the
24098          * command's response data will be written. This can be either a host
24099          * physical address (HPA) or a guest physical address (GPA) and must
24100          * point to a physically contiguous block of memory.
24101          */
24102         uint64_t        resp_addr;
24103         /* Host address data is to DMA'd to. */
24104         uint64_t        resp_data_addr;
24105         /*
24106          * Size of the buffer pointed to by resp_data_addr. The firmware may
24107          * use this entire buffer or less than the entire buffer, but never more.
24108          */
24109         uint16_t        data_len;
24110         uint16_t        unused_0;
24111         uint32_t        unused_1;
24112         /* Port ID of port where PRBS test to be run. */
24113         uint16_t        port_id;
24114         /* Polynomial selection for PRBS test. */
24115         uint16_t        poly;
24116         /* PRBS7 */
24117         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS7   UINT32_C(0x0)
24118         /* PRBS9 */
24119         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS9   UINT32_C(0x1)
24120         /* PRBS11 */
24121         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS11  UINT32_C(0x2)
24122         /* PRBS15 */
24123         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS15  UINT32_C(0x3)
24124         /* PRBS23 */
24125         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS23  UINT32_C(0x4)
24126         /* PRBS31 */
24127         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS31  UINT32_C(0x5)
24128         /* PRBS58 */
24129         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS58  UINT32_C(0x6)
24130         /* Invalid */
24131         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID UINT32_C(0xff)
24132         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_LAST \
24133                 HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID
24134         /*
24135          * Configuration bits for PRBS test.
24136          * Use enable bit to start/stop test.
24137          * Use tx/rx lane map bits to run test on specific lanes,
24138          * if set to 0 test will be run on all lanes.
24139          */
24140         uint16_t        prbs_config;
24141         /*
24142          * Set 0 to stop test currently in progress
24143          * Set 1 to start test with configuration provided.
24144          */
24145         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_START_STOP \
24146                 UINT32_C(0x1)
24147         /*
24148          * If set to 1, tx_lane_map bitmap should have lane bits set.
24149          * If set to 0, test will be run on all lanes for this port.
24150          */
24151         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_TX_LANE_MAP_VALID \
24152                 UINT32_C(0x2)
24153         /*
24154          * If set to 1, rx_lane_map bitmap should have lane bits set.
24155          * If set to 0, test will be run on all lanes for this port.
24156          */
24157         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_RX_LANE_MAP_VALID \
24158                 UINT32_C(0x4)
24159         /* Duration in seconds to run the PRBS test. */
24160         uint16_t        timeout;
24161         /*
24162          * If tx_lane_map_valid is set to 1, this field is a bitmap
24163          * of tx lanes to run PRBS test. bit0 = lane0,
24164          * bit1 = lane1 ..bit31 = lane31
24165          */
24166         uint32_t        tx_lane_map;
24167         /*
24168          * If rx_lane_map_valid is set to 1, this field is a bitmap
24169          * of rx lanes to run PRBS test. bit0 = lane0,
24170          * bit1 = lane1 ..bit31 = lane31
24171          */
24172         uint32_t        rx_lane_map;
24173 } __rte_packed;
24174
24175 /* hwrm_port_prbs_test_output (size:128b/16B) */
24176 struct hwrm_port_prbs_test_output {
24177         /* The specific error status for the command. */
24178         uint16_t        error_code;
24179         /* The HWRM command request type. */
24180         uint16_t        req_type;
24181         /* The sequence ID from the original command. */
24182         uint16_t        seq_id;
24183         /* The length of the response data in number of bytes. */
24184         uint16_t        resp_len;
24185         /* Total length of stored data. */
24186         uint16_t        total_data_len;
24187         uint16_t        unused_0;
24188         uint8_t unused_1[3];
24189         /*
24190          * This field is used in Output records to indicate that the output
24191          * is completely written to RAM.  This field should be read as '1'
24192          * to indicate that the output has been completely written.
24193          * When writing a command completion or response to an internal processor,
24194          * the order of writes has to be such that this field is written last.
24195          */
24196         uint8_t valid;
24197 } __rte_packed;
24198
24199 /**********************
24200  * hwrm_port_dsc_dump *
24201  **********************/
24202
24203
24204 /* hwrm_port_dsc_dump_input (size:320b/40B) */
24205 struct hwrm_port_dsc_dump_input {
24206         /* The HWRM command request type. */
24207         uint16_t        req_type;
24208         /*
24209          * The completion ring to send the completion event on. This should
24210          * be the NQ ID returned from the `nq_alloc` HWRM command.
24211          */
24212         uint16_t        cmpl_ring;
24213         /*
24214          * The sequence ID is used by the driver for tracking multiple
24215          * commands. This ID is treated as opaque data by the firmware and
24216          * the value is returned in the `hwrm_resp_hdr` upon completion.
24217          */
24218         uint16_t        seq_id;
24219         /*
24220          * The target ID of the command:
24221          * * 0x0-0xFFF8 - The function ID
24222          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24223          * * 0xFFFD - Reserved for user-space HWRM interface
24224          * * 0xFFFF - HWRM
24225          */
24226         uint16_t        target_id;
24227         /*
24228          * A physical address pointer pointing to a host buffer that the
24229          * command's response data will be written. This can be either a host
24230          * physical address (HPA) or a guest physical address (GPA) and must
24231          * point to a physically contiguous block of memory.
24232          */
24233         uint64_t        resp_addr;
24234         /* Host address where response diagnostic data is returned. */
24235         uint64_t        resp_data_addr;
24236         /*
24237          * Size of the buffer pointed to by resp_data_addr. The firmware
24238          * may use this entire buffer or less than the entire buffer, but
24239          * never more.
24240          */
24241         uint16_t        data_len;
24242         uint16_t        unused_0;
24243         uint32_t        unused_1;
24244         /* Port ID of port where dsc dump to be collected. */
24245         uint16_t        port_id;
24246         /* Diag level specified by the user */
24247         uint16_t        diag_level;
24248         /* SRDS_DIAG_LANE */
24249         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE \
24250                 UINT32_C(0x0)
24251         /* SRDS_DIAG_CORE */
24252         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_CORE \
24253                 UINT32_C(0x1)
24254         /* SRDS_DIAG_EVENT */
24255         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT \
24256                 UINT32_C(0x2)
24257         /* SRDS_DIAG_EYE */
24258         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EYE \
24259                 UINT32_C(0x3)
24260         /* SRDS_DIAG_REG_CORE */
24261         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_CORE \
24262                 UINT32_C(0x4)
24263         /* SRDS_DIAG_REG_LANE */
24264         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_REG_LANE \
24265                 UINT32_C(0x5)
24266         /* SRDS_DIAG_UC_CORE */
24267         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_CORE \
24268                 UINT32_C(0x6)
24269         /* SRDS_DIAG_UC_LANE */
24270         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_UC_LANE \
24271                 UINT32_C(0x7)
24272         /* SRDS_DIAG_LANE_DEBUG */
24273         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_LANE_DEBUG \
24274                 UINT32_C(0x8)
24275         /* SRDS_DIAG_BER_VERT */
24276         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_VERT \
24277                 UINT32_C(0x9)
24278         /* SRDS_DIAG_BER_HORZ */
24279         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_BER_HORZ \
24280                 UINT32_C(0xa)
24281         /* SRDS_DIAG_EVENT_SAFE */
24282         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_EVENT_SAFE \
24283                 UINT32_C(0xb)
24284         /* SRDS_DIAG_TIMESTAMP */
24285         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP \
24286                 UINT32_C(0xc)
24287         #define HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_LAST \
24288                 HWRM_PORT_DSC_DUMP_INPUT_DIAG_LEVEL_SRDS_DIAG_TIMESTAMP
24289         /*
24290          * This field is a lane number
24291          * on which to collect the dsc dump
24292          */
24293         uint16_t        lane_number;
24294         /*
24295          * Configuration bits.
24296          * Use enable bit to start dsc dump or retrieve dump
24297          */
24298         uint16_t        dsc_dump_config;
24299         /*
24300          * Set 0 to retrieve the dsc dump
24301          * Set 1 to start the dsc dump
24302          */
24303         #define HWRM_PORT_DSC_DUMP_INPUT_DSC_DUMP_CONFIG_START_RETRIEVE \
24304                 UINT32_C(0x1)
24305 } __rte_packed;
24306
24307 /* hwrm_port_dsc_dump_output (size:128b/16B) */
24308 struct hwrm_port_dsc_dump_output {
24309         /* The specific error status for the command. */
24310         uint16_t        error_code;
24311         /* The HWRM command request type. */
24312         uint16_t        req_type;
24313         /* The sequence ID from the original command. */
24314         uint16_t        seq_id;
24315         /* The length of the response data in number of bytes. */
24316         uint16_t        resp_len;
24317         /* Total length of stored data. */
24318         uint16_t        total_data_len;
24319         uint16_t        unused_0;
24320         uint8_t unused_1[3];
24321         /*
24322          * This field is used in Output records to indicate that the output
24323          * is completely written to RAM.  This field should be read as '1'
24324          * to indicate that the output has been completely written.
24325          * When writing a command completion or response to an internal processor,
24326          * the order of writes has to be such that this field is written last.
24327          */
24328         uint8_t valid;
24329 } __rte_packed;
24330
24331 /******************************
24332  * hwrm_port_sfp_sideband_cfg *
24333  ******************************/
24334
24335
24336 /* hwrm_port_sfp_sideband_cfg_input (size:256b/32B) */
24337 struct hwrm_port_sfp_sideband_cfg_input {
24338         /* The HWRM command request type. */
24339         uint16_t        req_type;
24340         /*
24341          * The completion ring to send the completion event on. This should
24342          * be the NQ ID returned from the `nq_alloc` HWRM command.
24343          */
24344         uint16_t        cmpl_ring;
24345         /*
24346          * The sequence ID is used by the driver for tracking multiple
24347          * commands. This ID is treated as opaque data by the firmware and
24348          * the value is returned in the `hwrm_resp_hdr` upon completion.
24349          */
24350         uint16_t        seq_id;
24351         /*
24352          * The target ID of the command:
24353          * * 0x0-0xFFF8 - The function ID
24354          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24355          * * 0xFFFD - Reserved for user-space HWRM interface
24356          * * 0xFFFF - HWRM
24357          */
24358         uint16_t        target_id;
24359         /*
24360          * A physical address pointer pointing to a host buffer that the
24361          * command's response data will be written. This can be either a host
24362          * physical address (HPA) or a guest physical address (GPA) and must
24363          * point to a physically contiguous block of memory.
24364          */
24365         uint64_t        resp_addr;
24366         /* Port ID of port that is to be queried. */
24367         uint16_t        port_id;
24368         uint8_t unused_0[6];
24369         /*
24370          * This bitfield is used to specify which bits from the 'flags'
24371          * fields are being configured by the caller.
24372          */
24373         uint32_t        enables;
24374         /* This bit must be '1' for rs0 to be configured. */
24375         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS0 \
24376                 UINT32_C(0x1)
24377         /* This bit must be '1' for rs1 to be configured. */
24378         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RS1 \
24379                 UINT32_C(0x2)
24380         /* This bit must be '1' for tx_disable to be configured. */
24381         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_TX_DIS \
24382                 UINT32_C(0x4)
24383         /*
24384          * This bit must be '1' for mod_sel to be configured.
24385          * Valid only on QSFP modules
24386          */
24387         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_MOD_SEL \
24388                 UINT32_C(0x8)
24389         /* This bit must be '1' for reset_l to be configured. */
24390         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_RESET_L \
24391                 UINT32_C(0x10)
24392         /* This bit must be '1' for lp_mode to be configured. */
24393         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_LP_MODE \
24394                 UINT32_C(0x20)
24395         /* This bit must be '1' for pwr_disable to be configured. */
24396         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_ENABLES_PWR_DIS \
24397                 UINT32_C(0x40)
24398         /*
24399          * Only bits that have corresponding bits in the 'enables'
24400          * bitfield are processed by the firmware, all other bits
24401          * of 'flags' are ignored.
24402          */
24403         uint32_t        flags;
24404         /*
24405          * This bit along with rs1 configures the current speed of the dual
24406          * rate module. If these pins are GNDed then the speed can be changed
24407          * by driectly writing to EEPROM.
24408          */
24409         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS0 \
24410                 UINT32_C(0x1)
24411         /*
24412          * This bit along with rs0 configures the current speed of the dual
24413          * rate module. If these pins are GNDed then the speed can be changed
24414          * by driectly writing to EEPROM.
24415          */
24416         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RS1 \
24417                 UINT32_C(0x2)
24418         /*
24419          * When this bit is set to '1', tx_disable is set.
24420          * On a 1G BASE-T module, if this bit is set,
24421          * module PHY registers will not be accessible.
24422          */
24423         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_TX_DIS \
24424                 UINT32_C(0x4)
24425         /*
24426          * When this bit is set to '1', this module is selected.
24427          * Valid only on QSFP modules
24428          */
24429         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_MOD_SEL \
24430                 UINT32_C(0x8)
24431         /*
24432          * If reset_l is set to 0, Module will be taken out of reset
24433          * and other signals will be set to their requested state once
24434          * the module is out of reset.
24435          * Valid only on QSFP modules
24436          */
24437         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_RESET_L \
24438                 UINT32_C(0x10)
24439         /*
24440          * When this bit is set to '1', the module will be configured
24441          * in low power mode.
24442          * Valid only on QSFP modules
24443          */
24444         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_LP_MODE \
24445                 UINT32_C(0x20)
24446         /* When this bit is set to '1', the module will be powered down. */
24447         #define HWRM_PORT_SFP_SIDEBAND_CFG_INPUT_FLAGS_PWR_DIS \
24448                 UINT32_C(0x40)
24449 } __rte_packed;
24450
24451 /* hwrm_port_sfp_sideband_cfg_output (size:128b/16B) */
24452 struct hwrm_port_sfp_sideband_cfg_output {
24453         /* The specific error status for the command. */
24454         uint16_t        error_code;
24455         /* The HWRM command request type. */
24456         uint16_t        req_type;
24457         /* The sequence ID from the original command. */
24458         uint16_t        seq_id;
24459         /* The length of the response data in number of bytes. */
24460         uint16_t        resp_len;
24461         uint8_t unused[7];
24462         /*
24463          * This field is used in Output records to indicate that the output
24464          * is completely written to RAM.  This field should be read as '1'
24465          * to indicate that the output has been completely written. When
24466          * writing a command completion or response to an internal processor,
24467          * the order of writes has to be such that this field is written last.
24468          */
24469         uint8_t valid;
24470 } __rte_packed;
24471
24472 /*******************************
24473  * hwrm_port_sfp_sideband_qcfg *
24474  *******************************/
24475
24476
24477 /* hwrm_port_sfp_sideband_qcfg_input (size:192b/24B) */
24478 struct hwrm_port_sfp_sideband_qcfg_input {
24479         /* The HWRM command request type. */
24480         uint16_t        req_type;
24481         /*
24482          * The completion ring to send the completion event on. This should
24483          * be the NQ ID returned from the `nq_alloc` HWRM command.
24484          */
24485         uint16_t        cmpl_ring;
24486         /*
24487          * The sequence ID is used by the driver for tracking multiple
24488          * commands. This ID is treated as opaque data by the firmware and
24489          * the value is returned in the `hwrm_resp_hdr` upon completion.
24490          */
24491         uint16_t        seq_id;
24492         /*
24493          * The target ID of the command:
24494          * * 0x0-0xFFF8 - The function ID
24495          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24496          * * 0xFFFD - Reserved for user-space HWRM interface
24497          * * 0xFFFF - HWRM
24498          */
24499         uint16_t        target_id;
24500         /*
24501          * A physical address pointer pointing to a host buffer that the
24502          * command's response data will be written. This can be either a host
24503          * physical address (HPA) or a guest physical address (GPA) and must
24504          * point to a physically contiguous block of memory.
24505          */
24506         uint64_t        resp_addr;
24507         /* Port ID of port that is to be queried. */
24508         uint16_t        port_id;
24509         uint8_t unused_0[6];
24510 } __rte_packed;
24511
24512 /* hwrm_port_sfp_sideband_qcfg_output (size:192b/24B) */
24513 struct hwrm_port_sfp_sideband_qcfg_output {
24514         /* The specific error status for the command. */
24515         uint16_t        error_code;
24516         /* The HWRM command request type. */
24517         uint16_t        req_type;
24518         /* The sequence ID from the original command. */
24519         uint16_t        seq_id;
24520         /* The length of the response data in number of bytes. */
24521         uint16_t        resp_len;
24522         /*
24523          * Bitmask indicating which sideband signals are valid.
24524          * This is based on the board and nvm cfg that is present on the board.
24525          */
24526         uint32_t        supported_mask;
24527         uint32_t        sideband_signals;
24528         /* When this bit is set to '1', the Module is absent. */
24529         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_ABS \
24530                 UINT32_C(0x1)
24531         /*
24532          * When this bit is set to '1', there is no valid signal on RX.
24533          * This signal is a filtered version of Signal Detect.
24534          */
24535         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RX_LOS \
24536                 UINT32_C(0x2)
24537         /*
24538          * This bit along with rs1 indiactes the current speed of the dual
24539          * rate module.If these pins are grounded then the speed can be
24540          * changed by driectky writing to EEPROM.
24541          */
24542         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS0 \
24543                 UINT32_C(0x4)
24544         /*
24545          * This bit along with rs0 indiactes the current speed of the dual
24546          * rate module.If these pins are grounded then the speed can be
24547          * changed by driectky writing to EEPROM.
24548          */
24549         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RS1 \
24550                 UINT32_C(0x8)
24551         /*
24552          * When this bit is set to '1', tx_disable is set.
24553          * On a 1G BASE-T module, if this bit is set, module PHY
24554          * registers will not be accessible.
24555          */
24556         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_DIS \
24557                 UINT32_C(0x10)
24558         /* When this bit is set to '1', tx_fault is set. */
24559         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_TX_FAULT \
24560                 UINT32_C(0x20)
24561         /*
24562          * When this bit is set to '1', module is selected.
24563          * Valid only on QSFP modules
24564          */
24565         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_MOD_SEL \
24566                 UINT32_C(0x40)
24567         /*
24568          * When this bit is set to '0', the module is held in reset.
24569          * if reset_l is set to 1,first module is taken out of reset
24570          * and other signals will be set to their requested state.
24571          * Valid only on QSFP modules.
24572          */
24573         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_RESET_L \
24574                 UINT32_C(0x80)
24575         /*
24576          * When this bit is set to '1', the module is in low power mode.
24577          * Valid only on QSFP modules
24578          */
24579         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_LP_MODE \
24580                 UINT32_C(0x100)
24581         /* When this bit is set to '1', module is in power down state. */
24582         #define HWRM_PORT_SFP_SIDEBAND_QCFG_OUTPUT_SIDEBAND_SIGNALS_PWR_DIS \
24583                 UINT32_C(0x200)
24584         uint8_t unused[7];
24585         /*
24586          * This field is used in Output records to indicate that the output
24587          * is completely written to RAM.  This field should be read as '1'
24588          * to indicate that the output has been completely written. When
24589          * writing a command completion or response to an internal processor,
24590          * the order of writes has to be such that this field is written last.
24591          */
24592         uint8_t valid;
24593 } __rte_packed;
24594
24595 /**********************************
24596  * hwrm_port_phy_mdio_bus_acquire *
24597  **********************************/
24598
24599
24600 /* hwrm_port_phy_mdio_bus_acquire_input (size:192b/24B) */
24601 struct hwrm_port_phy_mdio_bus_acquire_input {
24602         /* The HWRM command request type. */
24603         uint16_t        req_type;
24604         /*
24605          * The completion ring to send the completion event on. This should
24606          * be the NQ ID returned from the `nq_alloc` HWRM command.
24607          */
24608         uint16_t        cmpl_ring;
24609         /*
24610          * The sequence ID is used by the driver for tracking multiple
24611          * commands. This ID is treated as opaque data by the firmware and
24612          * the value is returned in the `hwrm_resp_hdr` upon completion.
24613          */
24614         uint16_t        seq_id;
24615         /*
24616          * The target ID of the command:
24617          * * 0x0-0xFFF8 - The function ID
24618          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24619          * * 0xFFFD - Reserved for user-space HWRM interface
24620          * * 0xFFFF - HWRM
24621          */
24622         uint16_t        target_id;
24623         /*
24624          * A physical address pointer pointing to a host buffer that the
24625          * command's response data will be written. This can be either a host
24626          * physical address (HPA) or a guest physical address (GPA) and must
24627          * point to a physically contiguous block of memory.
24628          */
24629         uint64_t        resp_addr;
24630         /* Port ID of the port. */
24631         uint16_t        port_id;
24632         /*
24633          * client_id of the client requesting BUS access.
24634          * Any value from 0x10 to 0xFFFF can be used.
24635          * Client should make sure that the returned client_id
24636          * in response matches the client_id in request.
24637          * 0-0xF are reserved for internal use.
24638          */
24639         uint16_t        client_id;
24640         /*
24641          * Timeout in milli seconds, MDIO BUS will be released automatically
24642          * after this time, if another mdio acquire command is not received
24643          * within the timeout window from the same client.
24644          * A 0xFFFF will hold the bus until this bus is released.
24645          */
24646         uint16_t        mdio_bus_timeout;
24647         uint8_t unused_0[2];
24648 } __rte_packed;
24649
24650 /* hwrm_port_phy_mdio_bus_acquire_output (size:128b/16B) */
24651 struct hwrm_port_phy_mdio_bus_acquire_output {
24652         /* The specific error status for the command. */
24653         uint16_t        error_code;
24654         /* The HWRM command request type. */
24655         uint16_t        req_type;
24656         /* The sequence ID from the original command. */
24657         uint16_t        seq_id;
24658         /* The length of the response data in number of bytes. */
24659         uint16_t        resp_len;
24660         uint16_t        unused_0;
24661         /*
24662          * client_id of the module holding the BUS.
24663          * 0-0xF are reserved for internal use.
24664          */
24665         uint16_t        client_id;
24666         uint8_t unused_1[3];
24667         /*
24668          * This field is used in Output records to indicate that the output
24669          * is completely written to RAM.  This field should be read as '1'
24670          * to indicate that the output has been completely written.
24671          * When writing a command completion or response to an internal processor,
24672          * the order of writes has to be such that this field is written last.
24673          */
24674         uint8_t valid;
24675 } __rte_packed;
24676
24677 /**********************************
24678  * hwrm_port_phy_mdio_bus_release *
24679  **********************************/
24680
24681
24682 /* hwrm_port_phy_mdio_bus_release_input (size:192b/24B) */
24683 struct hwrm_port_phy_mdio_bus_release_input {
24684         /* The HWRM command request type. */
24685         uint16_t        req_type;
24686         /*
24687          * The completion ring to send the completion event on. This should
24688          * be the NQ ID returned from the `nq_alloc` HWRM command.
24689          */
24690         uint16_t        cmpl_ring;
24691         /*
24692          * The sequence ID is used by the driver for tracking multiple
24693          * commands. This ID is treated as opaque data by the firmware and
24694          * the value is returned in the `hwrm_resp_hdr` upon completion.
24695          */
24696         uint16_t        seq_id;
24697         /*
24698          * The target ID of the command:
24699          * * 0x0-0xFFF8 - The function ID
24700          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24701          * * 0xFFFD - Reserved for user-space HWRM interface
24702          * * 0xFFFF - HWRM
24703          */
24704         uint16_t        target_id;
24705         /*
24706          * A physical address pointer pointing to a host buffer that the
24707          * command's response data will be written. This can be either a host
24708          * physical address (HPA) or a guest physical address (GPA) and must
24709          * point to a physically contiguous block of memory.
24710          */
24711         uint64_t        resp_addr;
24712         /* Port ID of the port. */
24713         uint16_t        port_id;
24714         /*
24715          * client_id of the client requesting BUS release.
24716          * A client should not release any other clients BUS.
24717          */
24718         uint16_t        client_id;
24719         uint8_t unused_0[4];
24720 } __rte_packed;
24721
24722 /* hwrm_port_phy_mdio_bus_release_output (size:128b/16B) */
24723 struct hwrm_port_phy_mdio_bus_release_output {
24724         /* The specific error status for the command. */
24725         uint16_t        error_code;
24726         /* The HWRM command request type. */
24727         uint16_t        req_type;
24728         /* The sequence ID from the original command. */
24729         uint16_t        seq_id;
24730         /* The length of the response data in number of bytes. */
24731         uint16_t        resp_len;
24732         uint16_t        unused_0;
24733         /* The BUS is released if client_id matches the client_id in request. */
24734         uint16_t        clients_id;
24735         uint8_t unused_1[3];
24736         /*
24737          * This field is used in Output records to indicate that the output
24738          * is completely written to RAM.  This field should be read as '1'
24739          * to indicate that the output has been completely written.
24740          * When writing a command completion or response to an internal processor,
24741          * the order of writes has to be such that this field is written last.
24742          */
24743         uint8_t valid;
24744 } __rte_packed;
24745
24746 /************************
24747  * hwrm_port_tx_fir_cfg *
24748  ************************/
24749
24750
24751 /* hwrm_port_tx_fir_cfg_input (size:320b/40B) */
24752 struct hwrm_port_tx_fir_cfg_input {
24753         /* The HWRM command request type. */
24754         uint16_t        req_type;
24755         /*
24756          * The completion ring to send the completion event on. This should
24757          * be the NQ ID returned from the `nq_alloc` HWRM command.
24758          */
24759         uint16_t        cmpl_ring;
24760         /*
24761          * The sequence ID is used by the driver for tracking multiple
24762          * commands. This ID is treated as opaque data by the firmware and
24763          * the value is returned in the `hwrm_resp_hdr` upon completion.
24764          */
24765         uint16_t        seq_id;
24766         /*
24767          * The target ID of the command:
24768          * * 0x0-0xFFF8 - The function ID
24769          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24770          * * 0xFFFD - Reserved for user-space HWRM interface
24771          * * 0xFFFF - HWRM
24772          */
24773         uint16_t        target_id;
24774         /*
24775          * A physical address pointer pointing to a host buffer that the
24776          * command's response data will be written. This can be either a host
24777          * physical address (HPA) or a guest physical address (GPA) and must
24778          * point to a physically contiguous block of memory.
24779          */
24780         uint64_t        resp_addr;
24781         /* Modulation types of TX FIR: NRZ, PAM4. */
24782         uint8_t mod_type;
24783         /* For NRZ */
24784         #define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_NRZ  UINT32_C(0x0)
24785         /* For PAM4 */
24786         #define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_PAM4 UINT32_C(0x1)
24787         #define HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_LAST \
24788                 HWRM_PORT_TX_FIR_CFG_INPUT_MOD_TYPE_PAM4
24789         /* The lane mask of the lane TX FIR will be configured. */
24790         uint8_t lane_mask;
24791         uint8_t unused_0[2];
24792         /* Value1 of TX FIR, required for NRZ or PAM4. */
24793         uint32_t        txfir_val_1;
24794         /* Value2 of TX FIR, required for NRZ or PAM4. */
24795         uint32_t        txfir_val_2;
24796         /* Value3 of TX FIR, required for PAM4. */
24797         uint32_t        txfir_val_3;
24798         /* Value4 of TX FIR, required for PAM4. */
24799         uint32_t        txfir_val_4;
24800         uint8_t unused_1[4];
24801 } __rte_packed;
24802
24803 /* hwrm_port_tx_fir_cfg_output (size:128b/16B) */
24804 struct hwrm_port_tx_fir_cfg_output {
24805         /* The specific error status for the command. */
24806         uint16_t        error_code;
24807         /* The HWRM command request type. */
24808         uint16_t        req_type;
24809         /* The sequence ID from the original command. */
24810         uint16_t        seq_id;
24811         /* The length of the response data in number of bytes. */
24812         uint16_t        resp_len;
24813         uint8_t unused[7];
24814         /*
24815          * This field is used in Output records to indicate that the output
24816          * is completely written to RAM.  This field should be read as '1'
24817          * to indicate that the output has been completely written.
24818          * When writing a command completion or response to an internal processor,
24819          * the order of writes has to be such that this field is written last.
24820          */
24821         uint8_t valid;
24822 } __rte_packed;
24823
24824 /*************************
24825  * hwrm_port_tx_fir_qcfg *
24826  *************************/
24827
24828
24829 /* hwrm_port_tx_fir_qcfg_input (size:192b/24B) */
24830 struct hwrm_port_tx_fir_qcfg_input {
24831         /* The HWRM command request type. */
24832         uint16_t        req_type;
24833         /*
24834          * The completion ring to send the completion event on. This should
24835          * be the NQ ID returned from the `nq_alloc` HWRM command.
24836          */
24837         uint16_t        cmpl_ring;
24838         /*
24839          * The sequence ID is used by the driver for tracking multiple
24840          * commands. This ID is treated as opaque data by the firmware and
24841          * the value is returned in the `hwrm_resp_hdr` upon completion.
24842          */
24843         uint16_t        seq_id;
24844         /*
24845          * The target ID of the command:
24846          * * 0x0-0xFFF8 - The function ID
24847          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24848          * * 0xFFFD - Reserved for user-space HWRM interface
24849          * * 0xFFFF - HWRM
24850          */
24851         uint16_t        target_id;
24852         /*
24853          * A physical address pointer pointing to a host buffer that the
24854          * command's response data will be written. This can be either a host
24855          * physical address (HPA) or a guest physical address (GPA) and must
24856          * point to a physically contiguous block of memory.
24857          */
24858         uint64_t        resp_addr;
24859         /* Modulation types of TX FIR: NRZ, PAM4. */
24860         uint8_t mod_type;
24861         /* For NRZ */
24862         #define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_NRZ  UINT32_C(0x0)
24863         /* For PAM4 */
24864         #define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_PAM4 UINT32_C(0x1)
24865         #define HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_LAST \
24866                 HWRM_PORT_TX_FIR_QCFG_INPUT_MOD_TYPE_PAM4
24867         /* The ID of the lane TX FIR will be queried. */
24868         uint8_t lane_id;
24869         uint8_t unused[6];
24870 } __rte_packed;
24871
24872 /* hwrm_port_tx_fir_qcfg_output (size:256b/32B) */
24873 struct hwrm_port_tx_fir_qcfg_output {
24874         /* The specific error status for the command. */
24875         uint16_t        error_code;
24876         /* The HWRM command request type. */
24877         uint16_t        req_type;
24878         /* The sequence ID from the original command. */
24879         uint16_t        seq_id;
24880         /* The length of the response data in number of bytes. */
24881         uint16_t        resp_len;
24882         /* Value1 of TX FIR, required for NRZ or PAM4. */
24883         uint32_t        txfir_val_1;
24884         /* Value2 of TX FIR, required for NRZ or PAM4. */
24885         uint32_t        txfir_val_2;
24886         /* Value3 of TX FIR, required for PAM4. */
24887         uint32_t        txfir_val_3;
24888         /* Value4 of TX FIR, required for PAM4. */
24889         uint32_t        txfir_val_4;
24890         uint8_t unused[7];
24891         /*
24892          * This field is used in Output records to indicate that the output
24893          * is completely written to RAM.  This field should be read as '1'
24894          * to indicate that the output has been completely written.
24895          * When writing a command completion or response to an internal processor,
24896          * the order of writes has to be such that this field is written last.
24897          */
24898         uint8_t valid;
24899 } __rte_packed;
24900
24901 /***********************
24902  * hwrm_queue_qportcfg *
24903  ***********************/
24904
24905
24906 /* hwrm_queue_qportcfg_input (size:192b/24B) */
24907 struct hwrm_queue_qportcfg_input {
24908         /* The HWRM command request type. */
24909         uint16_t        req_type;
24910         /*
24911          * The completion ring to send the completion event on. This should
24912          * be the NQ ID returned from the `nq_alloc` HWRM command.
24913          */
24914         uint16_t        cmpl_ring;
24915         /*
24916          * The sequence ID is used by the driver for tracking multiple
24917          * commands. This ID is treated as opaque data by the firmware and
24918          * the value is returned in the `hwrm_resp_hdr` upon completion.
24919          */
24920         uint16_t        seq_id;
24921         /*
24922          * The target ID of the command:
24923          * * 0x0-0xFFF8 - The function ID
24924          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24925          * * 0xFFFD - Reserved for user-space HWRM interface
24926          * * 0xFFFF - HWRM
24927          */
24928         uint16_t        target_id;
24929         /*
24930          * A physical address pointer pointing to a host buffer that the
24931          * command's response data will be written. This can be either a host
24932          * physical address (HPA) or a guest physical address (GPA) and must
24933          * point to a physically contiguous block of memory.
24934          */
24935         uint64_t        resp_addr;
24936         uint32_t        flags;
24937         /*
24938          * Enumeration denoting the RX, TX type of the resource.
24939          * This enumeration is used for resources that are similar for both
24940          * TX and RX paths of the chip.
24941          */
24942         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
24943         /* tx path */
24944         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
24945         /* rx path */
24946         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
24947         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
24948                 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
24949         /*
24950          * Port ID of port for which the queue configuration is being
24951          * queried. This field is only required when sent by IPC.
24952          */
24953         uint16_t        port_id;
24954         /*
24955          * Drivers will set this capability when it can use
24956          * queue_idx_service_profile to map the queues to application.
24957          */
24958         uint8_t drv_qmap_cap;
24959         /* disabled */
24960         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
24961         /* enabled */
24962         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
24963         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
24964                 HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
24965         uint8_t unused_0;
24966 } __rte_packed;
24967
24968 /* hwrm_queue_qportcfg_output (size:1344b/168B) */
24969 struct hwrm_queue_qportcfg_output {
24970         /* The specific error status for the command. */
24971         uint16_t        error_code;
24972         /* The HWRM command request type. */
24973         uint16_t        req_type;
24974         /* The sequence ID from the original command. */
24975         uint16_t        seq_id;
24976         /* The length of the response data in number of bytes. */
24977         uint16_t        resp_len;
24978         /*
24979          * The maximum number of queues that can be configured on this
24980          * port.
24981          * Valid values range from 1 through 8.
24982          */
24983         uint8_t max_configurable_queues;
24984         /*
24985          * The maximum number of lossless queues that can be configured
24986          * on this port.
24987          * Valid values range from 0 through 8.
24988          */
24989         uint8_t max_configurable_lossless_queues;
24990         /*
24991          * Bitmask indicating which queues can be configured by the
24992          * hwrm_queue_cfg command.
24993          *
24994          * Each bit represents a specific queue where bit 0 represents
24995          * queue 0 and bit 7 represents queue 7.
24996          * # A value of 0 indicates that the queue is not configurable
24997          * by the hwrm_queue_cfg command.
24998          * # A value of 1 indicates that the queue is configurable.
24999          * # A hwrm_queue_cfg command shall return error when trying to
25000          * configure a queue not configurable.
25001          */
25002         uint8_t queue_cfg_allowed;
25003         /* Information about queue configuration. */
25004         uint8_t queue_cfg_info;
25005         /*
25006          * If this flag is set to '1', then the queues are
25007          * configured asymmetrically on TX and RX sides.
25008          * If this flag is set to '0', then the queues are
25009          * configured symmetrically on TX and RX sides. For
25010          * symmetric configuration, the queue configuration
25011          * including queue ids and service profiles on the
25012          * TX side is the same as the corresponding queue
25013          * configuration on the RX side.
25014          */
25015         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
25016                 UINT32_C(0x1)
25017         /*
25018          * Bitmask indicating which queues can be configured by the
25019          * hwrm_queue_pfcenable_cfg command.
25020          *
25021          * Each bit represents a specific priority where bit 0 represents
25022          * priority 0 and bit 7 represents priority 7.
25023          * # A value of 0 indicates that the priority is not configurable by
25024          * the hwrm_queue_pfcenable_cfg command.
25025          * # A value of 1 indicates that the priority is configurable.
25026          * # A hwrm_queue_pfcenable_cfg command shall return error when
25027          * trying to configure a priority that is not configurable.
25028          */
25029         uint8_t queue_pfcenable_cfg_allowed;
25030         /*
25031          * Bitmask indicating which queues can be configured by the
25032          * hwrm_queue_pri2cos_cfg command.
25033          *
25034          * Each bit represents a specific queue where bit 0 represents
25035          * queue 0 and bit 7 represents queue 7.
25036          * # A value of 0 indicates that the queue is not configurable
25037          * by the hwrm_queue_pri2cos_cfg command.
25038          * # A value of 1 indicates that the queue is configurable.
25039          * # A hwrm_queue_pri2cos_cfg command shall return error when
25040          * trying to configure a queue that is not configurable.
25041          */
25042         uint8_t queue_pri2cos_cfg_allowed;
25043         /*
25044          * Bitmask indicating which queues can be configured by the
25045          * hwrm_queue_pri2cos_cfg command.
25046          *
25047          * Each bit represents a specific queue where bit 0 represents
25048          * queue 0 and bit 7 represents queue 7.
25049          * # A value of 0 indicates that the queue is not configurable
25050          * by the hwrm_queue_pri2cos_cfg command.
25051          * # A value of 1 indicates that the queue is configurable.
25052          * # A hwrm_queue_pri2cos_cfg command shall return error when
25053          * trying to configure a queue not configurable.
25054          */
25055         uint8_t queue_cos2bw_cfg_allowed;
25056         /*
25057          * ID of CoS Queue 0.
25058          * FF - Invalid id
25059          *
25060          * # This ID can be used on any subsequent call to an hwrm command
25061          * that takes a queue id.
25062          * # IDs must always be queried by this command before any use
25063          * by the driver or software.
25064          * # The CoS queue index is obtained by applying modulo 10 to the
25065          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25066          * The CoS queue index is used to reference port statistics for the
25067          * CoS queue.
25068          * # A value of 0xff indicates that the queue is not available.
25069          * # Available queues may not be in sequential order.
25070          */
25071         uint8_t queue_id0;
25072         /* This value specifies service profile kind for CoS queue */
25073         uint8_t queue_id0_service_profile;
25074         /* Lossy (best-effort) */
25075         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
25076                 UINT32_C(0x0)
25077         /* Lossless */
25078         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
25079                 UINT32_C(0x1)
25080         /* Lossless RoCE (deprecated) */
25081         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \
25082                 UINT32_C(0x1)
25083         /* Lossy RoCE CNP (deprecated) */
25084         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \
25085                 UINT32_C(0x2)
25086         /* Lossless NIC (deprecated) */
25087         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \
25088                 UINT32_C(0x3)
25089         /* Set to 0xFF... (All Fs) if there is no service profile specified */
25090         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
25091                 UINT32_C(0xff)
25092         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \
25093                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
25094         /*
25095          * ID of CoS Queue 1.
25096          * FF - Invalid id
25097          *
25098          * # This ID can be used on any subsequent call to an hwrm command
25099          * that takes a queue id.
25100          * # IDs must always be queried by this command before any use
25101          * by the driver or software.
25102          * # The CoS queue index is obtained by applying modulo 10 to the
25103          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25104          * The CoS queue index is used to reference port statistics for the
25105          * CoS queue.
25106          * # A value of 0xff indicates that the queue is not available.
25107          * # Available queues may not be in sequential order.
25108          */
25109         uint8_t queue_id1;
25110         /* This value specifies service profile kind for CoS queue */
25111         uint8_t queue_id1_service_profile;
25112         /* Lossy (best-effort) */
25113         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
25114                 UINT32_C(0x0)
25115         /* Lossless */
25116         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
25117                 UINT32_C(0x1)
25118         /* Lossless RoCE (deprecated) */
25119         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \
25120                 UINT32_C(0x1)
25121         /* Lossy RoCE CNP (deprecated) */
25122         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \
25123                 UINT32_C(0x2)
25124         /* Lossless NIC (deprecated) */
25125         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \
25126                 UINT32_C(0x3)
25127         /* Set to 0xFF... (All Fs) if there is no service profile specified */
25128         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
25129                 UINT32_C(0xff)
25130         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \
25131                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
25132         /*
25133          * ID of CoS Queue 2.
25134          * FF - Invalid id
25135          *
25136          * # This ID can be used on any subsequent call to an hwrm command
25137          * that takes a queue id.
25138          * # IDs must always be queried by this command before any use
25139          * by the driver or software.
25140          * # The CoS queue index is obtained by applying modulo 10 to the
25141          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25142          * The CoS queue index is used to reference port statistics for the
25143          * CoS queue.
25144          * # A value of 0xff indicates that the queue is not available.
25145          * # Available queues may not be in sequential order.
25146          */
25147         uint8_t queue_id2;
25148         /* This value specifies service profile kind for CoS queue */
25149         uint8_t queue_id2_service_profile;
25150         /* Lossy (best-effort) */
25151         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
25152                 UINT32_C(0x0)
25153         /* Lossless */
25154         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
25155                 UINT32_C(0x1)
25156         /* Lossless RoCE (deprecated) */
25157         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \
25158                 UINT32_C(0x1)
25159         /* Lossy RoCE CNP (deprecated) */
25160         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \
25161                 UINT32_C(0x2)
25162         /* Lossless NIC (deprecated) */
25163         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \
25164                 UINT32_C(0x3)
25165         /* Set to 0xFF... (All Fs) if there is no service profile specified */
25166         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
25167                 UINT32_C(0xff)
25168         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \
25169                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
25170         /*
25171          * ID of CoS Queue 3.
25172          * FF - Invalid id
25173          *
25174          * # This ID can be used on any subsequent call to an hwrm command
25175          * that takes a queue id.
25176          * # IDs must always be queried by this command before any use
25177          * by the driver or software.
25178          * # The CoS queue index is obtained by applying modulo 10 to the
25179          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25180          * The CoS queue index is used to reference port statistics for the
25181          * CoS queue.
25182          * # A value of 0xff indicates that the queue is not available.
25183          * # Available queues may not be in sequential order.
25184          */
25185         uint8_t queue_id3;
25186         /* This value specifies service profile kind for CoS queue */
25187         uint8_t queue_id3_service_profile;
25188         /* Lossy (best-effort) */
25189         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
25190                 UINT32_C(0x0)
25191         /* Lossless */
25192         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
25193                 UINT32_C(0x1)
25194         /* Lossless RoCE (deprecated) */
25195         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \
25196                 UINT32_C(0x1)
25197         /* Lossy RoCE CNP (deprecated) */
25198         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \
25199                 UINT32_C(0x2)
25200         /* Lossless NIC (deprecated) */
25201         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \
25202                 UINT32_C(0x3)
25203         /* Set to 0xFF... (All Fs) if there is no service profile specified */
25204         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
25205                 UINT32_C(0xff)
25206         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \
25207                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
25208         /*
25209          * ID of CoS Queue 4.
25210          * FF - Invalid id
25211          *
25212          * # This ID can be used on any subsequent call to an hwrm command
25213          * that takes a queue id.
25214          * # IDs must always be queried by this command before any use
25215          * by the driver or software.
25216          * # The CoS queue index is obtained by applying modulo 10 to the
25217          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25218          * The CoS queue index is used to reference port statistics for the
25219          * CoS queue.
25220          * # A value of 0xff indicates that the queue is not available.
25221          * # Available queues may not be in sequential order.
25222          */
25223         uint8_t queue_id4;
25224         /* This value specifies service profile kind for CoS queue */
25225         uint8_t queue_id4_service_profile;
25226         /* Lossy (best-effort) */
25227         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
25228                 UINT32_C(0x0)
25229         /* Lossless */
25230         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
25231                 UINT32_C(0x1)
25232         /* Lossless RoCE (deprecated) */
25233         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \
25234                 UINT32_C(0x1)
25235         /* Lossy RoCE CNP (deprecated) */
25236         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \
25237                 UINT32_C(0x2)
25238         /* Lossless NIC (deprecated) */
25239         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \
25240                 UINT32_C(0x3)
25241         /* Set to 0xFF... (All Fs) if there is no service profile specified */
25242         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
25243                 UINT32_C(0xff)
25244         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \
25245                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
25246         /*
25247          * ID of CoS Queue 5.
25248          * FF - Invalid id
25249          *
25250          * # This ID can be used on any subsequent call to an hwrm command
25251          * that takes a queue id.
25252          * # IDs must always be queried by this command before any use
25253          * by the driver or software.
25254          * # The CoS queue index is obtained by applying modulo 10 to the
25255          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25256          * The CoS queue index is used to reference port statistics for the
25257          * CoS queue.
25258          * # A value of 0xff indicates that the queue is not available.
25259          * # Available queues may not be in sequential order.
25260          */
25261         uint8_t queue_id5;
25262         /* This value specifies service profile kind for CoS queue */
25263         uint8_t queue_id5_service_profile;
25264         /* Lossy (best-effort) */
25265         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
25266                 UINT32_C(0x0)
25267         /* Lossless */
25268         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
25269                 UINT32_C(0x1)
25270         /* Lossless RoCE (deprecated) */
25271         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \
25272                 UINT32_C(0x1)
25273         /* Lossy RoCE CNP (deprecated) */
25274         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \
25275                 UINT32_C(0x2)
25276         /* Lossless NIC (deprecated) */
25277         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \
25278                 UINT32_C(0x3)
25279         /* Set to 0xFF... (All Fs) if there is no service profile specified */
25280         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
25281                 UINT32_C(0xff)
25282         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \
25283                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
25284         /*
25285          * ID of CoS Queue 6.
25286          * FF - Invalid id
25287          *
25288          * # This ID can be used on any subsequent call to an hwrm command
25289          * that takes a queue id.
25290          * # IDs must always be queried by this command before any use
25291          * by the driver or software.
25292          * # The CoS queue index is obtained by applying modulo 10 to the
25293          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25294          * The CoS queue index is used to reference port statistics for the
25295          * CoS queue.
25296          * # A value of 0xff indicates that the queue is not available.
25297          * # Available queues may not be in sequential order.
25298          */
25299         uint8_t queue_id6;
25300         /* This value specifies service profile kind for CoS queue */
25301         uint8_t queue_id6_service_profile;
25302         /* Lossy (best-effort) */
25303         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
25304                 UINT32_C(0x0)
25305         /* Lossless */
25306         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
25307                 UINT32_C(0x1)
25308         /* Lossless RoCE (deprecated) */
25309         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \
25310                 UINT32_C(0x1)
25311         /* Lossy RoCE CNP (deprecated) */
25312         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \
25313                 UINT32_C(0x2)
25314         /* Lossless NIC (deprecated) */
25315         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \
25316                 UINT32_C(0x3)
25317         /* Set to 0xFF... (All Fs) if there is no service profile specified */
25318         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
25319                 UINT32_C(0xff)
25320         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \
25321                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
25322         /*
25323          * ID of CoS Queue 7.
25324          * FF - Invalid id
25325          *
25326          * # This ID can be used on any subsequent call to an hwrm command
25327          * that takes a queue id.
25328          * # IDs must always be queried by this command before any use
25329          * by the driver or software.
25330          * # The CoS queue index is obtained by applying modulo 10 to the
25331          * CoS queue ID. Valid CoS queue indexes are in the range of 0 to 7.
25332          * The CoS queue index is used to reference port statistics for the
25333          * CoS queue.
25334          * # A value of 0xff indicates that the queue is not available.
25335          * # Available queues may not be in sequential order.
25336          */
25337         uint8_t queue_id7;
25338         /* This value specifies service profile kind for CoS queue */
25339         uint8_t queue_id7_service_profile;
25340         /* Lossy (best-effort) */
25341         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
25342                 UINT32_C(0x0)
25343         /* Lossless */
25344         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
25345                 UINT32_C(0x1)
25346         /* Lossless RoCE (deprecated) */
25347         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \
25348                 UINT32_C(0x1)
25349         /* Lossy RoCE CNP (deprecated) */
25350         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \
25351                 UINT32_C(0x2)
25352         /* Lossless NIC (deprecated) */
25353         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \
25354                 UINT32_C(0x3)
25355         /* Set to 0xFF... (All Fs) if there is no service profile specified */
25356         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
25357                 UINT32_C(0xff)
25358         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \
25359                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
25360         /*
25361          * This value specifies traffic type for the service profile. We can
25362          * have a TC mapped to multiple traffic types. For example shared
25363          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25364          * A value of zero is considered as invalid.
25365          */
25366         uint8_t queue_id0_service_profile_type;
25367         /* Recommended to be used for RoCE traffic only. */
25368         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_ROCE \
25369                 UINT32_C(0x1)
25370         /* Recommended to be used for NIC/L2 traffic only. */
25371         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_NIC \
25372                 UINT32_C(0x2)
25373         /* Recommended to be used for CNP traffic only. */
25374         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_TYPE_CNP \
25375                 UINT32_C(0x4)
25376         /*
25377          * Up to 16 bytes of null padded ASCII string describing this queue.
25378          * The queue name includes a CoS queue index and, in some cases, text
25379          * that distinguishes the queue from other queues in the group.
25380          */
25381         char    qid0_name[16];
25382         /* Up to 16 bytes of null padded ASCII string describing this queue. */
25383         char    qid1_name[16];
25384         /* Up to 16 bytes of null padded ASCII string describing this queue. */
25385         char    qid2_name[16];
25386         /* Up to 16 bytes of null padded ASCII string describing this queue. */
25387         char    qid3_name[16];
25388         /* Up to 16 bytes of null padded ASCII string describing this queue. */
25389         char    qid4_name[16];
25390         /* Up to 16 bytes of null padded ASCII string describing this queue. */
25391         char    qid5_name[16];
25392         /* Up to 16 bytes of null padded ASCII string describing this queue. */
25393         char    qid6_name[16];
25394         /* Up to 16 bytes of null padded ASCII string describing this queue. */
25395         char    qid7_name[16];
25396         /*
25397          * This value specifies traffic type for the service profile. We can
25398          * have a TC mapped to multiple traffic types. For example shared
25399          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25400          * A value of zero is considered as invalid.
25401          */
25402         uint8_t queue_id1_service_profile_type;
25403         /* Recommended to be used for RoCE traffic only. */
25404         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_ROCE \
25405                 UINT32_C(0x1)
25406         /* Recommended to be used for NIC/L2 traffic only. */
25407         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_NIC \
25408                 UINT32_C(0x2)
25409         /* Recommended to be used for CNP traffic only. */
25410         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_TYPE_CNP \
25411                 UINT32_C(0x4)
25412         /*
25413          * This value specifies traffic type for the service profile. We can
25414          * have a TC mapped to multiple traffic types. For example shared
25415          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25416          * A value of zero is considered as invalid.
25417          */
25418         uint8_t queue_id2_service_profile_type;
25419         /* Recommended to be used for RoCE traffic only. */
25420         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_ROCE \
25421                 UINT32_C(0x1)
25422         /* Recommended to be used for NIC/L2 traffic only. */
25423         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_NIC \
25424                 UINT32_C(0x2)
25425         /* Recommended to be used for CNP traffic only. */
25426         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_TYPE_CNP \
25427                 UINT32_C(0x4)
25428         /*
25429          * This value specifies traffic type for the service profile. We can
25430          * have a TC mapped to multiple traffic types. For example shared
25431          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25432          * A value of zero is considered as invalid.
25433          */
25434         uint8_t queue_id3_service_profile_type;
25435         /* Recommended to be used for RoCE traffic only. */
25436         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_ROCE \
25437                 UINT32_C(0x1)
25438         /* Recommended to be used for NIC/L2 traffic only. */
25439         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_NIC \
25440                 UINT32_C(0x2)
25441         /* Recommended to be used for CNP traffic only. */
25442         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_TYPE_CNP \
25443                 UINT32_C(0x4)
25444         /*
25445          * This value specifies traffic type for the service profile. We can
25446          * have a TC mapped to multiple traffic types. For example shared
25447          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25448          * A value of zero is considered as invalid.
25449          */
25450         uint8_t queue_id4_service_profile_type;
25451         /* Recommended to be used for RoCE traffic only. */
25452         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_ROCE \
25453                 UINT32_C(0x1)
25454         /* Recommended to be used for NIC/L2 traffic only. */
25455         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_NIC \
25456                 UINT32_C(0x2)
25457         /* Recommended to be used for CNP traffic only. */
25458         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_TYPE_CNP \
25459                 UINT32_C(0x4)
25460         /*
25461          * This value specifies traffic type for the service profile. We can
25462          * have a TC mapped to multiple traffic types. For example shared
25463          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25464          * A value of zero is considered as invalid.
25465          */
25466         uint8_t queue_id5_service_profile_type;
25467         /* Recommended to be used for RoCE traffic only. */
25468         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_ROCE \
25469                 UINT32_C(0x1)
25470         /* Recommended to be used for NIC/L2 traffic only. */
25471         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_NIC \
25472                 UINT32_C(0x2)
25473         /* Recommended to be used for CNP traffic only. */
25474         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_TYPE_CNP \
25475                 UINT32_C(0x4)
25476         /*
25477          * This value specifies traffic type for the service profile. We can
25478          * have a TC mapped to multiple traffic types. For example shared
25479          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25480          * A value of zero is considered as invalid.
25481          */
25482         uint8_t queue_id6_service_profile_type;
25483         /* Recommended to be used for RoCE traffic only. */
25484         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_ROCE \
25485                 UINT32_C(0x1)
25486         /* Recommended to be used for NIC/L2 traffic only. */
25487         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_NIC \
25488                 UINT32_C(0x2)
25489         /* Recommended to be used for CNP traffic only. */
25490         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_TYPE_CNP \
25491                 UINT32_C(0x4)
25492         /*
25493          * This value specifies traffic type for the service profile. We can
25494          * have a TC mapped to multiple traffic types. For example shared
25495          * CoS Q for CNP and NIC will have both cnp and nic bits set (0x6).
25496          * A value of zero is considered as invalid.
25497          */
25498         uint8_t queue_id7_service_profile_type;
25499         /* Recommended to be used for RoCE traffic only. */
25500         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_ROCE \
25501                 UINT32_C(0x1)
25502         /* Recommended to be used for NIC/L2 traffic only. */
25503         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_NIC \
25504                 UINT32_C(0x2)
25505         /* Recommended to be used for CNP traffic only. */
25506         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_TYPE_CNP \
25507                 UINT32_C(0x4)
25508         /*
25509          * This field is used in Output records to indicate that the output
25510          * is completely written to RAM. This field should be read as '1'
25511          * to indicate that the output has been completely written.
25512          * When writing a command completion or response to an internal processor,
25513          * the order of writes has to be such that this field is written last.
25514          */
25515         uint8_t valid;
25516 } __rte_packed;
25517
25518 /*******************
25519  * hwrm_queue_qcfg *
25520  *******************/
25521
25522
25523 /* hwrm_queue_qcfg_input (size:192b/24B) */
25524 struct hwrm_queue_qcfg_input {
25525         /* The HWRM command request type. */
25526         uint16_t        req_type;
25527         /*
25528          * The completion ring to send the completion event on. This should
25529          * be the NQ ID returned from the `nq_alloc` HWRM command.
25530          */
25531         uint16_t        cmpl_ring;
25532         /*
25533          * The sequence ID is used by the driver for tracking multiple
25534          * commands. This ID is treated as opaque data by the firmware and
25535          * the value is returned in the `hwrm_resp_hdr` upon completion.
25536          */
25537         uint16_t        seq_id;
25538         /*
25539          * The target ID of the command:
25540          * * 0x0-0xFFF8 - The function ID
25541          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25542          * * 0xFFFD - Reserved for user-space HWRM interface
25543          * * 0xFFFF - HWRM
25544          */
25545         uint16_t        target_id;
25546         /*
25547          * A physical address pointer pointing to a host buffer that the
25548          * command's response data will be written. This can be either a host
25549          * physical address (HPA) or a guest physical address (GPA) and must
25550          * point to a physically contiguous block of memory.
25551          */
25552         uint64_t        resp_addr;
25553         uint32_t        flags;
25554         /*
25555          * Enumeration denoting the RX, TX type of the resource.
25556          * This enumeration is used for resources that are similar for both
25557          * TX and RX paths of the chip.
25558          */
25559         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
25560         /* tx path */
25561         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
25562         /* rx path */
25563         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
25564         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST \
25565                 HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
25566         /* Queue ID of the queue. */
25567         uint32_t        queue_id;
25568 } __rte_packed;
25569
25570 /* hwrm_queue_qcfg_output (size:128b/16B) */
25571 struct hwrm_queue_qcfg_output {
25572         /* The specific error status for the command. */
25573         uint16_t        error_code;
25574         /* The HWRM command request type. */
25575         uint16_t        req_type;
25576         /* The sequence ID from the original command. */
25577         uint16_t        seq_id;
25578         /* The length of the response data in number of bytes. */
25579         uint16_t        resp_len;
25580         /*
25581          * This value is the estimate packet length used in the
25582          * TX arbiter.
25583          */
25584         uint32_t        queue_len;
25585         /* This value is applicable to CoS queues only. */
25586         uint8_t service_profile;
25587         /* Lossy (best-effort) */
25588         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
25589         /* Lossless */
25590         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25591         /* Set to 0xFF... (All Fs) if there is no service profile specified */
25592         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
25593         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST \
25594                 HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
25595         /* Information about queue configuration. */
25596         uint8_t queue_cfg_info;
25597         /*
25598          * If this flag is set to '1', then the queue is
25599          * configured asymmetrically on TX and RX sides.
25600          * If this flag is set to '0', then this queue is
25601          * configured symmetrically on TX and RX sides.
25602          */
25603         #define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
25604                 UINT32_C(0x1)
25605         uint8_t unused_0;
25606         /*
25607          * This field is used in Output records to indicate that the output
25608          * is completely written to RAM. This field should be read as '1'
25609          * to indicate that the output has been completely written.
25610          * When writing a command completion or response to an internal processor,
25611          * the order of writes has to be such that this field is written last.
25612          */
25613         uint8_t valid;
25614 } __rte_packed;
25615
25616 /******************
25617  * hwrm_queue_cfg *
25618  ******************/
25619
25620
25621 /* hwrm_queue_cfg_input (size:320b/40B) */
25622 struct hwrm_queue_cfg_input {
25623         /* The HWRM command request type. */
25624         uint16_t        req_type;
25625         /*
25626          * The completion ring to send the completion event on. This should
25627          * be the NQ ID returned from the `nq_alloc` HWRM command.
25628          */
25629         uint16_t        cmpl_ring;
25630         /*
25631          * The sequence ID is used by the driver for tracking multiple
25632          * commands. This ID is treated as opaque data by the firmware and
25633          * the value is returned in the `hwrm_resp_hdr` upon completion.
25634          */
25635         uint16_t        seq_id;
25636         /*
25637          * The target ID of the command:
25638          * * 0x0-0xFFF8 - The function ID
25639          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25640          * * 0xFFFD - Reserved for user-space HWRM interface
25641          * * 0xFFFF - HWRM
25642          */
25643         uint16_t        target_id;
25644         /*
25645          * A physical address pointer pointing to a host buffer that the
25646          * command's response data will be written. This can be either a host
25647          * physical address (HPA) or a guest physical address (GPA) and must
25648          * point to a physically contiguous block of memory.
25649          */
25650         uint64_t        resp_addr;
25651         uint32_t        flags;
25652         /*
25653          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
25654          * This enumeration is used for resources that are similar for both
25655          * TX and RX paths of the chip.
25656          */
25657         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
25658         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT  0
25659         /* tx path */
25660         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
25661         /* rx path */
25662         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
25663         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
25664         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
25665         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST \
25666                 HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
25667         uint32_t        enables;
25668         /*
25669          * This bit must be '1' for the dflt_len field to be
25670          * configured.
25671          */
25672         #define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN            UINT32_C(0x1)
25673         /*
25674          * This bit must be '1' for the service_profile field to be
25675          * configured.
25676          */
25677         #define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE     UINT32_C(0x2)
25678         /* Queue ID of queue that is to be configured by this function. */
25679         uint32_t        queue_id;
25680         /*
25681          * This value is a the estimate packet length used in the
25682          * TX arbiter.
25683          * Set to 0xFF... (All Fs) to not adjust this value.
25684          */
25685         uint32_t        dflt_len;
25686         /* This value is applicable to CoS queues only. */
25687         uint8_t service_profile;
25688         /* Lossy (best-effort) */
25689         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
25690         /* Lossless */
25691         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
25692         /* Set to 0xFF... (All Fs) if there is no service profile specified */
25693         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
25694         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST \
25695                 HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
25696         uint8_t unused_0[7];
25697 } __rte_packed;
25698
25699 /* hwrm_queue_cfg_output (size:128b/16B) */
25700 struct hwrm_queue_cfg_output {
25701         /* The specific error status for the command. */
25702         uint16_t        error_code;
25703         /* The HWRM command request type. */
25704         uint16_t        req_type;
25705         /* The sequence ID from the original command. */
25706         uint16_t        seq_id;
25707         /* The length of the response data in number of bytes. */
25708         uint16_t        resp_len;
25709         uint8_t unused_0[7];
25710         /*
25711          * This field is used in Output records to indicate that the output
25712          * is completely written to RAM. This field should be read as '1'
25713          * to indicate that the output has been completely written.
25714          * When writing a command completion or response to an internal processor,
25715          * the order of writes has to be such that this field is written last.
25716          */
25717         uint8_t valid;
25718 } __rte_packed;
25719
25720 /*****************************
25721  * hwrm_queue_pfcenable_qcfg *
25722  *****************************/
25723
25724
25725 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
25726 struct hwrm_queue_pfcenable_qcfg_input {
25727         /* The HWRM command request type. */
25728         uint16_t        req_type;
25729         /*
25730          * The completion ring to send the completion event on. This should
25731          * be the NQ ID returned from the `nq_alloc` HWRM command.
25732          */
25733         uint16_t        cmpl_ring;
25734         /*
25735          * The sequence ID is used by the driver for tracking multiple
25736          * commands. This ID is treated as opaque data by the firmware and
25737          * the value is returned in the `hwrm_resp_hdr` upon completion.
25738          */
25739         uint16_t        seq_id;
25740         /*
25741          * The target ID of the command:
25742          * * 0x0-0xFFF8 - The function ID
25743          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25744          * * 0xFFFD - Reserved for user-space HWRM interface
25745          * * 0xFFFF - HWRM
25746          */
25747         uint16_t        target_id;
25748         /*
25749          * A physical address pointer pointing to a host buffer that the
25750          * command's response data will be written. This can be either a host
25751          * physical address (HPA) or a guest physical address (GPA) and must
25752          * point to a physically contiguous block of memory.
25753          */
25754         uint64_t        resp_addr;
25755         /*
25756          * Port ID of port for which the table is being configured.
25757          * The HWRM needs to check whether this function is allowed
25758          * to configure pri2cos mapping on this port.
25759          */
25760         uint16_t        port_id;
25761         uint8_t unused_0[6];
25762 } __rte_packed;
25763
25764 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
25765 struct hwrm_queue_pfcenable_qcfg_output {
25766         /* The specific error status for the command. */
25767         uint16_t        error_code;
25768         /* The HWRM command request type. */
25769         uint16_t        req_type;
25770         /* The sequence ID from the original command. */
25771         uint16_t        seq_id;
25772         /* The length of the response data in number of bytes. */
25773         uint16_t        resp_len;
25774         uint32_t        flags;
25775         /* If set to 1, then PFC is enabled on PRI 0. */
25776         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED \
25777                 UINT32_C(0x1)
25778         /* If set to 1, then PFC is enabled on PRI 1. */
25779         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED \
25780                 UINT32_C(0x2)
25781         /* If set to 1, then PFC is enabled on PRI 2. */
25782         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED \
25783                 UINT32_C(0x4)
25784         /* If set to 1, then PFC is enabled on PRI 3. */
25785         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED \
25786                 UINT32_C(0x8)
25787         /* If set to 1, then PFC is enabled on PRI 4. */
25788         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED \
25789                 UINT32_C(0x10)
25790         /* If set to 1, then PFC is enabled on PRI 5. */
25791         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED \
25792                 UINT32_C(0x20)
25793         /* If set to 1, then PFC is enabled on PRI 6. */
25794         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED \
25795                 UINT32_C(0x40)
25796         /* If set to 1, then PFC is enabled on PRI 7. */
25797         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED \
25798                 UINT32_C(0x80)
25799         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
25800         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED \
25801                 UINT32_C(0x100)
25802         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
25803         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED \
25804                 UINT32_C(0x200)
25805         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
25806         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED \
25807                 UINT32_C(0x400)
25808         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
25809         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED \
25810                 UINT32_C(0x800)
25811         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
25812         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED \
25813                 UINT32_C(0x1000)
25814         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
25815         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED \
25816                 UINT32_C(0x2000)
25817         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
25818         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED \
25819                 UINT32_C(0x4000)
25820         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
25821         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED \
25822                 UINT32_C(0x8000)
25823         uint8_t unused_0[3];
25824         /*
25825          * This field is used in Output records to indicate that the output
25826          * is completely written to RAM. This field should be read as '1'
25827          * to indicate that the output has been completely written.
25828          * When writing a command completion or response to an internal processor,
25829          * the order of writes has to be such that this field is written last.
25830          */
25831         uint8_t valid;
25832 } __rte_packed;
25833
25834 /****************************
25835  * hwrm_queue_pfcenable_cfg *
25836  ****************************/
25837
25838
25839 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
25840 struct hwrm_queue_pfcenable_cfg_input {
25841         /* The HWRM command request type. */
25842         uint16_t        req_type;
25843         /*
25844          * The completion ring to send the completion event on. This should
25845          * be the NQ ID returned from the `nq_alloc` HWRM command.
25846          */
25847         uint16_t        cmpl_ring;
25848         /*
25849          * The sequence ID is used by the driver for tracking multiple
25850          * commands. This ID is treated as opaque data by the firmware and
25851          * the value is returned in the `hwrm_resp_hdr` upon completion.
25852          */
25853         uint16_t        seq_id;
25854         /*
25855          * The target ID of the command:
25856          * * 0x0-0xFFF8 - The function ID
25857          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25858          * * 0xFFFD - Reserved for user-space HWRM interface
25859          * * 0xFFFF - HWRM
25860          */
25861         uint16_t        target_id;
25862         /*
25863          * A physical address pointer pointing to a host buffer that the
25864          * command's response data will be written. This can be either a host
25865          * physical address (HPA) or a guest physical address (GPA) and must
25866          * point to a physically contiguous block of memory.
25867          */
25868         uint64_t        resp_addr;
25869         uint32_t        flags;
25870         /* If set to 1, then PFC is requested to be enabled on PRI 0. */
25871         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED \
25872                 UINT32_C(0x1)
25873         /* If set to 1, then PFC is requested to be enabled on PRI 1. */
25874         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED \
25875                 UINT32_C(0x2)
25876         /* If set to 1, then PFC is requested to be enabled on PRI 2. */
25877         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED \
25878                 UINT32_C(0x4)
25879         /* If set to 1, then PFC is requested to be enabled on PRI 3. */
25880         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED \
25881                 UINT32_C(0x8)
25882         /* If set to 1, then PFC is requested to be enabled on PRI 4. */
25883         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED \
25884                 UINT32_C(0x10)
25885         /* If set to 1, then PFC is requested to be enabled on PRI 5. */
25886         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED \
25887                 UINT32_C(0x20)
25888         /* If set to 1, then PFC is requested to be enabled on PRI 6. */
25889         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED \
25890                 UINT32_C(0x40)
25891         /* If set to 1, then PFC is requested to be enabled on PRI 7. */
25892         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED \
25893                 UINT32_C(0x80)
25894         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI0. */
25895         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_WATCHDOG_ENABLED \
25896                 UINT32_C(0x100)
25897         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI1. */
25898         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_WATCHDOG_ENABLED \
25899                 UINT32_C(0x200)
25900         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI2. */
25901         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_WATCHDOG_ENABLED \
25902                 UINT32_C(0x400)
25903         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI3. */
25904         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_WATCHDOG_ENABLED \
25905                 UINT32_C(0x800)
25906         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI4. */
25907         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_WATCHDOG_ENABLED \
25908                 UINT32_C(0x1000)
25909         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI5. */
25910         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_WATCHDOG_ENABLED \
25911                 UINT32_C(0x2000)
25912         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI6. */
25913         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_WATCHDOG_ENABLED \
25914                 UINT32_C(0x4000)
25915         /* If set to 1, then PFC WatchDog is requested to be enabled on PRI7. */
25916         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_WATCHDOG_ENABLED \
25917                 UINT32_C(0x8000)
25918         /*
25919          * Port ID of port for which the table is being configured.
25920          * The HWRM needs to check whether this function is allowed
25921          * to configure pri2cos mapping on this port.
25922          */
25923         uint16_t        port_id;
25924         uint8_t unused_0[2];
25925 } __rte_packed;
25926
25927 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
25928 struct hwrm_queue_pfcenable_cfg_output {
25929         /* The specific error status for the command. */
25930         uint16_t        error_code;
25931         /* The HWRM command request type. */
25932         uint16_t        req_type;
25933         /* The sequence ID from the original command. */
25934         uint16_t        seq_id;
25935         /* The length of the response data in number of bytes. */
25936         uint16_t        resp_len;
25937         uint8_t unused_0[7];
25938         /*
25939          * This field is used in Output records to indicate that the output
25940          * is completely written to RAM. This field should be read as '1'
25941          * to indicate that the output has been completely written.
25942          * When writing a command completion or response to an internal processor,
25943          * the order of writes has to be such that this field is written last.
25944          */
25945         uint8_t valid;
25946 } __rte_packed;
25947
25948 /***************************
25949  * hwrm_queue_pri2cos_qcfg *
25950  ***************************/
25951
25952
25953 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
25954 struct hwrm_queue_pri2cos_qcfg_input {
25955         /* The HWRM command request type. */
25956         uint16_t        req_type;
25957         /*
25958          * The completion ring to send the completion event on. This should
25959          * be the NQ ID returned from the `nq_alloc` HWRM command.
25960          */
25961         uint16_t        cmpl_ring;
25962         /*
25963          * The sequence ID is used by the driver for tracking multiple
25964          * commands. This ID is treated as opaque data by the firmware and
25965          * the value is returned in the `hwrm_resp_hdr` upon completion.
25966          */
25967         uint16_t        seq_id;
25968         /*
25969          * The target ID of the command:
25970          * * 0x0-0xFFF8 - The function ID
25971          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25972          * * 0xFFFD - Reserved for user-space HWRM interface
25973          * * 0xFFFF - HWRM
25974          */
25975         uint16_t        target_id;
25976         /*
25977          * A physical address pointer pointing to a host buffer that the
25978          * command's response data will be written. This can be either a host
25979          * physical address (HPA) or a guest physical address (GPA) and must
25980          * point to a physically contiguous block of memory.
25981          */
25982         uint64_t        resp_addr;
25983         uint32_t        flags;
25984         /*
25985          * Enumeration denoting the RX, TX type of the resource.
25986          * This enumeration is used for resources that are similar for both
25987          * TX and RX paths of the chip.
25988          */
25989         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH      UINT32_C(0x1)
25990         /* tx path */
25991         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
25992         /* rx path */
25993         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
25994         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST \
25995                 HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
25996         /*
25997          * When this bit is set to '0', the query is
25998          * for PRI from tunnel headers.
25999          * When this bit is set to '1', the query is
26000          * for PRI from inner packet headers.
26001          */
26002         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN     UINT32_C(0x2)
26003         /*
26004          * Port ID of port for which the table is being configured.
26005          * The HWRM needs to check whether this function is allowed
26006          * to configure pri2cos mapping on this port.
26007          */
26008         uint8_t port_id;
26009         uint8_t unused_0[3];
26010 } __rte_packed;
26011
26012 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
26013 struct hwrm_queue_pri2cos_qcfg_output {
26014         /* The specific error status for the command. */
26015         uint16_t        error_code;
26016         /* The HWRM command request type. */
26017         uint16_t        req_type;
26018         /* The sequence ID from the original command. */
26019         uint16_t        seq_id;
26020         /* The length of the response data in number of bytes. */
26021         uint16_t        resp_len;
26022         /*
26023          * CoS Queue assigned to priority 0. This value can only
26024          * be changed before traffic has started.
26025          * A value of 0xff indicates that no CoS queue is assigned to the
26026          * specified priority.
26027          */
26028         uint8_t pri0_cos_queue_id;
26029         /*
26030          * CoS Queue assigned to priority 1. This value can only
26031          * be changed before traffic has started.
26032          * A value of 0xff indicates that no CoS queue is assigned to the
26033          * specified priority.
26034          */
26035         uint8_t pri1_cos_queue_id;
26036         /*
26037          * CoS Queue assigned to priority 2. This value can only
26038          * be changed before traffic has started.
26039          * A value of 0xff indicates that no CoS queue is assigned to the
26040          * specified priority.
26041          */
26042         uint8_t pri2_cos_queue_id;
26043         /*
26044          * CoS Queue assigned to priority 3. This value can only
26045          * be changed before traffic has started.
26046          * A value of 0xff indicates that no CoS queue is assigned to the
26047          * specified priority.
26048          */
26049         uint8_t pri3_cos_queue_id;
26050         /*
26051          * CoS Queue assigned to priority 4. This value can only
26052          * be changed before traffic has started.
26053          * A value of 0xff indicates that no CoS queue is assigned to the
26054          * specified priority.
26055          */
26056         uint8_t pri4_cos_queue_id;
26057         /*
26058          * CoS Queue assigned to priority 5. This value can only
26059          * be changed before traffic has started.
26060          * A value of 0xff indicates that no CoS queue is assigned to the
26061          * specified priority.
26062          */
26063         uint8_t pri5_cos_queue_id;
26064         /*
26065          * CoS Queue assigned to priority 6. This value can only
26066          * be changed before traffic has started.
26067          * A value of 0xff indicates that no CoS queue is assigned to the
26068          * specified priority.
26069          */
26070         uint8_t pri6_cos_queue_id;
26071         /*
26072          * CoS Queue assigned to priority 7. This value can only
26073          * be changed before traffic has started.
26074          * A value of 0xff indicates that no CoS queue is assigned to the
26075          * specified priority.
26076          */
26077         uint8_t pri7_cos_queue_id;
26078         /* Information about queue configuration. */
26079         uint8_t queue_cfg_info;
26080         /*
26081          * If this flag is set to '1', then the PRI to CoS
26082          * configuration is asymmetric on TX and RX sides.
26083          * If this flag is set to '0', then PRI to CoS configuration
26084          * is symmetric on TX and RX sides.
26085          */
26086         #define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
26087                 UINT32_C(0x1)
26088         uint8_t unused_0[6];
26089         /*
26090          * This field is used in Output records to indicate that the output
26091          * is completely written to RAM. This field should be read as '1'
26092          * to indicate that the output has been completely written.
26093          * When writing a command completion or response to an internal processor,
26094          * the order of writes has to be such that this field is written last.
26095          */
26096         uint8_t valid;
26097 } __rte_packed;
26098
26099 /**************************
26100  * hwrm_queue_pri2cos_cfg *
26101  **************************/
26102
26103
26104 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
26105 struct hwrm_queue_pri2cos_cfg_input {
26106         /* The HWRM command request type. */
26107         uint16_t        req_type;
26108         /*
26109          * The completion ring to send the completion event on. This should
26110          * be the NQ ID returned from the `nq_alloc` HWRM command.
26111          */
26112         uint16_t        cmpl_ring;
26113         /*
26114          * The sequence ID is used by the driver for tracking multiple
26115          * commands. This ID is treated as opaque data by the firmware and
26116          * the value is returned in the `hwrm_resp_hdr` upon completion.
26117          */
26118         uint16_t        seq_id;
26119         /*
26120          * The target ID of the command:
26121          * * 0x0-0xFFF8 - The function ID
26122          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26123          * * 0xFFFD - Reserved for user-space HWRM interface
26124          * * 0xFFFF - HWRM
26125          */
26126         uint16_t        target_id;
26127         /*
26128          * A physical address pointer pointing to a host buffer that the
26129          * command's response data will be written. This can be either a host
26130          * physical address (HPA) or a guest physical address (GPA) and must
26131          * point to a physically contiguous block of memory.
26132          */
26133         uint64_t        resp_addr;
26134         uint32_t        flags;
26135         /*
26136          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
26137          * This enumeration is used for resources that are similar for both
26138          * TX and RX paths of the chip.
26139          */
26140         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
26141         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT  0
26142         /* tx path */
26143         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
26144         /* rx path */
26145         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
26146         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
26147         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
26148         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST \
26149                 HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
26150         /*
26151          * When this bit is set to '0', the mapping is requested
26152          * for PRI from tunnel headers.
26153          * When this bit is set to '1', the mapping is requested
26154          * for PRI from inner packet headers.
26155          */
26156         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN     UINT32_C(0x4)
26157         uint32_t        enables;
26158         /*
26159          * This bit must be '1' for the pri0_cos_queue_id field to be
26160          * configured.
26161          */
26162         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID \
26163                 UINT32_C(0x1)
26164         /*
26165          * This bit must be '1' for the pri1_cos_queue_id field to be
26166          * configured.
26167          */
26168         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID \
26169                 UINT32_C(0x2)
26170         /*
26171          * This bit must be '1' for the pri2_cos_queue_id field to be
26172          * configured.
26173          */
26174         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID \
26175                 UINT32_C(0x4)
26176         /*
26177          * This bit must be '1' for the pri3_cos_queue_id field to be
26178          * configured.
26179          */
26180         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID \
26181                 UINT32_C(0x8)
26182         /*
26183          * This bit must be '1' for the pri4_cos_queue_id field to be
26184          * configured.
26185          */
26186         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID \
26187                 UINT32_C(0x10)
26188         /*
26189          * This bit must be '1' for the pri5_cos_queue_id field to be
26190          * configured.
26191          */
26192         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID \
26193                 UINT32_C(0x20)
26194         /*
26195          * This bit must be '1' for the pri6_cos_queue_id field to be
26196          * configured.
26197          */
26198         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID \
26199                 UINT32_C(0x40)
26200         /*
26201          * This bit must be '1' for the pri7_cos_queue_id field to be
26202          * configured.
26203          */
26204         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID \
26205                 UINT32_C(0x80)
26206         /*
26207          * Port ID of port for which the table is being configured.
26208          * The HWRM needs to check whether this function is allowed
26209          * to configure pri2cos mapping on this port.
26210          */
26211         uint8_t port_id;
26212         /*
26213          * CoS Queue assigned to priority 0. This value can only
26214          * be changed before traffic has started.
26215          */
26216         uint8_t pri0_cos_queue_id;
26217         /*
26218          * CoS Queue assigned to priority 1. This value can only
26219          * be changed before traffic has started.
26220          */
26221         uint8_t pri1_cos_queue_id;
26222         /*
26223          * CoS Queue assigned to priority 2  This value can only
26224          * be changed before traffic has started.
26225          */
26226         uint8_t pri2_cos_queue_id;
26227         /*
26228          * CoS Queue assigned to priority 3. This value can only
26229          * be changed before traffic has started.
26230          */
26231         uint8_t pri3_cos_queue_id;
26232         /*
26233          * CoS Queue assigned to priority 4. This value can only
26234          * be changed before traffic has started.
26235          */
26236         uint8_t pri4_cos_queue_id;
26237         /*
26238          * CoS Queue assigned to priority 5. This value can only
26239          * be changed before traffic has started.
26240          */
26241         uint8_t pri5_cos_queue_id;
26242         /*
26243          * CoS Queue assigned to priority 6. This value can only
26244          * be changed before traffic has started.
26245          */
26246         uint8_t pri6_cos_queue_id;
26247         /*
26248          * CoS Queue assigned to priority 7. This value can only
26249          * be changed before traffic has started.
26250          */
26251         uint8_t pri7_cos_queue_id;
26252         uint8_t unused_0[7];
26253 } __rte_packed;
26254
26255 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
26256 struct hwrm_queue_pri2cos_cfg_output {
26257         /* The specific error status for the command. */
26258         uint16_t        error_code;
26259         /* The HWRM command request type. */
26260         uint16_t        req_type;
26261         /* The sequence ID from the original command. */
26262         uint16_t        seq_id;
26263         /* The length of the response data in number of bytes. */
26264         uint16_t        resp_len;
26265         uint8_t unused_0[7];
26266         /*
26267          * This field is used in Output records to indicate that the output
26268          * is completely written to RAM. This field should be read as '1'
26269          * to indicate that the output has been completely written.
26270          * When writing a command completion or response to an internal processor,
26271          * the order of writes has to be such that this field is written last.
26272          */
26273         uint8_t valid;
26274 } __rte_packed;
26275
26276 /**************************
26277  * hwrm_queue_cos2bw_qcfg *
26278  **************************/
26279
26280
26281 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
26282 struct hwrm_queue_cos2bw_qcfg_input {
26283         /* The HWRM command request type. */
26284         uint16_t        req_type;
26285         /*
26286          * The completion ring to send the completion event on. This should
26287          * be the NQ ID returned from the `nq_alloc` HWRM command.
26288          */
26289         uint16_t        cmpl_ring;
26290         /*
26291          * The sequence ID is used by the driver for tracking multiple
26292          * commands. This ID is treated as opaque data by the firmware and
26293          * the value is returned in the `hwrm_resp_hdr` upon completion.
26294          */
26295         uint16_t        seq_id;
26296         /*
26297          * The target ID of the command:
26298          * * 0x0-0xFFF8 - The function ID
26299          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26300          * * 0xFFFD - Reserved for user-space HWRM interface
26301          * * 0xFFFF - HWRM
26302          */
26303         uint16_t        target_id;
26304         /*
26305          * A physical address pointer pointing to a host buffer that the
26306          * command's response data will be written. This can be either a host
26307          * physical address (HPA) or a guest physical address (GPA) and must
26308          * point to a physically contiguous block of memory.
26309          */
26310         uint64_t        resp_addr;
26311         /*
26312          * Port ID of port for which the table is being configured.
26313          * The HWRM needs to check whether this function is allowed
26314          * to configure TC BW assignment on this port.
26315          */
26316         uint16_t        port_id;
26317         uint8_t unused_0[6];
26318 } __rte_packed;
26319
26320 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
26321 struct hwrm_queue_cos2bw_qcfg_output {
26322         /* The specific error status for the command. */
26323         uint16_t        error_code;
26324         /* The HWRM command request type. */
26325         uint16_t        req_type;
26326         /* The sequence ID from the original command. */
26327         uint16_t        seq_id;
26328         /* The length of the response data in number of bytes. */
26329         uint16_t        resp_len;
26330         /* ID of CoS Queue 0. */
26331         uint8_t queue_id0;
26332         uint8_t unused_0;
26333         uint16_t        unused_1;
26334         /*
26335          * Minimum BW allocated to CoS Queue.
26336          * The HWRM will translate this value into byte counter and
26337          * time interval used for this COS inside the device.
26338          */
26339         uint32_t        queue_id0_min_bw;
26340         /* The bandwidth value. */
26341         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
26342                 UINT32_C(0xfffffff)
26343         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
26344                 0
26345         /* The granularity of the value (bits or bytes). */
26346         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE \
26347                 UINT32_C(0x10000000)
26348         /* Value is in bits. */
26349         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
26350                 (UINT32_C(0x0) << 28)
26351         /* Value is in bytes. */
26352         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
26353                 (UINT32_C(0x1) << 28)
26354         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
26355                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
26356         /* bw_value_unit is 3 b */
26357         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
26358                 UINT32_C(0xe0000000)
26359         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
26360                 29
26361         /* Value is in Mb or MB (base 10). */
26362         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
26363                 (UINT32_C(0x0) << 29)
26364         /* Value is in Kb or KB (base 10). */
26365         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
26366                 (UINT32_C(0x2) << 29)
26367         /* Value is in bits or bytes. */
26368         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
26369                 (UINT32_C(0x4) << 29)
26370         /* Value is in Gb or GB (base 10). */
26371         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
26372                 (UINT32_C(0x6) << 29)
26373         /* Value is in 1/100th of a percentage of total bandwidth. */
26374         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
26375                 (UINT32_C(0x1) << 29)
26376         /* Invalid unit */
26377         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
26378                 (UINT32_C(0x7) << 29)
26379         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
26380                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
26381         /*
26382          * Maximum BW allocated to CoS Queue.
26383          * The HWRM will translate this value into byte counter and
26384          * time interval used for this COS inside the device.
26385          */
26386         uint32_t        queue_id0_max_bw;
26387         /* The bandwidth value. */
26388         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
26389                 UINT32_C(0xfffffff)
26390         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
26391                 0
26392         /* The granularity of the value (bits or bytes). */
26393         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE \
26394                 UINT32_C(0x10000000)
26395         /* Value is in bits. */
26396         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
26397                 (UINT32_C(0x0) << 28)
26398         /* Value is in bytes. */
26399         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
26400                 (UINT32_C(0x1) << 28)
26401         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
26402                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
26403         /* bw_value_unit is 3 b */
26404         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
26405                 UINT32_C(0xe0000000)
26406         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
26407                 29
26408         /* Value is in Mb or MB (base 10). */
26409         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
26410                 (UINT32_C(0x0) << 29)
26411         /* Value is in Kb or KB (base 10). */
26412         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
26413                 (UINT32_C(0x2) << 29)
26414         /* Value is in bits or bytes. */
26415         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
26416                 (UINT32_C(0x4) << 29)
26417         /* Value is in Gb or GB (base 10). */
26418         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
26419                 (UINT32_C(0x6) << 29)
26420         /* Value is in 1/100th of a percentage of total bandwidth. */
26421         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
26422                 (UINT32_C(0x1) << 29)
26423         /* Invalid unit */
26424         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
26425                 (UINT32_C(0x7) << 29)
26426         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
26427                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
26428         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26429         uint8_t queue_id0_tsa_assign;
26430         /* Strict Priority */
26431         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP \
26432                 UINT32_C(0x0)
26433         /* Enhanced Transmission Selection */
26434         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
26435                 UINT32_C(0x1)
26436         /* reserved. */
26437         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
26438                 UINT32_C(0x2)
26439         /* reserved. */
26440         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
26441                 UINT32_C(0xff)
26442         /*
26443          * Priority level for strict priority. Valid only when the
26444          * tsa_assign is 0 - Strict Priority (SP)
26445          * 0..7 - Valid values.
26446          * 8..255 - Reserved.
26447          */
26448         uint8_t queue_id0_pri_lvl;
26449         /*
26450          * Weight used to allocate remaining BW for this COS after
26451          * servicing guaranteed bandwidths for all COS.
26452          */
26453         uint8_t queue_id0_bw_weight;
26454         /* ID of CoS Queue 1. */
26455         uint8_t queue_id1;
26456         /*
26457          * Minimum BW allocated to CoS Queue.
26458          * The HWRM will translate this value into byte counter and
26459          * time interval used for this COS inside the device.
26460          */
26461         uint32_t        queue_id1_min_bw;
26462         /* The bandwidth value. */
26463         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
26464                 UINT32_C(0xfffffff)
26465         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
26466                 0
26467         /* The granularity of the value (bits or bytes). */
26468         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE \
26469                 UINT32_C(0x10000000)
26470         /* Value is in bits. */
26471         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
26472                 (UINT32_C(0x0) << 28)
26473         /* Value is in bytes. */
26474         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
26475                 (UINT32_C(0x1) << 28)
26476         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
26477                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
26478         /* bw_value_unit is 3 b */
26479         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
26480                 UINT32_C(0xe0000000)
26481         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
26482                 29
26483         /* Value is in Mb or MB (base 10). */
26484         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
26485                 (UINT32_C(0x0) << 29)
26486         /* Value is in Kb or KB (base 10). */
26487         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
26488                 (UINT32_C(0x2) << 29)
26489         /* Value is in bits or bytes. */
26490         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
26491                 (UINT32_C(0x4) << 29)
26492         /* Value is in Gb or GB (base 10). */
26493         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
26494                 (UINT32_C(0x6) << 29)
26495         /* Value is in 1/100th of a percentage of total bandwidth. */
26496         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
26497                 (UINT32_C(0x1) << 29)
26498         /* Invalid unit */
26499         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
26500                 (UINT32_C(0x7) << 29)
26501         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
26502                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
26503         /*
26504          * Maximum BW allocated to CoS queue.
26505          * The HWRM will translate this value into byte counter and
26506          * time interval used for this COS inside the device.
26507          */
26508         uint32_t        queue_id1_max_bw;
26509         /* The bandwidth value. */
26510         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
26511                 UINT32_C(0xfffffff)
26512         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
26513                 0
26514         /* The granularity of the value (bits or bytes). */
26515         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE \
26516                 UINT32_C(0x10000000)
26517         /* Value is in bits. */
26518         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
26519                 (UINT32_C(0x0) << 28)
26520         /* Value is in bytes. */
26521         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
26522                 (UINT32_C(0x1) << 28)
26523         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
26524                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
26525         /* bw_value_unit is 3 b */
26526         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
26527                 UINT32_C(0xe0000000)
26528         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
26529                 29
26530         /* Value is in Mb or MB (base 10). */
26531         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
26532                 (UINT32_C(0x0) << 29)
26533         /* Value is in Kb or KB (base 10). */
26534         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
26535                 (UINT32_C(0x2) << 29)
26536         /* Value is in bits or bytes. */
26537         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
26538                 (UINT32_C(0x4) << 29)
26539         /* Value is in Gb or GB (base 10). */
26540         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
26541                 (UINT32_C(0x6) << 29)
26542         /* Value is in 1/100th of a percentage of total bandwidth. */
26543         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
26544                 (UINT32_C(0x1) << 29)
26545         /* Invalid unit */
26546         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
26547                 (UINT32_C(0x7) << 29)
26548         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
26549                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
26550         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26551         uint8_t queue_id1_tsa_assign;
26552         /* Strict Priority */
26553         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP \
26554                 UINT32_C(0x0)
26555         /* Enhanced Transmission Selection */
26556         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
26557                 UINT32_C(0x1)
26558         /* reserved. */
26559         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
26560                 UINT32_C(0x2)
26561         /* reserved. */
26562         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
26563                 UINT32_C(0xff)
26564         /*
26565          * Priority level for strict priority. Valid only when the
26566          * tsa_assign is 0 - Strict Priority (SP)
26567          * 0..7 - Valid values.
26568          * 8..255 - Reserved.
26569          */
26570         uint8_t queue_id1_pri_lvl;
26571         /*
26572          * Weight used to allocate remaining BW for this COS after
26573          * servicing guaranteed bandwidths for all COS.
26574          */
26575         uint8_t queue_id1_bw_weight;
26576         /* ID of CoS Queue 2. */
26577         uint8_t queue_id2;
26578         /*
26579          * Minimum BW allocated to CoS Queue.
26580          * The HWRM will translate this value into byte counter and
26581          * time interval used for this COS inside the device.
26582          */
26583         uint32_t        queue_id2_min_bw;
26584         /* The bandwidth value. */
26585         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
26586                 UINT32_C(0xfffffff)
26587         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
26588                 0
26589         /* The granularity of the value (bits or bytes). */
26590         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE \
26591                 UINT32_C(0x10000000)
26592         /* Value is in bits. */
26593         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
26594                 (UINT32_C(0x0) << 28)
26595         /* Value is in bytes. */
26596         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
26597                 (UINT32_C(0x1) << 28)
26598         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
26599                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
26600         /* bw_value_unit is 3 b */
26601         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
26602                 UINT32_C(0xe0000000)
26603         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
26604                 29
26605         /* Value is in Mb or MB (base 10). */
26606         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
26607                 (UINT32_C(0x0) << 29)
26608         /* Value is in Kb or KB (base 10). */
26609         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
26610                 (UINT32_C(0x2) << 29)
26611         /* Value is in bits or bytes. */
26612         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
26613                 (UINT32_C(0x4) << 29)
26614         /* Value is in Gb or GB (base 10). */
26615         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
26616                 (UINT32_C(0x6) << 29)
26617         /* Value is in 1/100th of a percentage of total bandwidth. */
26618         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
26619                 (UINT32_C(0x1) << 29)
26620         /* Invalid unit */
26621         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
26622                 (UINT32_C(0x7) << 29)
26623         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
26624                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
26625         /*
26626          * Maximum BW allocated to CoS queue.
26627          * The HWRM will translate this value into byte counter and
26628          * time interval used for this COS inside the device.
26629          */
26630         uint32_t        queue_id2_max_bw;
26631         /* The bandwidth value. */
26632         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
26633                 UINT32_C(0xfffffff)
26634         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
26635                 0
26636         /* The granularity of the value (bits or bytes). */
26637         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE \
26638                 UINT32_C(0x10000000)
26639         /* Value is in bits. */
26640         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
26641                 (UINT32_C(0x0) << 28)
26642         /* Value is in bytes. */
26643         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
26644                 (UINT32_C(0x1) << 28)
26645         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
26646                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
26647         /* bw_value_unit is 3 b */
26648         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
26649                 UINT32_C(0xe0000000)
26650         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
26651                 29
26652         /* Value is in Mb or MB (base 10). */
26653         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
26654                 (UINT32_C(0x0) << 29)
26655         /* Value is in Kb or KB (base 10). */
26656         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
26657                 (UINT32_C(0x2) << 29)
26658         /* Value is in bits or bytes. */
26659         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
26660                 (UINT32_C(0x4) << 29)
26661         /* Value is in Gb or GB (base 10). */
26662         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
26663                 (UINT32_C(0x6) << 29)
26664         /* Value is in 1/100th of a percentage of total bandwidth. */
26665         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
26666                 (UINT32_C(0x1) << 29)
26667         /* Invalid unit */
26668         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
26669                 (UINT32_C(0x7) << 29)
26670         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
26671                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
26672         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26673         uint8_t queue_id2_tsa_assign;
26674         /* Strict Priority */
26675         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP \
26676                 UINT32_C(0x0)
26677         /* Enhanced Transmission Selection */
26678         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
26679                 UINT32_C(0x1)
26680         /* reserved. */
26681         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
26682                 UINT32_C(0x2)
26683         /* reserved. */
26684         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
26685                 UINT32_C(0xff)
26686         /*
26687          * Priority level for strict priority. Valid only when the
26688          * tsa_assign is 0 - Strict Priority (SP)
26689          * 0..7 - Valid values.
26690          * 8..255 - Reserved.
26691          */
26692         uint8_t queue_id2_pri_lvl;
26693         /*
26694          * Weight used to allocate remaining BW for this COS after
26695          * servicing guaranteed bandwidths for all COS.
26696          */
26697         uint8_t queue_id2_bw_weight;
26698         /* ID of CoS Queue 3. */
26699         uint8_t queue_id3;
26700         /*
26701          * Minimum BW allocated to CoS Queue.
26702          * The HWRM will translate this value into byte counter and
26703          * time interval used for this COS inside the device.
26704          */
26705         uint32_t        queue_id3_min_bw;
26706         /* The bandwidth value. */
26707         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
26708                 UINT32_C(0xfffffff)
26709         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
26710                 0
26711         /* The granularity of the value (bits or bytes). */
26712         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE \
26713                 UINT32_C(0x10000000)
26714         /* Value is in bits. */
26715         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
26716                 (UINT32_C(0x0) << 28)
26717         /* Value is in bytes. */
26718         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
26719                 (UINT32_C(0x1) << 28)
26720         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
26721                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
26722         /* bw_value_unit is 3 b */
26723         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
26724                 UINT32_C(0xe0000000)
26725         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
26726                 29
26727         /* Value is in Mb or MB (base 10). */
26728         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
26729                 (UINT32_C(0x0) << 29)
26730         /* Value is in Kb or KB (base 10). */
26731         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
26732                 (UINT32_C(0x2) << 29)
26733         /* Value is in bits or bytes. */
26734         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
26735                 (UINT32_C(0x4) << 29)
26736         /* Value is in Gb or GB (base 10). */
26737         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
26738                 (UINT32_C(0x6) << 29)
26739         /* Value is in 1/100th of a percentage of total bandwidth. */
26740         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
26741                 (UINT32_C(0x1) << 29)
26742         /* Invalid unit */
26743         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
26744                 (UINT32_C(0x7) << 29)
26745         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
26746                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
26747         /*
26748          * Maximum BW allocated to CoS queue.
26749          * The HWRM will translate this value into byte counter and
26750          * time interval used for this COS inside the device.
26751          */
26752         uint32_t        queue_id3_max_bw;
26753         /* The bandwidth value. */
26754         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
26755                 UINT32_C(0xfffffff)
26756         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
26757                 0
26758         /* The granularity of the value (bits or bytes). */
26759         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE \
26760                 UINT32_C(0x10000000)
26761         /* Value is in bits. */
26762         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
26763                 (UINT32_C(0x0) << 28)
26764         /* Value is in bytes. */
26765         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
26766                 (UINT32_C(0x1) << 28)
26767         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
26768                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
26769         /* bw_value_unit is 3 b */
26770         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
26771                 UINT32_C(0xe0000000)
26772         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
26773                 29
26774         /* Value is in Mb or MB (base 10). */
26775         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
26776                 (UINT32_C(0x0) << 29)
26777         /* Value is in Kb or KB (base 10). */
26778         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
26779                 (UINT32_C(0x2) << 29)
26780         /* Value is in bits or bytes. */
26781         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
26782                 (UINT32_C(0x4) << 29)
26783         /* Value is in Gb or GB (base 10). */
26784         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
26785                 (UINT32_C(0x6) << 29)
26786         /* Value is in 1/100th of a percentage of total bandwidth. */
26787         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
26788                 (UINT32_C(0x1) << 29)
26789         /* Invalid unit */
26790         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
26791                 (UINT32_C(0x7) << 29)
26792         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
26793                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
26794         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26795         uint8_t queue_id3_tsa_assign;
26796         /* Strict Priority */
26797         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP \
26798                 UINT32_C(0x0)
26799         /* Enhanced Transmission Selection */
26800         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
26801                 UINT32_C(0x1)
26802         /* reserved. */
26803         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
26804                 UINT32_C(0x2)
26805         /* reserved. */
26806         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
26807                 UINT32_C(0xff)
26808         /*
26809          * Priority level for strict priority. Valid only when the
26810          * tsa_assign is 0 - Strict Priority (SP)
26811          * 0..7 - Valid values.
26812          * 8..255 - Reserved.
26813          */
26814         uint8_t queue_id3_pri_lvl;
26815         /*
26816          * Weight used to allocate remaining BW for this COS after
26817          * servicing guaranteed bandwidths for all COS.
26818          */
26819         uint8_t queue_id3_bw_weight;
26820         /* ID of CoS Queue 4. */
26821         uint8_t queue_id4;
26822         /*
26823          * Minimum BW allocated to CoS Queue.
26824          * The HWRM will translate this value into byte counter and
26825          * time interval used for this COS inside the device.
26826          */
26827         uint32_t        queue_id4_min_bw;
26828         /* The bandwidth value. */
26829         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
26830                 UINT32_C(0xfffffff)
26831         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
26832                 0
26833         /* The granularity of the value (bits or bytes). */
26834         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE \
26835                 UINT32_C(0x10000000)
26836         /* Value is in bits. */
26837         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
26838                 (UINT32_C(0x0) << 28)
26839         /* Value is in bytes. */
26840         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
26841                 (UINT32_C(0x1) << 28)
26842         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
26843                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
26844         /* bw_value_unit is 3 b */
26845         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
26846                 UINT32_C(0xe0000000)
26847         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
26848                 29
26849         /* Value is in Mb or MB (base 10). */
26850         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
26851                 (UINT32_C(0x0) << 29)
26852         /* Value is in Kb or KB (base 10). */
26853         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
26854                 (UINT32_C(0x2) << 29)
26855         /* Value is in bits or bytes. */
26856         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
26857                 (UINT32_C(0x4) << 29)
26858         /* Value is in Gb or GB (base 10). */
26859         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
26860                 (UINT32_C(0x6) << 29)
26861         /* Value is in 1/100th of a percentage of total bandwidth. */
26862         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
26863                 (UINT32_C(0x1) << 29)
26864         /* Invalid unit */
26865         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
26866                 (UINT32_C(0x7) << 29)
26867         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
26868                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
26869         /*
26870          * Maximum BW allocated to CoS queue.
26871          * The HWRM will translate this value into byte counter and
26872          * time interval used for this COS inside the device.
26873          */
26874         uint32_t        queue_id4_max_bw;
26875         /* The bandwidth value. */
26876         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
26877                 UINT32_C(0xfffffff)
26878         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
26879                 0
26880         /* The granularity of the value (bits or bytes). */
26881         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE \
26882                 UINT32_C(0x10000000)
26883         /* Value is in bits. */
26884         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
26885                 (UINT32_C(0x0) << 28)
26886         /* Value is in bytes. */
26887         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
26888                 (UINT32_C(0x1) << 28)
26889         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
26890                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
26891         /* bw_value_unit is 3 b */
26892         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
26893                 UINT32_C(0xe0000000)
26894         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
26895                 29
26896         /* Value is in Mb or MB (base 10). */
26897         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
26898                 (UINT32_C(0x0) << 29)
26899         /* Value is in Kb or KB (base 10). */
26900         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
26901                 (UINT32_C(0x2) << 29)
26902         /* Value is in bits or bytes. */
26903         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
26904                 (UINT32_C(0x4) << 29)
26905         /* Value is in Gb or GB (base 10). */
26906         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
26907                 (UINT32_C(0x6) << 29)
26908         /* Value is in 1/100th of a percentage of total bandwidth. */
26909         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
26910                 (UINT32_C(0x1) << 29)
26911         /* Invalid unit */
26912         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
26913                 (UINT32_C(0x7) << 29)
26914         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
26915                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
26916         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
26917         uint8_t queue_id4_tsa_assign;
26918         /* Strict Priority */
26919         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP \
26920                 UINT32_C(0x0)
26921         /* Enhanced Transmission Selection */
26922         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
26923                 UINT32_C(0x1)
26924         /* reserved. */
26925         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
26926                 UINT32_C(0x2)
26927         /* reserved. */
26928         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
26929                 UINT32_C(0xff)
26930         /*
26931          * Priority level for strict priority. Valid only when the
26932          * tsa_assign is 0 - Strict Priority (SP)
26933          * 0..7 - Valid values.
26934          * 8..255 - Reserved.
26935          */
26936         uint8_t queue_id4_pri_lvl;
26937         /*
26938          * Weight used to allocate remaining BW for this COS after
26939          * servicing guaranteed bandwidths for all COS.
26940          */
26941         uint8_t queue_id4_bw_weight;
26942         /* ID of CoS Queue 5. */
26943         uint8_t queue_id5;
26944         /*
26945          * Minimum BW allocated to CoS Queue.
26946          * The HWRM will translate this value into byte counter and
26947          * time interval used for this COS inside the device.
26948          */
26949         uint32_t        queue_id5_min_bw;
26950         /* The bandwidth value. */
26951         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
26952                 UINT32_C(0xfffffff)
26953         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
26954                 0
26955         /* The granularity of the value (bits or bytes). */
26956         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE \
26957                 UINT32_C(0x10000000)
26958         /* Value is in bits. */
26959         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
26960                 (UINT32_C(0x0) << 28)
26961         /* Value is in bytes. */
26962         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
26963                 (UINT32_C(0x1) << 28)
26964         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
26965                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
26966         /* bw_value_unit is 3 b */
26967         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
26968                 UINT32_C(0xe0000000)
26969         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
26970                 29
26971         /* Value is in Mb or MB (base 10). */
26972         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
26973                 (UINT32_C(0x0) << 29)
26974         /* Value is in Kb or KB (base 10). */
26975         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
26976                 (UINT32_C(0x2) << 29)
26977         /* Value is in bits or bytes. */
26978         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
26979                 (UINT32_C(0x4) << 29)
26980         /* Value is in Gb or GB (base 10). */
26981         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
26982                 (UINT32_C(0x6) << 29)
26983         /* Value is in 1/100th of a percentage of total bandwidth. */
26984         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
26985                 (UINT32_C(0x1) << 29)
26986         /* Invalid unit */
26987         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
26988                 (UINT32_C(0x7) << 29)
26989         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
26990                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
26991         /*
26992          * Maximum BW allocated to CoS queue.
26993          * The HWRM will translate this value into byte counter and
26994          * time interval used for this COS inside the device.
26995          */
26996         uint32_t        queue_id5_max_bw;
26997         /* The bandwidth value. */
26998         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
26999                 UINT32_C(0xfffffff)
27000         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
27001                 0
27002         /* The granularity of the value (bits or bytes). */
27003         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE \
27004                 UINT32_C(0x10000000)
27005         /* Value is in bits. */
27006         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
27007                 (UINT32_C(0x0) << 28)
27008         /* Value is in bytes. */
27009         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
27010                 (UINT32_C(0x1) << 28)
27011         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
27012                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
27013         /* bw_value_unit is 3 b */
27014         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
27015                 UINT32_C(0xe0000000)
27016         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
27017                 29
27018         /* Value is in Mb or MB (base 10). */
27019         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
27020                 (UINT32_C(0x0) << 29)
27021         /* Value is in Kb or KB (base 10). */
27022         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
27023                 (UINT32_C(0x2) << 29)
27024         /* Value is in bits or bytes. */
27025         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
27026                 (UINT32_C(0x4) << 29)
27027         /* Value is in Gb or GB (base 10). */
27028         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
27029                 (UINT32_C(0x6) << 29)
27030         /* Value is in 1/100th of a percentage of total bandwidth. */
27031         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
27032                 (UINT32_C(0x1) << 29)
27033         /* Invalid unit */
27034         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
27035                 (UINT32_C(0x7) << 29)
27036         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
27037                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
27038         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27039         uint8_t queue_id5_tsa_assign;
27040         /* Strict Priority */
27041         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP \
27042                 UINT32_C(0x0)
27043         /* Enhanced Transmission Selection */
27044         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
27045                 UINT32_C(0x1)
27046         /* reserved. */
27047         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
27048                 UINT32_C(0x2)
27049         /* reserved. */
27050         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
27051                 UINT32_C(0xff)
27052         /*
27053          * Priority level for strict priority. Valid only when the
27054          * tsa_assign is 0 - Strict Priority (SP)
27055          * 0..7 - Valid values.
27056          * 8..255 - Reserved.
27057          */
27058         uint8_t queue_id5_pri_lvl;
27059         /*
27060          * Weight used to allocate remaining BW for this COS after
27061          * servicing guaranteed bandwidths for all COS.
27062          */
27063         uint8_t queue_id5_bw_weight;
27064         /* ID of CoS Queue 6. */
27065         uint8_t queue_id6;
27066         /*
27067          * Minimum BW allocated to CoS Queue.
27068          * The HWRM will translate this value into byte counter and
27069          * time interval used for this COS inside the device.
27070          */
27071         uint32_t        queue_id6_min_bw;
27072         /* The bandwidth value. */
27073         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
27074                 UINT32_C(0xfffffff)
27075         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
27076                 0
27077         /* The granularity of the value (bits or bytes). */
27078         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE \
27079                 UINT32_C(0x10000000)
27080         /* Value is in bits. */
27081         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
27082                 (UINT32_C(0x0) << 28)
27083         /* Value is in bytes. */
27084         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
27085                 (UINT32_C(0x1) << 28)
27086         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
27087                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
27088         /* bw_value_unit is 3 b */
27089         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
27090                 UINT32_C(0xe0000000)
27091         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
27092                 29
27093         /* Value is in Mb or MB (base 10). */
27094         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
27095                 (UINT32_C(0x0) << 29)
27096         /* Value is in Kb or KB (base 10). */
27097         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
27098                 (UINT32_C(0x2) << 29)
27099         /* Value is in bits or bytes. */
27100         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
27101                 (UINT32_C(0x4) << 29)
27102         /* Value is in Gb or GB (base 10). */
27103         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
27104                 (UINT32_C(0x6) << 29)
27105         /* Value is in 1/100th of a percentage of total bandwidth. */
27106         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
27107                 (UINT32_C(0x1) << 29)
27108         /* Invalid unit */
27109         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
27110                 (UINT32_C(0x7) << 29)
27111         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
27112                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
27113         /*
27114          * Maximum BW allocated to CoS queue.
27115          * The HWRM will translate this value into byte counter and
27116          * time interval used for this COS inside the device.
27117          */
27118         uint32_t        queue_id6_max_bw;
27119         /* The bandwidth value. */
27120         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
27121                 UINT32_C(0xfffffff)
27122         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
27123                 0
27124         /* The granularity of the value (bits or bytes). */
27125         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE \
27126                 UINT32_C(0x10000000)
27127         /* Value is in bits. */
27128         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
27129                 (UINT32_C(0x0) << 28)
27130         /* Value is in bytes. */
27131         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
27132                 (UINT32_C(0x1) << 28)
27133         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
27134                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
27135         /* bw_value_unit is 3 b */
27136         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
27137                 UINT32_C(0xe0000000)
27138         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
27139                 29
27140         /* Value is in Mb or MB (base 10). */
27141         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
27142                 (UINT32_C(0x0) << 29)
27143         /* Value is in Kb or KB (base 10). */
27144         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
27145                 (UINT32_C(0x2) << 29)
27146         /* Value is in bits or bytes. */
27147         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
27148                 (UINT32_C(0x4) << 29)
27149         /* Value is in Gb or GB (base 10). */
27150         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
27151                 (UINT32_C(0x6) << 29)
27152         /* Value is in 1/100th of a percentage of total bandwidth. */
27153         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
27154                 (UINT32_C(0x1) << 29)
27155         /* Invalid unit */
27156         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
27157                 (UINT32_C(0x7) << 29)
27158         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
27159                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
27160         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27161         uint8_t queue_id6_tsa_assign;
27162         /* Strict Priority */
27163         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP \
27164                 UINT32_C(0x0)
27165         /* Enhanced Transmission Selection */
27166         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
27167                 UINT32_C(0x1)
27168         /* reserved. */
27169         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
27170                 UINT32_C(0x2)
27171         /* reserved. */
27172         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
27173                 UINT32_C(0xff)
27174         /*
27175          * Priority level for strict priority. Valid only when the
27176          * tsa_assign is 0 - Strict Priority (SP)
27177          * 0..7 - Valid values.
27178          * 8..255 - Reserved.
27179          */
27180         uint8_t queue_id6_pri_lvl;
27181         /*
27182          * Weight used to allocate remaining BW for this COS after
27183          * servicing guaranteed bandwidths for all COS.
27184          */
27185         uint8_t queue_id6_bw_weight;
27186         /* ID of CoS Queue 7. */
27187         uint8_t queue_id7;
27188         /*
27189          * Minimum BW allocated to CoS Queue.
27190          * The HWRM will translate this value into byte counter and
27191          * time interval used for this COS inside the device.
27192          */
27193         uint32_t        queue_id7_min_bw;
27194         /* The bandwidth value. */
27195         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
27196                 UINT32_C(0xfffffff)
27197         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
27198                 0
27199         /* The granularity of the value (bits or bytes). */
27200         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE \
27201                 UINT32_C(0x10000000)
27202         /* Value is in bits. */
27203         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
27204                 (UINT32_C(0x0) << 28)
27205         /* Value is in bytes. */
27206         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
27207                 (UINT32_C(0x1) << 28)
27208         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
27209                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
27210         /* bw_value_unit is 3 b */
27211         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
27212                 UINT32_C(0xe0000000)
27213         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
27214                 29
27215         /* Value is in Mb or MB (base 10). */
27216         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
27217                 (UINT32_C(0x0) << 29)
27218         /* Value is in Kb or KB (base 10). */
27219         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
27220                 (UINT32_C(0x2) << 29)
27221         /* Value is in bits or bytes. */
27222         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
27223                 (UINT32_C(0x4) << 29)
27224         /* Value is in Gb or GB (base 10). */
27225         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
27226                 (UINT32_C(0x6) << 29)
27227         /* Value is in 1/100th of a percentage of total bandwidth. */
27228         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
27229                 (UINT32_C(0x1) << 29)
27230         /* Invalid unit */
27231         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
27232                 (UINT32_C(0x7) << 29)
27233         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
27234                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
27235         /*
27236          * Maximum BW allocated to CoS queue.
27237          * The HWRM will translate this value into byte counter and
27238          * time interval used for this COS inside the device.
27239          */
27240         uint32_t        queue_id7_max_bw;
27241         /* The bandwidth value. */
27242         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
27243                 UINT32_C(0xfffffff)
27244         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
27245                 0
27246         /* The granularity of the value (bits or bytes). */
27247         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE \
27248                 UINT32_C(0x10000000)
27249         /* Value is in bits. */
27250         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
27251                 (UINT32_C(0x0) << 28)
27252         /* Value is in bytes. */
27253         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
27254                 (UINT32_C(0x1) << 28)
27255         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
27256                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
27257         /* bw_value_unit is 3 b */
27258         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
27259                 UINT32_C(0xe0000000)
27260         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
27261                 29
27262         /* Value is in Mb or MB (base 10). */
27263         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
27264                 (UINT32_C(0x0) << 29)
27265         /* Value is in Kb or KB (base 10). */
27266         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
27267                 (UINT32_C(0x2) << 29)
27268         /* Value is in bits or bytes. */
27269         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
27270                 (UINT32_C(0x4) << 29)
27271         /* Value is in Gb or GB (base 10). */
27272         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
27273                 (UINT32_C(0x6) << 29)
27274         /* Value is in 1/100th of a percentage of total bandwidth. */
27275         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
27276                 (UINT32_C(0x1) << 29)
27277         /* Invalid unit */
27278         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
27279                 (UINT32_C(0x7) << 29)
27280         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
27281                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
27282         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27283         uint8_t queue_id7_tsa_assign;
27284         /* Strict Priority */
27285         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP \
27286                 UINT32_C(0x0)
27287         /* Enhanced Transmission Selection */
27288         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
27289                 UINT32_C(0x1)
27290         /* reserved. */
27291         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
27292                 UINT32_C(0x2)
27293         /* reserved. */
27294         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
27295                 UINT32_C(0xff)
27296         /*
27297          * Priority level for strict priority. Valid only when the
27298          * tsa_assign is 0 - Strict Priority (SP)
27299          * 0..7 - Valid values.
27300          * 8..255 - Reserved.
27301          */
27302         uint8_t queue_id7_pri_lvl;
27303         /*
27304          * Weight used to allocate remaining BW for this COS after
27305          * servicing guaranteed bandwidths for all COS.
27306          */
27307         uint8_t queue_id7_bw_weight;
27308         uint8_t unused_2[4];
27309         /*
27310          * This field is used in Output records to indicate that the output
27311          * is completely written to RAM. This field should be read as '1'
27312          * to indicate that the output has been completely written.
27313          * When writing a command completion or response to an internal processor,
27314          * the order of writes has to be such that this field is written last.
27315          */
27316         uint8_t valid;
27317 } __rte_packed;
27318
27319 /*************************
27320  * hwrm_queue_cos2bw_cfg *
27321  *************************/
27322
27323
27324 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
27325 struct hwrm_queue_cos2bw_cfg_input {
27326         /* The HWRM command request type. */
27327         uint16_t        req_type;
27328         /*
27329          * The completion ring to send the completion event on. This should
27330          * be the NQ ID returned from the `nq_alloc` HWRM command.
27331          */
27332         uint16_t        cmpl_ring;
27333         /*
27334          * The sequence ID is used by the driver for tracking multiple
27335          * commands. This ID is treated as opaque data by the firmware and
27336          * the value is returned in the `hwrm_resp_hdr` upon completion.
27337          */
27338         uint16_t        seq_id;
27339         /*
27340          * The target ID of the command:
27341          * * 0x0-0xFFF8 - The function ID
27342          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27343          * * 0xFFFD - Reserved for user-space HWRM interface
27344          * * 0xFFFF - HWRM
27345          */
27346         uint16_t        target_id;
27347         /*
27348          * A physical address pointer pointing to a host buffer that the
27349          * command's response data will be written. This can be either a host
27350          * physical address (HPA) or a guest physical address (GPA) and must
27351          * point to a physically contiguous block of memory.
27352          */
27353         uint64_t        resp_addr;
27354         uint32_t        flags;
27355         uint32_t        enables;
27356         /*
27357          * If this bit is set to 1, then all queue_id0 related
27358          * parameters in this command are valid.
27359          */
27360         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID \
27361                 UINT32_C(0x1)
27362         /*
27363          * If this bit is set to 1, then all queue_id1 related
27364          * parameters in this command are valid.
27365          */
27366         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID \
27367                 UINT32_C(0x2)
27368         /*
27369          * If this bit is set to 1, then all queue_id2 related
27370          * parameters in this command are valid.
27371          */
27372         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID \
27373                 UINT32_C(0x4)
27374         /*
27375          * If this bit is set to 1, then all queue_id3 related
27376          * parameters in this command are valid.
27377          */
27378         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID \
27379                 UINT32_C(0x8)
27380         /*
27381          * If this bit is set to 1, then all queue_id4 related
27382          * parameters in this command are valid.
27383          */
27384         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID \
27385                 UINT32_C(0x10)
27386         /*
27387          * If this bit is set to 1, then all queue_id5 related
27388          * parameters in this command are valid.
27389          */
27390         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID \
27391                 UINT32_C(0x20)
27392         /*
27393          * If this bit is set to 1, then all queue_id6 related
27394          * parameters in this command are valid.
27395          */
27396         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID \
27397                 UINT32_C(0x40)
27398         /*
27399          * If this bit is set to 1, then all queue_id7 related
27400          * parameters in this command are valid.
27401          */
27402         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID \
27403                 UINT32_C(0x80)
27404         /*
27405          * Port ID of port for which the table is being configured.
27406          * The HWRM needs to check whether this function is allowed
27407          * to configure TC BW assignment on this port.
27408          */
27409         uint16_t        port_id;
27410         /* ID of CoS Queue 0. */
27411         uint8_t queue_id0;
27412         uint8_t unused_0;
27413         /*
27414          * Minimum BW allocated to CoS Queue.
27415          * The HWRM will translate this value into byte counter and
27416          * time interval used for this COS inside the device.
27417          */
27418         uint32_t        queue_id0_min_bw;
27419         /* The bandwidth value. */
27420         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
27421                 UINT32_C(0xfffffff)
27422         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
27423                 0
27424         /* The granularity of the value (bits or bytes). */
27425         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE \
27426                 UINT32_C(0x10000000)
27427         /* Value is in bits. */
27428         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
27429                 (UINT32_C(0x0) << 28)
27430         /* Value is in bytes. */
27431         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
27432                 (UINT32_C(0x1) << 28)
27433         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
27434                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
27435         /* bw_value_unit is 3 b */
27436         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
27437                 UINT32_C(0xe0000000)
27438         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
27439                 29
27440         /* Value is in Mb or MB (base 10). */
27441         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
27442                 (UINT32_C(0x0) << 29)
27443         /* Value is in Kb or KB (base 10). */
27444         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
27445                 (UINT32_C(0x2) << 29)
27446         /* Value is in bits or bytes. */
27447         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
27448                 (UINT32_C(0x4) << 29)
27449         /* Value is in Gb or GB (base 10). */
27450         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
27451                 (UINT32_C(0x6) << 29)
27452         /* Value is in 1/100th of a percentage of total bandwidth. */
27453         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
27454                 (UINT32_C(0x1) << 29)
27455         /* Invalid unit */
27456         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
27457                 (UINT32_C(0x7) << 29)
27458         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
27459                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
27460         /*
27461          * Maximum BW allocated to CoS Queue.
27462          * The HWRM will translate this value into byte counter and
27463          * time interval used for this COS inside the device.
27464          */
27465         uint32_t        queue_id0_max_bw;
27466         /* The bandwidth value. */
27467         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
27468                 UINT32_C(0xfffffff)
27469         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
27470                 0
27471         /* The granularity of the value (bits or bytes). */
27472         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE \
27473                 UINT32_C(0x10000000)
27474         /* Value is in bits. */
27475         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
27476                 (UINT32_C(0x0) << 28)
27477         /* Value is in bytes. */
27478         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
27479                 (UINT32_C(0x1) << 28)
27480         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
27481                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
27482         /* bw_value_unit is 3 b */
27483         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
27484                 UINT32_C(0xe0000000)
27485         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
27486                 29
27487         /* Value is in Mb or MB (base 10). */
27488         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
27489                 (UINT32_C(0x0) << 29)
27490         /* Value is in Kb or KB (base 10). */
27491         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
27492                 (UINT32_C(0x2) << 29)
27493         /* Value is in bits or bytes. */
27494         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
27495                 (UINT32_C(0x4) << 29)
27496         /* Value is in Gb or GB (base 10). */
27497         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
27498                 (UINT32_C(0x6) << 29)
27499         /* Value is in 1/100th of a percentage of total bandwidth. */
27500         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
27501                 (UINT32_C(0x1) << 29)
27502         /* Invalid unit */
27503         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
27504                 (UINT32_C(0x7) << 29)
27505         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
27506                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
27507         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27508         uint8_t queue_id0_tsa_assign;
27509         /* Strict Priority */
27510         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP \
27511                 UINT32_C(0x0)
27512         /* Enhanced Transmission Selection */
27513         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
27514                 UINT32_C(0x1)
27515         /* reserved. */
27516         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
27517                 UINT32_C(0x2)
27518         /* reserved. */
27519         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
27520                 UINT32_C(0xff)
27521         /*
27522          * Priority level for strict priority. Valid only when the
27523          * tsa_assign is 0 - Strict Priority (SP)
27524          * 0..7 - Valid values.
27525          * 8..255 - Reserved.
27526          */
27527         uint8_t queue_id0_pri_lvl;
27528         /*
27529          * Weight used to allocate remaining BW for this COS after
27530          * servicing guaranteed bandwidths for all COS.
27531          */
27532         uint8_t queue_id0_bw_weight;
27533         /* ID of CoS Queue 1. */
27534         uint8_t queue_id1;
27535         /*
27536          * Minimum BW allocated to CoS Queue.
27537          * The HWRM will translate this value into byte counter and
27538          * time interval used for this COS inside the device.
27539          */
27540         uint32_t        queue_id1_min_bw;
27541         /* The bandwidth value. */
27542         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
27543                 UINT32_C(0xfffffff)
27544         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
27545                 0
27546         /* The granularity of the value (bits or bytes). */
27547         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE \
27548                 UINT32_C(0x10000000)
27549         /* Value is in bits. */
27550         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
27551                 (UINT32_C(0x0) << 28)
27552         /* Value is in bytes. */
27553         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
27554                 (UINT32_C(0x1) << 28)
27555         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
27556                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
27557         /* bw_value_unit is 3 b */
27558         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
27559                 UINT32_C(0xe0000000)
27560         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
27561                 29
27562         /* Value is in Mb or MB (base 10). */
27563         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
27564                 (UINT32_C(0x0) << 29)
27565         /* Value is in Kb or KB (base 10). */
27566         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
27567                 (UINT32_C(0x2) << 29)
27568         /* Value is in bits or bytes. */
27569         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
27570                 (UINT32_C(0x4) << 29)
27571         /* Value is in Gb or GB (base 10). */
27572         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
27573                 (UINT32_C(0x6) << 29)
27574         /* Value is in 1/100th of a percentage of total bandwidth. */
27575         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
27576                 (UINT32_C(0x1) << 29)
27577         /* Invalid unit */
27578         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
27579                 (UINT32_C(0x7) << 29)
27580         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
27581                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
27582         /*
27583          * Maximum BW allocated to CoS queue.
27584          * The HWRM will translate this value into byte counter and
27585          * time interval used for this COS inside the device.
27586          */
27587         uint32_t        queue_id1_max_bw;
27588         /* The bandwidth value. */
27589         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
27590                 UINT32_C(0xfffffff)
27591         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
27592                 0
27593         /* The granularity of the value (bits or bytes). */
27594         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE \
27595                 UINT32_C(0x10000000)
27596         /* Value is in bits. */
27597         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
27598                 (UINT32_C(0x0) << 28)
27599         /* Value is in bytes. */
27600         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
27601                 (UINT32_C(0x1) << 28)
27602         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
27603                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
27604         /* bw_value_unit is 3 b */
27605         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
27606                 UINT32_C(0xe0000000)
27607         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
27608                 29
27609         /* Value is in Mb or MB (base 10). */
27610         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
27611                 (UINT32_C(0x0) << 29)
27612         /* Value is in Kb or KB (base 10). */
27613         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
27614                 (UINT32_C(0x2) << 29)
27615         /* Value is in bits or bytes. */
27616         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
27617                 (UINT32_C(0x4) << 29)
27618         /* Value is in Gb or GB (base 10). */
27619         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
27620                 (UINT32_C(0x6) << 29)
27621         /* Value is in 1/100th of a percentage of total bandwidth. */
27622         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
27623                 (UINT32_C(0x1) << 29)
27624         /* Invalid unit */
27625         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
27626                 (UINT32_C(0x7) << 29)
27627         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
27628                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
27629         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27630         uint8_t queue_id1_tsa_assign;
27631         /* Strict Priority */
27632         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP \
27633                 UINT32_C(0x0)
27634         /* Enhanced Transmission Selection */
27635         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
27636                 UINT32_C(0x1)
27637         /* reserved. */
27638         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
27639                 UINT32_C(0x2)
27640         /* reserved. */
27641         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
27642                 UINT32_C(0xff)
27643         /*
27644          * Priority level for strict priority. Valid only when the
27645          * tsa_assign is 0 - Strict Priority (SP)
27646          * 0..7 - Valid values.
27647          * 8..255 - Reserved.
27648          */
27649         uint8_t queue_id1_pri_lvl;
27650         /*
27651          * Weight used to allocate remaining BW for this COS after
27652          * servicing guaranteed bandwidths for all COS.
27653          */
27654         uint8_t queue_id1_bw_weight;
27655         /* ID of CoS Queue 2. */
27656         uint8_t queue_id2;
27657         /*
27658          * Minimum BW allocated to CoS Queue.
27659          * The HWRM will translate this value into byte counter and
27660          * time interval used for this COS inside the device.
27661          */
27662         uint32_t        queue_id2_min_bw;
27663         /* The bandwidth value. */
27664         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
27665                 UINT32_C(0xfffffff)
27666         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
27667                 0
27668         /* The granularity of the value (bits or bytes). */
27669         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE \
27670                 UINT32_C(0x10000000)
27671         /* Value is in bits. */
27672         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
27673                 (UINT32_C(0x0) << 28)
27674         /* Value is in bytes. */
27675         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
27676                 (UINT32_C(0x1) << 28)
27677         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
27678                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
27679         /* bw_value_unit is 3 b */
27680         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
27681                 UINT32_C(0xe0000000)
27682         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
27683                 29
27684         /* Value is in Mb or MB (base 10). */
27685         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
27686                 (UINT32_C(0x0) << 29)
27687         /* Value is in Kb or KB (base 10). */
27688         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
27689                 (UINT32_C(0x2) << 29)
27690         /* Value is in bits or bytes. */
27691         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
27692                 (UINT32_C(0x4) << 29)
27693         /* Value is in Gb or GB (base 10). */
27694         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
27695                 (UINT32_C(0x6) << 29)
27696         /* Value is in 1/100th of a percentage of total bandwidth. */
27697         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
27698                 (UINT32_C(0x1) << 29)
27699         /* Invalid unit */
27700         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
27701                 (UINT32_C(0x7) << 29)
27702         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
27703                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
27704         /*
27705          * Maximum BW allocated to CoS queue.
27706          * The HWRM will translate this value into byte counter and
27707          * time interval used for this COS inside the device.
27708          */
27709         uint32_t        queue_id2_max_bw;
27710         /* The bandwidth value. */
27711         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
27712                 UINT32_C(0xfffffff)
27713         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
27714                 0
27715         /* The granularity of the value (bits or bytes). */
27716         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE \
27717                 UINT32_C(0x10000000)
27718         /* Value is in bits. */
27719         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
27720                 (UINT32_C(0x0) << 28)
27721         /* Value is in bytes. */
27722         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
27723                 (UINT32_C(0x1) << 28)
27724         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
27725                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
27726         /* bw_value_unit is 3 b */
27727         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
27728                 UINT32_C(0xe0000000)
27729         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
27730                 29
27731         /* Value is in Mb or MB (base 10). */
27732         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
27733                 (UINT32_C(0x0) << 29)
27734         /* Value is in Kb or KB (base 10). */
27735         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
27736                 (UINT32_C(0x2) << 29)
27737         /* Value is in bits or bytes. */
27738         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
27739                 (UINT32_C(0x4) << 29)
27740         /* Value is in Gb or GB (base 10). */
27741         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
27742                 (UINT32_C(0x6) << 29)
27743         /* Value is in 1/100th of a percentage of total bandwidth. */
27744         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
27745                 (UINT32_C(0x1) << 29)
27746         /* Invalid unit */
27747         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
27748                 (UINT32_C(0x7) << 29)
27749         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
27750                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
27751         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27752         uint8_t queue_id2_tsa_assign;
27753         /* Strict Priority */
27754         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP \
27755                 UINT32_C(0x0)
27756         /* Enhanced Transmission Selection */
27757         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
27758                 UINT32_C(0x1)
27759         /* reserved. */
27760         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
27761                 UINT32_C(0x2)
27762         /* reserved. */
27763         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
27764                 UINT32_C(0xff)
27765         /*
27766          * Priority level for strict priority. Valid only when the
27767          * tsa_assign is 0 - Strict Priority (SP)
27768          * 0..7 - Valid values.
27769          * 8..255 - Reserved.
27770          */
27771         uint8_t queue_id2_pri_lvl;
27772         /*
27773          * Weight used to allocate remaining BW for this COS after
27774          * servicing guaranteed bandwidths for all COS.
27775          */
27776         uint8_t queue_id2_bw_weight;
27777         /* ID of CoS Queue 3. */
27778         uint8_t queue_id3;
27779         /*
27780          * Minimum BW allocated to CoS Queue.
27781          * The HWRM will translate this value into byte counter and
27782          * time interval used for this COS inside the device.
27783          */
27784         uint32_t        queue_id3_min_bw;
27785         /* The bandwidth value. */
27786         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
27787                 UINT32_C(0xfffffff)
27788         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
27789                 0
27790         /* The granularity of the value (bits or bytes). */
27791         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE \
27792                 UINT32_C(0x10000000)
27793         /* Value is in bits. */
27794         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
27795                 (UINT32_C(0x0) << 28)
27796         /* Value is in bytes. */
27797         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
27798                 (UINT32_C(0x1) << 28)
27799         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
27800                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
27801         /* bw_value_unit is 3 b */
27802         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
27803                 UINT32_C(0xe0000000)
27804         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
27805                 29
27806         /* Value is in Mb or MB (base 10). */
27807         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
27808                 (UINT32_C(0x0) << 29)
27809         /* Value is in Kb or KB (base 10). */
27810         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
27811                 (UINT32_C(0x2) << 29)
27812         /* Value is in bits or bytes. */
27813         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
27814                 (UINT32_C(0x4) << 29)
27815         /* Value is in Gb or GB (base 10). */
27816         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
27817                 (UINT32_C(0x6) << 29)
27818         /* Value is in 1/100th of a percentage of total bandwidth. */
27819         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
27820                 (UINT32_C(0x1) << 29)
27821         /* Invalid unit */
27822         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
27823                 (UINT32_C(0x7) << 29)
27824         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
27825                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
27826         /*
27827          * Maximum BW allocated to CoS queue.
27828          * The HWRM will translate this value into byte counter and
27829          * time interval used for this COS inside the device.
27830          */
27831         uint32_t        queue_id3_max_bw;
27832         /* The bandwidth value. */
27833         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
27834                 UINT32_C(0xfffffff)
27835         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
27836                 0
27837         /* The granularity of the value (bits or bytes). */
27838         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE \
27839                 UINT32_C(0x10000000)
27840         /* Value is in bits. */
27841         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
27842                 (UINT32_C(0x0) << 28)
27843         /* Value is in bytes. */
27844         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
27845                 (UINT32_C(0x1) << 28)
27846         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
27847                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
27848         /* bw_value_unit is 3 b */
27849         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
27850                 UINT32_C(0xe0000000)
27851         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
27852                 29
27853         /* Value is in Mb or MB (base 10). */
27854         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
27855                 (UINT32_C(0x0) << 29)
27856         /* Value is in Kb or KB (base 10). */
27857         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
27858                 (UINT32_C(0x2) << 29)
27859         /* Value is in bits or bytes. */
27860         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
27861                 (UINT32_C(0x4) << 29)
27862         /* Value is in Gb or GB (base 10). */
27863         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
27864                 (UINT32_C(0x6) << 29)
27865         /* Value is in 1/100th of a percentage of total bandwidth. */
27866         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
27867                 (UINT32_C(0x1) << 29)
27868         /* Invalid unit */
27869         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
27870                 (UINT32_C(0x7) << 29)
27871         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
27872                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
27873         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27874         uint8_t queue_id3_tsa_assign;
27875         /* Strict Priority */
27876         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP \
27877                 UINT32_C(0x0)
27878         /* Enhanced Transmission Selection */
27879         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
27880                 UINT32_C(0x1)
27881         /* reserved. */
27882         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
27883                 UINT32_C(0x2)
27884         /* reserved. */
27885         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
27886                 UINT32_C(0xff)
27887         /*
27888          * Priority level for strict priority. Valid only when the
27889          * tsa_assign is 0 - Strict Priority (SP)
27890          * 0..7 - Valid values.
27891          * 8..255 - Reserved.
27892          */
27893         uint8_t queue_id3_pri_lvl;
27894         /*
27895          * Weight used to allocate remaining BW for this COS after
27896          * servicing guaranteed bandwidths for all COS.
27897          */
27898         uint8_t queue_id3_bw_weight;
27899         /* ID of CoS Queue 4. */
27900         uint8_t queue_id4;
27901         /*
27902          * Minimum BW allocated to CoS Queue.
27903          * The HWRM will translate this value into byte counter and
27904          * time interval used for this COS inside the device.
27905          */
27906         uint32_t        queue_id4_min_bw;
27907         /* The bandwidth value. */
27908         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
27909                 UINT32_C(0xfffffff)
27910         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
27911                 0
27912         /* The granularity of the value (bits or bytes). */
27913         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE \
27914                 UINT32_C(0x10000000)
27915         /* Value is in bits. */
27916         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
27917                 (UINT32_C(0x0) << 28)
27918         /* Value is in bytes. */
27919         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
27920                 (UINT32_C(0x1) << 28)
27921         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
27922                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
27923         /* bw_value_unit is 3 b */
27924         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
27925                 UINT32_C(0xe0000000)
27926         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
27927                 29
27928         /* Value is in Mb or MB (base 10). */
27929         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
27930                 (UINT32_C(0x0) << 29)
27931         /* Value is in Kb or KB (base 10). */
27932         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
27933                 (UINT32_C(0x2) << 29)
27934         /* Value is in bits or bytes. */
27935         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
27936                 (UINT32_C(0x4) << 29)
27937         /* Value is in Gb or GB (base 10). */
27938         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
27939                 (UINT32_C(0x6) << 29)
27940         /* Value is in 1/100th of a percentage of total bandwidth. */
27941         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
27942                 (UINT32_C(0x1) << 29)
27943         /* Invalid unit */
27944         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
27945                 (UINT32_C(0x7) << 29)
27946         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
27947                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
27948         /*
27949          * Maximum BW allocated to CoS queue.
27950          * The HWRM will translate this value into byte counter and
27951          * time interval used for this COS inside the device.
27952          */
27953         uint32_t        queue_id4_max_bw;
27954         /* The bandwidth value. */
27955         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
27956                 UINT32_C(0xfffffff)
27957         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
27958                 0
27959         /* The granularity of the value (bits or bytes). */
27960         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE \
27961                 UINT32_C(0x10000000)
27962         /* Value is in bits. */
27963         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
27964                 (UINT32_C(0x0) << 28)
27965         /* Value is in bytes. */
27966         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
27967                 (UINT32_C(0x1) << 28)
27968         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
27969                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
27970         /* bw_value_unit is 3 b */
27971         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
27972                 UINT32_C(0xe0000000)
27973         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
27974                 29
27975         /* Value is in Mb or MB (base 10). */
27976         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
27977                 (UINT32_C(0x0) << 29)
27978         /* Value is in Kb or KB (base 10). */
27979         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
27980                 (UINT32_C(0x2) << 29)
27981         /* Value is in bits or bytes. */
27982         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
27983                 (UINT32_C(0x4) << 29)
27984         /* Value is in Gb or GB (base 10). */
27985         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
27986                 (UINT32_C(0x6) << 29)
27987         /* Value is in 1/100th of a percentage of total bandwidth. */
27988         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
27989                 (UINT32_C(0x1) << 29)
27990         /* Invalid unit */
27991         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
27992                 (UINT32_C(0x7) << 29)
27993         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
27994                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
27995         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
27996         uint8_t queue_id4_tsa_assign;
27997         /* Strict Priority */
27998         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP \
27999                 UINT32_C(0x0)
28000         /* Enhanced Transmission Selection */
28001         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
28002                 UINT32_C(0x1)
28003         /* reserved. */
28004         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
28005                 UINT32_C(0x2)
28006         /* reserved. */
28007         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
28008                 UINT32_C(0xff)
28009         /*
28010          * Priority level for strict priority. Valid only when the
28011          * tsa_assign is 0 - Strict Priority (SP)
28012          * 0..7 - Valid values.
28013          * 8..255 - Reserved.
28014          */
28015         uint8_t queue_id4_pri_lvl;
28016         /*
28017          * Weight used to allocate remaining BW for this COS after
28018          * servicing guaranteed bandwidths for all COS.
28019          */
28020         uint8_t queue_id4_bw_weight;
28021         /* ID of CoS Queue 5. */
28022         uint8_t queue_id5;
28023         /*
28024          * Minimum BW allocated to CoS Queue.
28025          * The HWRM will translate this value into byte counter and
28026          * time interval used for this COS inside the device.
28027          */
28028         uint32_t        queue_id5_min_bw;
28029         /* The bandwidth value. */
28030         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
28031                 UINT32_C(0xfffffff)
28032         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
28033                 0
28034         /* The granularity of the value (bits or bytes). */
28035         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE \
28036                 UINT32_C(0x10000000)
28037         /* Value is in bits. */
28038         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
28039                 (UINT32_C(0x0) << 28)
28040         /* Value is in bytes. */
28041         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
28042                 (UINT32_C(0x1) << 28)
28043         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
28044                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
28045         /* bw_value_unit is 3 b */
28046         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
28047                 UINT32_C(0xe0000000)
28048         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
28049                 29
28050         /* Value is in Mb or MB (base 10). */
28051         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
28052                 (UINT32_C(0x0) << 29)
28053         /* Value is in Kb or KB (base 10). */
28054         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
28055                 (UINT32_C(0x2) << 29)
28056         /* Value is in bits or bytes. */
28057         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
28058                 (UINT32_C(0x4) << 29)
28059         /* Value is in Gb or GB (base 10). */
28060         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
28061                 (UINT32_C(0x6) << 29)
28062         /* Value is in 1/100th of a percentage of total bandwidth. */
28063         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
28064                 (UINT32_C(0x1) << 29)
28065         /* Invalid unit */
28066         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
28067                 (UINT32_C(0x7) << 29)
28068         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
28069                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
28070         /*
28071          * Maximum BW allocated to CoS queue.
28072          * The HWRM will translate this value into byte counter and
28073          * time interval used for this COS inside the device.
28074          */
28075         uint32_t        queue_id5_max_bw;
28076         /* The bandwidth value. */
28077         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
28078                 UINT32_C(0xfffffff)
28079         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
28080                 0
28081         /* The granularity of the value (bits or bytes). */
28082         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE \
28083                 UINT32_C(0x10000000)
28084         /* Value is in bits. */
28085         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
28086                 (UINT32_C(0x0) << 28)
28087         /* Value is in bytes. */
28088         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
28089                 (UINT32_C(0x1) << 28)
28090         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
28091                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
28092         /* bw_value_unit is 3 b */
28093         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
28094                 UINT32_C(0xe0000000)
28095         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
28096                 29
28097         /* Value is in Mb or MB (base 10). */
28098         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
28099                 (UINT32_C(0x0) << 29)
28100         /* Value is in Kb or KB (base 10). */
28101         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
28102                 (UINT32_C(0x2) << 29)
28103         /* Value is in bits or bytes. */
28104         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
28105                 (UINT32_C(0x4) << 29)
28106         /* Value is in Gb or GB (base 10). */
28107         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
28108                 (UINT32_C(0x6) << 29)
28109         /* Value is in 1/100th of a percentage of total bandwidth. */
28110         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
28111                 (UINT32_C(0x1) << 29)
28112         /* Invalid unit */
28113         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
28114                 (UINT32_C(0x7) << 29)
28115         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
28116                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
28117         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
28118         uint8_t queue_id5_tsa_assign;
28119         /* Strict Priority */
28120         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP \
28121                 UINT32_C(0x0)
28122         /* Enhanced Transmission Selection */
28123         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
28124                 UINT32_C(0x1)
28125         /* reserved. */
28126         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
28127                 UINT32_C(0x2)
28128         /* reserved. */
28129         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
28130                 UINT32_C(0xff)
28131         /*
28132          * Priority level for strict priority. Valid only when the
28133          * tsa_assign is 0 - Strict Priority (SP)
28134          * 0..7 - Valid values.
28135          * 8..255 - Reserved.
28136          */
28137         uint8_t queue_id5_pri_lvl;
28138         /*
28139          * Weight used to allocate remaining BW for this COS after
28140          * servicing guaranteed bandwidths for all COS.
28141          */
28142         uint8_t queue_id5_bw_weight;
28143         /* ID of CoS Queue 6. */
28144         uint8_t queue_id6;
28145         /*
28146          * Minimum BW allocated to CoS Queue.
28147          * The HWRM will translate this value into byte counter and
28148          * time interval used for this COS inside the device.
28149          */
28150         uint32_t        queue_id6_min_bw;
28151         /* The bandwidth value. */
28152         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
28153                 UINT32_C(0xfffffff)
28154         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
28155                 0
28156         /* The granularity of the value (bits or bytes). */
28157         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE \
28158                 UINT32_C(0x10000000)
28159         /* Value is in bits. */
28160         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
28161                 (UINT32_C(0x0) << 28)
28162         /* Value is in bytes. */
28163         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
28164                 (UINT32_C(0x1) << 28)
28165         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
28166                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
28167         /* bw_value_unit is 3 b */
28168         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
28169                 UINT32_C(0xe0000000)
28170         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
28171                 29
28172         /* Value is in Mb or MB (base 10). */
28173         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
28174                 (UINT32_C(0x0) << 29)
28175         /* Value is in Kb or KB (base 10). */
28176         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
28177                 (UINT32_C(0x2) << 29)
28178         /* Value is in bits or bytes. */
28179         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
28180                 (UINT32_C(0x4) << 29)
28181         /* Value is in Gb or GB (base 10). */
28182         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
28183                 (UINT32_C(0x6) << 29)
28184         /* Value is in 1/100th of a percentage of total bandwidth. */
28185         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
28186                 (UINT32_C(0x1) << 29)
28187         /* Invalid unit */
28188         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
28189                 (UINT32_C(0x7) << 29)
28190         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
28191                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
28192         /*
28193          * Maximum BW allocated to CoS queue.
28194          * The HWRM will translate this value into byte counter and
28195          * time interval used for this COS inside the device.
28196          */
28197         uint32_t        queue_id6_max_bw;
28198         /* The bandwidth value. */
28199         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
28200                 UINT32_C(0xfffffff)
28201         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
28202                 0
28203         /* The granularity of the value (bits or bytes). */
28204         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE \
28205                 UINT32_C(0x10000000)
28206         /* Value is in bits. */
28207         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
28208                 (UINT32_C(0x0) << 28)
28209         /* Value is in bytes. */
28210         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
28211                 (UINT32_C(0x1) << 28)
28212         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
28213                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
28214         /* bw_value_unit is 3 b */
28215         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
28216                 UINT32_C(0xe0000000)
28217         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
28218                 29
28219         /* Value is in Mb or MB (base 10). */
28220         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
28221                 (UINT32_C(0x0) << 29)
28222         /* Value is in Kb or KB (base 10). */
28223         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
28224                 (UINT32_C(0x2) << 29)
28225         /* Value is in bits or bytes. */
28226         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
28227                 (UINT32_C(0x4) << 29)
28228         /* Value is in Gb or GB (base 10). */
28229         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
28230                 (UINT32_C(0x6) << 29)
28231         /* Value is in 1/100th of a percentage of total bandwidth. */
28232         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
28233                 (UINT32_C(0x1) << 29)
28234         /* Invalid unit */
28235         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
28236                 (UINT32_C(0x7) << 29)
28237         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
28238                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
28239         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
28240         uint8_t queue_id6_tsa_assign;
28241         /* Strict Priority */
28242         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP \
28243                 UINT32_C(0x0)
28244         /* Enhanced Transmission Selection */
28245         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
28246                 UINT32_C(0x1)
28247         /* reserved. */
28248         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
28249                 UINT32_C(0x2)
28250         /* reserved. */
28251         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
28252                 UINT32_C(0xff)
28253         /*
28254          * Priority level for strict priority. Valid only when the
28255          * tsa_assign is 0 - Strict Priority (SP)
28256          * 0..7 - Valid values.
28257          * 8..255 - Reserved.
28258          */
28259         uint8_t queue_id6_pri_lvl;
28260         /*
28261          * Weight used to allocate remaining BW for this COS after
28262          * servicing guaranteed bandwidths for all COS.
28263          */
28264         uint8_t queue_id6_bw_weight;
28265         /* ID of CoS Queue 7. */
28266         uint8_t queue_id7;
28267         /*
28268          * Minimum BW allocated to CoS Queue.
28269          * The HWRM will translate this value into byte counter and
28270          * time interval used for this COS inside the device.
28271          */
28272         uint32_t        queue_id7_min_bw;
28273         /* The bandwidth value. */
28274         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
28275                 UINT32_C(0xfffffff)
28276         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
28277                 0
28278         /* The granularity of the value (bits or bytes). */
28279         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE \
28280                 UINT32_C(0x10000000)
28281         /* Value is in bits. */
28282         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
28283                 (UINT32_C(0x0) << 28)
28284         /* Value is in bytes. */
28285         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
28286                 (UINT32_C(0x1) << 28)
28287         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
28288                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
28289         /* bw_value_unit is 3 b */
28290         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
28291                 UINT32_C(0xe0000000)
28292         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
28293                 29
28294         /* Value is in Mb or MB (base 10). */
28295         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
28296                 (UINT32_C(0x0) << 29)
28297         /* Value is in Kb or KB (base 10). */
28298         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
28299                 (UINT32_C(0x2) << 29)
28300         /* Value is in bits or bytes. */
28301         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
28302                 (UINT32_C(0x4) << 29)
28303         /* Value is in Gb or GB (base 10). */
28304         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
28305                 (UINT32_C(0x6) << 29)
28306         /* Value is in 1/100th of a percentage of total bandwidth. */
28307         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
28308                 (UINT32_C(0x1) << 29)
28309         /* Invalid unit */
28310         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
28311                 (UINT32_C(0x7) << 29)
28312         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
28313                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
28314         /*
28315          * Maximum BW allocated to CoS queue.
28316          * The HWRM will translate this value into byte counter and
28317          * time interval used for this COS inside the device.
28318          */
28319         uint32_t        queue_id7_max_bw;
28320         /* The bandwidth value. */
28321         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
28322                 UINT32_C(0xfffffff)
28323         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
28324                 0
28325         /* The granularity of the value (bits or bytes). */
28326         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE \
28327                 UINT32_C(0x10000000)
28328         /* Value is in bits. */
28329         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
28330                 (UINT32_C(0x0) << 28)
28331         /* Value is in bytes. */
28332         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
28333                 (UINT32_C(0x1) << 28)
28334         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
28335                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
28336         /* bw_value_unit is 3 b */
28337         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
28338                 UINT32_C(0xe0000000)
28339         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
28340                 29
28341         /* Value is in Mb or MB (base 10). */
28342         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
28343                 (UINT32_C(0x0) << 29)
28344         /* Value is in Kb or KB (base 10). */
28345         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
28346                 (UINT32_C(0x2) << 29)
28347         /* Value is in bits or bytes. */
28348         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
28349                 (UINT32_C(0x4) << 29)
28350         /* Value is in Gb or GB (base 10). */
28351         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
28352                 (UINT32_C(0x6) << 29)
28353         /* Value is in 1/100th of a percentage of total bandwidth. */
28354         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
28355                 (UINT32_C(0x1) << 29)
28356         /* Invalid unit */
28357         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
28358                 (UINT32_C(0x7) << 29)
28359         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
28360                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
28361         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
28362         uint8_t queue_id7_tsa_assign;
28363         /* Strict Priority */
28364         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP \
28365                 UINT32_C(0x0)
28366         /* Enhanced Transmission Selection */
28367         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
28368                 UINT32_C(0x1)
28369         /* reserved. */
28370         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
28371                 UINT32_C(0x2)
28372         /* reserved. */
28373         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
28374                 UINT32_C(0xff)
28375         /*
28376          * Priority level for strict priority. Valid only when the
28377          * tsa_assign is 0 - Strict Priority (SP)
28378          * 0..7 - Valid values.
28379          * 8..255 - Reserved.
28380          */
28381         uint8_t queue_id7_pri_lvl;
28382         /*
28383          * Weight used to allocate remaining BW for this COS after
28384          * servicing guaranteed bandwidths for all COS.
28385          */
28386         uint8_t queue_id7_bw_weight;
28387         uint8_t unused_1[5];
28388 } __rte_packed;
28389
28390 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
28391 struct hwrm_queue_cos2bw_cfg_output {
28392         /* The specific error status for the command. */
28393         uint16_t        error_code;
28394         /* The HWRM command request type. */
28395         uint16_t        req_type;
28396         /* The sequence ID from the original command. */
28397         uint16_t        seq_id;
28398         /* The length of the response data in number of bytes. */
28399         uint16_t        resp_len;
28400         uint8_t unused_0[7];
28401         /*
28402          * This field is used in Output records to indicate that the output
28403          * is completely written to RAM. This field should be read as '1'
28404          * to indicate that the output has been completely written.
28405          * When writing a command completion or response to an internal processor,
28406          * the order of writes has to be such that this field is written last.
28407          */
28408         uint8_t valid;
28409 } __rte_packed;
28410
28411 /*************************
28412  * hwrm_queue_dscp_qcaps *
28413  *************************/
28414
28415
28416 /* hwrm_queue_dscp_qcaps_input (size:192b/24B) */
28417 struct hwrm_queue_dscp_qcaps_input {
28418         /* The HWRM command request type. */
28419         uint16_t        req_type;
28420         /*
28421          * The completion ring to send the completion event on. This should
28422          * be the NQ ID returned from the `nq_alloc` HWRM command.
28423          */
28424         uint16_t        cmpl_ring;
28425         /*
28426          * The sequence ID is used by the driver for tracking multiple
28427          * commands. This ID is treated as opaque data by the firmware and
28428          * the value is returned in the `hwrm_resp_hdr` upon completion.
28429          */
28430         uint16_t        seq_id;
28431         /*
28432          * The target ID of the command:
28433          * * 0x0-0xFFF8 - The function ID
28434          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28435          * * 0xFFFD - Reserved for user-space HWRM interface
28436          * * 0xFFFF - HWRM
28437          */
28438         uint16_t        target_id;
28439         /*
28440          * A physical address pointer pointing to a host buffer that the
28441          * command's response data will be written. This can be either a host
28442          * physical address (HPA) or a guest physical address (GPA) and must
28443          * point to a physically contiguous block of memory.
28444          */
28445         uint64_t        resp_addr;
28446         /*
28447          * Port ID of port for which the table is being configured.
28448          * The HWRM needs to check whether this function is allowed
28449          * to configure pri2cos mapping on this port.
28450          */
28451         uint8_t port_id;
28452         uint8_t unused_0[7];
28453 } __rte_packed;
28454
28455 /* hwrm_queue_dscp_qcaps_output (size:128b/16B) */
28456 struct hwrm_queue_dscp_qcaps_output {
28457         /* The specific error status for the command. */
28458         uint16_t        error_code;
28459         /* The HWRM command request type. */
28460         uint16_t        req_type;
28461         /* The sequence ID from the original command. */
28462         uint16_t        seq_id;
28463         /* The length of the response data in number of bytes. */
28464         uint16_t        resp_len;
28465         /* The number of bits provided by the hardware for the DSCP value. */
28466         uint8_t num_dscp_bits;
28467         uint8_t unused_0;
28468         /* Max number of DSCP-MASK-PRI entries supported. */
28469         uint16_t        max_entries;
28470         uint8_t unused_1[3];
28471         /*
28472          * This field is used in Output records to indicate that the output
28473          * is completely written to RAM. This field should be read as '1'
28474          * to indicate that the output has been completely written.
28475          * When writing a command completion or response to an internal processor,
28476          * the order of writes has to be such that this field is written last.
28477          */
28478         uint8_t valid;
28479 } __rte_packed;
28480
28481 /****************************
28482  * hwrm_queue_dscp2pri_qcfg *
28483  ****************************/
28484
28485
28486 /* hwrm_queue_dscp2pri_qcfg_input (size:256b/32B) */
28487 struct hwrm_queue_dscp2pri_qcfg_input {
28488         /* The HWRM command request type. */
28489         uint16_t        req_type;
28490         /*
28491          * The completion ring to send the completion event on. This should
28492          * be the NQ ID returned from the `nq_alloc` HWRM command.
28493          */
28494         uint16_t        cmpl_ring;
28495         /*
28496          * The sequence ID is used by the driver for tracking multiple
28497          * commands. This ID is treated as opaque data by the firmware and
28498          * the value is returned in the `hwrm_resp_hdr` upon completion.
28499          */
28500         uint16_t        seq_id;
28501         /*
28502          * The target ID of the command:
28503          * * 0x0-0xFFF8 - The function ID
28504          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28505          * * 0xFFFD - Reserved for user-space HWRM interface
28506          * * 0xFFFF - HWRM
28507          */
28508         uint16_t        target_id;
28509         /*
28510          * A physical address pointer pointing to a host buffer that the
28511          * command's response data will be written. This can be either a host
28512          * physical address (HPA) or a guest physical address (GPA) and must
28513          * point to a physically contiguous block of memory.
28514          */
28515         uint64_t        resp_addr;
28516         /*
28517          * This is the host address where the 24-bits DSCP-MASK-PRI
28518          * tuple(s) will be copied to.
28519          */
28520         uint64_t        dest_data_addr;
28521         /*
28522          * Port ID of port for which the table is being configured.
28523          * The HWRM needs to check whether this function is allowed
28524          * to configure pri2cos mapping on this port.
28525          */
28526         uint8_t port_id;
28527         uint8_t unused_0;
28528         /* Size of the buffer pointed to by dest_data_addr. */
28529         uint16_t        dest_data_buffer_size;
28530         uint8_t unused_1[4];
28531 } __rte_packed;
28532
28533 /* hwrm_queue_dscp2pri_qcfg_output (size:128b/16B) */
28534 struct hwrm_queue_dscp2pri_qcfg_output {
28535         /* The specific error status for the command. */
28536         uint16_t        error_code;
28537         /* The HWRM command request type. */
28538         uint16_t        req_type;
28539         /* The sequence ID from the original command. */
28540         uint16_t        seq_id;
28541         /* The length of the response data in number of bytes. */
28542         uint16_t        resp_len;
28543         /*
28544          * A count of the number of DSCP-MASK-PRI tuple(s) pointed to
28545          * by the dest_data_addr.
28546          */
28547         uint16_t        entry_cnt;
28548         /*
28549          * This is the default PRI which un-initialized DSCP values are
28550          * mapped to.
28551          */
28552         uint8_t default_pri;
28553         uint8_t unused_0[4];
28554         /*
28555          * This field is used in Output records to indicate that the output
28556          * is completely written to RAM. This field should be read as '1'
28557          * to indicate that the output has been completely written.
28558          * When writing a command completion or response to an internal processor,
28559          * the order of writes has to be such that this field is written last.
28560          */
28561         uint8_t valid;
28562 } __rte_packed;
28563
28564 /***************************
28565  * hwrm_queue_dscp2pri_cfg *
28566  ***************************/
28567
28568
28569 /* hwrm_queue_dscp2pri_cfg_input (size:320b/40B) */
28570 struct hwrm_queue_dscp2pri_cfg_input {
28571         /* The HWRM command request type. */
28572         uint16_t        req_type;
28573         /*
28574          * The completion ring to send the completion event on. This should
28575          * be the NQ ID returned from the `nq_alloc` HWRM command.
28576          */
28577         uint16_t        cmpl_ring;
28578         /*
28579          * The sequence ID is used by the driver for tracking multiple
28580          * commands. This ID is treated as opaque data by the firmware and
28581          * the value is returned in the `hwrm_resp_hdr` upon completion.
28582          */
28583         uint16_t        seq_id;
28584         /*
28585          * The target ID of the command:
28586          * * 0x0-0xFFF8 - The function ID
28587          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28588          * * 0xFFFD - Reserved for user-space HWRM interface
28589          * * 0xFFFF - HWRM
28590          */
28591         uint16_t        target_id;
28592         /*
28593          * A physical address pointer pointing to a host buffer that the
28594          * command's response data will be written. This can be either a host
28595          * physical address (HPA) or a guest physical address (GPA) and must
28596          * point to a physically contiguous block of memory.
28597          */
28598         uint64_t        resp_addr;
28599         /*
28600          * This is the host address where the 24-bits DSCP-MASK-PRI tuple
28601          * will be copied from.
28602          */
28603         uint64_t        src_data_addr;
28604         uint32_t        flags;
28605         /* use_hw_default_pri is 1 b */
28606         #define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_FLAGS_USE_HW_DEFAULT_PRI \
28607                 UINT32_C(0x1)
28608         uint32_t        enables;
28609         /*
28610          * This bit must be '1' for the default_pri field to be
28611          * configured.
28612          */
28613         #define HWRM_QUEUE_DSCP2PRI_CFG_INPUT_ENABLES_DEFAULT_PRI \
28614                 UINT32_C(0x1)
28615         /*
28616          * Port ID of port for which the table is being configured.
28617          * The HWRM needs to check whether this function is allowed
28618          * to configure pri2cos mapping on this port.
28619          */
28620         uint8_t port_id;
28621         /*
28622          * This is the default PRI which un-initialized DSCP values will be
28623          * mapped to.
28624          */
28625         uint8_t default_pri;
28626         /*
28627          * A count of the number of DSCP-MASK-PRI tuple(s) in the data pointed
28628          * to by src_data_addr.
28629          */
28630         uint16_t        entry_cnt;
28631         uint8_t unused_0[4];
28632 } __rte_packed;
28633
28634 /* hwrm_queue_dscp2pri_cfg_output (size:128b/16B) */
28635 struct hwrm_queue_dscp2pri_cfg_output {
28636         /* The specific error status for the command. */
28637         uint16_t        error_code;
28638         /* The HWRM command request type. */
28639         uint16_t        req_type;
28640         /* The sequence ID from the original command. */
28641         uint16_t        seq_id;
28642         /* The length of the response data in number of bytes. */
28643         uint16_t        resp_len;
28644         uint8_t unused_0[7];
28645         /*
28646          * This field is used in Output records to indicate that the output
28647          * is completely written to RAM. This field should be read as '1'
28648          * to indicate that the output has been completely written.
28649          * When writing a command completion or response to an internal processor,
28650          * the order of writes has to be such that this field is written last.
28651          */
28652         uint8_t valid;
28653 } __rte_packed;
28654
28655 /*************************
28656  * hwrm_queue_mpls_qcaps *
28657  *************************/
28658
28659
28660 /* hwrm_queue_mpls_qcaps_input (size:192b/24B) */
28661 struct hwrm_queue_mpls_qcaps_input {
28662         /* The HWRM command request type. */
28663         uint16_t        req_type;
28664         /*
28665          * The completion ring to send the completion event on. This should
28666          * be the NQ ID returned from the `nq_alloc` HWRM command.
28667          */
28668         uint16_t        cmpl_ring;
28669         /*
28670          * The sequence ID is used by the driver for tracking multiple
28671          * commands. This ID is treated as opaque data by the firmware and
28672          * the value is returned in the `hwrm_resp_hdr` upon completion.
28673          */
28674         uint16_t        seq_id;
28675         /*
28676          * The target ID of the command:
28677          * * 0x0-0xFFF8 - The function ID
28678          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28679          * * 0xFFFD - Reserved for user-space HWRM interface
28680          * * 0xFFFF - HWRM
28681          */
28682         uint16_t        target_id;
28683         /*
28684          * A physical address pointer pointing to a host buffer that the
28685          * command's response data will be written. This can be either a host
28686          * physical address (HPA) or a guest physical address (GPA) and must
28687          * point to a physically contiguous block of memory.
28688          */
28689         uint64_t        resp_addr;
28690         /*
28691          * Port ID of port for which the table is being configured.
28692          * The HWRM needs to check whether this function is allowed
28693          * to configure MPLS TC(EXP) to pri mapping on this port.
28694          */
28695         uint8_t port_id;
28696         uint8_t unused_0[7];
28697 } __rte_packed;
28698
28699 /* hwrm_queue_mpls_qcaps_output (size:128b/16B) */
28700 struct hwrm_queue_mpls_qcaps_output {
28701         /* The specific error status for the command. */
28702         uint16_t        error_code;
28703         /* The HWRM command request type. */
28704         uint16_t        req_type;
28705         /* The sequence ID from the original command. */
28706         uint16_t        seq_id;
28707         /* The length of the response data in number of bytes. */
28708         uint16_t        resp_len;
28709         /*
28710          * Bitmask indicating which queues can be configured by the
28711          * hwrm_queue_mplstc2pri_cfg command.
28712          *
28713          * Each bit represents a specific pri where bit 0 represents
28714          * pri 0 and bit 7 represents pri 7.
28715          * # A value of 0 indicates that the pri is not configurable
28716          * by the hwrm_queue_mplstc2pri_cfg command.
28717          * # A value of 1 indicates that the pri is configurable.
28718          * # A hwrm_queue_mplstc2pri_cfg command shall return error when
28719          * trying to configure a pri that is not configurable.
28720          */
28721         uint8_t queue_mplstc2pri_cfg_allowed;
28722         /*
28723          * This is the default PRI which un-initialized MPLS values will be
28724          * mapped to.
28725          */
28726         uint8_t hw_default_pri;
28727         uint8_t unused_0[5];
28728         /*
28729          * This field is used in Output records to indicate that the output
28730          * is completely written to RAM. This field should be read as '1'
28731          * to indicate that the output has been completely written.
28732          * When writing a command completion or response to an internal processor,
28733          * the order of writes has to be such that this field is written last.
28734          */
28735         uint8_t valid;
28736 } __rte_packed;
28737
28738 /******************************
28739  * hwrm_queue_mplstc2pri_qcfg *
28740  ******************************/
28741
28742
28743 /* hwrm_queue_mplstc2pri_qcfg_input (size:192b/24B) */
28744 struct hwrm_queue_mplstc2pri_qcfg_input {
28745         /* The HWRM command request type. */
28746         uint16_t        req_type;
28747         /*
28748          * The completion ring to send the completion event on. This should
28749          * be the NQ ID returned from the `nq_alloc` HWRM command.
28750          */
28751         uint16_t        cmpl_ring;
28752         /*
28753          * The sequence ID is used by the driver for tracking multiple
28754          * commands. This ID is treated as opaque data by the firmware and
28755          * the value is returned in the `hwrm_resp_hdr` upon completion.
28756          */
28757         uint16_t        seq_id;
28758         /*
28759          * The target ID of the command:
28760          * * 0x0-0xFFF8 - The function ID
28761          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28762          * * 0xFFFD - Reserved for user-space HWRM interface
28763          * * 0xFFFF - HWRM
28764          */
28765         uint16_t        target_id;
28766         /*
28767          * A physical address pointer pointing to a host buffer that the
28768          * command's response data will be written. This can be either a host
28769          * physical address (HPA) or a guest physical address (GPA) and must
28770          * point to a physically contiguous block of memory.
28771          */
28772         uint64_t        resp_addr;
28773         /*
28774          * Port ID of port for which the table is being configured.
28775          * The HWRM needs to check whether this function is allowed
28776          * to configure MPLS TC(EXP) to pri mapping on this port.
28777          */
28778         uint8_t port_id;
28779         uint8_t unused_0[7];
28780 } __rte_packed;
28781
28782 /* hwrm_queue_mplstc2pri_qcfg_output (size:192b/24B) */
28783 struct hwrm_queue_mplstc2pri_qcfg_output {
28784         /* The specific error status for the command. */
28785         uint16_t        error_code;
28786         /* The HWRM command request type. */
28787         uint16_t        req_type;
28788         /* The sequence ID from the original command. */
28789         uint16_t        seq_id;
28790         /* The length of the response data in number of bytes. */
28791         uint16_t        resp_len;
28792         /*
28793          * pri assigned to MPLS TC(EXP) 0. This value can only be changed
28794          * before traffic has started.
28795          * A value of 0xff indicates that no pri is assigned to the
28796          * MPLS TC(EXP) 0.
28797          */
28798         uint8_t tc0_pri_queue_id;
28799         /*
28800          * pri assigned to MPLS TC(EXP) 1. This value can only be changed
28801          * before traffic has started.
28802          * A value of 0xff indicates that no pri is assigned to the
28803          * MPLS TC(EXP) 1.
28804          */
28805         uint8_t tc1_pri_queue_id;
28806         /*
28807          * pri assigned to MPLS TC(EXP) 2. This value can only be changed
28808          * before traffic has started.
28809          * A value of 0xff indicates that no pri is assigned to the
28810          * MPLS TC(EXP) 2.
28811          */
28812         uint8_t tc2_pri_queue_id;
28813         /*
28814          * pri assigned to MPLS TC(EXP) 3. This value can only be changed
28815          * before traffic has started.
28816          * A value of 0xff indicates that no pri is assigned to the
28817          * MPLS TC(EXP) 3.
28818          */
28819         uint8_t tc3_pri_queue_id;
28820         /*
28821          * pri assigned to MPLS TC(EXP) 4. This value can only be changed
28822          * before traffic has started.
28823          * A value of 0xff indicates that no pri is assigned to the
28824          * MPLS TC(EXP) 4.
28825          */
28826         uint8_t tc4_pri_queue_id;
28827         /*
28828          * pri assigned to MPLS TC(EXP) 5. This value can only be changed
28829          * before traffic has started.
28830          * A value of 0xff indicates that no pri is assigned to the
28831          * MPLS TC(EXP) 5.
28832          */
28833         uint8_t tc5_pri_queue_id;
28834         /*
28835          * pri assigned to MPLS TC(EXP) 6. This value can only
28836          * be changed before traffic has started.
28837          * A value of 0xff indicates that no pri is assigned to the
28838          * MPLS TC(EXP) 6.
28839          */
28840         uint8_t tc6_pri_queue_id;
28841         /*
28842          * pri assigned to MPLS TC(EXP) 7. This value can only
28843          * be changed before traffic has started.
28844          * A value of 0xff indicates that no pri is assigned to the
28845          * MPLS TC(EXP) 7.
28846          */
28847         uint8_t tc7_pri_queue_id;
28848         uint8_t unused_0[7];
28849         /*
28850          * This field is used in Output records to indicate that the output
28851          * is completely written to RAM. This field should be read as '1'
28852          * to indicate that the output has been completely written.
28853          * When writing a command completion or response to an internal processor,
28854          * the order of writes has to be such that this field is written last.
28855          */
28856         uint8_t valid;
28857 } __rte_packed;
28858
28859 /*****************************
28860  * hwrm_queue_mplstc2pri_cfg *
28861  *****************************/
28862
28863
28864 /* hwrm_queue_mplstc2pri_cfg_input (size:256b/32B) */
28865 struct hwrm_queue_mplstc2pri_cfg_input {
28866         /* The HWRM command request type. */
28867         uint16_t        req_type;
28868         /*
28869          * The completion ring to send the completion event on. This should
28870          * be the NQ ID returned from the `nq_alloc` HWRM command.
28871          */
28872         uint16_t        cmpl_ring;
28873         /*
28874          * The sequence ID is used by the driver for tracking multiple
28875          * commands. This ID is treated as opaque data by the firmware and
28876          * the value is returned in the `hwrm_resp_hdr` upon completion.
28877          */
28878         uint16_t        seq_id;
28879         /*
28880          * The target ID of the command:
28881          * * 0x0-0xFFF8 - The function ID
28882          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28883          * * 0xFFFD - Reserved for user-space HWRM interface
28884          * * 0xFFFF - HWRM
28885          */
28886         uint16_t        target_id;
28887         /*
28888          * A physical address pointer pointing to a host buffer that the
28889          * command's response data will be written. This can be either a host
28890          * physical address (HPA) or a guest physical address (GPA) and must
28891          * point to a physically contiguous block of memory.
28892          */
28893         uint64_t        resp_addr;
28894         uint32_t        enables;
28895         /*
28896          * This bit must be '1' for the mplstc0_pri_queue_id field to be
28897          * configured.
28898          */
28899         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC0_PRI_QUEUE_ID \
28900                 UINT32_C(0x1)
28901         /*
28902          * This bit must be '1' for the mplstc1_pri_queue_id field to be
28903          * configured.
28904          */
28905         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC1_PRI_QUEUE_ID \
28906                 UINT32_C(0x2)
28907         /*
28908          * This bit must be '1' for the mplstc2_pri_queue_id field to be
28909          * configured.
28910          */
28911         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC2_PRI_QUEUE_ID \
28912                 UINT32_C(0x4)
28913         /*
28914          * This bit must be '1' for the mplstc3_pri_queue_id field to be
28915          * configured.
28916          */
28917         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC3_PRI_QUEUE_ID \
28918                 UINT32_C(0x8)
28919         /*
28920          * This bit must be '1' for the mplstc4_pri_queue_id field to be
28921          * configured.
28922          */
28923         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC4_PRI_QUEUE_ID \
28924                 UINT32_C(0x10)
28925         /*
28926          * This bit must be '1' for the mplstc5_pri_queue_id field to be
28927          * configured.
28928          */
28929         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC5_PRI_QUEUE_ID \
28930                 UINT32_C(0x20)
28931         /*
28932          * This bit must be '1' for the mplstc6_pri_queue_id field to be
28933          * configured.
28934          */
28935         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC6_PRI_QUEUE_ID \
28936                 UINT32_C(0x40)
28937         /*
28938          * This bit must be '1' for the mplstc7_pri_queue_id field to be
28939          * configured.
28940          */
28941         #define HWRM_QUEUE_MPLSTC2PRI_CFG_INPUT_ENABLES_TC7_PRI_QUEUE_ID \
28942                 UINT32_C(0x80)
28943         /*
28944          * Port ID of port for which the table is being configured.
28945          * The HWRM needs to check whether this function is allowed
28946          * to configure MPLS TC(EXP)to pri mapping on this port.
28947          */
28948         uint8_t port_id;
28949         uint8_t unused_0[3];
28950         /*
28951          * pri assigned to MPLS TC(EXP) 0. This value can only
28952          * be changed before traffic has started.
28953          */
28954         uint8_t tc0_pri_queue_id;
28955         /*
28956          * pri assigned to MPLS TC(EXP) 1. This value can only
28957          * be changed before traffic has started.
28958          */
28959         uint8_t tc1_pri_queue_id;
28960         /*
28961          * pri assigned to MPLS TC(EXP) 2  This value can only
28962          * be changed before traffic has started.
28963          */
28964         uint8_t tc2_pri_queue_id;
28965         /*
28966          * pri assigned to MPLS TC(EXP) 3. This value can only
28967          * be changed before traffic has started.
28968          */
28969         uint8_t tc3_pri_queue_id;
28970         /*
28971          * pri assigned to MPLS TC(EXP) 4. This value can only
28972          * be changed before traffic has started.
28973          */
28974         uint8_t tc4_pri_queue_id;
28975         /*
28976          * pri assigned to MPLS TC(EXP) 5. This value can only
28977          * be changed before traffic has started.
28978          */
28979         uint8_t tc5_pri_queue_id;
28980         /*
28981          * pri assigned to MPLS TC(EXP) 6. This value can only
28982          * be changed before traffic has started.
28983          */
28984         uint8_t tc6_pri_queue_id;
28985         /*
28986          * pri assigned to MPLS TC(EXP) 7. This value can only
28987          * be changed before traffic has started.
28988          */
28989         uint8_t tc7_pri_queue_id;
28990 } __rte_packed;
28991
28992 /* hwrm_queue_mplstc2pri_cfg_output (size:128b/16B) */
28993 struct hwrm_queue_mplstc2pri_cfg_output {
28994         /* The specific error status for the command. */
28995         uint16_t        error_code;
28996         /* The HWRM command request type. */
28997         uint16_t        req_type;
28998         /* The sequence ID from the original command. */
28999         uint16_t        seq_id;
29000         /* The length of the response data in number of bytes. */
29001         uint16_t        resp_len;
29002         uint8_t unused_0[7];
29003         /*
29004          * This field is used in Output records to indicate that the output
29005          * is completely written to RAM. This field should be read as '1'
29006          * to indicate that the output has been completely written.
29007          * When writing a command completion or response to an internal processor,
29008          * the order of writes has to be such that this field is written last.
29009          */
29010         uint8_t valid;
29011 } __rte_packed;
29012
29013 /****************************
29014  * hwrm_queue_vlanpri_qcaps *
29015  ****************************/
29016
29017
29018 /* hwrm_queue_vlanpri_qcaps_input (size:192b/24B) */
29019 struct hwrm_queue_vlanpri_qcaps_input {
29020         /* The HWRM command request type. */
29021         uint16_t        req_type;
29022         /*
29023          * The completion ring to send the completion event on. This should
29024          * be the NQ ID returned from the `nq_alloc` HWRM command.
29025          */
29026         uint16_t        cmpl_ring;
29027         /*
29028          * The sequence ID is used by the driver for tracking multiple
29029          * commands. This ID is treated as opaque data by the firmware and
29030          * the value is returned in the `hwrm_resp_hdr` upon completion.
29031          */
29032         uint16_t        seq_id;
29033         /*
29034          * The target ID of the command:
29035          * * 0x0-0xFFF8 - The function ID
29036          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29037          * * 0xFFFD - Reserved for user-space HWRM interface
29038          * * 0xFFFF - HWRM
29039          */
29040         uint16_t        target_id;
29041         /*
29042          * A physical address pointer pointing to a host buffer that the
29043          * command's response data will be written. This can be either a host
29044          * physical address (HPA) or a guest physical address (GPA) and must
29045          * point to a physically contiguous block of memory.
29046          */
29047         uint64_t        resp_addr;
29048         /*
29049          * Port ID of port for which the table is being configured.
29050          * The HWRM needs to check whether this function is allowed
29051          * to configure VLAN priority to user priority mapping on this port.
29052          */
29053         uint8_t port_id;
29054         uint8_t unused_0[7];
29055 } __rte_packed;
29056
29057 /* hwrm_queue_vlanpri_qcaps_output (size:128b/16B) */
29058 struct hwrm_queue_vlanpri_qcaps_output {
29059         /* The specific error status for the command. */
29060         uint16_t        error_code;
29061         /* The HWRM command request type. */
29062         uint16_t        req_type;
29063         /* The sequence ID from the original command. */
29064         uint16_t        seq_id;
29065         /* The length of the response data in number of bytes. */
29066         uint16_t        resp_len;
29067         /*
29068          * This is the default user priority which all VLAN priority values
29069          * are mapped to if there is no VLAN priority to user priority mapping.
29070          */
29071         uint8_t hw_default_pri;
29072         uint8_t unused_0[6];
29073         /*
29074          * This field is used in Output records to indicate that the output
29075          * is completely written to RAM. This field should be read as '1'
29076          * to indicate that the output has been completely written.
29077          * When writing a command completion or response to an internal processor,
29078          * the order of writes has to be such that this field is written last.
29079          */
29080         uint8_t valid;
29081 } __rte_packed;
29082
29083 /*******************************
29084  * hwrm_queue_vlanpri2pri_qcfg *
29085  *******************************/
29086
29087
29088 /* hwrm_queue_vlanpri2pri_qcfg_input (size:192b/24B) */
29089 struct hwrm_queue_vlanpri2pri_qcfg_input {
29090         /* The HWRM command request type. */
29091         uint16_t        req_type;
29092         /*
29093          * The completion ring to send the completion event on. This should
29094          * be the NQ ID returned from the `nq_alloc` HWRM command.
29095          */
29096         uint16_t        cmpl_ring;
29097         /*
29098          * The sequence ID is used by the driver for tracking multiple
29099          * commands. This ID is treated as opaque data by the firmware and
29100          * the value is returned in the `hwrm_resp_hdr` upon completion.
29101          */
29102         uint16_t        seq_id;
29103         /*
29104          * The target ID of the command:
29105          * * 0x0-0xFFF8 - The function ID
29106          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29107          * * 0xFFFD - Reserved for user-space HWRM interface
29108          * * 0xFFFF - HWRM
29109          */
29110         uint16_t        target_id;
29111         /*
29112          * A physical address pointer pointing to a host buffer that the
29113          * command's response data will be written. This can be either a host
29114          * physical address (HPA) or a guest physical address (GPA) and must
29115          * point to a physically contiguous block of memory.
29116          */
29117         uint64_t        resp_addr;
29118         /*
29119          * Port ID of port for which the table is being configured.
29120          * The HWRM needs to check whether this function is allowed
29121          * to configure VLAN priority to user priority mapping on this port.
29122          */
29123         uint8_t port_id;
29124         uint8_t unused_0[7];
29125 } __rte_packed;
29126
29127 /* hwrm_queue_vlanpri2pri_qcfg_output (size:192b/24B) */
29128 struct hwrm_queue_vlanpri2pri_qcfg_output {
29129         /* The specific error status for the command. */
29130         uint16_t        error_code;
29131         /* The HWRM command request type. */
29132         uint16_t        req_type;
29133         /* The sequence ID from the original command. */
29134         uint16_t        seq_id;
29135         /* The length of the response data in number of bytes. */
29136         uint16_t        resp_len;
29137         /*
29138          * User priority assigned to VLAN priority 0. A value of 0xff
29139          * indicates that no user priority is assigned. The default user
29140          * priority will be used.
29141          */
29142         uint8_t vlanpri0_user_pri_id;
29143         /*
29144          * User priority assigned to VLAN priority 1. A value of 0xff
29145          * indicates that no user priority is assigned. The default user
29146          * priority will be used.
29147          */
29148         uint8_t vlanpri1_user_pri_id;
29149         /*
29150          * User priority assigned to VLAN priority 2. A value of 0xff
29151          * indicates that no user priority is assigned. The default user
29152          * priority will be used.
29153          */
29154         uint8_t vlanpri2_user_pri_id;
29155         /*
29156          * User priority assigned to VLAN priority 3. A value of 0xff
29157          * indicates that no user priority is assigned. The default user
29158          * priority will be used.
29159          */
29160         uint8_t vlanpri3_user_pri_id;
29161         /*
29162          * User priority assigned to VLAN priority 4. A value of 0xff
29163          * indicates that no user priority is assigned. The default user
29164          * priority will be used.
29165          */
29166         uint8_t vlanpri4_user_pri_id;
29167         /*
29168          * User priority assigned to VLAN priority 5. A value of 0xff
29169          * indicates that no user priority is assigned. The default user
29170          * priority will be used.
29171          */
29172         uint8_t vlanpri5_user_pri_id;
29173         /*
29174          * User priority assigned to VLAN priority 6. A value of 0xff
29175          * indicates that no user priority is assigned. The default user
29176          * priority will be used.
29177          */
29178         uint8_t vlanpri6_user_pri_id;
29179         /*
29180          * User priority assigned to VLAN priority 7. A value of 0xff
29181          * indicates that no user priority is assigned. The default user
29182          * priority will be used.
29183          */
29184         uint8_t vlanpri7_user_pri_id;
29185         uint8_t unused_0[7];
29186         /*
29187          * This field is used in Output records to indicate that the output
29188          * is completely written to RAM. This field should be read as '1'
29189          * to indicate that the output has been completely written.
29190          * When writing a command completion or response to an internal processor,
29191          * the order of writes has to be such that this field is written last.
29192          */
29193         uint8_t valid;
29194 } __rte_packed;
29195
29196 /******************************
29197  * hwrm_queue_vlanpri2pri_cfg *
29198  ******************************/
29199
29200
29201 /* hwrm_queue_vlanpri2pri_cfg_input (size:256b/32B) */
29202 struct hwrm_queue_vlanpri2pri_cfg_input {
29203         /* The HWRM command request type. */
29204         uint16_t        req_type;
29205         /*
29206          * The completion ring to send the completion event on. This should
29207          * be the NQ ID returned from the `nq_alloc` HWRM command.
29208          */
29209         uint16_t        cmpl_ring;
29210         /*
29211          * The sequence ID is used by the driver for tracking multiple
29212          * commands. This ID is treated as opaque data by the firmware and
29213          * the value is returned in the `hwrm_resp_hdr` upon completion.
29214          */
29215         uint16_t        seq_id;
29216         /*
29217          * The target ID of the command:
29218          * * 0x0-0xFFF8 - The function ID
29219          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29220          * * 0xFFFD - Reserved for user-space HWRM interface
29221          * * 0xFFFF - HWRM
29222          */
29223         uint16_t        target_id;
29224         /*
29225          * A physical address pointer pointing to a host buffer that the
29226          * command's response data will be written. This can be either a host
29227          * physical address (HPA) or a guest physical address (GPA) and must
29228          * point to a physically contiguous block of memory.
29229          */
29230         uint64_t        resp_addr;
29231         uint32_t        enables;
29232         /*
29233          * This bit must be '1' for the vlanpri0_user_pri_id field to be
29234          * configured.
29235          */
29236         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI0_USER_PRI_ID \
29237                 UINT32_C(0x1)
29238         /*
29239          * This bit must be '1' for the vlanpri1_user_pri_id field to be
29240          * configured.
29241          */
29242         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI1_USER_PRI_ID \
29243                 UINT32_C(0x2)
29244         /*
29245          * This bit must be '1' for the vlanpri2_user_pri_id field to be
29246          * configured.
29247          */
29248         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI2_USER_PRI_ID \
29249                 UINT32_C(0x4)
29250         /*
29251          * This bit must be '1' for the vlanpri3_user_pri_id field to be
29252          * configured.
29253          */
29254         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI3_USER_PRI_ID \
29255                 UINT32_C(0x8)
29256         /*
29257          * This bit must be '1' for the vlanpri4_user_pri_id field to be
29258          * configured.
29259          */
29260         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI4_USER_PRI_ID \
29261                 UINT32_C(0x10)
29262         /*
29263          * This bit must be '1' for the vlanpri5_user_pri_id field to be
29264          * configured.
29265          */
29266         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI5_USER_PRI_ID \
29267                 UINT32_C(0x20)
29268         /*
29269          * This bit must be '1' for the vlanpri6_user_pri_id field to be
29270          * configured.
29271          */
29272         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI6_USER_PRI_ID \
29273                 UINT32_C(0x40)
29274         /*
29275          * This bit must be '1' for the vlanpri7_user_pri_id field to be
29276          * configured.
29277          */
29278         #define HWRM_QUEUE_VLANPRI2PRI_CFG_INPUT_ENABLES_VLANPRI7_USER_PRI_ID \
29279                 UINT32_C(0x80)
29280         /*
29281          * Port ID of port for which the table is being configured.
29282          * The HWRM needs to check whether this function is allowed
29283          * to configure VLAN priority to user priority mapping on this port.
29284          */
29285         uint8_t port_id;
29286         uint8_t unused_0[3];
29287         /*
29288          * User priority assigned to VLAN priority 0. This value can only
29289          * be changed before traffic has started.
29290          */
29291         uint8_t vlanpri0_user_pri_id;
29292         /*
29293          * User priority assigned to VLAN priority 1. This value can only
29294          * be changed before traffic has started.
29295          */
29296         uint8_t vlanpri1_user_pri_id;
29297         /*
29298          * User priority assigned to VLAN priority 2. This value can only
29299          * be changed before traffic has started.
29300          */
29301         uint8_t vlanpri2_user_pri_id;
29302         /*
29303          * User priority assigned to VLAN priority 3. This value can only
29304          * be changed before traffic has started.
29305          */
29306         uint8_t vlanpri3_user_pri_id;
29307         /*
29308          * User priority assigned to VLAN priority 4. This value can only
29309          * be changed before traffic has started.
29310          */
29311         uint8_t vlanpri4_user_pri_id;
29312         /*
29313          * User priority assigned to VLAN priority 5. This value can only
29314          * be changed before traffic has started.
29315          */
29316         uint8_t vlanpri5_user_pri_id;
29317         /*
29318          * User priority assigned to VLAN priority 6. This value can only
29319          * be changed before traffic has started.
29320          */
29321         uint8_t vlanpri6_user_pri_id;
29322         /*
29323          * User priority assigned to VLAN priority 7. This value can only
29324          * be changed before traffic has started.
29325          */
29326         uint8_t vlanpri7_user_pri_id;
29327 } __rte_packed;
29328
29329 /* hwrm_queue_vlanpri2pri_cfg_output (size:128b/16B) */
29330 struct hwrm_queue_vlanpri2pri_cfg_output {
29331         /* The specific error status for the command. */
29332         uint16_t        error_code;
29333         /* The HWRM command request type. */
29334         uint16_t        req_type;
29335         /* The sequence ID from the original command. */
29336         uint16_t        seq_id;
29337         /* The length of the response data in number of bytes. */
29338         uint16_t        resp_len;
29339         uint8_t unused_0[7];
29340         /*
29341          * This field is used in Output records to indicate that the output
29342          * is completely written to RAM. This field should be read as '1'
29343          * to indicate that the output has been completely written.
29344          * When writing a command completion or response to an internal processor,
29345          * the order of writes has to be such that this field is written last.
29346          */
29347         uint8_t valid;
29348 } __rte_packed;
29349
29350 /*******************
29351  * hwrm_vnic_alloc *
29352  *******************/
29353
29354
29355 /* hwrm_vnic_alloc_input (size:192b/24B) */
29356 struct hwrm_vnic_alloc_input {
29357         /* The HWRM command request type. */
29358         uint16_t        req_type;
29359         /*
29360          * The completion ring to send the completion event on. This should
29361          * be the NQ ID returned from the `nq_alloc` HWRM command.
29362          */
29363         uint16_t        cmpl_ring;
29364         /*
29365          * The sequence ID is used by the driver for tracking multiple
29366          * commands. This ID is treated as opaque data by the firmware and
29367          * the value is returned in the `hwrm_resp_hdr` upon completion.
29368          */
29369         uint16_t        seq_id;
29370         /*
29371          * The target ID of the command:
29372          * * 0x0-0xFFF8 - The function ID
29373          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29374          * * 0xFFFD - Reserved for user-space HWRM interface
29375          * * 0xFFFF - HWRM
29376          */
29377         uint16_t        target_id;
29378         /*
29379          * A physical address pointer pointing to a host buffer that the
29380          * command's response data will be written. This can be either a host
29381          * physical address (HPA) or a guest physical address (GPA) and must
29382          * point to a physically contiguous block of memory.
29383          */
29384         uint64_t        resp_addr;
29385         uint32_t        flags;
29386         /*
29387          * When this bit is '1', this VNIC is requested to
29388          * be the default VNIC for this function.
29389          */
29390         #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT \
29391                 UINT32_C(0x1)
29392         /*
29393          * When this bit is '1', proxy VEE PF is requesting
29394          * allocation of a default VNIC on behalf of virtio-net
29395          * function given in virtio_net_fid field.
29396          */
29397         #define HWRM_VNIC_ALLOC_INPUT_FLAGS_VIRTIO_NET_FID_VALID \
29398                 UINT32_C(0x2)
29399         /*
29400          * Virtio-net function's FID.
29401          * This virtio-net function is requesting allocation of default
29402          * VNIC through proxy VEE PF.
29403          */
29404         uint16_t        virtio_net_fid;
29405         uint8_t unused_0[2];
29406 } __rte_packed;
29407
29408 /* hwrm_vnic_alloc_output (size:128b/16B) */
29409 struct hwrm_vnic_alloc_output {
29410         /* The specific error status for the command. */
29411         uint16_t        error_code;
29412         /* The HWRM command request type. */
29413         uint16_t        req_type;
29414         /* The sequence ID from the original command. */
29415         uint16_t        seq_id;
29416         /* The length of the response data in number of bytes. */
29417         uint16_t        resp_len;
29418         /* Logical vnic ID */
29419         uint32_t        vnic_id;
29420         uint8_t unused_0[3];
29421         /*
29422          * This field is used in Output records to indicate that the output
29423          * is completely written to RAM.  This field should be read as '1'
29424          * to indicate that the output has been completely written.
29425          * When writing a command completion or response to an internal processor,
29426          * the order of writes has to be such that this field is written last.
29427          */
29428         uint8_t valid;
29429 } __rte_packed;
29430
29431 /********************
29432  * hwrm_vnic_update *
29433  ********************/
29434
29435
29436 /* hwrm_vnic_update_input (size:256b/32B) */
29437 struct hwrm_vnic_update_input {
29438         /* The HWRM command request type. */
29439         uint16_t        req_type;
29440         /*
29441          * The completion ring to send the completion event on. This should
29442          * be the NQ ID returned from the `nq_alloc` HWRM command.
29443          */
29444         uint16_t        cmpl_ring;
29445         /*
29446          * The sequence ID is used by the driver for tracking multiple
29447          * commands. This ID is treated as opaque data by the firmware and
29448          * the value is returned in the `hwrm_resp_hdr` upon completion.
29449          */
29450         uint16_t        seq_id;
29451         /*
29452          * The target ID of the command:
29453          * * 0x0-0xFFF8 - The function ID
29454          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29455          * * 0xFFFD - Reserved for user-space HWRM interface
29456          * * 0xFFFF - HWRM
29457          */
29458         uint16_t        target_id;
29459         /*
29460          * A physical address pointer pointing to a host buffer that the
29461          * command's response data will be written. This can be either a host
29462          * physical address (HPA) or a guest physical address (GPA) and must
29463          * point to a physically contiguous block of memory.
29464          */
29465         uint64_t        resp_addr;
29466         /* Logical vnic ID */
29467         uint32_t        vnic_id;
29468         uint32_t        enables;
29469         /*
29470          * This bit must be '1' for the vnic_state field to be
29471          * configured.
29472          */
29473         #define HWRM_VNIC_UPDATE_INPUT_ENABLES_VNIC_STATE_VALID \
29474                 UINT32_C(0x1)
29475         /*
29476          * This bit must be '1' for the mru field to be
29477          * configured.
29478          */
29479         #define HWRM_VNIC_UPDATE_INPUT_ENABLES_MRU_VALID \
29480                 UINT32_C(0x2)
29481         /*
29482          * This bit must be '1' for the metadata_format_type field to be
29483          * configured.
29484          */
29485         #define HWRM_VNIC_UPDATE_INPUT_ENABLES_METADATA_FORMAT_TYPE_VALID \
29486                 UINT32_C(0x4)
29487         /*
29488          * This will update the context variable with the same name if
29489          * the corresponding enable is set.
29490          */
29491         uint8_t vnic_state;
29492         /* Normal operation state for the VNIC. */
29493         #define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_NORMAL UINT32_C(0x0)
29494         /* All packets are dropped in this state. */
29495         #define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_DROP   UINT32_C(0x1)
29496         #define HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_LAST \
29497                 HWRM_VNIC_UPDATE_INPUT_VNIC_STATE_DROP
29498         /*
29499          * The metadata format type used in all the RX packet completions
29500          * going through this VNIC.
29501          */
29502         uint8_t metadata_format_type;
29503         /* No metadata information. */
29504         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_NONE \
29505                 UINT32_C(0x0)
29506         /*
29507          * Action record pointer (table_scope[4:0], act_rec_ptr[25:0],
29508          * vtag[19:0]).
29509          */
29510         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_ACT_RECORD_PTR \
29511                 UINT32_C(0x1)
29512         /* Tunnel ID (tunnel_id[31:0], vtag[19:0]) */
29513         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_TUNNEL_ID \
29514                 UINT32_C(0x2)
29515         /* Custom header data (updated_chdr_data[31:0], vtag[19:0]) */
29516         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_CUSTOM_HDR_DATA \
29517                 UINT32_C(0x3)
29518         /* Header offsets (hdr_offsets[31:0], vtag[19:0]) */
29519         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_HDR_OFFSETS \
29520                 UINT32_C(0x4)
29521         #define HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_LAST \
29522                 HWRM_VNIC_UPDATE_INPUT_METADATA_FORMAT_TYPE_HDR_OFFSETS
29523         /*
29524          * The maximum receive unit of the vnic.
29525          * Each vnic is associated with a function.
29526          * The vnic mru value overwrites the mru setting of the
29527          * associated function.
29528          * The HWRM shall make sure that vnic mru does not exceed
29529          * the mru of the port the function is associated with.
29530          */
29531         uint16_t        mru;
29532         uint8_t unused_1[4];
29533 } __rte_packed;
29534
29535 /* hwrm_vnic_update_output (size:128b/16B) */
29536 struct hwrm_vnic_update_output {
29537         /* The specific error status for the command. */
29538         uint16_t        error_code;
29539         /* The HWRM command request type. */
29540         uint16_t        req_type;
29541         /* The sequence ID from the original command. */
29542         uint16_t        seq_id;
29543         /* The length of the response data in number of bytes. */
29544         uint16_t        resp_len;
29545         uint8_t unused_0[7];
29546         /*
29547          * This field is used in Output records to indicate that the output
29548          * is completely written to RAM.  This field should be read as '1'
29549          * to indicate that the output has been completely written.
29550          * When writing a command completion or response to an internal
29551          * processor, the order of writes has to be such that this field is
29552          * written last.
29553          */
29554         uint8_t valid;
29555 } __rte_packed;
29556
29557 /******************
29558  * hwrm_vnic_free *
29559  ******************/
29560
29561
29562 /* hwrm_vnic_free_input (size:192b/24B) */
29563 struct hwrm_vnic_free_input {
29564         /* The HWRM command request type. */
29565         uint16_t        req_type;
29566         /*
29567          * The completion ring to send the completion event on. This should
29568          * be the NQ ID returned from the `nq_alloc` HWRM command.
29569          */
29570         uint16_t        cmpl_ring;
29571         /*
29572          * The sequence ID is used by the driver for tracking multiple
29573          * commands. This ID is treated as opaque data by the firmware and
29574          * the value is returned in the `hwrm_resp_hdr` upon completion.
29575          */
29576         uint16_t        seq_id;
29577         /*
29578          * The target ID of the command:
29579          * * 0x0-0xFFF8 - The function ID
29580          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29581          * * 0xFFFD - Reserved for user-space HWRM interface
29582          * * 0xFFFF - HWRM
29583          */
29584         uint16_t        target_id;
29585         /*
29586          * A physical address pointer pointing to a host buffer that the
29587          * command's response data will be written. This can be either a host
29588          * physical address (HPA) or a guest physical address (GPA) and must
29589          * point to a physically contiguous block of memory.
29590          */
29591         uint64_t        resp_addr;
29592         /* Logical vnic ID */
29593         uint32_t        vnic_id;
29594         uint8_t unused_0[4];
29595 } __rte_packed;
29596
29597 /* hwrm_vnic_free_output (size:128b/16B) */
29598 struct hwrm_vnic_free_output {
29599         /* The specific error status for the command. */
29600         uint16_t        error_code;
29601         /* The HWRM command request type. */
29602         uint16_t        req_type;
29603         /* The sequence ID from the original command. */
29604         uint16_t        seq_id;
29605         /* The length of the response data in number of bytes. */
29606         uint16_t        resp_len;
29607         uint8_t unused_0[7];
29608         /*
29609          * This field is used in Output records to indicate that the output
29610          * is completely written to RAM.  This field should be read as '1'
29611          * to indicate that the output has been completely written.
29612          * When writing a command completion or response to an internal processor,
29613          * the order of writes has to be such that this field is written last.
29614          */
29615         uint8_t valid;
29616 } __rte_packed;
29617
29618 /*****************
29619  * hwrm_vnic_cfg *
29620  *****************/
29621
29622
29623 /* hwrm_vnic_cfg_input (size:384b/48B) */
29624 struct hwrm_vnic_cfg_input {
29625         /* The HWRM command request type. */
29626         uint16_t        req_type;
29627         /*
29628          * The completion ring to send the completion event on. This should
29629          * be the NQ ID returned from the `nq_alloc` HWRM command.
29630          */
29631         uint16_t        cmpl_ring;
29632         /*
29633          * The sequence ID is used by the driver for tracking multiple
29634          * commands. This ID is treated as opaque data by the firmware and
29635          * the value is returned in the `hwrm_resp_hdr` upon completion.
29636          */
29637         uint16_t        seq_id;
29638         /*
29639          * The target ID of the command:
29640          * * 0x0-0xFFF8 - The function ID
29641          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29642          * * 0xFFFD - Reserved for user-space HWRM interface
29643          * * 0xFFFF - HWRM
29644          */
29645         uint16_t        target_id;
29646         /*
29647          * A physical address pointer pointing to a host buffer that the
29648          * command's response data will be written. This can be either a host
29649          * physical address (HPA) or a guest physical address (GPA) and must
29650          * point to a physically contiguous block of memory.
29651          */
29652         uint64_t        resp_addr;
29653         uint32_t        flags;
29654         /*
29655          * When this bit is '1', the VNIC is requested to
29656          * be the default VNIC for the function.
29657          */
29658         #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT \
29659                 UINT32_C(0x1)
29660         /*
29661          * When this bit is '1', the VNIC is being configured to
29662          * strip VLAN in the RX path.
29663          * If set to '0', then VLAN stripping is disabled on
29664          * this VNIC.
29665          */
29666         #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE \
29667                 UINT32_C(0x2)
29668         /*
29669          * When this bit is '1', the VNIC is being configured to
29670          * buffer receive packets in the hardware until the host
29671          * posts new receive buffers.
29672          * If set to '0', then bd_stall is being configured to be
29673          * disabled on this VNIC.
29674          */
29675         #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE \
29676                 UINT32_C(0x4)
29677         /*
29678          * When this bit is '1', the VNIC is being configured to
29679          * receive both RoCE and non-RoCE traffic.
29680          * If set to '0', then this VNIC is not configured to be
29681          * operating in dual VNIC mode.
29682          */
29683         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
29684                 UINT32_C(0x8)
29685         /*
29686          * When this flag is set to '1', the VNIC is requested to
29687          * be configured to receive only RoCE traffic.
29688          * If this flag is set to '0', then this flag shall be
29689          * ignored by the HWRM.
29690          * If roce_dual_vnic_mode flag is set to '1'
29691          * or roce_mirroring_capable_vnic_mode flag to 1,
29692          * then the HWRM client shall not set this flag to '1'.
29693          */
29694         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
29695                 UINT32_C(0x10)
29696         /*
29697          * When a VNIC uses one destination ring group for certain
29698          * application (e.g. Receive Flow Steering) where
29699          * exact match is used to direct packets to a VNIC with one
29700          * destination ring group only, there is no need to configure
29701          * RSS indirection table for that VNIC as only one destination
29702          * ring group is used.
29703          *
29704          * This flag is used to enable a mode where
29705          * RSS is enabled in the VNIC using a RSS context
29706          * for computing RSS hash but the RSS indirection table is
29707          * not configured using hwrm_vnic_rss_cfg.
29708          *
29709          * If this mode is enabled, then the driver should not program
29710          * RSS indirection table for the RSS context that is used for
29711          * computing RSS hash only.
29712          */
29713         #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE \
29714                 UINT32_C(0x20)
29715         /*
29716          * When this bit is '1', the VNIC is being configured to
29717          * receive both RoCE and non-RoCE traffic, but forward only the
29718          * RoCE traffic further. Also, RoCE traffic can be mirrored to
29719          * L2 driver.
29720          */
29721         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
29722                 UINT32_C(0x40)
29723         uint32_t        enables;
29724         /*
29725          * This bit must be '1' for the dflt_ring_grp field to be
29726          * configured.
29727          */
29728         #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP \
29729                 UINT32_C(0x1)
29730         /*
29731          * This bit must be '1' for the rss_rule field to be
29732          * configured.
29733          */
29734         #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE \
29735                 UINT32_C(0x2)
29736         /*
29737          * This bit must be '1' for the cos_rule field to be
29738          * configured.
29739          */
29740         #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE \
29741                 UINT32_C(0x4)
29742         /*
29743          * This bit must be '1' for the lb_rule field to be
29744          * configured.
29745          */
29746         #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE \
29747                 UINT32_C(0x8)
29748         /*
29749          * This bit must be '1' for the mru field to be
29750          * configured.
29751          */
29752         #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU \
29753                 UINT32_C(0x10)
29754         /*
29755          * This bit must be '1' for the default_rx_ring_id field to be
29756          * configured.
29757          */
29758         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID \
29759                 UINT32_C(0x20)
29760         /*
29761          * This bit must be '1' for the default_cmpl_ring_id field to be
29762          * configured.
29763          */
29764         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID \
29765                 UINT32_C(0x40)
29766         /* This bit must be '1' for the queue_id field to be configured. */
29767         #define HWRM_VNIC_CFG_INPUT_ENABLES_QUEUE_ID \
29768                 UINT32_C(0x80)
29769         /* This bit must be '1' for the rx_csum_v2_mode field to be configured. */
29770         #define HWRM_VNIC_CFG_INPUT_ENABLES_RX_CSUM_V2_MODE \
29771                 UINT32_C(0x100)
29772         /* Logical vnic ID */
29773         uint16_t        vnic_id;
29774         /*
29775          * Default Completion ring for the VNIC.  This ring will
29776          * be chosen if packet does not match any RSS rules and if
29777          * there is no COS rule.
29778          */
29779         uint16_t        dflt_ring_grp;
29780         /*
29781          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
29782          * there is no RSS rule.
29783          */
29784         uint16_t        rss_rule;
29785         /*
29786          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
29787          * there is no COS rule.
29788          */
29789         uint16_t        cos_rule;
29790         /*
29791          * RSS ID for load balancing rule/table structure.
29792          * 0xFF... (All Fs) if there is no LB rule.
29793          */
29794         uint16_t        lb_rule;
29795         /*
29796          * The maximum receive unit of the vnic.
29797          * Each vnic is associated with a function.
29798          * The vnic mru value overwrites the mru setting of the
29799          * associated function.
29800          * The HWRM shall make sure that vnic mru does not exceed
29801          * the mru of the port the function is associated with.
29802          */
29803         uint16_t        mru;
29804         /*
29805          * Default Rx ring for the VNIC.  This ring will
29806          * be chosen if packet does not match any RSS rules.
29807          * The aggregation ring associated with the Rx ring is
29808          * implied based on the Rx ring specified when the
29809          * aggregation ring was allocated.
29810          */
29811         uint16_t        default_rx_ring_id;
29812         /*
29813          * Default completion ring for the VNIC.  This ring will
29814          * be chosen if packet does not match any RSS rules.
29815          */
29816         uint16_t        default_cmpl_ring_id;
29817         /*
29818          * When specified, only incoming packets classified to the specified CoS
29819          * queue ID will be arriving on this VNIC.  Packet priority to CoS mapping
29820          * rules can be specified using HWRM_QUEUE_PRI2COS_CFG.  In this mode,
29821          * ntuple filters with VNIC destination specified are invalid since they
29822          * conflict with the CoS to VNIC steering rules in this mode.
29823          *
29824          * If this field is not specified, packet to VNIC steering will be
29825          * subject to the standard L2 filter rules and any additional ntuple
29826          * filter rules with destination VNIC specified.
29827          */
29828         uint16_t        queue_id;
29829         /*
29830          * If the device supports the RX V2 and RX TPA start V2 completion
29831          * records as indicated by the HWRM_VNIC_QCAPS command, this field is
29832          * used to specify the two RX checksum modes supported by these
29833          * completion records.
29834          */
29835         uint8_t rx_csum_v2_mode;
29836         /*
29837          * When configured with this checksum mode, the number of header
29838          * groups in the delivered packet with a valid IP checksum and
29839          * the number of header groups in the delivered packet with a valid
29840          * L4 checksum are reported. Valid checksums are counted from the
29841          * outermost header group to the innermost header group, stopping at
29842          * the first error.  This is the default checksum mode supported if
29843          * the driver doesn't explicitly configure the RX checksum mode.
29844          */
29845         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
29846         /*
29847          * When configured with this checksum mode, the checksum status is
29848          * reported using 'all ok' mode. In the RX completion record, one
29849          * bit indicates if the IP checksum is valid for all the parsed
29850          * header groups with an IP checksum. Another bit indicates if the
29851          * L4 checksum is valid for all the parsed header groups with an L4
29852          * checksum. The number of header groups that were parsed by the
29853          * chip and passed in the delivered packet is also reported.
29854          */
29855         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_ALL_OK  UINT32_C(0x1)
29856         /*
29857          * Any rx_csum_v2_mode value larger than or equal to this is not
29858          * valid
29859          */
29860         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX     UINT32_C(0x2)
29861         #define HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_LAST \
29862                 HWRM_VNIC_CFG_INPUT_RX_CSUM_V2_MODE_MAX
29863         uint8_t unused0[5];
29864 } __rte_packed;
29865
29866 /* hwrm_vnic_cfg_output (size:128b/16B) */
29867 struct hwrm_vnic_cfg_output {
29868         /* The specific error status for the command. */
29869         uint16_t        error_code;
29870         /* The HWRM command request type. */
29871         uint16_t        req_type;
29872         /* The sequence ID from the original command. */
29873         uint16_t        seq_id;
29874         /* The length of the response data in number of bytes. */
29875         uint16_t        resp_len;
29876         uint8_t unused_0[7];
29877         /*
29878          * This field is used in Output records to indicate that the output
29879          * is completely written to RAM.  This field should be read as '1'
29880          * to indicate that the output has been completely written.
29881          * When writing a command completion or response to an internal processor,
29882          * the order of writes has to be such that this field is written last.
29883          */
29884         uint8_t valid;
29885 } __rte_packed;
29886
29887 /******************
29888  * hwrm_vnic_qcfg *
29889  ******************/
29890
29891
29892 /* hwrm_vnic_qcfg_input (size:256b/32B) */
29893 struct hwrm_vnic_qcfg_input {
29894         /* The HWRM command request type. */
29895         uint16_t        req_type;
29896         /*
29897          * The completion ring to send the completion event on. This should
29898          * be the NQ ID returned from the `nq_alloc` HWRM command.
29899          */
29900         uint16_t        cmpl_ring;
29901         /*
29902          * The sequence ID is used by the driver for tracking multiple
29903          * commands. This ID is treated as opaque data by the firmware and
29904          * the value is returned in the `hwrm_resp_hdr` upon completion.
29905          */
29906         uint16_t        seq_id;
29907         /*
29908          * The target ID of the command:
29909          * * 0x0-0xFFF8 - The function ID
29910          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29911          * * 0xFFFD - Reserved for user-space HWRM interface
29912          * * 0xFFFF - HWRM
29913          */
29914         uint16_t        target_id;
29915         /*
29916          * A physical address pointer pointing to a host buffer that the
29917          * command's response data will be written. This can be either a host
29918          * physical address (HPA) or a guest physical address (GPA) and must
29919          * point to a physically contiguous block of memory.
29920          */
29921         uint64_t        resp_addr;
29922         uint32_t        enables;
29923         /*
29924          * This bit must be '1' for the vf_id_valid field to be
29925          * configured.
29926          */
29927         #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
29928         /* Logical vnic ID */
29929         uint32_t        vnic_id;
29930         /* ID of Virtual Function whose VNIC resource is being queried. */
29931         uint16_t        vf_id;
29932         uint8_t unused_0[6];
29933 } __rte_packed;
29934
29935 /* hwrm_vnic_qcfg_output (size:256b/32B) */
29936 struct hwrm_vnic_qcfg_output {
29937         /* The specific error status for the command. */
29938         uint16_t        error_code;
29939         /* The HWRM command request type. */
29940         uint16_t        req_type;
29941         /* The sequence ID from the original command. */
29942         uint16_t        seq_id;
29943         /* The length of the response data in number of bytes. */
29944         uint16_t        resp_len;
29945         /* Default Completion ring for the VNIC. */
29946         uint16_t        dflt_ring_grp;
29947         /*
29948          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
29949          * there is no RSS rule.
29950          */
29951         uint16_t        rss_rule;
29952         /*
29953          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
29954          * there is no COS rule.
29955          */
29956         uint16_t        cos_rule;
29957         /*
29958          * RSS ID for load balancing rule/table structure.
29959          * 0xFF... (All Fs) if there is no LB rule.
29960          */
29961         uint16_t        lb_rule;
29962         /* The maximum receive unit of the vnic. */
29963         uint16_t        mru;
29964         uint8_t unused_0[2];
29965         uint32_t        flags;
29966         /*
29967          * When this bit is '1', the VNIC is the default VNIC for
29968          * the function.
29969          */
29970         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT \
29971                 UINT32_C(0x1)
29972         /*
29973          * When this bit is '1', the VNIC is configured to
29974          * strip VLAN in the RX path.
29975          * If set to '0', then VLAN stripping is disabled on
29976          * this VNIC.
29977          */
29978         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE \
29979                 UINT32_C(0x2)
29980         /*
29981          * When this bit is '1', the VNIC is configured to
29982          * buffer receive packets in the hardware until the host
29983          * posts new receive buffers.
29984          * If set to '0', then bd_stall is disabled on
29985          * this VNIC.
29986          */
29987         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE \
29988                 UINT32_C(0x4)
29989         /*
29990          * When this bit is '1', the VNIC is configured to
29991          * receive both RoCE and non-RoCE traffic.
29992          * If set to '0', then this VNIC is not configured to
29993          * operate in dual VNIC mode.
29994          */
29995         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
29996                 UINT32_C(0x8)
29997         /*
29998          * When this flag is set to '1', the VNIC is configured to
29999          * receive only RoCE traffic.
30000          * When this flag is set to '0', the VNIC is not configured
30001          * to receive only RoCE traffic.
30002          * If roce_dual_vnic_mode flag and this flag both are set
30003          * to '1', then it is an invalid configuration of the
30004          * VNIC. The HWRM should not allow that type of
30005          * mis-configuration by HWRM clients.
30006          */
30007         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
30008                 UINT32_C(0x10)
30009         /*
30010          * When a VNIC uses one destination ring group for certain
30011          * application (e.g. Receive Flow Steering) where
30012          * exact match is used to direct packets to a VNIC with one
30013          * destination ring group only, there is no need to configure
30014          * RSS indirection table for that VNIC as only one destination
30015          * ring group is used.
30016          *
30017          * When this bit is set to '1', then the VNIC is enabled in a
30018          * mode where RSS is enabled in the VNIC using a RSS context
30019          * for computing RSS hash but the RSS indirection table is
30020          * not configured.
30021          */
30022         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE \
30023                 UINT32_C(0x20)
30024         /*
30025          * When this bit is '1', the VNIC is configured to
30026          * receive both RoCE and non-RoCE traffic, but forward only
30027          * RoCE traffic further. Also RoCE traffic can be mirrored to
30028          * L2 driver.
30029          */
30030         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
30031                 UINT32_C(0x40)
30032         /*
30033          * When this bit is '0', VNIC is in normal operation state.
30034          * When this bit is '1', VNIC drops all the received packets.
30035          */
30036         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_OPERATION_STATE \
30037                 UINT32_C(0x80)
30038         /*
30039          * When returned with a valid CoS Queue id, the CoS Queue/VNIC association
30040          * is valid.  Otherwise it will return 0xFFFF to indicate no VNIC/CoS
30041          * queue association.
30042          */
30043         uint16_t        queue_id;
30044         /*
30045          * If the device supports the RX V2 and RX TPA start V2 completion
30046          * records as indicated by the HWRM_VNIC_QCAPS command, this field is
30047          * used to specify the current RX checksum mode configured for all the
30048          * RX rings of a VNIC.
30049          */
30050         uint8_t rx_csum_v2_mode;
30051         /*
30052          * This value indicates that the VNIC is configured to use the
30053          * default RX checksum mode for all the rings associated with this
30054          * VNIC.
30055          */
30056         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_DEFAULT UINT32_C(0x0)
30057         /*
30058          * This value indicates that the VNIC is configured to use the RX
30059          * checksum ‘all_ok’ mode for all the rings associated with this
30060          * VNIC.
30061          */
30062         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_ALL_OK  UINT32_C(0x1)
30063         /*
30064          * Any rx_csum_v2_mode value larger than or equal to this is not
30065          * valid
30066          */
30067         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX     UINT32_C(0x2)
30068         #define HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_LAST \
30069                 HWRM_VNIC_QCFG_OUTPUT_RX_CSUM_V2_MODE_MAX
30070         uint8_t unused_1[4];
30071         /*
30072          * This field is used in Output records to indicate that the output
30073          * is completely written to RAM.  This field should be read as '1'
30074          * to indicate that the output has been completely written.
30075          * When writing a command completion or response to an internal processor,
30076          * the order of writes has to be such that this field is written last.
30077          */
30078         uint8_t valid;
30079 } __rte_packed;
30080
30081 /*******************
30082  * hwrm_vnic_qcaps *
30083  *******************/
30084
30085
30086 /* hwrm_vnic_qcaps_input (size:192b/24B) */
30087 struct hwrm_vnic_qcaps_input {
30088         /* The HWRM command request type. */
30089         uint16_t        req_type;
30090         /*
30091          * The completion ring to send the completion event on. This should
30092          * be the NQ ID returned from the `nq_alloc` HWRM command.
30093          */
30094         uint16_t        cmpl_ring;
30095         /*
30096          * The sequence ID is used by the driver for tracking multiple
30097          * commands. This ID is treated as opaque data by the firmware and
30098          * the value is returned in the `hwrm_resp_hdr` upon completion.
30099          */
30100         uint16_t        seq_id;
30101         /*
30102          * The target ID of the command:
30103          * * 0x0-0xFFF8 - The function ID
30104          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30105          * * 0xFFFD - Reserved for user-space HWRM interface
30106          * * 0xFFFF - HWRM
30107          */
30108         uint16_t        target_id;
30109         /*
30110          * A physical address pointer pointing to a host buffer that the
30111          * command's response data will be written. This can be either a host
30112          * physical address (HPA) or a guest physical address (GPA) and must
30113          * point to a physically contiguous block of memory.
30114          */
30115         uint64_t        resp_addr;
30116         uint32_t        enables;
30117         uint8_t unused_0[4];
30118 } __rte_packed;
30119
30120 /* hwrm_vnic_qcaps_output (size:192b/24B) */
30121 struct hwrm_vnic_qcaps_output {
30122         /* The specific error status for the command. */
30123         uint16_t        error_code;
30124         /* The HWRM command request type. */
30125         uint16_t        req_type;
30126         /* The sequence ID from the original command. */
30127         uint16_t        seq_id;
30128         /* The length of the response data in number of bytes. */
30129         uint16_t        resp_len;
30130         /* The maximum receive unit that is settable on a vnic. */
30131         uint16_t        mru;
30132         uint8_t unused_0[2];
30133         uint32_t        flags;
30134         /* Unused. */
30135         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED \
30136                 UINT32_C(0x1)
30137         /*
30138          * When this bit is '1', the capability of stripping VLAN in
30139          * the RX path is supported on VNIC(s).
30140          * If set to '0', then VLAN stripping capability is
30141          * not supported on VNIC(s).
30142          */
30143         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP \
30144                 UINT32_C(0x2)
30145         /*
30146          * When this bit is '1', the capability to buffer receive
30147          * packets in the hardware until the host posts new receive buffers
30148          * is supported on VNIC(s).
30149          * If set to '0', then bd_stall capability is not supported
30150          * on VNIC(s).
30151          */
30152         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP \
30153                 UINT32_C(0x4)
30154         /*
30155          * When this bit is '1', the capability to
30156          * receive both RoCE and non-RoCE traffic on VNIC(s) is
30157          * supported.
30158          * If set to '0', then the capability to receive
30159          * both RoCE and non-RoCE traffic on VNIC(s) is
30160          * not supported.
30161          */
30162         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP \
30163                 UINT32_C(0x8)
30164         /*
30165          * When this bit is set to '1', the capability to configure
30166          * a VNIC to receive only RoCE traffic is supported.
30167          * When this flag is set to '0', the VNIC capability to
30168          * configure to receive only RoCE traffic is not supported.
30169          */
30170         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP \
30171                 UINT32_C(0x10)
30172         /*
30173          * When this bit is set to '1', then the capability to enable
30174          * a VNIC in a mode where RSS context without configuring
30175          * RSS indirection table is supported (for RSS hash computation).
30176          * When this bit is set to '0', then a VNIC can not be configured
30177          * with a mode to enable RSS context without configuring RSS
30178          * indirection table.
30179          */
30180         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP \
30181                 UINT32_C(0x20)
30182         /*
30183          * When this bit is '1', the capability to
30184          * mirror the RoCE traffic is supported.
30185          * If set to '0', then the capability to mirror the
30186          * RoCE traffic is not supported.
30187          */
30188         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP \
30189                 UINT32_C(0x40)
30190         /*
30191          * When this bit is '1', the outermost RSS hashing capability
30192          * is supported. If set to '0', then the outermost RSS hashing
30193          * capability is not supported.
30194          */
30195         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP \
30196                 UINT32_C(0x80)
30197         /*
30198          * When this bit is '1', it indicates that firmware supports the
30199          * ability to steer incoming packets from one CoS queue to one
30200          * VNIC.  This optional feature can then be enabled
30201          * using HWRM_VNIC_CFG on any VNIC.  This feature is only
30202          * available when NVM option “enable_cos_classfication” is set
30203          * to 1.  If set to '0', firmware does not support this feature.
30204          */
30205         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_COS_ASSIGNMENT_CAP \
30206                 UINT32_C(0x100)
30207         /*
30208          * When this bit is '1', it indicates that HW and firmware supports
30209          * the use of RX V2 and RX TPA start V2 completion records for all
30210          * the RX rings of a VNIC. Once set, this feature is mandatory to
30211          * be used for the RX rings of the VNIC. Additionally, two new RX
30212          * checksum features supported by these ompletion records can be
30213          * configured using the HWRM_VNIC_CFG on a VNIC. If set to '0', the
30214          * HW and the firmware does not support this feature.
30215          */
30216         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RX_CMPL_V2_CAP \
30217                 UINT32_C(0x200)
30218         /*
30219          * When this bit is '1', it indicates that HW and firmware support
30220          * vnic state change. Host drivers can change the vnic state using
30221          * HWRM_VNIC_UPDATE. If set to '0', the HW and firmware do not
30222          * support this feature.
30223          */
30224         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VNIC_STATE_CAP \
30225                 UINT32_C(0x400)
30226         /*
30227          * When this bit is '1', it indicates that firmware supports
30228          * virtio-net functions default VNIC allocation using
30229          * HWRM_VNIC_ALLOC.
30230          * This capability is available only on Proxy VEE PF. If set to '0',
30231          * firmware does not support this feature.
30232          */
30233         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VIRTIO_NET_VNIC_ALLOC_CAP \
30234                 UINT32_C(0x800)
30235         /*
30236          * When this bit is set '1', then the capability to configure the
30237          * metadata format in the RX completion is supported for the VNIC.
30238          * When this bit is set to '0', then the capability to configure
30239          * the metadata format in the RX completion is not supported for
30240          * the VNIC.
30241          */
30242         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_METADATA_FORMAT_CAP \
30243                 UINT32_C(0x1000)
30244         /*
30245          * This field advertises the maximum concurrent TPA aggregations
30246          * supported by the VNIC on new devices that support TPA v2.
30247          * '0' means that TPA v2 is not supported.
30248          */
30249         uint16_t        max_aggs_supported;
30250         uint8_t unused_1[5];
30251         /*
30252          * This field is used in Output records to indicate that the output
30253          * is completely written to RAM.  This field should be read as '1'
30254          * to indicate that the output has been completely written.
30255          * When writing a command completion or response to an internal processor,
30256          * the order of writes has to be such that this field is written last.
30257          */
30258         uint8_t valid;
30259 } __rte_packed;
30260
30261 /*********************
30262  * hwrm_vnic_tpa_cfg *
30263  *********************/
30264
30265
30266 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */
30267 struct hwrm_vnic_tpa_cfg_input {
30268         /* The HWRM command request type. */
30269         uint16_t        req_type;
30270         /*
30271          * The completion ring to send the completion event on. This should
30272          * be the NQ ID returned from the `nq_alloc` HWRM command.
30273          */
30274         uint16_t        cmpl_ring;
30275         /*
30276          * The sequence ID is used by the driver for tracking multiple
30277          * commands. This ID is treated as opaque data by the firmware and
30278          * the value is returned in the `hwrm_resp_hdr` upon completion.
30279          */
30280         uint16_t        seq_id;
30281         /*
30282          * The target ID of the command:
30283          * * 0x0-0xFFF8 - The function ID
30284          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30285          * * 0xFFFD - Reserved for user-space HWRM interface
30286          * * 0xFFFF - HWRM
30287          */
30288         uint16_t        target_id;
30289         /*
30290          * A physical address pointer pointing to a host buffer that the
30291          * command's response data will be written. This can be either a host
30292          * physical address (HPA) or a guest physical address (GPA) and must
30293          * point to a physically contiguous block of memory.
30294          */
30295         uint64_t        resp_addr;
30296         uint32_t        flags;
30297         /*
30298          * When this bit is '1', the VNIC shall be configured to
30299          * perform transparent packet aggregation (TPA) of
30300          * non-tunneled TCP packets.
30301          */
30302         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA \
30303                 UINT32_C(0x1)
30304         /*
30305          * When this bit is '1', the VNIC shall be configured to
30306          * perform transparent packet aggregation (TPA) of
30307          * tunneled TCP packets.
30308          */
30309         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA \
30310                 UINT32_C(0x2)
30311         /*
30312          * When this bit is '1', the VNIC shall be configured to
30313          * perform transparent packet aggregation (TPA) according
30314          * to Windows Receive Segment Coalescing (RSC) rules.
30315          */
30316         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE \
30317                 UINT32_C(0x4)
30318         /*
30319          * When this bit is '1', the VNIC shall be configured to
30320          * perform transparent packet aggregation (TPA) according
30321          * to Linux Generic Receive Offload (GRO) rules.
30322          */
30323         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO \
30324                 UINT32_C(0x8)
30325         /*
30326          * When this bit is '1', the VNIC shall be configured to
30327          * perform transparent packet aggregation (TPA) for TCP
30328          * packets with IP ECN set to non-zero.
30329          */
30330         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN \
30331                 UINT32_C(0x10)
30332         /*
30333          * When this bit is '1', the VNIC shall be configured to
30334          * perform transparent packet aggregation (TPA) for
30335          * GRE tunneled TCP packets only if all packets have the
30336          * same GRE sequence.
30337          */
30338         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
30339                 UINT32_C(0x20)
30340         /*
30341          * When this bit is '1' and the GRO mode is enabled,
30342          * the VNIC shall be configured to
30343          * perform transparent packet aggregation (TPA) for
30344          * TCP/IPv4 packets with consecutively increasing IPIDs.
30345          * In other words, the last packet that is being
30346          * aggregated to an already existing aggregation context
30347          * shall have IPID 1 more than the IPID of the last packet
30348          * that was aggregated in that aggregation context.
30349          */
30350         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK \
30351                 UINT32_C(0x40)
30352         /*
30353          * When this bit is '1' and the GRO mode is enabled,
30354          * the VNIC shall be configured to
30355          * perform transparent packet aggregation (TPA) for
30356          * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
30357          * value.
30358          */
30359         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK \
30360                 UINT32_C(0x80)
30361         /*
30362          * When this bit is '1' and the GRO mode is enabled,
30363          * the VNIC shall DMA payload data using GRO rules.
30364          * When this bit is '0', the VNIC shall DMA payload data
30365          * using the more efficient LRO rules of filling all
30366          * aggregation buffers.
30367          */
30368         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_PACK_AS_GRO \
30369                 UINT32_C(0x100)
30370         uint32_t        enables;
30371         /*
30372          * This bit must be '1' for the max_agg_segs field to be
30373          * configured.
30374          */
30375         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS      UINT32_C(0x1)
30376         /*
30377          * This bit must be '1' for the max_aggs field to be
30378          * configured.
30379          */
30380         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS          UINT32_C(0x2)
30381         /*
30382          * This bit must be '1' for the max_agg_timer field to be
30383          * configured.
30384          */
30385         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER     UINT32_C(0x4)
30386         /* deprecated bit.  Do not use!!! */
30387         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN       UINT32_C(0x8)
30388         /* Logical vnic ID */
30389         uint16_t        vnic_id;
30390         /*
30391          * This is the maximum number of TCP segments that can
30392          * be aggregated (unit is Log2). Max value is 31. On new
30393          * devices supporting TPA v2, the unit is multiples of 4 and
30394          * valid values are > 0 and <= 63.
30395          */
30396         uint16_t        max_agg_segs;
30397         /* 1 segment */
30398         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
30399         /* 2 segments */
30400         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
30401         /* 4 segments */
30402         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
30403         /* 8 segments */
30404         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
30405         /* Any segment size larger than this is not valid */
30406         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
30407         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST \
30408                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
30409         /*
30410          * This is the maximum number of aggregations this VNIC is
30411          * allowed (unit is Log2). Max value is 7. On new devices
30412          * supporting TPA v2, this is in unit of 1 and must be > 0
30413          * and <= max_aggs_supported in the hwrm_vnic_qcaps response
30414          * to enable TPA v2.
30415          */
30416         uint16_t        max_aggs;
30417         /* 1 aggregation */
30418         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1   UINT32_C(0x0)
30419         /* 2 aggregations */
30420         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2   UINT32_C(0x1)
30421         /* 4 aggregations */
30422         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4   UINT32_C(0x2)
30423         /* 8 aggregations */
30424         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8   UINT32_C(0x3)
30425         /* 16 aggregations */
30426         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16  UINT32_C(0x4)
30427         /* Any aggregation size larger than this is not valid */
30428         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
30429         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST \
30430                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
30431         uint8_t unused_0[2];
30432         /*
30433          * This is the maximum amount of time allowed for
30434          * an aggregation context to complete after it was initiated.
30435          */
30436         uint32_t        max_agg_timer;
30437         /*
30438          * This is the minimum amount of payload length required to
30439          * start an aggregation context. This field is deprecated and
30440          * should be set to 0.  The minimum length is set by firmware
30441          * and can be queried using hwrm_vnic_tpa_qcfg.
30442          */
30443         uint32_t        min_agg_len;
30444 } __rte_packed;
30445
30446 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
30447 struct hwrm_vnic_tpa_cfg_output {
30448         /* The specific error status for the command. */
30449         uint16_t        error_code;
30450         /* The HWRM command request type. */
30451         uint16_t        req_type;
30452         /* The sequence ID from the original command. */
30453         uint16_t        seq_id;
30454         /* The length of the response data in number of bytes. */
30455         uint16_t        resp_len;
30456         uint8_t unused_0[7];
30457         /*
30458          * This field is used in Output records to indicate that the output
30459          * is completely written to RAM.  This field should be read as '1'
30460          * to indicate that the output has been completely written.
30461          * When writing a command completion or response to an internal processor,
30462          * the order of writes has to be such that this field is written last.
30463          */
30464         uint8_t valid;
30465 } __rte_packed;
30466
30467 /*********************
30468  * hwrm_vnic_rss_cfg *
30469  *********************/
30470
30471
30472 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
30473 struct hwrm_vnic_rss_cfg_input {
30474         /* The HWRM command request type. */
30475         uint16_t        req_type;
30476         /*
30477          * The completion ring to send the completion event on. This should
30478          * be the NQ ID returned from the `nq_alloc` HWRM command.
30479          */
30480         uint16_t        cmpl_ring;
30481         /*
30482          * The sequence ID is used by the driver for tracking multiple
30483          * commands. This ID is treated as opaque data by the firmware and
30484          * the value is returned in the `hwrm_resp_hdr` upon completion.
30485          */
30486         uint16_t        seq_id;
30487         /*
30488          * The target ID of the command:
30489          * * 0x0-0xFFF8 - The function ID
30490          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30491          * * 0xFFFD - Reserved for user-space HWRM interface
30492          * * 0xFFFF - HWRM
30493          */
30494         uint16_t        target_id;
30495         /*
30496          * A physical address pointer pointing to a host buffer that the
30497          * command's response data will be written. This can be either a host
30498          * physical address (HPA) or a guest physical address (GPA) and must
30499          * point to a physically contiguous block of memory.
30500          */
30501         uint64_t        resp_addr;
30502         uint32_t        hash_type;
30503         /*
30504          * When this bit is '1', the RSS hash shall be computed
30505          * over source and destination IPv4 addresses of IPv4
30506          * packets.
30507          */
30508         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
30509         /*
30510          * When this bit is '1', the RSS hash shall be computed
30511          * over source/destination IPv4 addresses and
30512          * source/destination ports of TCP/IPv4 packets.
30513          */
30514         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
30515         /*
30516          * When this bit is '1', the RSS hash shall be computed
30517          * over source/destination IPv4 addresses and
30518          * source/destination ports of UDP/IPv4 packets.
30519          */
30520         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
30521         /*
30522          * When this bit is '1', the RSS hash shall be computed
30523          * over source and destination IPv4 addresses of IPv6
30524          * packets.
30525          */
30526         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
30527         /*
30528          * When this bit is '1', the RSS hash shall be computed
30529          * over source/destination IPv6 addresses and
30530          * source/destination ports of TCP/IPv6 packets.
30531          */
30532         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
30533         /*
30534          * When this bit is '1', the RSS hash shall be computed
30535          * over source/destination IPv6 addresses and
30536          * source/destination ports of UDP/IPv6 packets.
30537          */
30538         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
30539         /* VNIC ID of VNIC associated with RSS table being configured. */
30540         uint16_t        vnic_id;
30541         /*
30542          * Specifies which VNIC ring table pair to configure.
30543          * Valid values range from 0 to 7.
30544          */
30545         uint8_t ring_table_pair_index;
30546         /* Flags to specify different RSS hash modes. */
30547         uint8_t hash_mode_flags;
30548         /*
30549          * When this bit is '1', it indicates using current RSS
30550          * hash mode setting configured in the device.
30551          */
30552         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \
30553                 UINT32_C(0x1)
30554         /*
30555          * When this bit is '1', it indicates requesting support of
30556          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
30557          * l4.src, l4.dest} for tunnel packets. For none-tunnel
30558          * packets, the RSS hash is computed over the normal
30559          * src/dest l3 and src/dest l4 headers.
30560          */
30561         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \
30562                 UINT32_C(0x2)
30563         /*
30564          * When this bit is '1', it indicates requesting support of
30565          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
30566          * tunnel packets. For none-tunnel packets, the RSS hash is
30567          * computed over the normal src/dest l3 headers.
30568          */
30569         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \
30570                 UINT32_C(0x4)
30571         /*
30572          * When this bit is '1', it indicates requesting support of
30573          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
30574          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
30575          * packets, the RSS hash is computed over the normal
30576          * src/dest l3 and src/dest l4 headers.
30577          */
30578         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
30579                 UINT32_C(0x8)
30580         /*
30581          * When this bit is '1', it indicates requesting support of
30582          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
30583          * tunnel packets. For none-tunnel packets, the RSS hash is
30584          * computed over the normal src/dest l3 headers.
30585          */
30586         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
30587                 UINT32_C(0x10)
30588         /* This is the address for rss ring group table */
30589         uint64_t        ring_grp_tbl_addr;
30590         /* This is the address for rss hash key table */
30591         uint64_t        hash_key_tbl_addr;
30592         /* Index to the rss indirection table. */
30593         uint16_t        rss_ctx_idx;
30594         uint8_t unused_1[6];
30595 } __rte_packed;
30596
30597 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
30598 struct hwrm_vnic_rss_cfg_output {
30599         /* The specific error status for the command. */
30600         uint16_t        error_code;
30601         /* The HWRM command request type. */
30602         uint16_t        req_type;
30603         /* The sequence ID from the original command. */
30604         uint16_t        seq_id;
30605         /* The length of the response data in number of bytes. */
30606         uint16_t        resp_len;
30607         uint8_t unused_0[7];
30608         /*
30609          * This field is used in Output records to indicate that the output
30610          * is completely written to RAM.  This field should be read as '1'
30611          * to indicate that the output has been completely written.
30612          * When writing a command completion or response to an internal processor,
30613          * the order of writes has to be such that this field is written last.
30614          */
30615         uint8_t valid;
30616 } __rte_packed;
30617
30618 /* hwrm_vnic_rss_cfg_cmd_err (size:64b/8B) */
30619 struct hwrm_vnic_rss_cfg_cmd_err {
30620         /*
30621          * command specific error codes that goes to
30622          * the cmd_err field in Common HWRM Error Response.
30623          */
30624         uint8_t code;
30625         /* Unknown error */
30626         #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_UNKNOWN \
30627                 UINT32_C(0x0)
30628         /*
30629          * Unable to change global RSS mode to outer due to all active
30630          * interfaces are not ready to support outer RSS hashing.
30631          */
30632         #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY \
30633                 UINT32_C(0x1)
30634         #define HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_LAST \
30635                 HWRM_VNIC_RSS_CFG_CMD_ERR_CODE_INTERFACE_NOT_READY
30636         uint8_t unused_0[7];
30637 } __rte_packed;
30638
30639 /**********************
30640  * hwrm_vnic_rss_qcfg *
30641  **********************/
30642
30643
30644 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
30645 struct hwrm_vnic_rss_qcfg_input {
30646         /* The HWRM command request type. */
30647         uint16_t        req_type;
30648         /*
30649          * The completion ring to send the completion event on. This should
30650          * be the NQ ID returned from the `nq_alloc` HWRM command.
30651          */
30652         uint16_t        cmpl_ring;
30653         /*
30654          * The sequence ID is used by the driver for tracking multiple
30655          * commands. This ID is treated as opaque data by the firmware and
30656          * the value is returned in the `hwrm_resp_hdr` upon completion.
30657          */
30658         uint16_t        seq_id;
30659         /*
30660          * The target ID of the command:
30661          * * 0x0-0xFFF8 - The function ID
30662          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30663          * * 0xFFFD - Reserved for user-space HWRM interface
30664          * * 0xFFFF - HWRM
30665          */
30666         uint16_t        target_id;
30667         /*
30668          * A physical address pointer pointing to a host buffer that the
30669          * command's response data will be written. This can be either a host
30670          * physical address (HPA) or a guest physical address (GPA) and must
30671          * point to a physically contiguous block of memory.
30672          */
30673         uint64_t        resp_addr;
30674         /* Index to the rss indirection table. */
30675         uint16_t        rss_ctx_idx;
30676         uint8_t unused_0[6];
30677 } __rte_packed;
30678
30679 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
30680 struct hwrm_vnic_rss_qcfg_output {
30681         /* The specific error status for the command. */
30682         uint16_t        error_code;
30683         /* The HWRM command request type. */
30684         uint16_t        req_type;
30685         /* The sequence ID from the original command. */
30686         uint16_t        seq_id;
30687         /* The length of the response data in number of bytes. */
30688         uint16_t        resp_len;
30689         uint32_t        hash_type;
30690         /*
30691          * When this bit is '1', the RSS hash shall be computed
30692          * over source and destination IPv4 addresses of IPv4
30693          * packets.
30694          */
30695         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
30696         /*
30697          * When this bit is '1', the RSS hash shall be computed
30698          * over source/destination IPv4 addresses and
30699          * source/destination ports of TCP/IPv4 packets.
30700          */
30701         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
30702         /*
30703          * When this bit is '1', the RSS hash shall be computed
30704          * over source/destination IPv4 addresses and
30705          * source/destination ports of UDP/IPv4 packets.
30706          */
30707         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
30708         /*
30709          * When this bit is '1', the RSS hash shall be computed
30710          * over source and destination IPv4 addresses of IPv6
30711          * packets.
30712          */
30713         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
30714         /*
30715          * When this bit is '1', the RSS hash shall be computed
30716          * over source/destination IPv6 addresses and
30717          * source/destination ports of TCP/IPv6 packets.
30718          */
30719         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
30720         /*
30721          * When this bit is '1', the RSS hash shall be computed
30722          * over source/destination IPv6 addresses and
30723          * source/destination ports of UDP/IPv6 packets.
30724          */
30725         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
30726         uint8_t unused_0[4];
30727         /* This is the value of rss hash key */
30728         uint32_t        hash_key[10];
30729         /* Flags to specify different RSS hash modes. */
30730         uint8_t hash_mode_flags;
30731         /*
30732          * When this bit is '1', it indicates using current RSS
30733          * hash mode setting configured in the device.
30734          */
30735         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \
30736                 UINT32_C(0x1)
30737         /*
30738          * When this bit is '1', it indicates requesting support of
30739          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
30740          * l4.src, l4.dest} for tunnel packets. For none-tunnel
30741          * packets, the RSS hash is computed over the normal
30742          * src/dest l3 and src/dest l4 headers.
30743          */
30744         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \
30745                 UINT32_C(0x2)
30746         /*
30747          * When this bit is '1', it indicates requesting support of
30748          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
30749          * tunnel packets. For none-tunnel packets, the RSS hash is
30750          * computed over the normal src/dest l3 headers.
30751          */
30752         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \
30753                 UINT32_C(0x4)
30754         /*
30755          * When this bit is '1', it indicates requesting support of
30756          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
30757          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
30758          * packets, the RSS hash is computed over the normal
30759          * src/dest l3 and src/dest l4 headers.
30760          */
30761         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
30762                 UINT32_C(0x8)
30763         /*
30764          * When this bit is '1', it indicates requesting support of
30765          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
30766          * tunnel packets. For none-tunnel packets, the RSS hash is
30767          * computed over the normal src/dest l3 headers.
30768          */
30769         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
30770                 UINT32_C(0x10)
30771         uint8_t unused_1[6];
30772         /*
30773          * This field is used in Output records to indicate that the output
30774          * is completely written to RAM.  This field should be read as '1'
30775          * to indicate that the output has been completely written.
30776          * When writing a command completion or response to an internal processor,
30777          * the order of writes has to be such that this field is written last.
30778          */
30779         uint8_t valid;
30780 } __rte_packed;
30781
30782 /**************************
30783  * hwrm_vnic_plcmodes_cfg *
30784  **************************/
30785
30786
30787 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
30788 struct hwrm_vnic_plcmodes_cfg_input {
30789         /* The HWRM command request type. */
30790         uint16_t        req_type;
30791         /*
30792          * The completion ring to send the completion event on. This should
30793          * be the NQ ID returned from the `nq_alloc` HWRM command.
30794          */
30795         uint16_t        cmpl_ring;
30796         /*
30797          * The sequence ID is used by the driver for tracking multiple
30798          * commands. This ID is treated as opaque data by the firmware and
30799          * the value is returned in the `hwrm_resp_hdr` upon completion.
30800          */
30801         uint16_t        seq_id;
30802         /*
30803          * The target ID of the command:
30804          * * 0x0-0xFFF8 - The function ID
30805          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30806          * * 0xFFFD - Reserved for user-space HWRM interface
30807          * * 0xFFFF - HWRM
30808          */
30809         uint16_t        target_id;
30810         /*
30811          * A physical address pointer pointing to a host buffer that the
30812          * command's response data will be written. This can be either a host
30813          * physical address (HPA) or a guest physical address (GPA) and must
30814          * point to a physically contiguous block of memory.
30815          */
30816         uint64_t        resp_addr;
30817         uint32_t        flags;
30818         /*
30819          * When this bit is '1', the VNIC shall be configured to
30820          * use regular placement algorithm.
30821          * By default, the regular placement algorithm shall be
30822          * enabled on the VNIC.
30823          */
30824         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
30825                 UINT32_C(0x1)
30826         /*
30827          * When this bit is '1', the VNIC shall be configured
30828          * use the jumbo placement algorithm.
30829          */
30830         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
30831                 UINT32_C(0x2)
30832         /*
30833          * When this bit is '1', the VNIC shall be configured
30834          * to enable Header-Data split for IPv4 packets according
30835          * to the following rules:
30836          * # If the packet is identified as TCP/IPv4, then the
30837          * packet is split at the beginning of the TCP payload.
30838          * # If the packet is identified as UDP/IPv4, then the
30839          * packet is split at the beginning of UDP payload.
30840          * # If the packet is identified as non-TCP and non-UDP
30841          * IPv4 packet, then the packet is split at the beginning
30842          * of the upper layer protocol header carried in the IPv4
30843          * packet.
30844          */
30845         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 \
30846                 UINT32_C(0x4)
30847         /*
30848          * When this bit is '1', the VNIC shall be configured
30849          * to enable Header-Data split for IPv6 packets according
30850          * to the following rules:
30851          * # If the packet is identified as TCP/IPv6, then the
30852          * packet is split at the beginning of the TCP payload.
30853          * # If the packet is identified as UDP/IPv6, then the
30854          * packet is split at the beginning of UDP payload.
30855          * # If the packet is identified as non-TCP and non-UDP
30856          * IPv6 packet, then the packet is split at the beginning
30857          * of the upper layer protocol header carried in the IPv6
30858          * packet.
30859          */
30860         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 \
30861                 UINT32_C(0x8)
30862         /*
30863          * When this bit is '1', the VNIC shall be configured
30864          * to enable Header-Data split for FCoE packets at the
30865          * beginning of FC payload.
30866          */
30867         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE \
30868                 UINT32_C(0x10)
30869         /*
30870          * When this bit is '1', the VNIC shall be configured
30871          * to enable Header-Data split for RoCE packets at the
30872          * beginning of RoCE payload (after BTH/GRH headers).
30873          */
30874         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE \
30875                 UINT32_C(0x20)
30876         /*
30877          * When this bit is '1', the VNIC shall be configured use the virtio
30878          * placement algorithm. This feature can only be configured when
30879          * proxy mode is supported on the function.
30880          */
30881         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_VIRTIO_PLACEMENT \
30882                 UINT32_C(0x40)
30883         uint32_t        enables;
30884         /*
30885          * This bit must be '1' for the jumbo_thresh_valid field to be
30886          * configured.
30887          */
30888         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
30889                 UINT32_C(0x1)
30890         /*
30891          * This bit must be '1' for the hds_offset_valid field to be
30892          * configured.
30893          */
30894         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
30895                 UINT32_C(0x2)
30896         /*
30897          * This bit must be '1' for the hds_threshold_valid field to be
30898          * configured.
30899          */
30900         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
30901                 UINT32_C(0x4)
30902         /*
30903          * This bit must be '1' for the max_bds_valid field to be
30904          * configured.
30905          */
30906         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_MAX_BDS_VALID \
30907                 UINT32_C(0x8)
30908         /* Logical vnic ID */
30909         uint32_t        vnic_id;
30910         /*
30911          * When jumbo placement algorithm is enabled, this value
30912          * is used to determine the threshold for jumbo placement.
30913          * Packets with length larger than this value will be
30914          * placed according to the jumbo placement algorithm.
30915          */
30916         uint16_t        jumbo_thresh;
30917         /*
30918          * This value is used to determine the offset into
30919          * packet buffer where the split data (payload) will be
30920          * placed according to one of HDS placement algorithm.
30921          *
30922          * The lengths of packet buffers provided for split data
30923          * shall be larger than this value.
30924          */
30925         uint16_t        hds_offset;
30926         /*
30927          * When one of the HDS placement algorithm is enabled, this
30928          * value is used to determine the threshold for HDS
30929          * placement.
30930          * Packets with length larger than this value will be
30931          * placed according to the HDS placement algorithm.
30932          * This value shall be in multiple of 4 bytes.
30933          */
30934         uint16_t        hds_threshold;
30935         /*
30936          * When virtio placement algorithm is enabled, this
30937          * value is used to determine the maximum number of BDs
30938          * that can be used to place an Rx Packet.
30939          * If an incoming packet does not fit in the buffers described
30940          * by the max BDs, the packet will be dropped and an error
30941          * will be reported in the completion. Valid values for this
30942          * field are between 1 and 8. If the VNIC uses header-data-
30943          * separation and/or TPA with buffer spanning enabled, valid
30944          * values for this field are between 2 and 8.
30945          * This feature can only be configured when proxy mode is
30946          * supported on the function.
30947          */
30948         uint16_t        max_bds;
30949         uint8_t unused_0[4];
30950 } __rte_packed;
30951
30952 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
30953 struct hwrm_vnic_plcmodes_cfg_output {
30954         /* The specific error status for the command. */
30955         uint16_t        error_code;
30956         /* The HWRM command request type. */
30957         uint16_t        req_type;
30958         /* The sequence ID from the original command. */
30959         uint16_t        seq_id;
30960         /* The length of the response data in number of bytes. */
30961         uint16_t        resp_len;
30962         uint8_t unused_0[7];
30963         /*
30964          * This field is used in Output records to indicate that the output
30965          * is completely written to RAM.  This field should be read as '1'
30966          * to indicate that the output has been completely written.
30967          * When writing a command completion or response to an internal
30968          * processor, the order of writes has to be such that this field is
30969          * written last.
30970          */
30971         uint8_t valid;
30972 } __rte_packed;
30973
30974 /***************************
30975  * hwrm_vnic_plcmodes_qcfg *
30976  ***************************/
30977
30978
30979 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
30980 struct hwrm_vnic_plcmodes_qcfg_input {
30981         /* The HWRM command request type. */
30982         uint16_t        req_type;
30983         /*
30984          * The completion ring to send the completion event on. This should
30985          * be the NQ ID returned from the `nq_alloc` HWRM command.
30986          */
30987         uint16_t        cmpl_ring;
30988         /*
30989          * The sequence ID is used by the driver for tracking multiple
30990          * commands. This ID is treated as opaque data by the firmware and
30991          * the value is returned in the `hwrm_resp_hdr` upon completion.
30992          */
30993         uint16_t        seq_id;
30994         /*
30995          * The target ID of the command:
30996          * * 0x0-0xFFF8 - The function ID
30997          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30998          * * 0xFFFD - Reserved for user-space HWRM interface
30999          * * 0xFFFF - HWRM
31000          */
31001         uint16_t        target_id;
31002         /*
31003          * A physical address pointer pointing to a host buffer that the
31004          * command's response data will be written. This can be either a host
31005          * physical address (HPA) or a guest physical address (GPA) and must
31006          * point to a physically contiguous block of memory.
31007          */
31008         uint64_t        resp_addr;
31009         /* Logical vnic ID */
31010         uint32_t        vnic_id;
31011         uint8_t unused_0[4];
31012 } __rte_packed;
31013
31014 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
31015 struct hwrm_vnic_plcmodes_qcfg_output {
31016         /* The specific error status for the command. */
31017         uint16_t        error_code;
31018         /* The HWRM command request type. */
31019         uint16_t        req_type;
31020         /* The sequence ID from the original command. */
31021         uint16_t        seq_id;
31022         /* The length of the response data in number of bytes. */
31023         uint16_t        resp_len;
31024         uint32_t        flags;
31025         /*
31026          * When this bit is '1', the VNIC is configured to
31027          * use regular placement algorithm.
31028          */
31029         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
31030                 UINT32_C(0x1)
31031         /*
31032          * When this bit is '1', the VNIC is configured to
31033          * use the jumbo placement algorithm.
31034          */
31035         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
31036                 UINT32_C(0x2)
31037         /*
31038          * When this bit is '1', the VNIC is configured
31039          * to enable Header-Data split for IPv4 packets.
31040          */
31041         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 \
31042                 UINT32_C(0x4)
31043         /*
31044          * When this bit is '1', the VNIC is configured
31045          * to enable Header-Data split for IPv6 packets.
31046          */
31047         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 \
31048                 UINT32_C(0x8)
31049         /*
31050          * When this bit is '1', the VNIC is configured
31051          * to enable Header-Data split for FCoE packets.
31052          */
31053         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE \
31054                 UINT32_C(0x10)
31055         /*
31056          * When this bit is '1', the VNIC is configured
31057          * to enable Header-Data split for RoCE packets.
31058          */
31059         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE \
31060                 UINT32_C(0x20)
31061         /*
31062          * When this bit is '1', the VNIC is configured
31063          * to be the default VNIC of the requesting function.
31064          */
31065         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC \
31066                 UINT32_C(0x40)
31067         /*
31068          * When this bit is '1', the VNIC is configured to use the virtio
31069          * placement algorithm. This feature can only be configured when
31070          * proxy mode is supported on the function.
31071          */
31072         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_VIRTIO_PLACEMENT \
31073                 UINT32_C(0x80)
31074         /*
31075          * When jumbo placement algorithm is enabled, this value
31076          * is used to determine the threshold for jumbo placement.
31077          * Packets with length larger than this value will be
31078          * placed according to the jumbo placement algorithm.
31079          */
31080         uint16_t        jumbo_thresh;
31081         /*
31082          * This value is used to determine the offset into
31083          * packet buffer where the split data (payload) will be
31084          * placed according to one of HDS placement algorithm.
31085          *
31086          * The lengths of packet buffers provided for split data
31087          * shall be larger than this value.
31088          */
31089         uint16_t        hds_offset;
31090         /*
31091          * When one of the HDS placement algorithm is enabled, this
31092          * value is used to determine the threshold for HDS
31093          * placement.
31094          * Packets with length larger than this value will be
31095          * placed according to the HDS placement algorithm.
31096          * This value shall be in multiple of 4 bytes.
31097          */
31098         uint16_t        hds_threshold;
31099         /*
31100          * When virtio placement algorithm is enabled, this
31101          * value is used to determine the maximum number of BDs
31102          * that can be used to place an Rx Packet.
31103          * If an incoming packet does not fit in the buffers described
31104          * by the max BDs, the packet will be dropped and an error
31105          * will be reported in the completion. Valid values for this
31106          * field are between 1 and 8. If the VNIC uses header-data-
31107          * separation and/or TPA with buffer spanning enabled, valid
31108          * values for this field are between 2 and 8.
31109          * This feature can only be configured when proxy mode is supported
31110          * on the function
31111          */
31112         uint16_t        max_bds;
31113         uint8_t unused_0[3];
31114         /*
31115          * This field is used in Output records to indicate that the output
31116          * is completely written to RAM.  This field should be read as '1'
31117          * to indicate that the output has been completely written.
31118          * When writing a command completion or response to an internal
31119          * processor, the order of writes has to be such that this field is
31120          * written last.
31121          */
31122         uint8_t valid;
31123 } __rte_packed;
31124
31125 /**********************************
31126  * hwrm_vnic_rss_cos_lb_ctx_alloc *
31127  **********************************/
31128
31129
31130 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
31131 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
31132         /* The HWRM command request type. */
31133         uint16_t        req_type;
31134         /*
31135          * The completion ring to send the completion event on. This should
31136          * be the NQ ID returned from the `nq_alloc` HWRM command.
31137          */
31138         uint16_t        cmpl_ring;
31139         /*
31140          * The sequence ID is used by the driver for tracking multiple
31141          * commands. This ID is treated as opaque data by the firmware and
31142          * the value is returned in the `hwrm_resp_hdr` upon completion.
31143          */
31144         uint16_t        seq_id;
31145         /*
31146          * The target ID of the command:
31147          * * 0x0-0xFFF8 - The function ID
31148          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31149          * * 0xFFFD - Reserved for user-space HWRM interface
31150          * * 0xFFFF - HWRM
31151          */
31152         uint16_t        target_id;
31153         /*
31154          * A physical address pointer pointing to a host buffer that the
31155          * command's response data will be written. This can be either a host
31156          * physical address (HPA) or a guest physical address (GPA) and must
31157          * point to a physically contiguous block of memory.
31158          */
31159         uint64_t        resp_addr;
31160 } __rte_packed;
31161
31162 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
31163 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
31164         /* The specific error status for the command. */
31165         uint16_t        error_code;
31166         /* The HWRM command request type. */
31167         uint16_t        req_type;
31168         /* The sequence ID from the original command. */
31169         uint16_t        seq_id;
31170         /* The length of the response data in number of bytes. */
31171         uint16_t        resp_len;
31172         /* rss_cos_lb_ctx_id is 16 b */
31173         uint16_t        rss_cos_lb_ctx_id;
31174         uint8_t unused_0[5];
31175         /*
31176          * This field is used in Output records to indicate that the output
31177          * is completely written to RAM.  This field should be read as '1'
31178          * to indicate that the output has been completely written.
31179          * When writing a command completion or response to an internal processor,
31180          * the order of writes has to be such that this field is written last.
31181          */
31182         uint8_t valid;
31183 } __rte_packed;
31184
31185 /*********************************
31186  * hwrm_vnic_rss_cos_lb_ctx_free *
31187  *********************************/
31188
31189
31190 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
31191 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
31192         /* The HWRM command request type. */
31193         uint16_t        req_type;
31194         /*
31195          * The completion ring to send the completion event on. This should
31196          * be the NQ ID returned from the `nq_alloc` HWRM command.
31197          */
31198         uint16_t        cmpl_ring;
31199         /*
31200          * The sequence ID is used by the driver for tracking multiple
31201          * commands. This ID is treated as opaque data by the firmware and
31202          * the value is returned in the `hwrm_resp_hdr` upon completion.
31203          */
31204         uint16_t        seq_id;
31205         /*
31206          * The target ID of the command:
31207          * * 0x0-0xFFF8 - The function ID
31208          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31209          * * 0xFFFD - Reserved for user-space HWRM interface
31210          * * 0xFFFF - HWRM
31211          */
31212         uint16_t        target_id;
31213         /*
31214          * A physical address pointer pointing to a host buffer that the
31215          * command's response data will be written. This can be either a host
31216          * physical address (HPA) or a guest physical address (GPA) and must
31217          * point to a physically contiguous block of memory.
31218          */
31219         uint64_t        resp_addr;
31220         /* rss_cos_lb_ctx_id is 16 b */
31221         uint16_t        rss_cos_lb_ctx_id;
31222         uint8_t unused_0[6];
31223 } __rte_packed;
31224
31225 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
31226 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
31227         /* The specific error status for the command. */
31228         uint16_t        error_code;
31229         /* The HWRM command request type. */
31230         uint16_t        req_type;
31231         /* The sequence ID from the original command. */
31232         uint16_t        seq_id;
31233         /* The length of the response data in number of bytes. */
31234         uint16_t        resp_len;
31235         uint8_t unused_0[7];
31236         /*
31237          * This field is used in Output records to indicate that the output
31238          * is completely written to RAM.  This field should be read as '1'
31239          * to indicate that the output has been completely written.
31240          * When writing a command completion or response to an internal processor,
31241          * the order of writes has to be such that this field is written last.
31242          */
31243         uint8_t valid;
31244 } __rte_packed;
31245
31246 /*******************
31247  * hwrm_ring_alloc *
31248  *******************/
31249
31250
31251 /* hwrm_ring_alloc_input (size:704b/88B) */
31252 struct hwrm_ring_alloc_input {
31253         /* The HWRM command request type. */
31254         uint16_t        req_type;
31255         /*
31256          * The completion ring to send the completion event on. This should
31257          * be the NQ ID returned from the `nq_alloc` HWRM command.
31258          */
31259         uint16_t        cmpl_ring;
31260         /*
31261          * The sequence ID is used by the driver for tracking multiple
31262          * commands. This ID is treated as opaque data by the firmware and
31263          * the value is returned in the `hwrm_resp_hdr` upon completion.
31264          */
31265         uint16_t        seq_id;
31266         /*
31267          * The target ID of the command:
31268          * * 0x0-0xFFF8 - The function ID
31269          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31270          * * 0xFFFD - Reserved for user-space HWRM interface
31271          * * 0xFFFF - HWRM
31272          */
31273         uint16_t        target_id;
31274         /*
31275          * A physical address pointer pointing to a host buffer that the
31276          * command's response data will be written. This can be either a host
31277          * physical address (HPA) or a guest physical address (GPA) and must
31278          * point to a physically contiguous block of memory.
31279          */
31280         uint64_t        resp_addr;
31281         uint32_t        enables;
31282         /*
31283          * This bit must be '1' for the ring_arb_cfg field to be
31284          * configured.
31285          */
31286         #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG \
31287                 UINT32_C(0x2)
31288         /*
31289          * This bit must be '1' for the stat_ctx_id_valid field to be
31290          * configured.
31291          */
31292         #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID \
31293                 UINT32_C(0x8)
31294         /*
31295          * This bit must be '1' for the max_bw_valid field to be
31296          * configured.
31297          */
31298         #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID \
31299                 UINT32_C(0x20)
31300         /*
31301          * This bit must be '1' for the rx_ring_id field to be
31302          * configured.
31303          */
31304         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID \
31305                 UINT32_C(0x40)
31306         /*
31307          * This bit must be '1' for the nq_ring_id field to be
31308          * configured.
31309          */
31310         #define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID \
31311                 UINT32_C(0x80)
31312         /*
31313          * This bit must be '1' for the rx_buf_size field to be
31314          * configured.
31315          */
31316         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID \
31317                 UINT32_C(0x100)
31318         /*
31319          * This bit must be '1' for the schq_id field to be
31320          * configured.
31321          */
31322         #define HWRM_RING_ALLOC_INPUT_ENABLES_SCHQ_ID \
31323                 UINT32_C(0x200)
31324         /*
31325          * This bit must be '1' for the mpc_chnls_type field to be
31326          * configured.
31327          */
31328         #define HWRM_RING_ALLOC_INPUT_ENABLES_MPC_CHNLS_TYPE \
31329                 UINT32_C(0x400)
31330         /* Ring Type. */
31331         uint8_t ring_type;
31332         /* L2 Completion Ring (CR) */
31333         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
31334         /* TX Ring (TR) */
31335         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX        UINT32_C(0x1)
31336         /* RX Ring (RR) */
31337         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX        UINT32_C(0x2)
31338         /* RoCE Notification Completion Ring (ROCE_CR) */
31339         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
31340         /* RX Aggregation Ring */
31341         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
31342         /* Notification Queue */
31343         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
31344         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST \
31345                 HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
31346         uint8_t unused_0;
31347         /* Ring allocation flags. */
31348         uint16_t        flags;
31349         /*
31350          * For Rx rings, the incoming packet data can be placed at either
31351          * a 0B or 2B offset from the start of the Rx packet buffer. When
31352          * '1', the received packet will be padded with 2B of zeros at the
31353          * front of the packet. Note that this flag is only used for
31354          * Rx rings and is ignored for all other rings included Rx
31355          * Aggregation rings.
31356          */
31357         #define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD     UINT32_C(0x1)
31358         /*
31359          * This value is a pointer to the page table for the
31360          * Ring.
31361          */
31362         uint64_t        page_tbl_addr;
31363         /* First Byte Offset of the first entry in the first page. */
31364         uint32_t        fbo;
31365         /*
31366          * Actual page size in 2^page_size. The supported range is increments
31367          * in powers of 2 from 16 bytes to 1GB.
31368          * - 4 = 16 B
31369          *     Page size is 16 B.
31370          * - 12 = 4 KB
31371          *     Page size is 4 KB.
31372          * - 13 = 8 KB
31373          *     Page size is 8 KB.
31374          * - 16 = 64 KB
31375          *     Page size is 64 KB.
31376          * - 21 = 2 MB
31377          *     Page size is 2 MB.
31378          * - 22 = 4 MB
31379          *     Page size is 4 MB.
31380          * - 30 = 1 GB
31381          *     Page size is 1 GB.
31382          */
31383         uint8_t page_size;
31384         /*
31385          * This value indicates the depth of page table.
31386          * For this version of the specification, value other than 0 or
31387          * 1 shall be considered as an invalid value.
31388          * When the page_tbl_depth = 0, then it is treated as a
31389          * special case with the following.
31390          * 1. FBO and page size fields are not valid.
31391          * 2. page_tbl_addr is the physical address of the first
31392          *    element of the ring.
31393          */
31394         uint8_t page_tbl_depth;
31395         /* Used by a PF driver to associate a SCHQ with one of its TX rings. */
31396         uint16_t        schq_id;
31397         /*
31398          * Number of 16B units in the ring.  Minimum size for
31399          * a ring is 16 16B entries.
31400          */
31401         uint32_t        length;
31402         /*
31403          * Logical ring number for the ring to be allocated.
31404          * This value determines the position in the doorbell
31405          * area where the update to the ring will be made.
31406          *
31407          * For completion rings, this value is also the MSI-X
31408          * vector number for the function the completion ring is
31409          * associated with.
31410          */
31411         uint16_t        logical_id;
31412         /*
31413          * This field is used only when ring_type is a TX ring.
31414          * This value indicates what completion ring the TX ring
31415          * is associated with.
31416          */
31417         uint16_t        cmpl_ring_id;
31418         /*
31419          * This field is used only when ring_type is a TX ring.
31420          * This value indicates what CoS queue the TX ring
31421          * is associated with.
31422          */
31423         uint16_t        queue_id;
31424         /*
31425          * When allocating a Rx ring or Rx aggregation ring, this field
31426          * specifies the size of the buffer descriptors posted to the ring.
31427          */
31428         uint16_t        rx_buf_size;
31429         /*
31430          * When allocating an Rx aggregation ring, this field
31431          * specifies the associated Rx ring ID.
31432          */
31433         uint16_t        rx_ring_id;
31434         /*
31435          * When allocating a completion ring, this field
31436          * specifies the associated NQ ring ID.
31437          */
31438         uint16_t        nq_ring_id;
31439         /*
31440          * This field is used only when ring_type is a TX ring.
31441          * This field is used to configure arbitration related
31442          * parameters for a TX ring.
31443          */
31444         uint16_t        ring_arb_cfg;
31445         /* Arbitration policy used for the ring. */
31446         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK \
31447                 UINT32_C(0xf)
31448         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT       0
31449         /*
31450          * Use strict priority for the TX ring.
31451          * Priority value is specified in arb_policy_param
31452          */
31453         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
31454                 UINT32_C(0x1)
31455         /*
31456          * Use weighted fair queue arbitration for the TX ring.
31457          * Weight is specified in arb_policy_param
31458          */
31459         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
31460                 UINT32_C(0x2)
31461         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
31462                 HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
31463         /* Reserved field. */
31464         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK \
31465                 UINT32_C(0xf0)
31466         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT             4
31467         /*
31468          * Arbitration policy specific parameter.
31469          * # For strict priority arbitration policy, this field
31470          * represents a priority value. If set to 0, then the priority
31471          * is not specified and the HWRM is allowed to select
31472          * any priority for this TX ring.
31473          * # For weighted fair queue arbitration policy, this field
31474          * represents a weight value. If set to 0, then the weight
31475          * is not specified and the HWRM is allowed to select
31476          * any weight for this TX ring.
31477          */
31478         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
31479                 UINT32_C(0xff00)
31480         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
31481         uint16_t        unused_3;
31482         /*
31483          * This field is reserved for the future use.
31484          * It shall be set to 0.
31485          */
31486         uint32_t        reserved3;
31487         /*
31488          * This field is used only when ring_type is a TX ring.
31489          * This input indicates what statistics context this ring
31490          * should be associated with.
31491          */
31492         uint32_t        stat_ctx_id;
31493         /*
31494          * This field is reserved for the future use.
31495          * It shall be set to 0.
31496          */
31497         uint32_t        reserved4;
31498         /*
31499          * This field is used only when ring_type is a TX ring
31500          * to specify maximum BW allocated to the TX ring.
31501          * The HWRM will translate this value into byte counter and
31502          * time interval used for this ring inside the device.
31503          */
31504         uint32_t        max_bw;
31505         /* The bandwidth value. */
31506         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK \
31507                 UINT32_C(0xfffffff)
31508         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT              0
31509         /* The granularity of the value (bits or bytes). */
31510         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE \
31511                 UINT32_C(0x10000000)
31512         /* Value is in bits. */
31513         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS \
31514                 (UINT32_C(0x0) << 28)
31515         /* Value is in bytes. */
31516         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES \
31517                 (UINT32_C(0x1) << 28)
31518         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
31519                 HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
31520         /* bw_value_unit is 3 b */
31521         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
31522                 UINT32_C(0xe0000000)
31523         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
31524         /* Value is in Mb or MB (base 10). */
31525         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
31526                 (UINT32_C(0x0) << 29)
31527         /* Value is in Kb or KB (base 10). */
31528         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
31529                 (UINT32_C(0x2) << 29)
31530         /* Value is in bits or bytes. */
31531         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
31532                 (UINT32_C(0x4) << 29)
31533         /* Value is in Gb or GB (base 10). */
31534         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
31535                 (UINT32_C(0x6) << 29)
31536         /* Value is in 1/100th of a percentage of total bandwidth. */
31537         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
31538                 (UINT32_C(0x1) << 29)
31539         /* Invalid unit */
31540         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
31541                 (UINT32_C(0x7) << 29)
31542         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
31543                 HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
31544         /*
31545          * This field is used only when ring_type is a Completion ring.
31546          * This value indicates what interrupt mode should be used
31547          * on this completion ring.
31548          * Note: In the legacy interrupt mode, no more than 16
31549          * completion rings are allowed.
31550          */
31551         uint8_t int_mode;
31552         /* Legacy INTA */
31553         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
31554         /* Reserved */
31555         #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD   UINT32_C(0x1)
31556         /* MSI-X */
31557         #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX   UINT32_C(0x2)
31558         /* No Interrupt - Polled mode */
31559         #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL   UINT32_C(0x3)
31560         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST \
31561                 HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
31562         /* Midpath channel type */
31563         uint8_t mpc_chnls_type;
31564         /*
31565          * Indicate the TX ring alloc MPC channel type is a MPC channel
31566          * with destination to the TX crypto engine block.
31567          */
31568         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_TCE     UINT32_C(0x0)
31569         /*
31570          * Indicate the RX ring alloc MPC channel type is a MPC channel
31571          * with destination to the RX crypto engine block.
31572          */
31573         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_RCE     UINT32_C(0x1)
31574         /*
31575          * Indicate the RX ring alloc MPC channel type is a MPC channel
31576          * with destination to the TX configurable flow processing block.
31577          */
31578         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_TE_CFA  UINT32_C(0x2)
31579         /*
31580          * Indicate the RX ring alloc MPC channel type is a MPC channel
31581          * with destination to the RX configurable flow processing block.
31582          */
31583         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_RE_CFA  UINT32_C(0x3)
31584         /*
31585          * Indicate the RX ring alloc MPC channel type is a MPC channel
31586          * with destination to the primate processor block.
31587          */
31588         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_PRIMATE UINT32_C(0x4)
31589         #define HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_LAST \
31590                 HWRM_RING_ALLOC_INPUT_MPC_CHNLS_TYPE_PRIMATE
31591         uint8_t unused_4[2];
31592         /*
31593          * The cq_handle is specified when allocating a completion ring. For
31594          * devices that support NQs, this cq_handle will be included in the
31595          * NQE to specify which CQ should be read to retrieve the completion
31596          * record.
31597          */
31598         uint64_t        cq_handle;
31599 } __rte_packed;
31600
31601 /* hwrm_ring_alloc_output (size:128b/16B) */
31602 struct hwrm_ring_alloc_output {
31603         /* The specific error status for the command. */
31604         uint16_t        error_code;
31605         /* The HWRM command request type. */
31606         uint16_t        req_type;
31607         /* The sequence ID from the original command. */
31608         uint16_t        seq_id;
31609         /* The length of the response data in number of bytes. */
31610         uint16_t        resp_len;
31611         /*
31612          * Physical number of ring allocated.
31613          * This value shall be unique for a ring type.
31614          */
31615         uint16_t        ring_id;
31616         /* Logical number of ring allocated. */
31617         uint16_t        logical_ring_id;
31618         /*
31619          * This field will tell whether to use ping or pong buffer
31620          * for first push operation.
31621          */
31622         uint8_t push_buffer_index;
31623         /* Start push from ping buffer index */
31624         #define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PING_BUFFER \
31625                 UINT32_C(0x0)
31626         /* Start push from pong buffer index */
31627         #define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER \
31628                 UINT32_C(0x1)
31629         #define HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_LAST \
31630                 HWRM_RING_ALLOC_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER
31631         uint8_t unused_0[2];
31632         /*
31633          * This field is used in Output records to indicate that the output
31634          * is completely written to RAM.  This field should be read as '1'
31635          * to indicate that the output has been completely written.
31636          * When writing a command completion or response to an internal processor,
31637          * the order of writes has to be such that this field is written last.
31638          */
31639         uint8_t valid;
31640 } __rte_packed;
31641
31642 /******************
31643  * hwrm_ring_free *
31644  ******************/
31645
31646
31647 /* hwrm_ring_free_input (size:192b/24B) */
31648 struct hwrm_ring_free_input {
31649         /* The HWRM command request type. */
31650         uint16_t        req_type;
31651         /*
31652          * The completion ring to send the completion event on. This should
31653          * be the NQ ID returned from the `nq_alloc` HWRM command.
31654          */
31655         uint16_t        cmpl_ring;
31656         /*
31657          * The sequence ID is used by the driver for tracking multiple
31658          * commands. This ID is treated as opaque data by the firmware and
31659          * the value is returned in the `hwrm_resp_hdr` upon completion.
31660          */
31661         uint16_t        seq_id;
31662         /*
31663          * The target ID of the command:
31664          * * 0x0-0xFFF8 - The function ID
31665          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31666          * * 0xFFFD - Reserved for user-space HWRM interface
31667          * * 0xFFFF - HWRM
31668          */
31669         uint16_t        target_id;
31670         /*
31671          * A physical address pointer pointing to a host buffer that the
31672          * command's response data will be written. This can be either a host
31673          * physical address (HPA) or a guest physical address (GPA) and must
31674          * point to a physically contiguous block of memory.
31675          */
31676         uint64_t        resp_addr;
31677         /* Ring Type. */
31678         uint8_t ring_type;
31679         /* L2 Completion Ring (CR) */
31680         #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
31681         /* TX Ring (TR) */
31682         #define HWRM_RING_FREE_INPUT_RING_TYPE_TX        UINT32_C(0x1)
31683         /* RX Ring (RR) */
31684         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX        UINT32_C(0x2)
31685         /* RoCE Notification Completion Ring (ROCE_CR) */
31686         #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
31687         /* RX Aggregation Ring */
31688         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
31689         /* Notification Queue */
31690         #define HWRM_RING_FREE_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
31691         #define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \
31692                 HWRM_RING_FREE_INPUT_RING_TYPE_NQ
31693         uint8_t unused_0;
31694         /* Physical number of ring allocated. */
31695         uint16_t        ring_id;
31696         uint8_t unused_1[4];
31697 } __rte_packed;
31698
31699 /* hwrm_ring_free_output (size:128b/16B) */
31700 struct hwrm_ring_free_output {
31701         /* The specific error status for the command. */
31702         uint16_t        error_code;
31703         /* The HWRM command request type. */
31704         uint16_t        req_type;
31705         /* The sequence ID from the original command. */
31706         uint16_t        seq_id;
31707         /* The length of the response data in number of bytes. */
31708         uint16_t        resp_len;
31709         uint8_t unused_0[7];
31710         /*
31711          * This field is used in Output records to indicate that the output
31712          * is completely written to RAM.  This field should be read as '1'
31713          * to indicate that the output has been completely written.
31714          * When writing a command completion or response to an internal processor,
31715          * the order of writes has to be such that this field is written last.
31716          */
31717         uint8_t valid;
31718 } __rte_packed;
31719
31720 /*******************
31721  * hwrm_ring_reset *
31722  *******************/
31723
31724
31725 /* hwrm_ring_reset_input (size:192b/24B) */
31726 struct hwrm_ring_reset_input {
31727         /* The HWRM command request type. */
31728         uint16_t        req_type;
31729         /*
31730          * The completion ring to send the completion event on. This should
31731          * be the NQ ID returned from the `nq_alloc` HWRM command.
31732          */
31733         uint16_t        cmpl_ring;
31734         /*
31735          * The sequence ID is used by the driver for tracking multiple
31736          * commands. This ID is treated as opaque data by the firmware and
31737          * the value is returned in the `hwrm_resp_hdr` upon completion.
31738          */
31739         uint16_t        seq_id;
31740         /*
31741          * The target ID of the command:
31742          * * 0x0-0xFFF8 - The function ID
31743          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31744          * * 0xFFFD - Reserved for user-space HWRM interface
31745          * * 0xFFFF - HWRM
31746          */
31747         uint16_t        target_id;
31748         /*
31749          * A physical address pointer pointing to a host buffer that the
31750          * command's response data will be written. This can be either a host
31751          * physical address (HPA) or a guest physical address (GPA) and must
31752          * point to a physically contiguous block of memory.
31753          */
31754         uint64_t        resp_addr;
31755         /* Ring Type. */
31756         uint8_t ring_type;
31757         /* L2 Completion Ring (CR) */
31758         #define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL     UINT32_C(0x0)
31759         /* TX Ring (TR) */
31760         #define HWRM_RING_RESET_INPUT_RING_TYPE_TX          UINT32_C(0x1)
31761         /* RX Ring (RR) */
31762         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX          UINT32_C(0x2)
31763         /* RoCE Notification Completion Ring (ROCE_CR) */
31764         #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL   UINT32_C(0x3)
31765         /*
31766          * Rx Ring Group.  This is to reset rx and aggregation in an atomic
31767          * operation. Completion ring associated with this ring group is
31768          * not reset.
31769          */
31770         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP UINT32_C(0x6)
31771         #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \
31772                 HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP
31773         uint8_t unused_0;
31774         /*
31775          * Physical number of the ring. When ring type is rx_ring_grp, ring id
31776          * actually refers to ring group id.
31777          */
31778         uint16_t        ring_id;
31779         uint8_t unused_1[4];
31780 } __rte_packed;
31781
31782 /* hwrm_ring_reset_output (size:128b/16B) */
31783 struct hwrm_ring_reset_output {
31784         /* The specific error status for the command. */
31785         uint16_t        error_code;
31786         /* The HWRM command request type. */
31787         uint16_t        req_type;
31788         /* The sequence ID from the original command. */
31789         uint16_t        seq_id;
31790         /* The length of the response data in number of bytes. */
31791         uint16_t        resp_len;
31792         /*
31793          * This field will tell whether to use ping or pong buffer
31794          * for first push operation.
31795          */
31796         uint8_t push_buffer_index;
31797         /* Start push from ping buffer index */
31798         #define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PING_BUFFER \
31799                 UINT32_C(0x0)
31800         /* Start push from pong buffer index */
31801         #define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER \
31802                 UINT32_C(0x1)
31803         #define HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_LAST \
31804                 HWRM_RING_RESET_OUTPUT_PUSH_BUFFER_INDEX_PONG_BUFFER
31805         uint8_t unused_0[3];
31806         /* Position of consumer index after ring reset completes. */
31807         uint8_t consumer_idx[3];
31808         /*
31809          * This field is used in Output records to indicate that the output
31810          * is completely written to RAM.  This field should be read as '1'
31811          * to indicate that the output has been completely written.
31812          * When writing a command completion or response to an internal processor,
31813          * the order of writes has to be such that this field is written last.
31814          */
31815         uint8_t valid;
31816 } __rte_packed;
31817
31818 /*****************
31819  * hwrm_ring_cfg *
31820  *****************/
31821
31822
31823 /* hwrm_ring_cfg_input (size:320b/40B) */
31824 struct hwrm_ring_cfg_input {
31825         /* The HWRM command request type. */
31826         uint16_t        req_type;
31827         /*
31828          * The completion ring to send the completion event on. This should
31829          * be the NQ ID returned from the `nq_alloc` HWRM command.
31830          */
31831         uint16_t        cmpl_ring;
31832         /*
31833          * The sequence ID is used by the driver for tracking multiple
31834          * commands. This ID is treated as opaque data by the firmware and
31835          * the value is returned in the `hwrm_resp_hdr` upon completion.
31836          */
31837         uint16_t        seq_id;
31838         /*
31839          * The target ID of the command:
31840          * * 0x0-0xFFF8 - The function ID
31841          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31842          * * 0xFFFD - Reserved for user-space HWRM interface
31843          * * 0xFFFF - HWRM
31844          */
31845         uint16_t        target_id;
31846         /*
31847          * A physical address pointer pointing to a host buffer that the
31848          * command's response data will be written. This can be either a host
31849          * physical address (HPA) or a guest physical address (GPA) and must
31850          * point to a physically contiguous block of memory.
31851          */
31852         uint64_t        resp_addr;
31853         /* Ring Type. */
31854         uint8_t ring_type;
31855         /* TX Ring (TR) */
31856         #define HWRM_RING_CFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
31857         /* RX Ring (RR) */
31858         #define HWRM_RING_CFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
31859         #define HWRM_RING_CFG_INPUT_RING_TYPE_LAST \
31860                 HWRM_RING_CFG_INPUT_RING_TYPE_RX
31861         uint8_t unused_0;
31862         /* Physical number of the ring. */
31863         uint16_t        ring_id;
31864         /* Ring config enable bits. */
31865         uint16_t        enables;
31866         /*
31867          * For Rx rings, the incoming packet data can be placed at either
31868          * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
31869          * buffer.
31870          * When '1', the received packet will be padded with 2B, 10B or 12B
31871          * of zeros at the front of the packet. The exact offset is specified
31872          * by rx_sop_pad_bytes parameter.
31873          * When '0', the received packet will not be padded.
31874          * Note that this flag is only used for Rx rings and is ignored
31875          * for all other rings included Rx Aggregation rings.
31876          */
31877         #define HWRM_RING_CFG_INPUT_ENABLES_RX_SOP_PAD_ENABLE \
31878                 UINT32_C(0x1)
31879         /*
31880          * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
31881          * When rings are allocated, the PCI function on which driver issues
31882          * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
31883          * the buffer descriptors (BDs) from those rings is assumed to issue
31884          * packet payload DMA using same PCI function. When proxy mode is
31885          * enabled, hardware can perform payload DMA using another PCI
31886          * function on same or different host.
31887          * When set to '0', the PCI function on which driver issues
31888          * HWRM_RING_CFG command is used for host payload DMA operation.
31889          * When set to '1', the host PCI function specified by proxy_fid is
31890          * used for host payload DMA operation.
31891          */
31892         #define HWRM_RING_CFG_INPUT_ENABLES_PROXY_MODE_ENABLE \
31893                 UINT32_C(0x2)
31894         /*
31895          * Tx ring packet source interface override, for Tx rings only.
31896          * When TX rings are allocated, the PCI function on which driver
31897          * issues HWRM_RING_CFG is assumed to be source interface of
31898          * packets sent from TX ring.
31899          * When set to '1', the host PCI function specified by proxy_fid
31900          * is used as source interface of the transmitted packets.
31901          */
31902         #define HWRM_RING_CFG_INPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE \
31903                 UINT32_C(0x4)
31904         /* The schq_id field is valid */
31905         #define HWRM_RING_CFG_INPUT_ENABLES_SCHQ_ID \
31906                 UINT32_C(0x8)
31907         /* Update completion ring ID associated with Tx or Rx ring. */
31908         #define HWRM_RING_CFG_INPUT_ENABLES_CMPL_RING_ID_UPDATE \
31909                 UINT32_C(0x10)
31910         /*
31911          * When set to '1', metadata value provided by tx_metadata
31912          * field in this command is inserted in the lb_header_metadata
31913          * QP context field. When set to '0', no change done to metadata.
31914          * Firmware rejects the tx ring metadata programming with
31915          * HWRM_ERR_CODE_UNSUPPORTED error if the per function CFA BD
31916          * metadata feature is not disabled.
31917          */
31918         #define HWRM_RING_CFG_INPUT_ENABLES_TX_METADATA \
31919                 UINT32_C(0x20)
31920         /*
31921          * Proxy function FID value.
31922          * This value is only used when either proxy_mode_enable flag or
31923          * tx_proxy_svif_override is set to '1'.
31924          * When proxy_mode_enable is set to '1', it identifies a host PCI
31925          * function used for host payload DMA operations.
31926          * When tx_proxy_src_intf is set to '1', it identifies a host PCI
31927          * function as source interface for all transmitted packets from
31928          * the TX ring.
31929          */
31930         uint16_t        proxy_fid;
31931         /*
31932          * Identifies the new scheduler queue (SCHQ) to associate with the
31933          * ring. Only valid for Tx rings.
31934          * A value of zero indicates that the Tx ring should be associated
31935          * with the default scheduler queue (SCHQ).
31936          */
31937         uint16_t        schq_id;
31938         /*
31939          * This field is valid for TX or Rx rings. This value identifies the
31940          * new completion ring ID to associate with the TX or Rx ring.
31941          */
31942         uint16_t        cmpl_ring_id;
31943         /*
31944          * Rx SOP padding amount in bytes.
31945          * This value is only used when rx_sop_pad_enable flag is set to '1'.
31946          */
31947         uint8_t rx_sop_pad_bytes;
31948         uint8_t unused_1[3];
31949         /*
31950          * When tx_metadata enable bit is set, value specified in this field
31951          * is copied to lb_header_metadata in the QP context.
31952          */
31953         uint32_t        tx_metadata;
31954         uint8_t unused_2[4];
31955 } __rte_packed;
31956
31957 /* hwrm_ring_cfg_output (size:128b/16B) */
31958 struct hwrm_ring_cfg_output {
31959         /* The specific error status for the command. */
31960         uint16_t        error_code;
31961         /* The HWRM command request type. */
31962         uint16_t        req_type;
31963         /* The sequence ID from the original command. */
31964         uint16_t        seq_id;
31965         /* The length of the response data in number of bytes. */
31966         uint16_t        resp_len;
31967         uint8_t unused_0[7];
31968         /*
31969          * This field is used in Output records to indicate that the output
31970          * is completely written to RAM.  This field should be read as '1'
31971          * to indicate that the output has been completely written.
31972          * When writing a command completion or response to an internal
31973          * processor, the order of writes has to be such that this field is
31974          * written last.
31975          */
31976         uint8_t valid;
31977 } __rte_packed;
31978
31979 /******************
31980  * hwrm_ring_qcfg *
31981  ******************/
31982
31983
31984 /* hwrm_ring_qcfg_input (size:192b/24B) */
31985 struct hwrm_ring_qcfg_input {
31986         /* The HWRM command request type. */
31987         uint16_t        req_type;
31988         /*
31989          * The completion ring to send the completion event on. This should
31990          * be the NQ ID returned from the `nq_alloc` HWRM command.
31991          */
31992         uint16_t        cmpl_ring;
31993         /*
31994          * The sequence ID is used by the driver for tracking multiple
31995          * commands. This ID is treated as opaque data by the firmware and
31996          * the value is returned in the `hwrm_resp_hdr` upon completion.
31997          */
31998         uint16_t        seq_id;
31999         /*
32000          * The target ID of the command:
32001          * * 0x0-0xFFF8 - The function ID
32002          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32003          * * 0xFFFD - Reserved for user-space HWRM interface
32004          * * 0xFFFF - HWRM
32005          */
32006         uint16_t        target_id;
32007         /*
32008          * A physical address pointer pointing to a host buffer that the
32009          * command's response data will be written. This can be either a host
32010          * physical address (HPA) or a guest physical address (GPA) and must
32011          * point to a physically contiguous block of memory.
32012          */
32013         uint64_t        resp_addr;
32014         /* Ring Type. */
32015         uint8_t ring_type;
32016         /* TX Ring (TR) */
32017         #define HWRM_RING_QCFG_INPUT_RING_TYPE_TX UINT32_C(0x1)
32018         /* RX Ring (RR) */
32019         #define HWRM_RING_QCFG_INPUT_RING_TYPE_RX UINT32_C(0x2)
32020         #define HWRM_RING_QCFG_INPUT_RING_TYPE_LAST \
32021                 HWRM_RING_QCFG_INPUT_RING_TYPE_RX
32022         uint8_t unused_0[5];
32023         /* Physical number of the ring. */
32024         uint16_t        ring_id;
32025 } __rte_packed;
32026
32027 /* hwrm_ring_qcfg_output (size:256b/32B) */
32028 struct hwrm_ring_qcfg_output {
32029         /* The specific error status for the command. */
32030         uint16_t        error_code;
32031         /* The HWRM command request type. */
32032         uint16_t        req_type;
32033         /* The sequence ID from the original command. */
32034         uint16_t        seq_id;
32035         /* The length of the response data in number of bytes. */
32036         uint16_t        resp_len;
32037         /* Ring config enable bits. */
32038         uint16_t        enables;
32039         /*
32040          * For Rx rings, the incoming packet data can be placed at either
32041          * a 0B, 2B, 10B or 12B offset from the start of the Rx packet
32042          * buffer.
32043          * When '1', the received packet will be padded with 2B, 10B or 12B
32044          * of zeros at the front of the packet. The exact offset is specified
32045          * by rx_sop_pad_bytes parameter.
32046          * When '0', the received packet will not be padded.
32047          * Note that this flag is only used for Rx rings and is ignored
32048          * for all other rings included Rx Aggregation rings.
32049          */
32050         #define HWRM_RING_QCFG_OUTPUT_ENABLES_RX_SOP_PAD_ENABLE \
32051                 UINT32_C(0x1)
32052         /*
32053          * Proxy mode enable, for Tx, Rx and Rx aggregation rings only.
32054          * When rings are allocated, the PCI function on which driver issues
32055          * HWRM_RING_CFG command is assumed to own the rings. Hardware takes
32056          * the buffer descriptors (BDs) from those rings is assumed to issue
32057          * packet payload DMA using same PCI function. When proxy mode is
32058          * enabled, hardware can perform payload DMA using another PCI
32059          * function on same or different host.
32060          * When set to '0', the PCI function on which driver issues
32061          * HWRM_RING_CFG command is used for host payload DMA operation.
32062          * When set to '1', the host PCI function specified by proxy_fid is
32063          * used for host payload DMA operation.
32064          */
32065         #define HWRM_RING_QCFG_OUTPUT_ENABLES_PROXY_MODE_ENABLE \
32066                 UINT32_C(0x2)
32067         /*
32068          * Tx ring packet source interface override, for Tx rings only.
32069          * When TX rings are allocated, the PCI function on which driver
32070          * issues HWRM_RING_CFG is assumed to be source interface of
32071          * packets sent from TX ring.
32072          * When set to '1', the host PCI function specified by proxy_fid is
32073          * used as source interface of the transmitted packets.
32074          */
32075         #define HWRM_RING_QCFG_OUTPUT_ENABLES_TX_PROXY_SRC_INTF_OVERRIDE \
32076                 UINT32_C(0x4)
32077         /*
32078          * Proxy function FID value.
32079          * This value is only used when either proxy_mode_enable flag or
32080          * tx_proxy_svif_override is set to '1'.
32081          * When proxy_mode_enable is set to '1', it identifies a host PCI
32082          * function used for host payload DMA operations.
32083          * When tx_proxy_src_intf is set to '1', it identifies a host PCI
32084          * function as source interface for all transmitted packets from the TX
32085          * ring.
32086          */
32087         uint16_t        proxy_fid;
32088         /*
32089          * Identifies the new scheduler queue (SCHQ) to associate with the
32090          * ring. Only valid for Tx rings.
32091          * A value of zero indicates that the Tx ring should be associated with
32092          * the default scheduler queue (SCHQ).
32093          */
32094         uint16_t        schq_id;
32095         /*
32096          * This field is used when ring_type is a TX or Rx ring.
32097          * This value indicates what completion ring the TX or Rx ring
32098          * is associated with.
32099          */
32100         uint16_t        cmpl_ring_id;
32101         /*
32102          * Rx SOP padding amount in bytes.
32103          * This value is only used when rx_sop_pad_enable flag is set to '1'.
32104          */
32105         uint8_t rx_sop_pad_bytes;
32106         uint8_t unused_0[3];
32107         /* lb_header_metadata in the QP context is copied to this field. */
32108         uint32_t        tx_metadata;
32109         uint8_t unused_1[7];
32110         /*
32111          * This field is used in Output records to indicate that the output
32112          * is completely written to RAM.  This field should be read as '1'
32113          * to indicate that the output has been completely written.
32114          * When writing a command completion or response to an internal
32115          * processor, the order of writes has to be such that this field is
32116          * written last.
32117          */
32118         uint8_t valid;
32119 } __rte_packed;
32120
32121 /**************************
32122  * hwrm_ring_aggint_qcaps *
32123  **************************/
32124
32125
32126 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */
32127 struct hwrm_ring_aggint_qcaps_input {
32128         /* The HWRM command request type. */
32129         uint16_t        req_type;
32130         /*
32131          * The completion ring to send the completion event on. This should
32132          * be the NQ ID returned from the `nq_alloc` HWRM command.
32133          */
32134         uint16_t        cmpl_ring;
32135         /*
32136          * The sequence ID is used by the driver for tracking multiple
32137          * commands. This ID is treated as opaque data by the firmware and
32138          * the value is returned in the `hwrm_resp_hdr` upon completion.
32139          */
32140         uint16_t        seq_id;
32141         /*
32142          * The target ID of the command:
32143          * * 0x0-0xFFF8 - The function ID
32144          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32145          * * 0xFFFD - Reserved for user-space HWRM interface
32146          * * 0xFFFF - HWRM
32147          */
32148         uint16_t        target_id;
32149         /*
32150          * A physical address pointer pointing to a host buffer that the
32151          * command's response data will be written. This can be either a host
32152          * physical address (HPA) or a guest physical address (GPA) and must
32153          * point to a physically contiguous block of memory.
32154          */
32155         uint64_t        resp_addr;
32156 } __rte_packed;
32157
32158 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
32159 struct hwrm_ring_aggint_qcaps_output {
32160         /* The specific error status for the command. */
32161         uint16_t        error_code;
32162         /* The HWRM command request type. */
32163         uint16_t        req_type;
32164         /* The sequence ID from the original command. */
32165         uint16_t        seq_id;
32166         /* The length of the response data in number of bytes. */
32167         uint16_t        resp_len;
32168         uint32_t        cmpl_params;
32169         /*
32170          * When this bit is set to '1', int_lat_tmr_min can be configured
32171          * on completion rings.
32172          */
32173         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN \
32174                 UINT32_C(0x1)
32175         /*
32176          * When this bit is set to '1', int_lat_tmr_max can be configured
32177          * on completion rings.
32178          */
32179         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX \
32180                 UINT32_C(0x2)
32181         /*
32182          * When this bit is set to '1', timer_reset can be enabled
32183          * on completion rings.
32184          */
32185         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET \
32186                 UINT32_C(0x4)
32187         /*
32188          * When this bit is set to '1', ring_idle can be enabled
32189          * on completion rings.
32190          */
32191         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE \
32192                 UINT32_C(0x8)
32193         /*
32194          * When this bit is set to '1', num_cmpl_dma_aggr can be configured
32195          * on completion rings.
32196          */
32197         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR \
32198                 UINT32_C(0x10)
32199         /*
32200          * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be configured
32201          * on completion rings.
32202          */
32203         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT \
32204                 UINT32_C(0x20)
32205         /*
32206          * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured
32207          * on completion rings.
32208          */
32209         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR \
32210                 UINT32_C(0x40)
32211         /*
32212          * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be configured
32213          * on completion rings.
32214          */
32215         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT \
32216                 UINT32_C(0x80)
32217         /*
32218          * When this bit is set to '1', num_cmpl_aggr_int can be configured
32219          * on completion rings.
32220          */
32221         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT \
32222                 UINT32_C(0x100)
32223         uint32_t        nq_params;
32224         /*
32225          * When this bit is set to '1', int_lat_tmr_min can be configured
32226          * on notification queues.
32227          */
32228         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN \
32229                 UINT32_C(0x1)
32230         /* Minimum value for num_cmpl_dma_aggr */
32231         uint16_t        num_cmpl_dma_aggr_min;
32232         /* Maximum value for num_cmpl_dma_aggr */
32233         uint16_t        num_cmpl_dma_aggr_max;
32234         /* Minimum value for num_cmpl_dma_aggr_during_int */
32235         uint16_t        num_cmpl_dma_aggr_during_int_min;
32236         /* Maximum value for num_cmpl_dma_aggr_during_int */
32237         uint16_t        num_cmpl_dma_aggr_during_int_max;
32238         /* Minimum value for cmpl_aggr_dma_tmr */
32239         uint16_t        cmpl_aggr_dma_tmr_min;
32240         /* Maximum value for cmpl_aggr_dma_tmr */
32241         uint16_t        cmpl_aggr_dma_tmr_max;
32242         /* Minimum value for cmpl_aggr_dma_tmr_during_int */
32243         uint16_t        cmpl_aggr_dma_tmr_during_int_min;
32244         /* Maximum value for cmpl_aggr_dma_tmr_during_int */
32245         uint16_t        cmpl_aggr_dma_tmr_during_int_max;
32246         /* Minimum value for int_lat_tmr_min */
32247         uint16_t        int_lat_tmr_min_min;
32248         /* Maximum value for int_lat_tmr_min */
32249         uint16_t        int_lat_tmr_min_max;
32250         /* Minimum value for int_lat_tmr_max */
32251         uint16_t        int_lat_tmr_max_min;
32252         /* Maximum value for int_lat_tmr_max */
32253         uint16_t        int_lat_tmr_max_max;
32254         /* Minimum value for num_cmpl_aggr_int */
32255         uint16_t        num_cmpl_aggr_int_min;
32256         /* Maximum value for num_cmpl_aggr_int */
32257         uint16_t        num_cmpl_aggr_int_max;
32258         /* The units for timer parameters, in nanoseconds. */
32259         uint16_t        timer_units;
32260         uint8_t unused_0[1];
32261         /*
32262          * This field is used in Output records to indicate that the output
32263          * is completely written to RAM.  This field should be read as '1'
32264          * to indicate that the output has been completely written.
32265          * When writing a command completion or response to an internal processor,
32266          * the order of writes has to be such that this field is written last.
32267          */
32268         uint8_t valid;
32269 } __rte_packed;
32270
32271 /**************************************
32272  * hwrm_ring_cmpl_ring_qaggint_params *
32273  **************************************/
32274
32275
32276 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
32277 struct hwrm_ring_cmpl_ring_qaggint_params_input {
32278         /* The HWRM command request type. */
32279         uint16_t        req_type;
32280         /*
32281          * The completion ring to send the completion event on. This should
32282          * be the NQ ID returned from the `nq_alloc` HWRM command.
32283          */
32284         uint16_t        cmpl_ring;
32285         /*
32286          * The sequence ID is used by the driver for tracking multiple
32287          * commands. This ID is treated as opaque data by the firmware and
32288          * the value is returned in the `hwrm_resp_hdr` upon completion.
32289          */
32290         uint16_t        seq_id;
32291         /*
32292          * The target ID of the command:
32293          * * 0x0-0xFFF8 - The function ID
32294          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32295          * * 0xFFFD - Reserved for user-space HWRM interface
32296          * * 0xFFFF - HWRM
32297          */
32298         uint16_t        target_id;
32299         /*
32300          * A physical address pointer pointing to a host buffer that the
32301          * command's response data will be written. This can be either a host
32302          * physical address (HPA) or a guest physical address (GPA) and must
32303          * point to a physically contiguous block of memory.
32304          */
32305         uint64_t        resp_addr;
32306         /* Physical number of completion ring. */
32307         uint16_t        ring_id;
32308         uint16_t        flags;
32309         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_MASK \
32310                 UINT32_C(0x3)
32311         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_SFT 0
32312         /*
32313          * Set this flag to 1 when querying parameters on a notification
32314          * queue. Set this flag to 0 when querying parameters on a
32315          * completion queue or completion ring.
32316          */
32317         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
32318                 UINT32_C(0x4)
32319         uint8_t unused_0[4];
32320 } __rte_packed;
32321
32322 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
32323 struct hwrm_ring_cmpl_ring_qaggint_params_output {
32324         /* The specific error status for the command. */
32325         uint16_t        error_code;
32326         /* The HWRM command request type. */
32327         uint16_t        req_type;
32328         /* The sequence ID from the original command. */
32329         uint16_t        seq_id;
32330         /* The length of the response data in number of bytes. */
32331         uint16_t        resp_len;
32332         uint16_t        flags;
32333         /*
32334          * When this bit is set to '1', interrupt max
32335          * timer is reset whenever a completion is received.
32336          */
32337         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET \
32338                 UINT32_C(0x1)
32339         /*
32340          * When this bit is set to '1', ring idle mode
32341          * aggregation will be enabled.
32342          */
32343         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE \
32344                 UINT32_C(0x2)
32345         /*
32346          * Number of completions to aggregate before DMA
32347          * during the normal mode.
32348          */
32349         uint16_t        num_cmpl_dma_aggr;
32350         /*
32351          * Number of completions to aggregate before DMA
32352          * during the interrupt mode.
32353          */
32354         uint16_t        num_cmpl_dma_aggr_during_int;
32355         /*
32356          * Timer used to aggregate completions before
32357          * DMA during the normal mode (not in interrupt mode).
32358          */
32359         uint16_t        cmpl_aggr_dma_tmr;
32360         /*
32361          * Timer used to aggregate completions before
32362          * DMA when in interrupt mode.
32363          */
32364         uint16_t        cmpl_aggr_dma_tmr_during_int;
32365         /* Minimum time between two interrupts. */
32366         uint16_t        int_lat_tmr_min;
32367         /*
32368          * Maximum wait time spent aggregating
32369          * completions before signaling the interrupt after the
32370          * interrupt is enabled.
32371          */
32372         uint16_t        int_lat_tmr_max;
32373         /*
32374          * Minimum number of completions aggregated before signaling
32375          * an interrupt.
32376          */
32377         uint16_t        num_cmpl_aggr_int;
32378         uint8_t unused_0[7];
32379         /*
32380          * This field is used in Output records to indicate that the output
32381          * is completely written to RAM.  This field should be read as '1'
32382          * to indicate that the output has been completely written.
32383          * When writing a command completion or response to an internal processor,
32384          * the order of writes has to be such that this field is written last.
32385          */
32386         uint8_t valid;
32387 } __rte_packed;
32388
32389 /*****************************************
32390  * hwrm_ring_cmpl_ring_cfg_aggint_params *
32391  *****************************************/
32392
32393
32394 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
32395 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
32396         /* The HWRM command request type. */
32397         uint16_t        req_type;
32398         /*
32399          * The completion ring to send the completion event on. This should
32400          * be the NQ ID returned from the `nq_alloc` HWRM command.
32401          */
32402         uint16_t        cmpl_ring;
32403         /*
32404          * The sequence ID is used by the driver for tracking multiple
32405          * commands. This ID is treated as opaque data by the firmware and
32406          * the value is returned in the `hwrm_resp_hdr` upon completion.
32407          */
32408         uint16_t        seq_id;
32409         /*
32410          * The target ID of the command:
32411          * * 0x0-0xFFF8 - The function ID
32412          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32413          * * 0xFFFD - Reserved for user-space HWRM interface
32414          * * 0xFFFF - HWRM
32415          */
32416         uint16_t        target_id;
32417         /*
32418          * A physical address pointer pointing to a host buffer that the
32419          * command's response data will be written. This can be either a host
32420          * physical address (HPA) or a guest physical address (GPA) and must
32421          * point to a physically contiguous block of memory.
32422          */
32423         uint64_t        resp_addr;
32424         /* Physical number of completion ring. */
32425         uint16_t        ring_id;
32426         uint16_t        flags;
32427         /*
32428          * When this bit is set to '1', interrupt latency max
32429          * timer is reset whenever a completion is received.
32430          */
32431         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET \
32432                 UINT32_C(0x1)
32433         /*
32434          * When this bit is set to '1', ring idle mode
32435          * aggregation will be enabled.
32436          */
32437         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE \
32438                 UINT32_C(0x2)
32439         /*
32440          * Set this flag to 1 when configuring parameters on a
32441          * notification queue. Set this flag to 0 when configuring
32442          * parameters on a completion queue or completion ring.
32443          */
32444         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
32445                 UINT32_C(0x4)
32446         /*
32447          * Number of completions to aggregate before DMA
32448          * during the normal mode.
32449          */
32450         uint16_t        num_cmpl_dma_aggr;
32451         /*
32452          * Number of completions to aggregate before DMA
32453          * during the interrupt mode.
32454          */
32455         uint16_t        num_cmpl_dma_aggr_during_int;
32456         /*
32457          * Timer used to aggregate completions before
32458          * DMA during the normal mode (not in interrupt mode).
32459          */
32460         uint16_t        cmpl_aggr_dma_tmr;
32461         /*
32462          * Timer used to aggregate completions before
32463          * DMA while in interrupt mode.
32464          */
32465         uint16_t        cmpl_aggr_dma_tmr_during_int;
32466         /* Minimum time between two interrupts. */
32467         uint16_t        int_lat_tmr_min;
32468         /*
32469          * Maximum wait time spent aggregating
32470          * completions before signaling the interrupt after the
32471          * interrupt is enabled.
32472          */
32473         uint16_t        int_lat_tmr_max;
32474         /*
32475          * Minimum number of completions aggregated before signaling
32476          * an interrupt.
32477          */
32478         uint16_t        num_cmpl_aggr_int;
32479         /*
32480          * Bitfield that indicates which parameters are to be applied. Only
32481          * required when configuring devices with notification queues, and
32482          * used in that case to set certain parameters on completion queues
32483          * and others on notification queues.
32484          */
32485         uint16_t        enables;
32486         /*
32487          * This bit must be '1' for the num_cmpl_dma_aggr field to be
32488          * configured.
32489          */
32490         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR \
32491                 UINT32_C(0x1)
32492         /*
32493          * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be
32494          * configured.
32495          */
32496         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT \
32497                 UINT32_C(0x2)
32498         /*
32499          * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
32500          * configured.
32501          */
32502         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR \
32503                 UINT32_C(0x4)
32504         /*
32505          * This bit must be '1' for the int_lat_tmr_min field to be
32506          * configured.
32507          */
32508         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN \
32509                 UINT32_C(0x8)
32510         /*
32511          * This bit must be '1' for the int_lat_tmr_max field to be
32512          * configured.
32513          */
32514         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX \
32515                 UINT32_C(0x10)
32516         /*
32517          * This bit must be '1' for the num_cmpl_aggr_int field to be
32518          * configured.
32519          */
32520         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT \
32521                 UINT32_C(0x20)
32522         uint8_t unused_0[4];
32523 } __rte_packed;
32524
32525 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
32526 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
32527         /* The specific error status for the command. */
32528         uint16_t        error_code;
32529         /* The HWRM command request type. */
32530         uint16_t        req_type;
32531         /* The sequence ID from the original command. */
32532         uint16_t        seq_id;
32533         /* The length of the response data in number of bytes. */
32534         uint16_t        resp_len;
32535         uint8_t unused_0[7];
32536         /*
32537          * This field is used in Output records to indicate that the output
32538          * is completely written to RAM.  This field should be read as '1'
32539          * to indicate that the output has been completely written.
32540          * When writing a command completion or response to an internal processor,
32541          * the order of writes has to be such that this field is written last.
32542          */
32543         uint8_t valid;
32544 } __rte_packed;
32545
32546 /***********************
32547  * hwrm_ring_grp_alloc *
32548  ***********************/
32549
32550
32551 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
32552 struct hwrm_ring_grp_alloc_input {
32553         /* The HWRM command request type. */
32554         uint16_t        req_type;
32555         /*
32556          * The completion ring to send the completion event on. This should
32557          * be the NQ ID returned from the `nq_alloc` HWRM command.
32558          */
32559         uint16_t        cmpl_ring;
32560         /*
32561          * The sequence ID is used by the driver for tracking multiple
32562          * commands. This ID is treated as opaque data by the firmware and
32563          * the value is returned in the `hwrm_resp_hdr` upon completion.
32564          */
32565         uint16_t        seq_id;
32566         /*
32567          * The target ID of the command:
32568          * * 0x0-0xFFF8 - The function ID
32569          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32570          * * 0xFFFD - Reserved for user-space HWRM interface
32571          * * 0xFFFF - HWRM
32572          */
32573         uint16_t        target_id;
32574         /*
32575          * A physical address pointer pointing to a host buffer that the
32576          * command's response data will be written. This can be either a host
32577          * physical address (HPA) or a guest physical address (GPA) and must
32578          * point to a physically contiguous block of memory.
32579          */
32580         uint64_t        resp_addr;
32581         /*
32582          * This value identifies the CR associated with the ring
32583          * group.
32584          */
32585         uint16_t        cr;
32586         /*
32587          * This value identifies the main RR associated with the ring
32588          * group.
32589          */
32590         uint16_t        rr;
32591         /*
32592          * This value identifies the aggregation RR associated with
32593          * the ring group.  If this value is 0xFF... (All Fs), then no
32594          * Aggregation ring will be set.
32595          */
32596         uint16_t        ar;
32597         /*
32598          * This value identifies the statistics context associated
32599          * with the ring group.
32600          */
32601         uint16_t        sc;
32602 } __rte_packed;
32603
32604 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
32605 struct hwrm_ring_grp_alloc_output {
32606         /* The specific error status for the command. */
32607         uint16_t        error_code;
32608         /* The HWRM command request type. */
32609         uint16_t        req_type;
32610         /* The sequence ID from the original command. */
32611         uint16_t        seq_id;
32612         /* The length of the response data in number of bytes. */
32613         uint16_t        resp_len;
32614         /*
32615          * This is the ring group ID value.  Use this value to program
32616          * the default ring group for the VNIC or as table entries
32617          * in an RSS/COS context.
32618          */
32619         uint32_t        ring_group_id;
32620         uint8_t unused_0[3];
32621         /*
32622          * This field is used in Output records to indicate that the output
32623          * is completely written to RAM.  This field should be read as '1'
32624          * to indicate that the output has been completely written.
32625          * When writing a command completion or response to an internal processor,
32626          * the order of writes has to be such that this field is written last.
32627          */
32628         uint8_t valid;
32629 } __rte_packed;
32630
32631 /**********************
32632  * hwrm_ring_grp_free *
32633  **********************/
32634
32635
32636 /* hwrm_ring_grp_free_input (size:192b/24B) */
32637 struct hwrm_ring_grp_free_input {
32638         /* The HWRM command request type. */
32639         uint16_t        req_type;
32640         /*
32641          * The completion ring to send the completion event on. This should
32642          * be the NQ ID returned from the `nq_alloc` HWRM command.
32643          */
32644         uint16_t        cmpl_ring;
32645         /*
32646          * The sequence ID is used by the driver for tracking multiple
32647          * commands. This ID is treated as opaque data by the firmware and
32648          * the value is returned in the `hwrm_resp_hdr` upon completion.
32649          */
32650         uint16_t        seq_id;
32651         /*
32652          * The target ID of the command:
32653          * * 0x0-0xFFF8 - The function ID
32654          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32655          * * 0xFFFD - Reserved for user-space HWRM interface
32656          * * 0xFFFF - HWRM
32657          */
32658         uint16_t        target_id;
32659         /*
32660          * A physical address pointer pointing to a host buffer that the
32661          * command's response data will be written. This can be either a host
32662          * physical address (HPA) or a guest physical address (GPA) and must
32663          * point to a physically contiguous block of memory.
32664          */
32665         uint64_t        resp_addr;
32666         /* This is the ring group ID value. */
32667         uint32_t        ring_group_id;
32668         uint8_t unused_0[4];
32669 } __rte_packed;
32670
32671 /* hwrm_ring_grp_free_output (size:128b/16B) */
32672 struct hwrm_ring_grp_free_output {
32673         /* The specific error status for the command. */
32674         uint16_t        error_code;
32675         /* The HWRM command request type. */
32676         uint16_t        req_type;
32677         /* The sequence ID from the original command. */
32678         uint16_t        seq_id;
32679         /* The length of the response data in number of bytes. */
32680         uint16_t        resp_len;
32681         uint8_t unused_0[7];
32682         /*
32683          * This field is used in Output records to indicate that the output
32684          * is completely written to RAM.  This field should be read as '1'
32685          * to indicate that the output has been completely written.
32686          * When writing a command completion or response to an internal processor,
32687          * the order of writes has to be such that this field is written last.
32688          */
32689         uint8_t valid;
32690 } __rte_packed;
32691
32692 /************************
32693  * hwrm_ring_schq_alloc *
32694  ************************/
32695
32696
32697 /* hwrm_ring_schq_alloc_input (size:1088b/136B) */
32698 struct hwrm_ring_schq_alloc_input {
32699         /* The HWRM command request type. */
32700         uint16_t        req_type;
32701         /*
32702          * The completion ring to send the completion event on. This should
32703          * be the NQ ID returned from the `nq_alloc` HWRM command.
32704          */
32705         uint16_t        cmpl_ring;
32706         /*
32707          * The sequence ID is used by the driver for tracking multiple
32708          * commands. This ID is treated as opaque data by the firmware and
32709          * the value is returned in the `hwrm_resp_hdr` upon completion.
32710          */
32711         uint16_t        seq_id;
32712         /*
32713          * The target ID of the command:
32714          * * 0x0-0xFFF8 - The function ID
32715          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32716          * * 0xFFFD - Reserved for user-space HWRM interface
32717          * * 0xFFFF - HWRM
32718          */
32719         uint16_t        target_id;
32720         /*
32721          * A physical address pointer pointing to a host buffer that the
32722          * command's response data will be written. This can be either a host
32723          * physical address (HPA) or a guest physical address (GPA) and must
32724          * point to a physically contiguous block of memory.
32725          */
32726         uint64_t        resp_addr;
32727         uint32_t        enables;
32728         /*
32729          * This bit must be '1' for the tqm_ring0 fields to be
32730          * configured.
32731          */
32732         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING0     UINT32_C(0x1)
32733         /*
32734          * This bit must be '1' for the tqm_ring1 fields to be
32735          * configured.
32736          */
32737         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING1     UINT32_C(0x2)
32738         /*
32739          * This bit must be '1' for the tqm_ring2 fields to be
32740          * configured.
32741          */
32742         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING2     UINT32_C(0x4)
32743         /*
32744          * This bit must be '1' for the tqm_ring3 fields to be
32745          * configured.
32746          */
32747         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING3     UINT32_C(0x8)
32748         /*
32749          * This bit must be '1' for the tqm_ring4 fields to be
32750          * configured.
32751          */
32752         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING4     UINT32_C(0x10)
32753         /*
32754          * This bit must be '1' for the tqm_ring5 fields to be
32755          * configured.
32756          */
32757         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING5     UINT32_C(0x20)
32758         /*
32759          * This bit must be '1' for the tqm_ring6 fields to be
32760          * configured.
32761          */
32762         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING6     UINT32_C(0x40)
32763         /*
32764          * This bit must be '1' for the tqm_ring7 fields to be
32765          * configured.
32766          */
32767         #define HWRM_RING_SCHQ_ALLOC_INPUT_ENABLES_TQM_RING7     UINT32_C(0x80)
32768         /* Reserved for future use. */
32769         uint32_t        reserved;
32770         /* TQM ring 0 page size and level. */
32771         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
32772         /* TQM ring 0 PBL indirect levels. */
32773         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_MASK \
32774                 UINT32_C(0xf)
32775         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_SFT       0
32776         /* PBL pointer is physical start address. */
32777         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_0 \
32778                 UINT32_C(0x0)
32779         /* PBL pointer points to PTE table. */
32780         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_1 \
32781                 UINT32_C(0x1)
32782         /*
32783          * PBL pointer points to PDE table with each entry pointing to PTE
32784          * tables.
32785          */
32786         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2 \
32787                 UINT32_C(0x2)
32788         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LAST \
32789                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_LVL_LVL_2
32790         /* TQM ring 0 page size. */
32791         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_MASK \
32792                 UINT32_C(0xf0)
32793         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_SFT   4
32794         /* 4KB. */
32795         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_4K \
32796                 (UINT32_C(0x0) << 4)
32797         /* 8KB. */
32798         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8K \
32799                 (UINT32_C(0x1) << 4)
32800         /* 64KB. */
32801         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_64K \
32802                 (UINT32_C(0x2) << 4)
32803         /* 2MB. */
32804         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_2M \
32805                 (UINT32_C(0x3) << 4)
32806         /* 8MB. */
32807         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_8M \
32808                 (UINT32_C(0x4) << 4)
32809         /* 1GB. */
32810         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G \
32811                 (UINT32_C(0x5) << 4)
32812         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_LAST \
32813                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING0_PG_SIZE_PG_1G
32814         /* TQM ring 1 page size and level. */
32815         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
32816         /* TQM ring 1 PBL indirect levels. */
32817         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_MASK \
32818                 UINT32_C(0xf)
32819         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_SFT       0
32820         /* PBL pointer is physical start address. */
32821         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_0 \
32822                 UINT32_C(0x0)
32823         /* PBL pointer points to PTE table. */
32824         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_1 \
32825                 UINT32_C(0x1)
32826         /*
32827          * PBL pointer points to PDE table with each entry pointing to PTE
32828          * tables.
32829          */
32830         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2 \
32831                 UINT32_C(0x2)
32832         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LAST \
32833                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_LVL_LVL_2
32834         /* TQM ring 1 page size. */
32835         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_MASK \
32836                 UINT32_C(0xf0)
32837         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_SFT   4
32838         /* 4KB. */
32839         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_4K \
32840                 (UINT32_C(0x0) << 4)
32841         /* 8KB. */
32842         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8K \
32843                 (UINT32_C(0x1) << 4)
32844         /* 64KB. */
32845         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_64K \
32846                 (UINT32_C(0x2) << 4)
32847         /* 2MB. */
32848         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_2M \
32849                 (UINT32_C(0x3) << 4)
32850         /* 8MB. */
32851         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_8M \
32852                 (UINT32_C(0x4) << 4)
32853         /* 1GB. */
32854         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G \
32855                 (UINT32_C(0x5) << 4)
32856         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_LAST \
32857                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING1_PG_SIZE_PG_1G
32858         /* TQM ring 2 page size and level. */
32859         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
32860         /* TQM ring 2 PBL indirect levels. */
32861         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_MASK \
32862                 UINT32_C(0xf)
32863         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_SFT       0
32864         /* PBL pointer is physical start address. */
32865         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_0 \
32866                 UINT32_C(0x0)
32867         /* PBL pointer points to PTE table. */
32868         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_1 \
32869                 UINT32_C(0x1)
32870         /*
32871          * PBL pointer points to PDE table with each entry pointing to PTE
32872          * tables.
32873          */
32874         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2 \
32875                 UINT32_C(0x2)
32876         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LAST \
32877                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_LVL_LVL_2
32878         /* TQM ring 2 page size. */
32879         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_MASK \
32880                 UINT32_C(0xf0)
32881         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_SFT   4
32882         /* 4KB. */
32883         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_4K \
32884                 (UINT32_C(0x0) << 4)
32885         /* 8KB. */
32886         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8K \
32887                 (UINT32_C(0x1) << 4)
32888         /* 64KB. */
32889         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_64K \
32890                 (UINT32_C(0x2) << 4)
32891         /* 2MB. */
32892         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_2M \
32893                 (UINT32_C(0x3) << 4)
32894         /* 8MB. */
32895         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_8M \
32896                 (UINT32_C(0x4) << 4)
32897         /* 1GB. */
32898         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G \
32899                 (UINT32_C(0x5) << 4)
32900         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_LAST \
32901                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING2_PG_SIZE_PG_1G
32902         /* TQM ring 3 page size and level. */
32903         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
32904         /* TQM ring 3 PBL indirect levels. */
32905         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_MASK \
32906                 UINT32_C(0xf)
32907         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_SFT       0
32908         /* PBL pointer is physical start address. */
32909         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_0 \
32910                 UINT32_C(0x0)
32911         /* PBL pointer points to PTE table. */
32912         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_1 \
32913                 UINT32_C(0x1)
32914         /*
32915          * PBL pointer points to PDE table with each entry pointing to PTE
32916          * tables.
32917          */
32918         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2 \
32919                 UINT32_C(0x2)
32920         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LAST \
32921                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_LVL_LVL_2
32922         /* TQM ring 3 page size. */
32923         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_MASK \
32924                 UINT32_C(0xf0)
32925         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_SFT   4
32926         /* 4KB. */
32927         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_4K \
32928                 (UINT32_C(0x0) << 4)
32929         /* 8KB. */
32930         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8K \
32931                 (UINT32_C(0x1) << 4)
32932         /* 64KB. */
32933         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_64K \
32934                 (UINT32_C(0x2) << 4)
32935         /* 2MB. */
32936         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_2M \
32937                 (UINT32_C(0x3) << 4)
32938         /* 8MB. */
32939         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_8M \
32940                 (UINT32_C(0x4) << 4)
32941         /* 1GB. */
32942         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G \
32943                 (UINT32_C(0x5) << 4)
32944         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_LAST \
32945                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING3_PG_SIZE_PG_1G
32946         /* TQM ring 4 page size and level. */
32947         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
32948         /* TQM ring 4 PBL indirect levels. */
32949         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_MASK \
32950                 UINT32_C(0xf)
32951         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_SFT       0
32952         /* PBL pointer is physical start address. */
32953         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_0 \
32954                 UINT32_C(0x0)
32955         /* PBL pointer points to PTE table. */
32956         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_1 \
32957                 UINT32_C(0x1)
32958         /*
32959          * PBL pointer points to PDE table with each entry pointing to PTE
32960          * tables.
32961          */
32962         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2 \
32963                 UINT32_C(0x2)
32964         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LAST \
32965                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_LVL_LVL_2
32966         /* TQM ring 4 page size. */
32967         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_MASK \
32968                 UINT32_C(0xf0)
32969         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_SFT   4
32970         /* 4KB. */
32971         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_4K \
32972                 (UINT32_C(0x0) << 4)
32973         /* 8KB. */
32974         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8K \
32975                 (UINT32_C(0x1) << 4)
32976         /* 64KB. */
32977         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_64K \
32978                 (UINT32_C(0x2) << 4)
32979         /* 2MB. */
32980         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_2M \
32981                 (UINT32_C(0x3) << 4)
32982         /* 8MB. */
32983         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_8M \
32984                 (UINT32_C(0x4) << 4)
32985         /* 1GB. */
32986         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G \
32987                 (UINT32_C(0x5) << 4)
32988         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_LAST \
32989                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING4_PG_SIZE_PG_1G
32990         /* TQM ring 5 page size and level. */
32991         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
32992         /* TQM ring 5 PBL indirect levels. */
32993         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_MASK \
32994                 UINT32_C(0xf)
32995         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_SFT       0
32996         /* PBL pointer is physical start address. */
32997         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_0 \
32998                 UINT32_C(0x0)
32999         /* PBL pointer points to PTE table. */
33000         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_1 \
33001                 UINT32_C(0x1)
33002         /*
33003          * PBL pointer points to PDE table with each entry pointing to PTE
33004          * tables.
33005          */
33006         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2 \
33007                 UINT32_C(0x2)
33008         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LAST \
33009                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_LVL_LVL_2
33010         /* TQM ring 5 page size. */
33011         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_MASK \
33012                 UINT32_C(0xf0)
33013         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_SFT   4
33014         /* 4KB. */
33015         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_4K \
33016                 (UINT32_C(0x0) << 4)
33017         /* 8KB. */
33018         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8K \
33019                 (UINT32_C(0x1) << 4)
33020         /* 64KB. */
33021         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_64K \
33022                 (UINT32_C(0x2) << 4)
33023         /* 2MB. */
33024         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_2M \
33025                 (UINT32_C(0x3) << 4)
33026         /* 8MB. */
33027         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_8M \
33028                 (UINT32_C(0x4) << 4)
33029         /* 1GB. */
33030         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G \
33031                 (UINT32_C(0x5) << 4)
33032         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_LAST \
33033                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING5_PG_SIZE_PG_1G
33034         /* TQM ring 6 page size and level. */
33035         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
33036         /* TQM ring 6 PBL indirect levels. */
33037         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_MASK \
33038                 UINT32_C(0xf)
33039         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_SFT       0
33040         /* PBL pointer is physical start address. */
33041         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_0 \
33042                 UINT32_C(0x0)
33043         /* PBL pointer points to PTE table. */
33044         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_1 \
33045                 UINT32_C(0x1)
33046         /*
33047          * PBL pointer points to PDE table with each entry pointing to PTE
33048          * tables.
33049          */
33050         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2 \
33051                 UINT32_C(0x2)
33052         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LAST \
33053                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_LVL_LVL_2
33054         /* TQM ring 6 page size. */
33055         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_MASK \
33056                 UINT32_C(0xf0)
33057         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_SFT   4
33058         /* 4KB. */
33059         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_4K \
33060                 (UINT32_C(0x0) << 4)
33061         /* 8KB. */
33062         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8K \
33063                 (UINT32_C(0x1) << 4)
33064         /* 64KB. */
33065         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_64K \
33066                 (UINT32_C(0x2) << 4)
33067         /* 2MB. */
33068         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_2M \
33069                 (UINT32_C(0x3) << 4)
33070         /* 8MB. */
33071         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_8M \
33072                 (UINT32_C(0x4) << 4)
33073         /* 1GB. */
33074         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G \
33075                 (UINT32_C(0x5) << 4)
33076         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_LAST \
33077                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING6_PG_SIZE_PG_1G
33078         /* TQM ring 7 page size and level. */
33079         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
33080         /* TQM ring 7 PBL indirect levels. */
33081         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_MASK \
33082                 UINT32_C(0xf)
33083         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_SFT       0
33084         /* PBL pointer is physical start address. */
33085         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_0 \
33086                 UINT32_C(0x0)
33087         /* PBL pointer points to PTE table. */
33088         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_1 \
33089                 UINT32_C(0x1)
33090         /*
33091          * PBL pointer points to PDE table with each entry pointing to PTE
33092          * tables.
33093          */
33094         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2 \
33095                 UINT32_C(0x2)
33096         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LAST \
33097                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_LVL_LVL_2
33098         /* TQM ring 7 page size. */
33099         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_MASK \
33100                 UINT32_C(0xf0)
33101         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_SFT   4
33102         /* 4KB. */
33103         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_4K \
33104                 (UINT32_C(0x0) << 4)
33105         /* 8KB. */
33106         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8K \
33107                 (UINT32_C(0x1) << 4)
33108         /* 64KB. */
33109         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_64K \
33110                 (UINT32_C(0x2) << 4)
33111         /* 2MB. */
33112         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_2M \
33113                 (UINT32_C(0x3) << 4)
33114         /* 8MB. */
33115         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_8M \
33116                 (UINT32_C(0x4) << 4)
33117         /* 1GB. */
33118         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G \
33119                 (UINT32_C(0x5) << 4)
33120         #define HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_LAST \
33121                 HWRM_RING_SCHQ_ALLOC_INPUT_TQM_RING7_PG_SIZE_PG_1G
33122         /* TQM ring 0 page directory. */
33123         uint64_t        tqm_ring0_page_dir;
33124         /* TQM ring 1 page directory. */
33125         uint64_t        tqm_ring1_page_dir;
33126         /* TQM ring 2 page directory. */
33127         uint64_t        tqm_ring2_page_dir;
33128         /* TQM ring 3 page directory. */
33129         uint64_t        tqm_ring3_page_dir;
33130         /* TQM ring 4 page directory. */
33131         uint64_t        tqm_ring4_page_dir;
33132         /* TQM ring 5 page directory. */
33133         uint64_t        tqm_ring5_page_dir;
33134         /* TQM ring 6 page directory. */
33135         uint64_t        tqm_ring6_page_dir;
33136         /* TQM ring 7 page directory. */
33137         uint64_t        tqm_ring7_page_dir;
33138         /*
33139          * Number of TQM ring 0 entries.
33140          *
33141          * TQM fastpath rings should be sized large enough to accommodate the
33142          * maximum number of QPs (either L2 or RoCE, or both if shared)
33143          * that can be enqueued to the TQM ring.
33144          *
33145          * Note that TQM ring sizes cannot be extended while the system is
33146          * operational. If a PF driver needs to extend a TQM ring, it needs
33147          * to delete the SCHQ and then reallocate it.
33148          */
33149         uint32_t        tqm_ring0_num_entries;
33150         /*
33151          * Number of TQM ring 1 entries.
33152          *
33153          * TQM fastpath rings should be sized large enough to accommodate the
33154          * maximum number of QPs (either L2 or RoCE, or both if shared)
33155          * that can be enqueued to the TQM ring.
33156          *
33157          * Note that TQM ring sizes cannot be extended while the system is
33158          * operational. If a PF driver needs to extend a TQM ring, it needs
33159          * to delete the SCHQ and then reallocate it.
33160          */
33161         uint32_t        tqm_ring1_num_entries;
33162         /*
33163          * Number of TQM ring 2 entries.
33164          *
33165          * TQM fastpath rings should be sized large enough to accommodate the
33166          * maximum number of QPs (either L2 or RoCE, or both if shared)
33167          * that can be enqueued to the TQM ring.
33168          *
33169          * Note that TQM ring sizes cannot be extended while the system is
33170          * operational. If a PF driver needs to extend a TQM ring, it needs
33171          * to delete the SCHQ and then reallocate it.
33172          */
33173         uint32_t        tqm_ring2_num_entries;
33174         /*
33175          * Number of TQM ring 3 entries.
33176          *
33177          * TQM fastpath rings should be sized large enough to accommodate the
33178          * maximum number of QPs (either L2 or RoCE, or both if shared)
33179          * that can be enqueued to the TQM ring.
33180          *
33181          * Note that TQM ring sizes cannot be extended while the system is
33182          * operational. If a PF driver needs to extend a TQM ring, it needs
33183          * to delete the SCHQ and then reallocate it.
33184          */
33185         uint32_t        tqm_ring3_num_entries;
33186         /*
33187          * Number of TQM ring 4 entries.
33188          *
33189          * TQM fastpath rings should be sized large enough to accommodate the
33190          * maximum number of QPs (either L2 or RoCE, or both if shared)
33191          * that can be enqueued to the TQM ring.
33192          *
33193          * Note that TQM ring sizes cannot be extended while the system is
33194          * operational. If a PF driver needs to extend a TQM ring, it needs
33195          * to delete the SCHQ and then reallocate it.
33196          */
33197         uint32_t        tqm_ring4_num_entries;
33198         /*
33199          * Number of TQM ring 5 entries.
33200          *
33201          * TQM fastpath rings should be sized large enough to accommodate the
33202          * maximum number of QPs (either L2 or RoCE, or both if shared)
33203          * that can be enqueued to the TQM ring.
33204          *
33205          * Note that TQM ring sizes cannot be extended while the system is
33206          * operational. If a PF driver needs to extend a TQM ring, it needs
33207          * to delete the SCHQ and then reallocate it.
33208          */
33209         uint32_t        tqm_ring5_num_entries;
33210         /*
33211          * Number of TQM ring 6 entries.
33212          *
33213          * TQM fastpath rings should be sized large enough to accommodate the
33214          * maximum number of QPs (either L2 or RoCE, or both if shared)
33215          * that can be enqueued to the TQM ring.
33216          *
33217          * Note that TQM ring sizes cannot be extended while the system is
33218          * operational. If a PF driver needs to extend a TQM ring, it needs
33219          * to delete the SCHQ and then reallocate it.
33220          */
33221         uint32_t        tqm_ring6_num_entries;
33222         /*
33223          * Number of TQM ring 7 entries.
33224          *
33225          * TQM fastpath rings should be sized large enough to accommodate the
33226          * maximum number of QPs (either L2 or RoCE, or both if shared)
33227          * that can be enqueued to the TQM ring.
33228          *
33229          * Note that TQM ring sizes cannot be extended while the system is
33230          * operational. If a PF driver needs to extend a TQM ring, it needs
33231          * to delete the SCHQ and then reallocate it.
33232          */
33233         uint32_t        tqm_ring7_num_entries;
33234         /* Number of bytes that have been allocated for each context entry. */
33235         uint16_t        tqm_entry_size;
33236         uint8_t unused_0[6];
33237 } __rte_packed;
33238
33239 /* hwrm_ring_schq_alloc_output (size:128b/16B) */
33240 struct hwrm_ring_schq_alloc_output {
33241         /* The specific error status for the command. */
33242         uint16_t        error_code;
33243         /* The HWRM command request type. */
33244         uint16_t        req_type;
33245         /* The sequence ID from the original command. */
33246         uint16_t        seq_id;
33247         /* The length of the response data in number of bytes. */
33248         uint16_t        resp_len;
33249         /*
33250          * This is an identifier for the SCHQ to be used in other HWRM commands
33251          * that need to reference this SCHQ. This value is greater than zero
33252          * (i.e. a schq_id of zero references the default SCHQ).
33253          */
33254         uint16_t        schq_id;
33255         uint8_t unused_0[5];
33256         /*
33257          * This field is used in Output records to indicate that the output
33258          * is completely written to RAM.  This field should be read as '1'
33259          * to indicate that the output has been completely written.
33260          * When writing a command completion or response to an internal processor,
33261          * the order of writes has to be such that this field is written last.
33262          */
33263         uint8_t valid;
33264 } __rte_packed;
33265
33266 /**********************
33267  * hwrm_ring_schq_cfg *
33268  **********************/
33269
33270
33271 /* hwrm_ring_schq_cfg_input (size:768b/96B) */
33272 struct hwrm_ring_schq_cfg_input {
33273         /* The HWRM command request type. */
33274         uint16_t        req_type;
33275         /*
33276          * The completion ring to send the completion event on. This should
33277          * be the NQ ID returned from the `nq_alloc` HWRM command.
33278          */
33279         uint16_t        cmpl_ring;
33280         /*
33281          * The sequence ID is used by the driver for tracking multiple
33282          * commands. This ID is treated as opaque data by the firmware and
33283          * the value is returned in the `hwrm_resp_hdr` upon completion.
33284          */
33285         uint16_t        seq_id;
33286         /*
33287          * The target ID of the command:
33288          * * 0x0-0xFFF8 - The function ID
33289          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33290          * * 0xFFFD - Reserved for user-space HWRM interface
33291          * * 0xFFFF - HWRM
33292          */
33293         uint16_t        target_id;
33294         /*
33295          * A physical address pointer pointing to a host buffer that the
33296          * command's response data will be written. This can be either a host
33297          * physical address (HPA) or a guest physical address (GPA) and must
33298          * point to a physically contiguous block of memory.
33299          */
33300         uint64_t        resp_addr;
33301         /*
33302          * Identifies the SCHQ being configured. A schq_id of zero refers to
33303          * the default SCHQ.
33304          */
33305         uint16_t        schq_id;
33306         /*
33307          * This field is an 8 bit bitmap that indicates which TCs are enabled
33308          * in this SCHQ. Bit 0 represents traffic class 0 and bit 7 represents
33309          * traffic class 7.
33310          */
33311         uint8_t tc_enabled;
33312         uint8_t unused_0;
33313         uint32_t        flags;
33314         /* The tc_max_bw array and the max_bw parameters are valid */
33315         #define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MAX_BW_ENABLED \
33316                 UINT32_C(0x1)
33317         /* The tc_min_bw array is valid */
33318         #define HWRM_RING_SCHQ_CFG_INPUT_FLAGS_TC_MIN_BW_ENABLED \
33319                 UINT32_C(0x2)
33320         /* Maximum bandwidth of the traffic class, specified in Mbps. */
33321         uint32_t        max_bw_tc0;
33322         /* Maximum bandwidth of the traffic class, specified in Mbps. */
33323         uint32_t        max_bw_tc1;
33324         /* Maximum bandwidth of the traffic class, specified in Mbps. */
33325         uint32_t        max_bw_tc2;
33326         /* Maximum bandwidth of the traffic class, specified in Mbps. */
33327         uint32_t        max_bw_tc3;
33328         /* Maximum bandwidth of the traffic class, specified in Mbps. */
33329         uint32_t        max_bw_tc4;
33330         /* Maximum bandwidth of the traffic class, specified in Mbps. */
33331         uint32_t        max_bw_tc5;
33332         /* Maximum bandwidth of the traffic class, specified in Mbps. */
33333         uint32_t        max_bw_tc6;
33334         /* Maximum bandwidth of the traffic class, specified in Mbps. */
33335         uint32_t        max_bw_tc7;
33336         /*
33337          * Bandwidth reservation for the traffic class, specified in Mbps.
33338          * A value of zero signifies that traffic belonging to this class
33339          * shares the bandwidth reservation for the same traffic class of
33340          * the default SCHQ.
33341          */
33342         uint32_t        min_bw_tc0;
33343         /*
33344          * Bandwidth reservation for the traffic class, specified in Mbps.
33345          * A value of zero signifies that traffic belonging to this class
33346          * shares the bandwidth reservation for the same traffic class of
33347          * the default SCHQ.
33348          */
33349         uint32_t        min_bw_tc1;
33350         /*
33351          * Bandwidth reservation for the traffic class, specified in Mbps.
33352          * A value of zero signifies that traffic belonging to this class
33353          * shares the bandwidth reservation for the same traffic class of
33354          * the default SCHQ.
33355          */
33356         uint32_t        min_bw_tc2;
33357         /*
33358          * Bandwidth reservation for the traffic class, specified in Mbps.
33359          * A value of zero signifies that traffic belonging to this class
33360          * shares the bandwidth reservation for the same traffic class of
33361          * the default SCHQ.
33362          */
33363         uint32_t        min_bw_tc3;
33364         /*
33365          * Bandwidth reservation for the traffic class, specified in Mbps.
33366          * A value of zero signifies that traffic belonging to this class
33367          * shares the bandwidth reservation for the same traffic class of
33368          * the default SCHQ.
33369          */
33370         uint32_t        min_bw_tc4;
33371         /*
33372          * Bandwidth reservation for the traffic class, specified in Mbps.
33373          * A value of zero signifies that traffic belonging to this class
33374          * shares the bandwidth reservation for the same traffic class of
33375          * the default SCHQ.
33376          */
33377         uint32_t        min_bw_tc5;
33378         /*
33379          * Bandwidth reservation for the traffic class, specified in Mbps.
33380          * A value of zero signifies that traffic belonging to this class
33381          * shares the bandwidth reservation for the same traffic class of
33382          * the default SCHQ.
33383          */
33384         uint32_t        min_bw_tc6;
33385         /*
33386          * Bandwidth reservation for the traffic class, specified in Mbps.
33387          * A value of zero signifies that traffic belonging to this class
33388          * shares the bandwidth reservation for the same traffic class of
33389          * the default SCHQ.
33390          */
33391         uint32_t        min_bw_tc7;
33392         /*
33393          * Indicates the max bandwidth for all enabled traffic classes in
33394          * this SCHQ, specified in Mbps.
33395          */
33396         uint32_t        max_bw;
33397         uint8_t unused_1[4];
33398 } __rte_packed;
33399
33400 /* hwrm_ring_schq_cfg_output (size:128b/16B) */
33401 struct hwrm_ring_schq_cfg_output {
33402         /* The specific error status for the command. */
33403         uint16_t        error_code;
33404         /* The HWRM command request type. */
33405         uint16_t        req_type;
33406         /* The sequence ID from the original command. */
33407         uint16_t        seq_id;
33408         /* The length of the response data in number of bytes. */
33409         uint16_t        resp_len;
33410         uint8_t unused_0[7];
33411         /*
33412          * This field is used in Output records to indicate that the output
33413          * is completely written to RAM.  This field should be read as '1'
33414          * to indicate that the output has been completely written.
33415          * When writing a command completion or response to an internal processor,
33416          * the order of writes has to be such that this field is written last.
33417          */
33418         uint8_t valid;
33419 } __rte_packed;
33420
33421 /***********************
33422  * hwrm_ring_schq_free *
33423  ***********************/
33424
33425
33426 /* hwrm_ring_schq_free_input (size:192b/24B) */
33427 struct hwrm_ring_schq_free_input {
33428         /* The HWRM command request type. */
33429         uint16_t        req_type;
33430         /*
33431          * The completion ring to send the completion event on. This should
33432          * be the NQ ID returned from the `nq_alloc` HWRM command.
33433          */
33434         uint16_t        cmpl_ring;
33435         /*
33436          * The sequence ID is used by the driver for tracking multiple
33437          * commands. This ID is treated as opaque data by the firmware and
33438          * the value is returned in the `hwrm_resp_hdr` upon completion.
33439          */
33440         uint16_t        seq_id;
33441         /*
33442          * The target ID of the command:
33443          * * 0x0-0xFFF8 - The function ID
33444          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33445          * * 0xFFFD - Reserved for user-space HWRM interface
33446          * * 0xFFFF - HWRM
33447          */
33448         uint16_t        target_id;
33449         /*
33450          * A physical address pointer pointing to a host buffer that the
33451          * command's response data will be written. This can be either a host
33452          * physical address (HPA) or a guest physical address (GPA) and must
33453          * point to a physically contiguous block of memory.
33454          */
33455         uint64_t        resp_addr;
33456         /* Identifies the SCHQ being freed. */
33457         uint16_t        schq_id;
33458         uint8_t unused_0[6];
33459 } __rte_packed;
33460
33461 /* hwrm_ring_schq_free_output (size:128b/16B) */
33462 struct hwrm_ring_schq_free_output {
33463         /* The specific error status for the command. */
33464         uint16_t        error_code;
33465         /* The HWRM command request type. */
33466         uint16_t        req_type;
33467         /* The sequence ID from the original command. */
33468         uint16_t        seq_id;
33469         /* The length of the response data in number of bytes. */
33470         uint16_t        resp_len;
33471         uint8_t unused_0[7];
33472         /*
33473          * This field is used in Output records to indicate that the output
33474          * is completely written to RAM.  This field should be read as '1'
33475          * to indicate that the output has been completely written.
33476          * When writing a command completion or response to an internal processor,
33477          * the order of writes has to be such that this field is written last.
33478          */
33479         uint8_t valid;
33480 } __rte_packed;
33481 /*
33482  * special reserved flow ID to identify per function default
33483  * flows for vSwitch offload
33484  */
33485 #define DEFAULT_FLOW_ID 0xFFFFFFFFUL
33486 /*
33487  * special reserved flow ID to identify per function RoCEv1
33488  * flows
33489  */
33490 #define ROCEV1_FLOW_ID 0xFFFFFFFEUL
33491 /*
33492  * special reserved flow ID to identify per function RoCEv2
33493  * flows
33494  */
33495 #define ROCEV2_FLOW_ID 0xFFFFFFFDUL
33496 /*
33497  * special reserved flow ID to identify per function RoCEv2
33498  * CNP flows
33499  */
33500 #define ROCEV2_CNP_FLOW_ID 0xFFFFFFFCUL
33501
33502 /****************************
33503  * hwrm_cfa_l2_filter_alloc *
33504  ****************************/
33505
33506
33507 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
33508 struct hwrm_cfa_l2_filter_alloc_input {
33509         /* The HWRM command request type. */
33510         uint16_t        req_type;
33511         /*
33512          * The completion ring to send the completion event on. This should
33513          * be the NQ ID returned from the `nq_alloc` HWRM command.
33514          */
33515         uint16_t        cmpl_ring;
33516         /*
33517          * The sequence ID is used by the driver for tracking multiple
33518          * commands. This ID is treated as opaque data by the firmware and
33519          * the value is returned in the `hwrm_resp_hdr` upon completion.
33520          */
33521         uint16_t        seq_id;
33522         /*
33523          * The target ID of the command:
33524          * * 0x0-0xFFF8 - The function ID
33525          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33526          * * 0xFFFD - Reserved for user-space HWRM interface
33527          * * 0xFFFF - HWRM
33528          */
33529         uint16_t        target_id;
33530         /*
33531          * A physical address pointer pointing to a host buffer that the
33532          * command's response data will be written. This can be either a host
33533          * physical address (HPA) or a guest physical address (GPA) and must
33534          * point to a physically contiguous block of memory.
33535          */
33536         uint64_t        resp_addr;
33537         uint32_t        flags;
33538         /*
33539          * Enumeration denoting the RX, TX type of the resource.
33540          * This enumeration is used for resources that are similar for both
33541          * TX and RX paths of the chip.
33542          */
33543         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
33544                 UINT32_C(0x1)
33545         /* tx path */
33546         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
33547                 UINT32_C(0x0)
33548         /* rx path */
33549         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
33550                 UINT32_C(0x1)
33551         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
33552                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
33553         /*
33554          * Setting of this flag indicates the applicability to the loopback
33555          * path.
33556          */
33557         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
33558                 UINT32_C(0x2)
33559         /*
33560          * Setting of this flag indicates drop action. If this flag is not
33561          * set, then it should be considered accept action.
33562          */
33563         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
33564                 UINT32_C(0x4)
33565         /*
33566          * If this flag is set, all t_l2_* fields are invalid
33567          * and they should not be specified.
33568          * If this flag is set, then l2_* fields refer to
33569          * fields of outermost L2 header.
33570          */
33571         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
33572                 UINT32_C(0x8)
33573         /*
33574          * Enumeration denoting NO_ROCE_L2 to support old drivers.
33575          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
33576          */
33577         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK \
33578                 UINT32_C(0x30)
33579         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT       4
33580         /* To support old drivers */
33581         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
33582                 (UINT32_C(0x0) << 4)
33583         /* Only L2 traffic */
33584         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2 \
33585                 (UINT32_C(0x1) << 4)
33586         /* Roce & L2 traffic */
33587         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE \
33588                 (UINT32_C(0x2) << 4)
33589         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST \
33590                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE
33591         /*
33592          * Setting of this flag indicates that no XDP filter is created with
33593          * L2 filter.
33594          * 0 - legacy behavior, XDP filter is created with L2 filter
33595          * 1 - XDP filter won't be created with L2 filter
33596          */
33597         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_XDP_DISABLE \
33598                 UINT32_C(0x40)
33599         /*
33600          * Setting this flag to 1 indicate the L2 fields in this command
33601          * pertain to source fields. Setting this flag to 0 indicate the
33602          * L2 fields in this command pertain to the destination fields
33603          * and this is the default/legacy behavior.
33604          */
33605         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_SOURCE_VALID \
33606                 UINT32_C(0x80)
33607         uint32_t        enables;
33608         /*
33609          * This bit must be '1' for the l2_addr field to be
33610          * configured.
33611          */
33612         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
33613                 UINT32_C(0x1)
33614         /*
33615          * This bit must be '1' for the l2_addr_mask field to be
33616          * configured.
33617          */
33618         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
33619                 UINT32_C(0x2)
33620         /*
33621          * This bit must be '1' for the l2_ovlan field to be
33622          * configured.
33623          */
33624         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
33625                 UINT32_C(0x4)
33626         /*
33627          * This bit must be '1' for the l2_ovlan_mask field to be
33628          * configured.
33629          */
33630         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
33631                 UINT32_C(0x8)
33632         /*
33633          * This bit must be '1' for the l2_ivlan field to be
33634          * configured.
33635          */
33636         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
33637                 UINT32_C(0x10)
33638         /*
33639          * This bit must be '1' for the l2_ivlan_mask field to be
33640          * configured.
33641          */
33642         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
33643                 UINT32_C(0x20)
33644         /*
33645          * This bit must be '1' for the t_l2_addr field to be
33646          * configured.
33647          */
33648         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
33649                 UINT32_C(0x40)
33650         /*
33651          * This bit must be '1' for the t_l2_addr_mask field to be
33652          * configured.
33653          */
33654         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
33655                 UINT32_C(0x80)
33656         /*
33657          * This bit must be '1' for the t_l2_ovlan field to be
33658          * configured.
33659          */
33660         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
33661                 UINT32_C(0x100)
33662         /*
33663          * This bit must be '1' for the t_l2_ovlan_mask field to be
33664          * configured.
33665          */
33666         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
33667                 UINT32_C(0x200)
33668         /*
33669          * This bit must be '1' for the t_l2_ivlan field to be
33670          * configured.
33671          */
33672         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
33673                 UINT32_C(0x400)
33674         /*
33675          * This bit must be '1' for the t_l2_ivlan_mask field to be
33676          * configured.
33677          */
33678         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
33679                 UINT32_C(0x800)
33680         /*
33681          * This bit must be '1' for the src_type field to be
33682          * configured.
33683          */
33684         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
33685                 UINT32_C(0x1000)
33686         /*
33687          * This bit must be '1' for the src_id field to be
33688          * configured.
33689          */
33690         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
33691                 UINT32_C(0x2000)
33692         /*
33693          * This bit must be '1' for the tunnel_type field to be
33694          * configured.
33695          */
33696         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
33697                 UINT32_C(0x4000)
33698         /*
33699          * This bit must be '1' for the dst_id field to be
33700          * configured.
33701          */
33702         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
33703                 UINT32_C(0x8000)
33704         /*
33705          * This bit must be '1' for the mirror_vnic_id field to be
33706          * configured.
33707          */
33708         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
33709                 UINT32_C(0x10000)
33710         /*
33711          * This bit must be '1' for the num_vlans field to be
33712          * configured.
33713          */
33714         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_NUM_VLANS \
33715                 UINT32_C(0x20000)
33716         /*
33717          * This bit must be '1' for the t_num_vlans field to be
33718          * configured.
33719          */
33720         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_NUM_VLANS \
33721                 UINT32_C(0x40000)
33722         /*
33723          * This value sets the match value for the L2 MAC address.
33724          * Destination MAC address for RX path.
33725          * Source MAC address for TX path.
33726          */
33727         uint8_t l2_addr[6];
33728         /* This value sets the match value for the number of VLANs. */
33729         uint8_t num_vlans;
33730         /*
33731          * This value sets the match value for the number of VLANs
33732          * in the tunnel headers.
33733          */
33734         uint8_t t_num_vlans;
33735         /*
33736          * This value sets the mask value for the L2 address.
33737          * A value of 0 will mask the corresponding bit from
33738          * compare.
33739          */
33740         uint8_t l2_addr_mask[6];
33741         /* This value sets VLAN ID value for outer VLAN. */
33742         uint16_t        l2_ovlan;
33743         /*
33744          * This value sets the mask value for the ovlan id.
33745          * A value of 0 will mask the corresponding bit from
33746          * compare.
33747          */
33748         uint16_t        l2_ovlan_mask;
33749         /* This value sets VLAN ID value for inner VLAN. */
33750         uint16_t        l2_ivlan;
33751         /*
33752          * This value sets the mask value for the ivlan id.
33753          * A value of 0 will mask the corresponding bit from
33754          * compare.
33755          */
33756         uint16_t        l2_ivlan_mask;
33757         uint8_t unused_1[2];
33758         /*
33759          * This value sets the match value for the tunnel
33760          * L2 MAC address.
33761          * Destination MAC address for RX path.
33762          * Source MAC address for TX path.
33763          */
33764         uint8_t t_l2_addr[6];
33765         uint8_t unused_2[2];
33766         /*
33767          * This value sets the mask value for the tunnel L2
33768          * address.
33769          * A value of 0 will mask the corresponding bit from
33770          * compare.
33771          */
33772         uint8_t t_l2_addr_mask[6];
33773         /* This value sets VLAN ID value for tunnel outer VLAN. */
33774         uint16_t        t_l2_ovlan;
33775         /*
33776          * This value sets the mask value for the tunnel ovlan id.
33777          * A value of 0 will mask the corresponding bit from
33778          * compare.
33779          */
33780         uint16_t        t_l2_ovlan_mask;
33781         /* This value sets VLAN ID value for tunnel inner VLAN. */
33782         uint16_t        t_l2_ivlan;
33783         /*
33784          * This value sets the mask value for the tunnel ivlan id.
33785          * A value of 0 will mask the corresponding bit from
33786          * compare.
33787          */
33788         uint16_t        t_l2_ivlan_mask;
33789         /* This value identifies the type of source of the packet. */
33790         uint8_t src_type;
33791         /* Network port */
33792         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
33793         /* Physical function */
33794         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF    UINT32_C(0x1)
33795         /* Virtual function */
33796         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF    UINT32_C(0x2)
33797         /* Virtual NIC of a function */
33798         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC  UINT32_C(0x3)
33799         /* Embedded processor for CFA management */
33800         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG  UINT32_C(0x4)
33801         /* Embedded processor for OOB management */
33802         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE   UINT32_C(0x5)
33803         /* Embedded processor for RoCE */
33804         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO  UINT32_C(0x6)
33805         /* Embedded processor for network proxy functions */
33806         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG  UINT32_C(0x7)
33807         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST \
33808                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
33809         uint8_t unused_3;
33810         /*
33811          * This value is the id of the source.
33812          * For a network port, it represents port_id.
33813          * For a physical function, it represents fid.
33814          * For a virtual function, it represents vf_id.
33815          * For a vnic, it represents vnic_id.
33816          * For embedded processors, this id is not valid.
33817          *
33818          * Notes:
33819          * 1. The function ID is implied if it src_id is
33820          *    not provided for a src_type that is either
33821          */
33822         uint32_t        src_id;
33823         /* Tunnel Type. */
33824         uint8_t tunnel_type;
33825         /* Non-tunnel */
33826         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
33827                 UINT32_C(0x0)
33828         /* Virtual eXtensible Local Area Network (VXLAN) */
33829         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
33830                 UINT32_C(0x1)
33831         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
33832         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
33833                 UINT32_C(0x2)
33834         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
33835         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
33836                 UINT32_C(0x3)
33837         /* IP in IP */
33838         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
33839                 UINT32_C(0x4)
33840         /* Generic Network Virtualization Encapsulation (Geneve) */
33841         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
33842                 UINT32_C(0x5)
33843         /* Multi-Protocol Label Switching (MPLS) */
33844         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
33845                 UINT32_C(0x6)
33846         /* Stateless Transport Tunnel (STT) */
33847         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
33848                 UINT32_C(0x7)
33849         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
33850         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
33851                 UINT32_C(0x8)
33852         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
33853         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
33854                 UINT32_C(0x9)
33855         /*
33856          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
33857          * datagram payload
33858          */
33859         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
33860                 UINT32_C(0xa)
33861         /* Use fixed layer 2 ether type of 0xFFFF */
33862         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
33863                 UINT32_C(0xb)
33864         /*
33865          * IPV6 over virtual eXtensible Local Area Network with GPE header
33866          * (IPV6oVXLANGPE)
33867          */
33868         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
33869                 UINT32_C(0xc)
33870         /* Any tunneled traffic */
33871         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
33872                 UINT32_C(0xff)
33873         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
33874                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
33875         uint8_t unused_4;
33876         /*
33877          * If set, this value shall represent the
33878          * Logical VNIC ID of the destination VNIC for the RX
33879          * path and network port id of the destination port for
33880          * the TX path.
33881          */
33882         uint16_t        dst_id;
33883         /*
33884          * Logical VNIC ID of the VNIC where traffic is
33885          * mirrored.
33886          */
33887         uint16_t        mirror_vnic_id;
33888         /*
33889          * This hint is provided to help in placing
33890          * the filter in the filter table.
33891          */
33892         uint8_t pri_hint;
33893         /* No preference */
33894         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
33895                 UINT32_C(0x0)
33896         /* Above the given filter */
33897         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
33898                 UINT32_C(0x1)
33899         /* Below the given filter */
33900         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
33901                 UINT32_C(0x2)
33902         /* As high as possible */
33903         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
33904                 UINT32_C(0x3)
33905         /* As low as possible */
33906         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
33907                 UINT32_C(0x4)
33908         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
33909                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
33910         uint8_t unused_5;
33911         uint32_t        unused_6;
33912         /*
33913          * This is the ID of the filter that goes along with
33914          * the pri_hint.
33915          *
33916          * This field is valid only for the following values.
33917          * 1 - Above the given filter
33918          * 2 - Below the given filter
33919          */
33920         uint64_t        l2_filter_id_hint;
33921 } __rte_packed;
33922
33923 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
33924 struct hwrm_cfa_l2_filter_alloc_output {
33925         /* The specific error status for the command. */
33926         uint16_t        error_code;
33927         /* The HWRM command request type. */
33928         uint16_t        req_type;
33929         /* The sequence ID from the original command. */
33930         uint16_t        seq_id;
33931         /* The length of the response data in number of bytes. */
33932         uint16_t        resp_len;
33933         /*
33934          * This value identifies a set of CFA data structures used for an L2
33935          * context.
33936          */
33937         uint64_t        l2_filter_id;
33938         /*
33939          * The flow id value in bit 0-29 is the actual ID of the flow
33940          * associated with this filter and it shall be used to match
33941          * and associate the flow identifier returned in completion
33942          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
33943          * shall indicate no valid flow id.
33944          */
33945         uint32_t        flow_id;
33946         /* Indicate the flow id value. */
33947         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
33948                 UINT32_C(0x3fffffff)
33949         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
33950         /* Indicate type of the flow. */
33951         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
33952                 UINT32_C(0x40000000)
33953         /*
33954          * If this bit set to 0, then it indicates that the flow is
33955          * internal flow.
33956          */
33957         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
33958                 (UINT32_C(0x0) << 30)
33959         /*
33960          * If this bit is set to 1, then it indicates that the flow is
33961          * external flow.
33962          */
33963         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
33964                 (UINT32_C(0x1) << 30)
33965         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
33966                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
33967         /* Indicate the flow direction. */
33968         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
33969                 UINT32_C(0x80000000)
33970         /* If this bit set to 0, then it indicates rx flow. */
33971         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
33972                 (UINT32_C(0x0) << 31)
33973         /* If this bit is set to 1, then it indicates that tx flow. */
33974         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
33975                 (UINT32_C(0x1) << 31)
33976         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
33977                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
33978         uint8_t unused_0[3];
33979         /*
33980          * This field is used in Output records to indicate that the output
33981          * is completely written to RAM. This field should be read as '1'
33982          * to indicate that the output has been completely written.
33983          * When writing a command completion or response to an internal
33984          * processor, the order of writes has to be such that this field is
33985          * written last.
33986          */
33987         uint8_t valid;
33988 } __rte_packed;
33989
33990 /***************************
33991  * hwrm_cfa_l2_filter_free *
33992  ***************************/
33993
33994
33995 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
33996 struct hwrm_cfa_l2_filter_free_input {
33997         /* The HWRM command request type. */
33998         uint16_t        req_type;
33999         /*
34000          * The completion ring to send the completion event on. This should
34001          * be the NQ ID returned from the `nq_alloc` HWRM command.
34002          */
34003         uint16_t        cmpl_ring;
34004         /*
34005          * The sequence ID is used by the driver for tracking multiple
34006          * commands. This ID is treated as opaque data by the firmware and
34007          * the value is returned in the `hwrm_resp_hdr` upon completion.
34008          */
34009         uint16_t        seq_id;
34010         /*
34011          * The target ID of the command:
34012          * * 0x0-0xFFF8 - The function ID
34013          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34014          * * 0xFFFD - Reserved for user-space HWRM interface
34015          * * 0xFFFF - HWRM
34016          */
34017         uint16_t        target_id;
34018         /*
34019          * A physical address pointer pointing to a host buffer that the
34020          * command's response data will be written. This can be either a host
34021          * physical address (HPA) or a guest physical address (GPA) and must
34022          * point to a physically contiguous block of memory.
34023          */
34024         uint64_t        resp_addr;
34025         /*
34026          * This value identifies a set of CFA data structures used for an L2
34027          * context.
34028          */
34029         uint64_t        l2_filter_id;
34030 } __rte_packed;
34031
34032 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
34033 struct hwrm_cfa_l2_filter_free_output {
34034         /* The specific error status for the command. */
34035         uint16_t        error_code;
34036         /* The HWRM command request type. */
34037         uint16_t        req_type;
34038         /* The sequence ID from the original command. */
34039         uint16_t        seq_id;
34040         /* The length of the response data in number of bytes. */
34041         uint16_t        resp_len;
34042         uint8_t unused_0[7];
34043         /*
34044          * This field is used in Output records to indicate that the output
34045          * is completely written to RAM. This field should be read as '1'
34046          * to indicate that the output has been completely written.
34047          * When writing a command completion or response to an internal
34048          * processor, the order of writes has to be such that this field is
34049          * written last.
34050          */
34051         uint8_t valid;
34052 } __rte_packed;
34053
34054 /**************************
34055  * hwrm_cfa_l2_filter_cfg *
34056  **************************/
34057
34058
34059 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
34060 struct hwrm_cfa_l2_filter_cfg_input {
34061         /* The HWRM command request type. */
34062         uint16_t        req_type;
34063         /*
34064          * The completion ring to send the completion event on. This should
34065          * be the NQ ID returned from the `nq_alloc` HWRM command.
34066          */
34067         uint16_t        cmpl_ring;
34068         /*
34069          * The sequence ID is used by the driver for tracking multiple
34070          * commands. This ID is treated as opaque data by the firmware and
34071          * the value is returned in the `hwrm_resp_hdr` upon completion.
34072          */
34073         uint16_t        seq_id;
34074         /*
34075          * The target ID of the command:
34076          * * 0x0-0xFFF8 - The function ID
34077          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34078          * * 0xFFFD - Reserved for user-space HWRM interface
34079          * * 0xFFFF - HWRM
34080          */
34081         uint16_t        target_id;
34082         /*
34083          * A physical address pointer pointing to a host buffer that the
34084          * command's response data will be written. This can be either a host
34085          * physical address (HPA) or a guest physical address (GPA) and must
34086          * point to a physically contiguous block of memory.
34087          */
34088         uint64_t        resp_addr;
34089         uint32_t        flags;
34090         /*
34091          * Enumeration denoting the RX, TX type of the resource.
34092          * This enumeration is used for resources that are similar for both
34093          * TX and RX paths of the chip.
34094          */
34095         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH \
34096                 UINT32_C(0x1)
34097         /* tx path */
34098         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \
34099                 UINT32_C(0x0)
34100         /* rx path */
34101         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \
34102                 UINT32_C(0x1)
34103         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
34104                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
34105         /*
34106          * Setting of this flag indicates drop action. If this flag is not
34107          * set, then it should be considered accept action.
34108          */
34109         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP \
34110                 UINT32_C(0x2)
34111         /*
34112          * Enumeration denoting NO_ROCE_L2 to support old drivers.
34113          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
34114          */
34115         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK \
34116                 UINT32_C(0xc)
34117         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT       2
34118         /* To support old drivers */
34119         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
34120                 (UINT32_C(0x0) << 2)
34121         /* Only L2 traffic */
34122         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2 \
34123                 (UINT32_C(0x1) << 2)
34124         /* Roce & L2 traffic */
34125         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE \
34126                 (UINT32_C(0x2) << 2)
34127         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST \
34128                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE
34129         uint32_t        enables;
34130         /*
34131          * This bit must be '1' for the dst_id field to be
34132          * configured.
34133          */
34134         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID \
34135                 UINT32_C(0x1)
34136         /*
34137          * This bit must be '1' for the new_mirror_vnic_id field to be
34138          * configured.
34139          */
34140         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
34141                 UINT32_C(0x2)
34142         /*
34143          * This value identifies a set of CFA data structures used for an L2
34144          * context.
34145          */
34146         uint64_t        l2_filter_id;
34147         /*
34148          * If set, this value shall represent the
34149          * Logical VNIC ID of the destination VNIC for the RX
34150          * path and network port id of the destination port for
34151          * the TX path.
34152          */
34153         uint32_t        dst_id;
34154         /*
34155          * New Logical VNIC ID of the VNIC where traffic is
34156          * mirrored.
34157          */
34158         uint32_t        new_mirror_vnic_id;
34159 } __rte_packed;
34160
34161 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
34162 struct hwrm_cfa_l2_filter_cfg_output {
34163         /* The specific error status for the command. */
34164         uint16_t        error_code;
34165         /* The HWRM command request type. */
34166         uint16_t        req_type;
34167         /* The sequence ID from the original command. */
34168         uint16_t        seq_id;
34169         /* The length of the response data in number of bytes. */
34170         uint16_t        resp_len;
34171         uint8_t unused_0[7];
34172         /*
34173          * This field is used in Output records to indicate that the output
34174          * is completely written to RAM. This field should be read as '1'
34175          * to indicate that the output has been completely written.
34176          * When writing a command completion or response to an internal
34177          * processor, the order of writes has to be such that this field is
34178          * written last.
34179          */
34180         uint8_t valid;
34181 } __rte_packed;
34182
34183 /***************************
34184  * hwrm_cfa_l2_set_rx_mask *
34185  ***************************/
34186
34187
34188 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
34189 struct hwrm_cfa_l2_set_rx_mask_input {
34190         /* The HWRM command request type. */
34191         uint16_t        req_type;
34192         /*
34193          * The completion ring to send the completion event on. This should
34194          * be the NQ ID returned from the `nq_alloc` HWRM command.
34195          */
34196         uint16_t        cmpl_ring;
34197         /*
34198          * The sequence ID is used by the driver for tracking multiple
34199          * commands. This ID is treated as opaque data by the firmware and
34200          * the value is returned in the `hwrm_resp_hdr` upon completion.
34201          */
34202         uint16_t        seq_id;
34203         /*
34204          * The target ID of the command:
34205          * * 0x0-0xFFF8 - The function ID
34206          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34207          * * 0xFFFD - Reserved for user-space HWRM interface
34208          * * 0xFFFF - HWRM
34209          */
34210         uint16_t        target_id;
34211         /*
34212          * A physical address pointer pointing to a host buffer that the
34213          * command's response data will be written. This can be either a host
34214          * physical address (HPA) or a guest physical address (GPA) and must
34215          * point to a physically contiguous block of memory.
34216          */
34217         uint64_t        resp_addr;
34218         /* VNIC ID */
34219         uint32_t        vnic_id;
34220         uint32_t        mask;
34221         /*
34222          * When this bit is '1', the function is requested to accept
34223          * multi-cast packets specified by the multicast addr table.
34224          */
34225         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST \
34226                 UINT32_C(0x2)
34227         /*
34228          * When this bit is '1', the function is requested to accept
34229          * all multi-cast packets.
34230          */
34231         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST \
34232                 UINT32_C(0x4)
34233         /*
34234          * When this bit is '1', the function is requested to accept
34235          * broadcast packets.
34236          */
34237         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST \
34238                 UINT32_C(0x8)
34239         /*
34240          * When this bit is '1', the function is requested to be
34241          * put in the promiscuous mode.
34242          *
34243          * The HWRM should accept any function to set up
34244          * promiscuous mode.
34245          *
34246          * The HWRM shall follow the semantics below for the
34247          * promiscuous mode support.
34248          * # When partitioning is not enabled on a port
34249          * (i.e. single PF on the port), then the PF shall
34250          * be allowed to be in the promiscuous mode. When the
34251          * PF is in the promiscuous mode, then it shall
34252          * receive all host bound traffic on that port.
34253          * # When partitioning is enabled on a port
34254          * (i.e. multiple PFs per port) and a PF on that
34255          * port is in the promiscuous mode, then the PF
34256          * receives all traffic within that partition as
34257          * identified by a unique identifier for the
34258          * PF (e.g. S-Tag). If a unique outer VLAN
34259          * for the PF is specified, then the setting of
34260          * promiscuous mode on that PF shall result in the
34261          * PF receiving all host bound traffic with matching
34262          * outer VLAN.
34263          * # A VF shall can be set in the promiscuous mode.
34264          * In the promiscuous mode, the VF does not receive any
34265          * traffic unless a unique outer VLAN for the
34266          * VF is specified. If a unique outer VLAN
34267          * for the VF is specified, then the setting of
34268          * promiscuous mode on that VF shall result in the
34269          * VF receiving all host bound traffic with the
34270          * matching outer VLAN.
34271          * # The HWRM shall allow the setting of promiscuous
34272          * mode on a function independently from the
34273          * promiscuous mode settings on other functions.
34274          */
34275         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS \
34276                 UINT32_C(0x10)
34277         /*
34278          * If this flag is set, the corresponding RX
34279          * filters shall be set up to cover multicast/broadcast
34280          * filters for the outermost Layer 2 destination MAC
34281          * address field.
34282          */
34283         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST \
34284                 UINT32_C(0x20)
34285         /*
34286          * If this flag is set, the corresponding RX
34287          * filters shall be set up to cover multicast/broadcast
34288          * filters for the VLAN-tagged packets that match the
34289          * TPID and VID fields of VLAN tags in the VLAN tag
34290          * table specified in this command.
34291          */
34292         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY \
34293                 UINT32_C(0x40)
34294         /*
34295          * If this flag is set, the corresponding RX
34296          * filters shall be set up to cover multicast/broadcast
34297          * filters for non-VLAN tagged packets and VLAN-tagged
34298          * packets that match the TPID and VID fields of VLAN
34299          * tags in the VLAN tag table specified in this command.
34300          */
34301         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN \
34302                 UINT32_C(0x80)
34303         /*
34304          * If this flag is set, the corresponding RX
34305          * filters shall be set up to cover multicast/broadcast
34306          * filters for non-VLAN tagged packets and VLAN-tagged
34307          * packets matching any VLAN tag.
34308          *
34309          * If this flag is set, then the HWRM shall ignore
34310          * VLAN tags specified in vlan_tag_tbl.
34311          *
34312          * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
34313          * flags is set, then the HWRM shall ignore
34314          * VLAN tags specified in vlan_tag_tbl.
34315          *
34316          * The HWRM client shall set at most one flag out of
34317          * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
34318          */
34319         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
34320                 UINT32_C(0x100)
34321         /* This is the address for mcast address tbl. */
34322         uint64_t        mc_tbl_addr;
34323         /*
34324          * This value indicates how many entries in mc_tbl are valid.
34325          * Each entry is 6 bytes.
34326          */
34327         uint32_t        num_mc_entries;
34328         uint8_t unused_0[4];
34329         /*
34330          * This is the address for VLAN tag table.
34331          * Each VLAN entry in the table is 4 bytes of a VLAN tag
34332          * including TPID, PCP, DEI, and VID fields in network byte
34333          * order.
34334          */
34335         uint64_t        vlan_tag_tbl_addr;
34336         /*
34337          * This value indicates how many entries in vlan_tag_tbl are
34338          * valid. Each entry is 4 bytes.
34339          */
34340         uint32_t        num_vlan_tags;
34341         uint8_t unused_1[4];
34342 } __rte_packed;
34343
34344 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
34345 struct hwrm_cfa_l2_set_rx_mask_output {
34346         /* The specific error status for the command. */
34347         uint16_t        error_code;
34348         /* The HWRM command request type. */
34349         uint16_t        req_type;
34350         /* The sequence ID from the original command. */
34351         uint16_t        seq_id;
34352         /* The length of the response data in number of bytes. */
34353         uint16_t        resp_len;
34354         uint8_t unused_0[7];
34355         /*
34356          * This field is used in Output records to indicate that the output
34357          * is completely written to RAM. This field should be read as '1'
34358          * to indicate that the output has been completely written.
34359          * When writing a command completion or response to an internal
34360          * processor, the order of writes has to be such that this field is
34361          * written last.
34362          */
34363         uint8_t valid;
34364 } __rte_packed;
34365
34366 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
34367 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
34368         /*
34369          * command specific error codes that goes to
34370          * the cmd_err field in Common HWRM Error Response.
34371          */
34372         uint8_t code;
34373         /* Unknown error */
34374         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN \
34375                 UINT32_C(0x0)
34376         /* Unable to complete operation due to conflict with Ntuple Filter */
34377         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR \
34378                 UINT32_C(0x1)
34379         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST \
34380                 HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
34381         uint8_t unused_0[7];
34382 } __rte_packed;
34383
34384 /*******************************
34385  * hwrm_cfa_vlan_antispoof_cfg *
34386  *******************************/
34387
34388
34389 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
34390 struct hwrm_cfa_vlan_antispoof_cfg_input {
34391         /* The HWRM command request type. */
34392         uint16_t        req_type;
34393         /*
34394          * The completion ring to send the completion event on. This should
34395          * be the NQ ID returned from the `nq_alloc` HWRM command.
34396          */
34397         uint16_t        cmpl_ring;
34398         /*
34399          * The sequence ID is used by the driver for tracking multiple
34400          * commands. This ID is treated as opaque data by the firmware and
34401          * the value is returned in the `hwrm_resp_hdr` upon completion.
34402          */
34403         uint16_t        seq_id;
34404         /*
34405          * The target ID of the command:
34406          * * 0x0-0xFFF8 - The function ID
34407          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34408          * * 0xFFFD - Reserved for user-space HWRM interface
34409          * * 0xFFFF - HWRM
34410          */
34411         uint16_t        target_id;
34412         /*
34413          * A physical address pointer pointing to a host buffer that the
34414          * command's response data will be written. This can be either a host
34415          * physical address (HPA) or a guest physical address (GPA) and must
34416          * point to a physically contiguous block of memory.
34417          */
34418         uint64_t        resp_addr;
34419         /*
34420          * Function ID of the function that is being configured.
34421          * Only valid for a VF FID configured by the PF.
34422          */
34423         uint16_t        fid;
34424         uint8_t unused_0[2];
34425         /* Number of VLAN entries in the vlan_tag_mask_tbl. */
34426         uint32_t        num_vlan_entries;
34427         /*
34428          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
34429          * antispoof table. Each table entry contains the 16-bit TPID
34430          * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
34431          * all in network order to match hwrm_cfa_l2_set_rx_mask.
34432          * For an individual VLAN entry, the mask value should be 0xfff
34433          * for the 12-bit VLAN ID.
34434          */
34435         uint64_t        vlan_tag_mask_tbl_addr;
34436 } __rte_packed;
34437
34438 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
34439 struct hwrm_cfa_vlan_antispoof_cfg_output {
34440         /* The specific error status for the command. */
34441         uint16_t        error_code;
34442         /* The HWRM command request type. */
34443         uint16_t        req_type;
34444         /* The sequence ID from the original command. */
34445         uint16_t        seq_id;
34446         /* The length of the response data in number of bytes. */
34447         uint16_t        resp_len;
34448         uint8_t unused_0[7];
34449         /*
34450          * This field is used in Output records to indicate that the output
34451          * is completely written to RAM. This field should be read as '1'
34452          * to indicate that the output has been completely written.
34453          * When writing a command completion or response to an internal
34454          * processor, the order of writes has to be such that this field is
34455          * written last.
34456          */
34457         uint8_t valid;
34458 } __rte_packed;
34459
34460 /********************************
34461  * hwrm_cfa_vlan_antispoof_qcfg *
34462  ********************************/
34463
34464
34465 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
34466 struct hwrm_cfa_vlan_antispoof_qcfg_input {
34467         /* The HWRM command request type. */
34468         uint16_t        req_type;
34469         /*
34470          * The completion ring to send the completion event on. This should
34471          * be the NQ ID returned from the `nq_alloc` HWRM command.
34472          */
34473         uint16_t        cmpl_ring;
34474         /*
34475          * The sequence ID is used by the driver for tracking multiple
34476          * commands. This ID is treated as opaque data by the firmware and
34477          * the value is returned in the `hwrm_resp_hdr` upon completion.
34478          */
34479         uint16_t        seq_id;
34480         /*
34481          * The target ID of the command:
34482          * * 0x0-0xFFF8 - The function ID
34483          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34484          * * 0xFFFD - Reserved for user-space HWRM interface
34485          * * 0xFFFF - HWRM
34486          */
34487         uint16_t        target_id;
34488         /*
34489          * A physical address pointer pointing to a host buffer that the
34490          * command's response data will be written. This can be either a host
34491          * physical address (HPA) or a guest physical address (GPA) and must
34492          * point to a physically contiguous block of memory.
34493          */
34494         uint64_t        resp_addr;
34495         /*
34496          * Function ID of the function that is being queried.
34497          * Only valid for a VF FID queried by the PF.
34498          */
34499         uint16_t        fid;
34500         uint8_t unused_0[2];
34501         /*
34502          * Maximum number of VLAN entries the firmware is allowed to DMA
34503          * to vlan_tag_mask_tbl.
34504          */
34505         uint32_t        max_vlan_entries;
34506         /*
34507          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
34508          * antispoof table to which firmware will DMA to. Each table
34509          * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
34510          * 16-bit VLAN ID, and a 16-bit mask, all in network order to
34511          * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
34512          * the mask value should be 0xfff for the 12-bit VLAN ID.
34513          */
34514         uint64_t        vlan_tag_mask_tbl_addr;
34515 } __rte_packed;
34516
34517 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
34518 struct hwrm_cfa_vlan_antispoof_qcfg_output {
34519         /* The specific error status for the command. */
34520         uint16_t        error_code;
34521         /* The HWRM command request type. */
34522         uint16_t        req_type;
34523         /* The sequence ID from the original command. */
34524         uint16_t        seq_id;
34525         /* The length of the response data in number of bytes. */
34526         uint16_t        resp_len;
34527         /* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
34528         uint32_t        num_vlan_entries;
34529         uint8_t unused_0[3];
34530         /*
34531          * This field is used in Output records to indicate that the output
34532          * is completely written to RAM. This field should be read as '1'
34533          * to indicate that the output has been completely written.
34534          * When writing a command completion or response to an internal
34535          * processor, the order of writes has to be such that this field is
34536          * written last.
34537          */
34538         uint8_t valid;
34539 } __rte_packed;
34540
34541 /********************************
34542  * hwrm_cfa_tunnel_filter_alloc *
34543  ********************************/
34544
34545
34546 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */
34547 struct hwrm_cfa_tunnel_filter_alloc_input {
34548         /* The HWRM command request type. */
34549         uint16_t        req_type;
34550         /*
34551          * The completion ring to send the completion event on. This should
34552          * be the NQ ID returned from the `nq_alloc` HWRM command.
34553          */
34554         uint16_t        cmpl_ring;
34555         /*
34556          * The sequence ID is used by the driver for tracking multiple
34557          * commands. This ID is treated as opaque data by the firmware and
34558          * the value is returned in the `hwrm_resp_hdr` upon completion.
34559          */
34560         uint16_t        seq_id;
34561         /*
34562          * The target ID of the command:
34563          * * 0x0-0xFFF8 - The function ID
34564          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34565          * * 0xFFFD - Reserved for user-space HWRM interface
34566          * * 0xFFFF - HWRM
34567          */
34568         uint16_t        target_id;
34569         /*
34570          * A physical address pointer pointing to a host buffer that the
34571          * command's response data will be written. This can be either a host
34572          * physical address (HPA) or a guest physical address (GPA) and must
34573          * point to a physically contiguous block of memory.
34574          */
34575         uint64_t        resp_addr;
34576         uint32_t        flags;
34577         /*
34578          * Setting of this flag indicates the applicability to the loopback
34579          * path.
34580          */
34581         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
34582                 UINT32_C(0x1)
34583         uint32_t        enables;
34584         /*
34585          * This bit must be '1' for the l2_filter_id field to be
34586          * configured.
34587          */
34588         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
34589                 UINT32_C(0x1)
34590         /*
34591          * This bit must be '1' for the l2_addr field to be
34592          * configured.
34593          */
34594         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
34595                 UINT32_C(0x2)
34596         /*
34597          * This bit must be '1' for the l2_ivlan field to be
34598          * configured.
34599          */
34600         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
34601                 UINT32_C(0x4)
34602         /*
34603          * This bit must be '1' for the l3_addr field to be
34604          * configured.
34605          */
34606         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR \
34607                 UINT32_C(0x8)
34608         /*
34609          * This bit must be '1' for the l3_addr_type field to be
34610          * configured.
34611          */
34612         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE \
34613                 UINT32_C(0x10)
34614         /*
34615          * This bit must be '1' for the t_l3_addr_type field to be
34616          * configured.
34617          */
34618         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE \
34619                 UINT32_C(0x20)
34620         /*
34621          * This bit must be '1' for the t_l3_addr field to be
34622          * configured.
34623          */
34624         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR \
34625                 UINT32_C(0x40)
34626         /*
34627          * This bit must be '1' for the tunnel_type field to be
34628          * configured.
34629          */
34630         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
34631                 UINT32_C(0x80)
34632         /*
34633          * This bit must be '1' for the vni field to be
34634          * configured.
34635          */
34636         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI \
34637                 UINT32_C(0x100)
34638         /*
34639          * This bit must be '1' for the dst_vnic_id field to be
34640          * configured.
34641          */
34642         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID \
34643                 UINT32_C(0x200)
34644         /*
34645          * This bit must be '1' for the mirror_vnic_id field to be
34646          * configured.
34647          */
34648         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
34649                 UINT32_C(0x400)
34650         /*
34651          * This value identifies a set of CFA data structures used for an L2
34652          * context.
34653          */
34654         uint64_t        l2_filter_id;
34655         /*
34656          * This value sets the match value for the inner L2
34657          * MAC address.
34658          * Destination MAC address for RX path.
34659          * Source MAC address for TX path.
34660          */
34661         uint8_t l2_addr[6];
34662         /*
34663          * This value sets VLAN ID value for inner VLAN.
34664          * Only 12-bits of VLAN ID are used in setting the filter.
34665          */
34666         uint16_t        l2_ivlan;
34667         /*
34668          * The value of inner destination IP address to be used in filtering.
34669          * For IPv4, first four bytes represent the IP address.
34670          */
34671         uint32_t        l3_addr[4];
34672         /*
34673          * The value of tunnel destination IP address to be used in filtering.
34674          * For IPv4, first four bytes represent the IP address.
34675          */
34676         uint32_t        t_l3_addr[4];
34677         /*
34678          * This value indicates the type of inner IP address.
34679          * 4 - IPv4
34680          * 6 - IPv6
34681          * All others are invalid.
34682          */
34683         uint8_t l3_addr_type;
34684         /*
34685          * This value indicates the type of tunnel IP address.
34686          * 4 - IPv4
34687          * 6 - IPv6
34688          * All others are invalid.
34689          */
34690         uint8_t t_l3_addr_type;
34691         /* Tunnel Type. */
34692         uint8_t tunnel_type;
34693         /* Non-tunnel */
34694         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
34695                 UINT32_C(0x0)
34696         /* Virtual eXtensible Local Area Network (VXLAN) */
34697         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
34698                 UINT32_C(0x1)
34699         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
34700         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
34701                 UINT32_C(0x2)
34702         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
34703         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
34704                 UINT32_C(0x3)
34705         /* IP in IP */
34706         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
34707                 UINT32_C(0x4)
34708         /* Generic Network Virtualization Encapsulation (Geneve) */
34709         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
34710                 UINT32_C(0x5)
34711         /* Multi-Protocol Label Switching (MPLS) */
34712         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
34713                 UINT32_C(0x6)
34714         /* Stateless Transport Tunnel (STT) */
34715         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
34716                 UINT32_C(0x7)
34717         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
34718         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
34719                 UINT32_C(0x8)
34720         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
34721         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
34722                 UINT32_C(0x9)
34723         /*
34724          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
34725          * datagram payload
34726          */
34727         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
34728                 UINT32_C(0xa)
34729         /* Use fixed layer 2 ether type of 0xFFFF */
34730         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
34731                 UINT32_C(0xb)
34732         /*
34733          * IPV6 over virtual eXtensible Local Area Network with GPE header
34734          * (IPV6oVXLANGPE)
34735          */
34736         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
34737                 UINT32_C(0xc)
34738         /* Any tunneled traffic */
34739         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
34740                 UINT32_C(0xff)
34741         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
34742                 HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
34743         /*
34744          * tunnel_flags allows the user to indicate the tunnel tag detection
34745          * for the tunnel type specified in tunnel_type.
34746          */
34747         uint8_t tunnel_flags;
34748         /*
34749          * If the tunnel_type is geneve, then this bit indicates if we
34750          * need to match the geneve OAM packet.
34751          * If the tunnel_type is nvgre or gre, then this bit indicates if
34752          * we need to detect checksum present bit in geneve header.
34753          * If the tunnel_type is mpls, then this bit indicates if we need
34754          * to match mpls packet with explicit IPV4/IPV6 null header.
34755          */
34756         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR \
34757                 UINT32_C(0x1)
34758         /*
34759          * If the tunnel_type is geneve, then this bit indicates if we
34760          * need to detect the critical option bit set in the oam packet.
34761          * If the tunnel_type is nvgre or gre, then this bit indicates
34762          * if we need to match nvgre packets with key present bit set in
34763          * gre header.
34764          * If the tunnel_type is mpls, then this bit indicates if we
34765          * need to match mpls packet with S bit from inner/second label.
34766          */
34767         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1 \
34768                 UINT32_C(0x2)
34769         /*
34770          * If the tunnel_type is geneve, then this bit indicates if we
34771          * need to match geneve packet with extended header bit set in
34772          * geneve header.
34773          * If the tunnel_type is nvgre or gre, then this bit indicates
34774          * if we need to match nvgre packets with sequence number
34775          * present bit set in gre header.
34776          * If the tunnel_type is mpls, then this bit indicates if we
34777          * need to match mpls packet with S bit from out/first label.
34778          */
34779         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0 \
34780                 UINT32_C(0x4)
34781         /*
34782          * Virtual Network Identifier (VNI). Only valid with
34783          * tunnel_types VXLAN, NVGRE, and Geneve.
34784          * Only lower 24-bits of VNI field are used
34785          * in setting up the filter.
34786          */
34787         uint32_t        vni;
34788         /* Logical VNIC ID of the destination VNIC. */
34789         uint32_t        dst_vnic_id;
34790         /*
34791          * Logical VNIC ID of the VNIC where traffic is
34792          * mirrored.
34793          */
34794         uint32_t        mirror_vnic_id;
34795 } __rte_packed;
34796
34797 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
34798 struct hwrm_cfa_tunnel_filter_alloc_output {
34799         /* The specific error status for the command. */
34800         uint16_t        error_code;
34801         /* The HWRM command request type. */
34802         uint16_t        req_type;
34803         /* The sequence ID from the original command. */
34804         uint16_t        seq_id;
34805         /* The length of the response data in number of bytes. */
34806         uint16_t        resp_len;
34807         /* This value is an opaque id into CFA data structures. */
34808         uint64_t        tunnel_filter_id;
34809         /*
34810          * The flow id value in bit 0-29 is the actual ID of the flow
34811          * associated with this filter and it shall be used to match
34812          * and associate the flow identifier returned in completion
34813          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
34814          * shall indicate no valid flow id.
34815          */
34816         uint32_t        flow_id;
34817         /* Indicate the flow id value. */
34818         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
34819                 UINT32_C(0x3fffffff)
34820         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
34821         /* Indicate type of the flow. */
34822         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
34823                 UINT32_C(0x40000000)
34824         /*
34825          * If this bit set to 0, then it indicates that the flow is
34826          * internal flow.
34827          */
34828         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
34829                 (UINT32_C(0x0) << 30)
34830         /*
34831          * If this bit is set to 1, then it indicates that the flow is
34832          * external flow.
34833          */
34834         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
34835                 (UINT32_C(0x1) << 30)
34836         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
34837                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
34838         /* Indicate the flow direction. */
34839         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
34840                 UINT32_C(0x80000000)
34841         /* If this bit set to 0, then it indicates rx flow. */
34842         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
34843                 (UINT32_C(0x0) << 31)
34844         /* If this bit is set to 1, then it indicates that tx flow. */
34845         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
34846                 (UINT32_C(0x1) << 31)
34847         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
34848                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
34849         uint8_t unused_0[3];
34850         /*
34851          * This field is used in Output records to indicate that the output
34852          * is completely written to RAM. This field should be read as '1'
34853          * to indicate that the output has been completely written.
34854          * When writing a command completion or response to an internal
34855          * processor, the order of writes has to be such that this field is
34856          * written last.
34857          */
34858         uint8_t valid;
34859 } __rte_packed;
34860
34861 /*******************************
34862  * hwrm_cfa_tunnel_filter_free *
34863  *******************************/
34864
34865
34866 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */
34867 struct hwrm_cfa_tunnel_filter_free_input {
34868         /* The HWRM command request type. */
34869         uint16_t        req_type;
34870         /*
34871          * The completion ring to send the completion event on. This should
34872          * be the NQ ID returned from the `nq_alloc` HWRM command.
34873          */
34874         uint16_t        cmpl_ring;
34875         /*
34876          * The sequence ID is used by the driver for tracking multiple
34877          * commands. This ID is treated as opaque data by the firmware and
34878          * the value is returned in the `hwrm_resp_hdr` upon completion.
34879          */
34880         uint16_t        seq_id;
34881         /*
34882          * The target ID of the command:
34883          * * 0x0-0xFFF8 - The function ID
34884          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34885          * * 0xFFFD - Reserved for user-space HWRM interface
34886          * * 0xFFFF - HWRM
34887          */
34888         uint16_t        target_id;
34889         /*
34890          * A physical address pointer pointing to a host buffer that the
34891          * command's response data will be written. This can be either a host
34892          * physical address (HPA) or a guest physical address (GPA) and must
34893          * point to a physically contiguous block of memory.
34894          */
34895         uint64_t        resp_addr;
34896         /* This value is an opaque id into CFA data structures. */
34897         uint64_t        tunnel_filter_id;
34898 } __rte_packed;
34899
34900 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
34901 struct hwrm_cfa_tunnel_filter_free_output {
34902         /* The specific error status for the command. */
34903         uint16_t        error_code;
34904         /* The HWRM command request type. */
34905         uint16_t        req_type;
34906         /* The sequence ID from the original command. */
34907         uint16_t        seq_id;
34908         /* The length of the response data in number of bytes. */
34909         uint16_t        resp_len;
34910         uint8_t unused_0[7];
34911         /*
34912          * This field is used in Output records to indicate that the output
34913          * is completely written to RAM. This field should be read as '1'
34914          * to indicate that the output has been completely written.
34915          * When writing a command completion or response to an internal
34916          * processor, the order of writes has to be such that this field is
34917          * written last.
34918          */
34919         uint8_t valid;
34920 } __rte_packed;
34921
34922 /***************************************
34923  * hwrm_cfa_redirect_tunnel_type_alloc *
34924  ***************************************/
34925
34926
34927 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */
34928 struct hwrm_cfa_redirect_tunnel_type_alloc_input {
34929         /* The HWRM command request type. */
34930         uint16_t        req_type;
34931         /*
34932          * The completion ring to send the completion event on. This should
34933          * be the NQ ID returned from the `nq_alloc` HWRM command.
34934          */
34935         uint16_t        cmpl_ring;
34936         /*
34937          * The sequence ID is used by the driver for tracking multiple
34938          * commands. This ID is treated as opaque data by the firmware and
34939          * the value is returned in the `hwrm_resp_hdr` upon completion.
34940          */
34941         uint16_t        seq_id;
34942         /*
34943          * The target ID of the command:
34944          * * 0x0-0xFFF8 - The function ID
34945          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
34946          * * 0xFFFD - Reserved for user-space HWRM interface
34947          * * 0xFFFF - HWRM
34948          */
34949         uint16_t        target_id;
34950         /*
34951          * A physical address pointer pointing to a host buffer that the
34952          * command's response data will be written. This can be either a host
34953          * physical address (HPA) or a guest physical address (GPA) and must
34954          * point to a physically contiguous block of memory.
34955          */
34956         uint64_t        resp_addr;
34957         /* The destination function id, to whom the traffic is redirected. */
34958         uint16_t        dest_fid;
34959         /* Tunnel Type. */
34960         uint8_t tunnel_type;
34961         /* Non-tunnel */
34962         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
34963                 UINT32_C(0x0)
34964         /* Virtual eXtensible Local Area Network (VXLAN) */
34965         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
34966                 UINT32_C(0x1)
34967         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
34968         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
34969                 UINT32_C(0x2)
34970         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
34971         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
34972                 UINT32_C(0x3)
34973         /* IP in IP */
34974         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
34975                 UINT32_C(0x4)
34976         /* Generic Network Virtualization Encapsulation (Geneve) */
34977         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
34978                 UINT32_C(0x5)
34979         /* Multi-Protocol Label Switching (MPLS) */
34980         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
34981                 UINT32_C(0x6)
34982         /* Stateless Transport Tunnel (STT) */
34983         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT \
34984                 UINT32_C(0x7)
34985         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
34986         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
34987                 UINT32_C(0x8)
34988         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
34989         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
34990                 UINT32_C(0x9)
34991         /*
34992          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
34993          * datagram payload
34994          */
34995         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
34996                 UINT32_C(0xa)
34997         /* Use fixed layer 2 ether type of 0xFFFF */
34998         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
34999                 UINT32_C(0xb)
35000         /*
35001          * IPV6 over virtual eXtensible Local Area Network with GPE header
35002          * (IPV6oVXLANGPE)
35003          */
35004         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
35005                 UINT32_C(0xc)
35006         /* Any tunneled traffic */
35007         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
35008                 UINT32_C(0xff)
35009         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST \
35010                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
35011         /* Tunnel alloc flags. */
35012         uint8_t flags;
35013         /*
35014          * Setting of this flag indicates modify existing redirect tunnel
35015          * to new destination function ID.
35016          */
35017         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST \
35018                 UINT32_C(0x1)
35019         uint8_t unused_0[4];
35020 } __rte_packed;
35021
35022 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
35023 struct hwrm_cfa_redirect_tunnel_type_alloc_output {
35024         /* The specific error status for the command. */
35025         uint16_t        error_code;
35026         /* The HWRM command request type. */
35027         uint16_t        req_type;
35028         /* The sequence ID from the original command. */
35029         uint16_t        seq_id;
35030         /* The length of the response data in number of bytes. */
35031         uint16_t        resp_len;
35032         uint8_t unused_0[7];
35033         /*
35034          * This field is used in Output records to indicate that the output
35035          * is completely written to RAM. This field should be read as '1'
35036          * to indicate that the output has been completely written.
35037          * When writing a command completion or response to an internal
35038          * processor, the order of writes has to be such that this field is
35039          * written last.
35040          */
35041         uint8_t valid;
35042 } __rte_packed;
35043
35044 /**************************************
35045  * hwrm_cfa_redirect_tunnel_type_free *
35046  **************************************/
35047
35048
35049 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */
35050 struct hwrm_cfa_redirect_tunnel_type_free_input {
35051         /* The HWRM command request type. */
35052         uint16_t        req_type;
35053         /*
35054          * The completion ring to send the completion event on. This should
35055          * be the NQ ID returned from the `nq_alloc` HWRM command.
35056          */
35057         uint16_t        cmpl_ring;
35058         /*
35059          * The sequence ID is used by the driver for tracking multiple
35060          * commands. This ID is treated as opaque data by the firmware and
35061          * the value is returned in the `hwrm_resp_hdr` upon completion.
35062          */
35063         uint16_t        seq_id;
35064         /*
35065          * The target ID of the command:
35066          * * 0x0-0xFFF8 - The function ID
35067          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35068          * * 0xFFFD - Reserved for user-space HWRM interface
35069          * * 0xFFFF - HWRM
35070          */
35071         uint16_t        target_id;
35072         /*
35073          * A physical address pointer pointing to a host buffer that the
35074          * command's response data will be written. This can be either a host
35075          * physical address (HPA) or a guest physical address (GPA) and must
35076          * point to a physically contiguous block of memory.
35077          */
35078         uint64_t        resp_addr;
35079         /* The destination function id, to whom the traffic is redirected. */
35080         uint16_t        dest_fid;
35081         /* Tunnel Type. */
35082         uint8_t tunnel_type;
35083         /* Non-tunnel */
35084         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL \
35085                 UINT32_C(0x0)
35086         /* Virtual eXtensible Local Area Network (VXLAN) */
35087         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN \
35088                 UINT32_C(0x1)
35089         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
35090         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE \
35091                 UINT32_C(0x2)
35092         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
35093         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE \
35094                 UINT32_C(0x3)
35095         /* IP in IP */
35096         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP \
35097                 UINT32_C(0x4)
35098         /* Generic Network Virtualization Encapsulation (Geneve) */
35099         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE \
35100                 UINT32_C(0x5)
35101         /* Multi-Protocol Label Switching (MPLS) */
35102         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS \
35103                 UINT32_C(0x6)
35104         /* Stateless Transport Tunnel (STT) */
35105         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT \
35106                 UINT32_C(0x7)
35107         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
35108         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE \
35109                 UINT32_C(0x8)
35110         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
35111         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
35112                 UINT32_C(0x9)
35113         /*
35114          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
35115          * datagram payload
35116          */
35117         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
35118                 UINT32_C(0xa)
35119         /* Use fixed layer 2 ether type of 0xFFFF */
35120         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
35121                 UINT32_C(0xb)
35122         /*
35123          * IPV6 over virtual eXtensible Local Area Network with GPE header
35124          * (IPV6oVXLANGPE)
35125          */
35126         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
35127                 UINT32_C(0xc)
35128         /* Any tunneled traffic */
35129         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL \
35130                 UINT32_C(0xff)
35131         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST \
35132                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
35133         uint8_t unused_0[5];
35134 } __rte_packed;
35135
35136 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
35137 struct hwrm_cfa_redirect_tunnel_type_free_output {
35138         /* The specific error status for the command. */
35139         uint16_t        error_code;
35140         /* The HWRM command request type. */
35141         uint16_t        req_type;
35142         /* The sequence ID from the original command. */
35143         uint16_t        seq_id;
35144         /* The length of the response data in number of bytes. */
35145         uint16_t        resp_len;
35146         uint8_t unused_0[7];
35147         /*
35148          * This field is used in Output records to indicate that the output
35149          * is completely written to RAM. This field should be read as '1'
35150          * to indicate that the output has been completely written.
35151          * When writing a command completion or response to an internal
35152          * processor, the order of writes has to be such that this field is
35153          * written last.
35154          */
35155         uint8_t valid;
35156 } __rte_packed;
35157
35158 /**************************************
35159  * hwrm_cfa_redirect_tunnel_type_info *
35160  **************************************/
35161
35162
35163 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */
35164 struct hwrm_cfa_redirect_tunnel_type_info_input {
35165         /* The HWRM command request type. */
35166         uint16_t        req_type;
35167         /*
35168          * The completion ring to send the completion event on. This should
35169          * be the NQ ID returned from the `nq_alloc` HWRM command.
35170          */
35171         uint16_t        cmpl_ring;
35172         /*
35173          * The sequence ID is used by the driver for tracking multiple
35174          * commands. This ID is treated as opaque data by the firmware and
35175          * the value is returned in the `hwrm_resp_hdr` upon completion.
35176          */
35177         uint16_t        seq_id;
35178         /*
35179          * The target ID of the command:
35180          * * 0x0-0xFFF8 - The function ID
35181          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35182          * * 0xFFFD - Reserved for user-space HWRM interface
35183          * * 0xFFFF - HWRM
35184          */
35185         uint16_t        target_id;
35186         /*
35187          * A physical address pointer pointing to a host buffer that the
35188          * command's response data will be written. This can be either a host
35189          * physical address (HPA) or a guest physical address (GPA) and must
35190          * point to a physically contiguous block of memory.
35191          */
35192         uint64_t        resp_addr;
35193         /* The source function id. */
35194         uint16_t        src_fid;
35195         /* Tunnel Type. */
35196         uint8_t tunnel_type;
35197         /* Non-tunnel */
35198         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL \
35199                 UINT32_C(0x0)
35200         /* Virtual eXtensible Local Area Network (VXLAN) */
35201         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN \
35202                 UINT32_C(0x1)
35203         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
35204         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE \
35205                 UINT32_C(0x2)
35206         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
35207         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE \
35208                 UINT32_C(0x3)
35209         /* IP in IP */
35210         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP \
35211                 UINT32_C(0x4)
35212         /* Generic Network Virtualization Encapsulation (Geneve) */
35213         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE \
35214                 UINT32_C(0x5)
35215         /* Multi-Protocol Label Switching (MPLS) */
35216         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS \
35217                 UINT32_C(0x6)
35218         /* Stateless Transport Tunnel (STT) */
35219         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT \
35220                 UINT32_C(0x7)
35221         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
35222         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE \
35223                 UINT32_C(0x8)
35224         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
35225         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4 \
35226                 UINT32_C(0x9)
35227         /*
35228          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
35229          * datagram payload
35230          */
35231         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1 \
35232                 UINT32_C(0xa)
35233         /* Use fixed layer 2 ether type of 0xFFFF */
35234         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2_ETYPE \
35235                 UINT32_C(0xb)
35236         /*
35237          * IPV6 over virtual eXtensible Local Area Network with GPE header
35238          * (IPV6oVXLANGPE)
35239          */
35240         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
35241                 UINT32_C(0xc)
35242         /* Any tunneled traffic */
35243         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL \
35244                 UINT32_C(0xff)
35245         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST \
35246                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
35247         uint8_t unused_0[5];
35248 } __rte_packed;
35249
35250 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
35251 struct hwrm_cfa_redirect_tunnel_type_info_output {
35252         /* The specific error status for the command. */
35253         uint16_t        error_code;
35254         /* The HWRM command request type. */
35255         uint16_t        req_type;
35256         /* The sequence ID from the original command. */
35257         uint16_t        seq_id;
35258         /* The length of the response data in number of bytes. */
35259         uint16_t        resp_len;
35260         /* The destination function id, to whom the traffic is redirected. */
35261         uint16_t        dest_fid;
35262         uint8_t unused_0[5];
35263         /*
35264          * This field is used in Output records to indicate that the output
35265          * is completely written to RAM. This field should be read as '1'
35266          * to indicate that the output has been completely written.
35267          * When writing a command completion or response to an internal
35268          * processor, the order of writes has to be such that this field is
35269          * written last.
35270          */
35271         uint8_t valid;
35272 } __rte_packed;
35273
35274 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
35275 struct hwrm_vxlan_ipv4_hdr {
35276         /* IPv4 version and header length. */
35277         uint8_t ver_hlen;
35278         /* IPv4 header length */
35279         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf)
35280         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0
35281         /* Version */
35282         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK      UINT32_C(0xf0)
35283         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT       4
35284         /* IPv4 type of service. */
35285         uint8_t tos;
35286         /* IPv4 identification. */
35287         uint16_t        ip_id;
35288         /* IPv4 flags and offset. */
35289         uint16_t        flags_frag_offset;
35290         /* IPv4 TTL. */
35291         uint8_t ttl;
35292         /* IPv4 protocol. */
35293         uint8_t protocol;
35294         /* IPv4 source address. */
35295         uint32_t        src_ip_addr;
35296         /* IPv4 destination address. */
35297         uint32_t        dest_ip_addr;
35298 } __rte_packed;
35299
35300 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
35301 struct hwrm_vxlan_ipv6_hdr {
35302         /* IPv6 version, traffic class and flow label. */
35303         uint32_t        ver_tc_flow_label;
35304         /* IPv6 version shift */
35305         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT \
35306                 UINT32_C(0x1c)
35307         /* IPv6 version mask */
35308         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK \
35309                 UINT32_C(0xf0000000)
35310         /* IPv6 TC shift */
35311         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT \
35312                 UINT32_C(0x14)
35313         /* IPv6 TC mask */
35314         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK \
35315                 UINT32_C(0xff00000)
35316         /* IPv6 flow label shift */
35317         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT \
35318                 UINT32_C(0x0)
35319         /* IPv6 flow label mask */
35320         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK \
35321                 UINT32_C(0xfffff)
35322         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST \
35323                 HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK
35324         /* IPv6 payload length. */
35325         uint16_t        payload_len;
35326         /* IPv6 next header. */
35327         uint8_t next_hdr;
35328         /* IPv6 TTL. */
35329         uint8_t ttl;
35330         /* IPv6 source address. */
35331         uint32_t        src_ip_addr[4];
35332         /* IPv6 destination address. */
35333         uint32_t        dest_ip_addr[4];
35334 } __rte_packed;
35335
35336 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
35337 struct hwrm_cfa_encap_data_vxlan {
35338         /* Source MAC address. */
35339         uint8_t src_mac_addr[6];
35340         /* reserved. */
35341         uint16_t        unused_0;
35342         /* Destination MAC address. */
35343         uint8_t dst_mac_addr[6];
35344         /* Number of VLAN tags. */
35345         uint8_t num_vlan_tags;
35346         /* reserved. */
35347         uint8_t unused_1;
35348         /* Outer VLAN TPID. */
35349         uint16_t        ovlan_tpid;
35350         /* Outer VLAN TCI. */
35351         uint16_t        ovlan_tci;
35352         /* Inner VLAN TPID. */
35353         uint16_t        ivlan_tpid;
35354         /* Inner VLAN TCI. */
35355         uint16_t        ivlan_tci;
35356         /* L3 header fields. */
35357         uint32_t        l3[10];
35358         /* IP version mask. */
35359         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf)
35360         /* IP version 4. */
35361         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4)
35362         /* IP version 6. */
35363         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6)
35364         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST \
35365                 HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6
35366         /* UDP source port. */
35367         uint16_t        src_port;
35368         /* UDP destination port. */
35369         uint16_t        dst_port;
35370         /* VXLAN Network Identifier. */
35371         uint32_t        vni;
35372         /*
35373          * 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN
35374          * header.
35375          */
35376         uint8_t hdr_rsvd0[3];
35377         /* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */
35378         uint8_t hdr_rsvd1;
35379         /* VXLAN header flags field. */
35380         uint8_t hdr_flags;
35381         uint8_t unused[3];
35382 } __rte_packed;
35383
35384 /*******************************
35385  * hwrm_cfa_encap_record_alloc *
35386  *******************************/
35387
35388
35389 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */
35390 struct hwrm_cfa_encap_record_alloc_input {
35391         /* The HWRM command request type. */
35392         uint16_t        req_type;
35393         /*
35394          * The completion ring to send the completion event on. This should
35395          * be the NQ ID returned from the `nq_alloc` HWRM command.
35396          */
35397         uint16_t        cmpl_ring;
35398         /*
35399          * The sequence ID is used by the driver for tracking multiple
35400          * commands. This ID is treated as opaque data by the firmware and
35401          * the value is returned in the `hwrm_resp_hdr` upon completion.
35402          */
35403         uint16_t        seq_id;
35404         /*
35405          * The target ID of the command:
35406          * * 0x0-0xFFF8 - The function ID
35407          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35408          * * 0xFFFD - Reserved for user-space HWRM interface
35409          * * 0xFFFF - HWRM
35410          */
35411         uint16_t        target_id;
35412         /*
35413          * A physical address pointer pointing to a host buffer that the
35414          * command's response data will be written. This can be either a host
35415          * physical address (HPA) or a guest physical address (GPA) and must
35416          * point to a physically contiguous block of memory.
35417          */
35418         uint64_t        resp_addr;
35419         uint32_t        flags;
35420         /*
35421          * Setting of this flag indicates the applicability to the loopback
35422          * path.
35423          */
35424         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK \
35425                 UINT32_C(0x1)
35426         /*
35427          * Setting of this flag indicates this encap record is external
35428          * encap record. Resetting of this flag indicates this flag is
35429          * internal encap record and this is the default setting.
35430          */
35431         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_EXTERNAL \
35432                 UINT32_C(0x2)
35433         /* Encapsulation Type. */
35434         uint8_t encap_type;
35435         /* Virtual eXtensible Local Area Network (VXLAN) */
35436         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN \
35437                 UINT32_C(0x1)
35438         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
35439         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE \
35440                 UINT32_C(0x2)
35441         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
35442         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE \
35443                 UINT32_C(0x3)
35444         /* IP in IP */
35445         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP \
35446                 UINT32_C(0x4)
35447         /* Generic Network Virtualization Encapsulation (Geneve) */
35448         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE \
35449                 UINT32_C(0x5)
35450         /* Multi-Protocol Label Switching (MPLS) */
35451         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS \
35452                 UINT32_C(0x6)
35453         /* VLAN */
35454         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN \
35455                 UINT32_C(0x7)
35456         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
35457         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE \
35458                 UINT32_C(0x8)
35459         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
35460         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4 \
35461                 UINT32_C(0x9)
35462         /*
35463          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
35464          * datagram payload
35465          */
35466         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE_V1 \
35467                 UINT32_C(0xa)
35468         /* Use fixed layer 2 ether type of 0xFFFF */
35469         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE \
35470                 UINT32_C(0xb)
35471         /*
35472          * IPV6 over virtual eXtensible Local Area Network with GPE header
35473          * (IPV6oVXLANGPE)
35474          */
35475         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6 \
35476                 UINT32_C(0xc)
35477         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST \
35478                 HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6
35479         uint8_t unused_0[3];
35480         /* This value is encap data used for the given encap type. */
35481         uint32_t        encap_data[20];
35482 } __rte_packed;
35483
35484 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
35485 struct hwrm_cfa_encap_record_alloc_output {
35486         /* The specific error status for the command. */
35487         uint16_t        error_code;
35488         /* The HWRM command request type. */
35489         uint16_t        req_type;
35490         /* The sequence ID from the original command. */
35491         uint16_t        seq_id;
35492         /* The length of the response data in number of bytes. */
35493         uint16_t        resp_len;
35494         /* This value is an opaque id into CFA data structures. */
35495         uint32_t        encap_record_id;
35496         uint8_t unused_0[3];
35497         /*
35498          * This field is used in Output records to indicate that the output
35499          * is completely written to RAM. This field should be read as '1'
35500          * to indicate that the output has been completely written.
35501          * When writing a command completion or response to an internal
35502          * processor, the order of writes has to be such that this field is
35503          * written last.
35504          */
35505         uint8_t valid;
35506 } __rte_packed;
35507
35508 /******************************
35509  * hwrm_cfa_encap_record_free *
35510  ******************************/
35511
35512
35513 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */
35514 struct hwrm_cfa_encap_record_free_input {
35515         /* The HWRM command request type. */
35516         uint16_t        req_type;
35517         /*
35518          * The completion ring to send the completion event on. This should
35519          * be the NQ ID returned from the `nq_alloc` HWRM command.
35520          */
35521         uint16_t        cmpl_ring;
35522         /*
35523          * The sequence ID is used by the driver for tracking multiple
35524          * commands. This ID is treated as opaque data by the firmware and
35525          * the value is returned in the `hwrm_resp_hdr` upon completion.
35526          */
35527         uint16_t        seq_id;
35528         /*
35529          * The target ID of the command:
35530          * * 0x0-0xFFF8 - The function ID
35531          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35532          * * 0xFFFD - Reserved for user-space HWRM interface
35533          * * 0xFFFF - HWRM
35534          */
35535         uint16_t        target_id;
35536         /*
35537          * A physical address pointer pointing to a host buffer that the
35538          * command's response data will be written. This can be either a host
35539          * physical address (HPA) or a guest physical address (GPA) and must
35540          * point to a physically contiguous block of memory.
35541          */
35542         uint64_t        resp_addr;
35543         /* This value is an opaque id into CFA data structures. */
35544         uint32_t        encap_record_id;
35545         uint8_t unused_0[4];
35546 } __rte_packed;
35547
35548 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
35549 struct hwrm_cfa_encap_record_free_output {
35550         /* The specific error status for the command. */
35551         uint16_t        error_code;
35552         /* The HWRM command request type. */
35553         uint16_t        req_type;
35554         /* The sequence ID from the original command. */
35555         uint16_t        seq_id;
35556         /* The length of the response data in number of bytes. */
35557         uint16_t        resp_len;
35558         uint8_t unused_0[7];
35559         /*
35560          * This field is used in Output records to indicate that the output
35561          * is completely written to RAM. This field should be read as '1'
35562          * to indicate that the output has been completely written.
35563          * When writing a command completion or response to an internal
35564          * processor, the order of writes has to be such that this field is
35565          * written last.
35566          */
35567         uint8_t valid;
35568 } __rte_packed;
35569
35570 /********************************
35571  * hwrm_cfa_ntuple_filter_alloc *
35572  ********************************/
35573
35574
35575 /* hwrm_cfa_ntuple_filter_alloc_input (size:1024b/128B) */
35576 struct hwrm_cfa_ntuple_filter_alloc_input {
35577         /* The HWRM command request type. */
35578         uint16_t        req_type;
35579         /*
35580          * The completion ring to send the completion event on. This should
35581          * be the NQ ID returned from the `nq_alloc` HWRM command.
35582          */
35583         uint16_t        cmpl_ring;
35584         /*
35585          * The sequence ID is used by the driver for tracking multiple
35586          * commands. This ID is treated as opaque data by the firmware and
35587          * the value is returned in the `hwrm_resp_hdr` upon completion.
35588          */
35589         uint16_t        seq_id;
35590         /*
35591          * The target ID of the command:
35592          * * 0x0-0xFFF8 - The function ID
35593          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
35594          * * 0xFFFD - Reserved for user-space HWRM interface
35595          * * 0xFFFF - HWRM
35596          */
35597         uint16_t        target_id;
35598         /*
35599          * A physical address pointer pointing to a host buffer that the
35600          * command's response data will be written. This can be either a host
35601          * physical address (HPA) or a guest physical address (GPA) and must
35602          * point to a physically contiguous block of memory.
35603          */
35604         uint64_t        resp_addr;
35605         uint32_t        flags;
35606         /*
35607          * Setting of this flag indicates the applicability to the loopback
35608          * path.
35609          */
35610         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
35611                 UINT32_C(0x1)
35612         /*
35613          * Setting of this flag indicates drop action. If this flag is not
35614          * set, then it should be considered accept action.
35615          */
35616         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP \
35617                 UINT32_C(0x2)
35618         /*
35619          * Setting of this flag indicates that a meter is expected to be
35620          * attached to this flow. This hint can be used when choosing the
35621          * action record format required for the flow.
35622          */
35623         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER \
35624                 UINT32_C(0x4)
35625         /*
35626          * Setting of this flag indicates that the dst_id field contains
35627          * function ID. If this is not set it indicates dest_id is VNIC
35628          * or VPORT.
35629          */
35630         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_FID \
35631                 UINT32_C(0x8)
35632         /*
35633          * Setting of this flag indicates match on arp reply when ethertype
35634          * is 0x0806. If this is not set it indicates no specific arp opcode
35635          * matching.
35636          */
35637         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_ARP_REPLY \
35638                 UINT32_C(0x10)
35639         /*
35640          * Setting of this flag indicates that the dst_id field contains RFS
35641          * ring table index. If this is not set it indicates dst_id is VNIC
35642          * or VPORT or function ID.  Note dest_fid and dest_rfs_ring_idx
35643          * can’t be set at the same time.
35644          */
35645         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_RFS_RING_IDX \
35646                 UINT32_C(0x20)
35647         uint32_t        enables;
35648         /*
35649          * This bit must be '1' for the l2_filter_id field to be
35650          * configured.
35651          */
35652         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
35653                 UINT32_C(0x1)
35654         /*
35655          * This bit must be '1' for the ethertype field to be
35656          * configured.
35657          */
35658         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
35659                 UINT32_C(0x2)
35660         /*
35661          * This bit must be '1' for the tunnel_type field to be
35662          * configured.
35663          */
35664         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
35665                 UINT32_C(0x4)
35666         /*
35667          * This bit must be '1' for the src_macaddr field to be
35668          * configured.
35669          */
35670         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
35671                 UINT32_C(0x8)
35672         /*
35673          * This bit must be '1' for the ipaddr_type field to be
35674          * configured.
35675          */
35676         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
35677                 UINT32_C(0x10)
35678         /*
35679          * This bit must be '1' for the src_ipaddr field to be
35680          * configured.
35681          */
35682         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
35683                 UINT32_C(0x20)
35684         /*
35685          * This bit must be '1' for the src_ipaddr_mask field to be
35686          * configured.
35687          */
35688         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK \
35689                 UINT32_C(0x40)
35690         /*
35691          * This bit must be '1' for the dst_ipaddr field to be
35692          * configured.
35693          */
35694         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
35695                 UINT32_C(0x80)
35696         /*
35697          * This bit must be '1' for the dst_ipaddr_mask field to be
35698          * configured.
35699          */
35700         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK \
35701                 UINT32_C(0x100)
35702         /*
35703          * This bit must be '1' for the ip_protocol field to be
35704          * configured.
35705          */
35706         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
35707                 UINT32_C(0x200)
35708         /*
35709          * This bit must be '1' for the src_port field to be
35710          * configured.
35711          */
35712         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
35713                 UINT32_C(0x400)
35714         /*
35715          * This bit must be '1' for the src_port_mask field to be
35716          * configured.
35717          */
35718         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK \
35719                 UINT32_C(0x800)
35720         /*
35721          * This bit must be '1' for the dst_port field to be
35722          * configured.
35723          */
35724         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
35725                 UINT32_C(0x1000)
35726         /*
35727          * This bit must be '1' for the dst_port_mask field to be
35728          * configured.
35729          */
35730         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK \
35731                 UINT32_C(0x2000)
35732         /*
35733          * This bit must be '1' for the pri_hint field to be
35734          * configured.
35735          */
35736         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT \
35737                 UINT32_C(0x4000)
35738         /*
35739          * This bit must be '1' for the ntuple_filter_id field to be
35740          * configured.
35741          */
35742         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID \
35743                 UINT32_C(0x8000)
35744         /*
35745          * This bit must be '1' for the dst_id field to be
35746          * configured.
35747          */
35748         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
35749                 UINT32_C(0x10000)
35750         /*
35751          * This bit must be '1' for the mirror_vnic_id field to be
35752          * configured.
35753          */
35754         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
35755                 UINT32_C(0x20000)
35756         /*
35757          * This bit must be '1' for the dst_macaddr field to be
35758          * configured.
35759          */
35760         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
35761                 UINT32_C(0x40000)
35762         /* This flag is deprecated. */
35763         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_RFS_RING_TBL_IDX \
35764                 UINT32_C(0x80000)
35765         /*
35766          * This value identifies a set of CFA data structures used for an L2
35767          * context.
35768          */
35769         uint64_t        l2_filter_id;
35770         /*
35771          * This value indicates the source MAC address in
35772          * the Ethernet header.
35773          */
35774         uint8_t src_macaddr[6];
35775         /* This value indicates the ethertype in the Ethernet header. */
35776         uint16_t        ethertype;
35777         /*
35778          * This value indicates the type of IP address.
35779          * 4 - IPv4
35780          * 6 - IPv6
35781          * All others are invalid.
35782          */
35783         uint8_t ip_addr_type;
35784         /* invalid */
35785         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
35786                 UINT32_C(0x0)
35787         /* IPv4 */
35788         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
35789                 UINT32_C(0x4)
35790         /* IPv6 */
35791         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
35792                 UINT32_C(0x6)
35793         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
35794                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
35795         /*
35796          * The value of protocol filed in IP header.
35797          * Applies to UDP and TCP traffic.
35798          * 6 - TCP
35799          * 17 - UDP
35800          */
35801         uint8_t ip_protocol;
35802         /* invalid */
35803         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
35804                 UINT32_C(0x0)
35805         /* TCP */
35806         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
35807                 UINT32_C(0x6)
35808         /* UDP */
35809         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
35810                 UINT32_C(0x11)
35811         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
35812                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
35813         /*
35814          * If set, this value shall represent the
35815          * Logical VNIC ID of the destination VNIC for the RX
35816          * path and network port id of the destination port for
35817          * the TX path.
35818          */
35819         uint16_t        dst_id;
35820         /*
35821          * Logical VNIC ID of the VNIC where traffic is
35822          * mirrored.
35823          */
35824         uint16_t        mirror_vnic_id;
35825         /*
35826          * This value indicates the tunnel type for this filter.
35827          * If this field is not specified, then the filter shall
35828          * apply to both non-tunneled and tunneled packets.
35829          * If this field conflicts with the tunnel_type specified
35830          * in the l2_filter_id, then the HWRM shall return an
35831          * error for this command.
35832          */
35833         uint8_t tunnel_type;
35834         /* Non-tunnel */
35835         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
35836                 UINT32_C(0x0)
35837         /* Virtual eXtensible Local Area Network (VXLAN) */
35838         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
35839                 UINT32_C(0x1)
35840         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
35841         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
35842                 UINT32_C(0x2)
35843         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
35844         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
35845                 UINT32_C(0x3)
35846         /* IP in IP */
35847         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
35848                 UINT32_C(0x4)
35849         /* Generic Network Virtualization Encapsulation (Geneve) */
35850         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
35851                 UINT32_C(0x5)
35852         /* Multi-Protocol Label Switching (MPLS) */
35853         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
35854                 UINT32_C(0x6)
35855         /* Stateless Transport Tunnel (STT) */
35856         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
35857                 UINT32_C(0x7)
35858         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
35859         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
35860                 UINT32_C(0x8)
35861         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
35862         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
35863                 UINT32_C(0x9)
35864         /*
35865          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
35866          * datagram payload
35867          */
35868         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
35869                 UINT32_C(0xa)
35870         /* Use fixed layer 2 ether type of 0xFFFF */
35871         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
35872                 UINT32_C(0xb)
35873         /*
35874          * IPV6 over virtual eXtensible Local Area Network with GPE header
35875          * (IPV6oVXLANGPE)
35876          */
35877         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
35878                 UINT32_C(0xc)
35879         /* Any tunneled traffic */
35880         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
35881                 UINT32_C(0xff)
35882         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
35883                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
35884         /*
35885          * This hint is provided to help in placing
35886          * the filter in the filter table.
35887          */
35888         uint8_t pri_hint;
35889         /* No preference */
35890         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
35891                 UINT32_C(0x0)
35892         /* Above the given filter */
35893         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE \
35894                 UINT32_C(0x1)
35895         /* Below the given filter */
35896         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW \
35897                 UINT32_C(0x2)
35898         /* As high as possible */
35899         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST \
35900                 UINT32_C(0x3)
35901         /* As low as possible */
35902         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST \
35903                 UINT32_C(0x4)
35904         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
35905                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
35906         /*
35907          * The value of source IP address to be used in filtering.
35908          * For IPv4, first four bytes represent the IP address.
35909          */
35910         uint32_t        src_ipaddr[4];
35911         /*
35912          * The value of source IP address mask to be used in
35913          * filtering.
35914          * For IPv4, first four bytes represent the IP address mask.
35915          */
35916         uint32_t        src_ipaddr_mask[4];
35917         /*
35918          * The value of destination IP address to be used in filtering.
35919          * For IPv4, first four bytes represent the IP address.
35920          */
35921         uint32_t        dst_ipaddr[4];
35922         /*
35923          * The value of destination IP address mask to be used in
35924          * filtering.
35925          * For IPv4, first four bytes represent the IP address mask.
35926          */
35927         uint32_t        dst_ipaddr_mask[4];
35928         /*
35929          * The value of source port to be used in filtering.
35930          * Applies to UDP and TCP traffic.
35931          */
35932         uint16_t        src_port;
35933         /*
35934          * The value of source port mask to be used in filtering.
35935          * Applies to UDP and TCP traffic.
35936          */
35937         uint16_t        src_port_mask;
35938         /*
35939          * The value of destination port to be used in filtering.
35940          * Applies to UDP and TCP traffic.
35941          */
35942         uint16_t        dst_port;
35943         /*
35944          * The value of destination port mask to be used in
35945          * filtering.
35946          * Applies to UDP and TCP traffic.
35947          */
35948         uint16_t        dst_port_mask;
35949         /*
35950          * This is the ID of the filter that goes along with
35951          * the pri_hint.
35952          */
35953         uint64_t        ntuple_filter_id_hint;
35954 } __rte_packed;
35955
35956 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
35957 struct hwrm_cfa_ntuple_filter_alloc_output {
35958         /* The specific error status for the command. */
35959         uint16_t        error_code;
35960         /* The HWRM command request type. */
35961         uint16_t        req_type;
35962         /* The sequence ID from the original command. */
35963         uint16_t        seq_id;
35964         /* The length of the response data in number of bytes. */
35965         uint16_t        resp_len;
35966         /* This value is an opaque id into CFA data structures. */
35967         uint64_t        ntuple_filter_id;
35968         /*
35969          * The flow id value in bit 0-29 is the actual ID of the flow
35970          * associated with this filter and it shall be used to match
35971          * and associate the flow identifier returned in completion
35972          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
35973          * shall indicate no valid flow id.
35974          */
35975         uint32_t        flow_id;
35976         /* Indicate the flow id value. */
35977         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
35978                 UINT32_C(0x3fffffff)
35979         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
35980         /* Indicate type of the flow. */
35981         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
35982                 UINT32_C(0x40000000)
35983         /*
35984          * If this bit set to 0, then it indicates that the flow is
35985          * internal flow.
35986          */
35987         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
35988                 (UINT32_C(0x0) << 30)
35989         /*
35990          * If this bit is set to 1, then it indicates that the flow is
35991          * external flow.
35992          */
35993         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
35994                 (UINT32_C(0x1) << 30)
35995         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
35996                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
35997         /* Indicate the flow direction. */
35998         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
35999                 UINT32_C(0x80000000)
36000         /* If this bit set to 0, then it indicates rx flow. */
36001         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
36002                 (UINT32_C(0x0) << 31)
36003         /* If this bit is set to 1, then it indicates that tx flow. */
36004         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
36005                 (UINT32_C(0x1) << 31)
36006         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
36007                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
36008         uint8_t unused_0[3];
36009         /*
36010          * This field is used in Output records to indicate that the output
36011          * is completely written to RAM. This field should be read as '1'
36012          * to indicate that the output has been completely written.
36013          * When writing a command completion or response to an internal
36014          * processor, the order of writes has to be such that this field is
36015          * written last.
36016          */
36017         uint8_t valid;
36018 } __rte_packed;
36019
36020 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
36021 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
36022         /*
36023          * command specific error codes that goes to
36024          * the cmd_err field in Common HWRM Error Response.
36025          */
36026         uint8_t code;
36027         /* Unknown error */
36028         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN \
36029                 UINT32_C(0x0)
36030         /* Unable to complete operation due to conflict with Rx Mask VLAN */
36031         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR \
36032                 UINT32_C(0x1)
36033         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST \
36034                 HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
36035         uint8_t unused_0[7];
36036 } __rte_packed;
36037
36038 /*******************************
36039  * hwrm_cfa_ntuple_filter_free *
36040  *******************************/
36041
36042
36043 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
36044 struct hwrm_cfa_ntuple_filter_free_input {
36045         /* The HWRM command request type. */
36046         uint16_t        req_type;
36047         /*
36048          * The completion ring to send the completion event on. This should
36049          * be the NQ ID returned from the `nq_alloc` HWRM command.
36050          */
36051         uint16_t        cmpl_ring;
36052         /*
36053          * The sequence ID is used by the driver for tracking multiple
36054          * commands. This ID is treated as opaque data by the firmware and
36055          * the value is returned in the `hwrm_resp_hdr` upon completion.
36056          */
36057         uint16_t        seq_id;
36058         /*
36059          * The target ID of the command:
36060          * * 0x0-0xFFF8 - The function ID
36061          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36062          * * 0xFFFD - Reserved for user-space HWRM interface
36063          * * 0xFFFF - HWRM
36064          */
36065         uint16_t        target_id;
36066         /*
36067          * A physical address pointer pointing to a host buffer that the
36068          * command's response data will be written. This can be either a host
36069          * physical address (HPA) or a guest physical address (GPA) and must
36070          * point to a physically contiguous block of memory.
36071          */
36072         uint64_t        resp_addr;
36073         /* This value is an opaque id into CFA data structures. */
36074         uint64_t        ntuple_filter_id;
36075 } __rte_packed;
36076
36077 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
36078 struct hwrm_cfa_ntuple_filter_free_output {
36079         /* The specific error status for the command. */
36080         uint16_t        error_code;
36081         /* The HWRM command request type. */
36082         uint16_t        req_type;
36083         /* The sequence ID from the original command. */
36084         uint16_t        seq_id;
36085         /* The length of the response data in number of bytes. */
36086         uint16_t        resp_len;
36087         uint8_t unused_0[7];
36088         /*
36089          * This field is used in Output records to indicate that the output
36090          * is completely written to RAM. This field should be read as '1'
36091          * to indicate that the output has been completely written.
36092          * When writing a command completion or response to an internal
36093          * processor, the order of writes has to be such that this field is
36094          * written last.
36095          */
36096         uint8_t valid;
36097 } __rte_packed;
36098
36099 /******************************
36100  * hwrm_cfa_ntuple_filter_cfg *
36101  ******************************/
36102
36103
36104 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
36105 struct hwrm_cfa_ntuple_filter_cfg_input {
36106         /* The HWRM command request type. */
36107         uint16_t        req_type;
36108         /*
36109          * The completion ring to send the completion event on. This should
36110          * be the NQ ID returned from the `nq_alloc` HWRM command.
36111          */
36112         uint16_t        cmpl_ring;
36113         /*
36114          * The sequence ID is used by the driver for tracking multiple
36115          * commands. This ID is treated as opaque data by the firmware and
36116          * the value is returned in the `hwrm_resp_hdr` upon completion.
36117          */
36118         uint16_t        seq_id;
36119         /*
36120          * The target ID of the command:
36121          * * 0x0-0xFFF8 - The function ID
36122          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36123          * * 0xFFFD - Reserved for user-space HWRM interface
36124          * * 0xFFFF - HWRM
36125          */
36126         uint16_t        target_id;
36127         /*
36128          * A physical address pointer pointing to a host buffer that the
36129          * command's response data will be written. This can be either a host
36130          * physical address (HPA) or a guest physical address (GPA) and must
36131          * point to a physically contiguous block of memory.
36132          */
36133         uint64_t        resp_addr;
36134         uint32_t        enables;
36135         /*
36136          * This bit must be '1' for the new_dst_id field to be
36137          * configured.
36138          */
36139         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID \
36140                 UINT32_C(0x1)
36141         /*
36142          * This bit must be '1' for the new_mirror_vnic_id field to be
36143          * configured.
36144          */
36145         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
36146                 UINT32_C(0x2)
36147         /*
36148          * This bit must be '1' for the new_meter_instance_id field to be
36149          * configured.
36150          */
36151         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
36152                 UINT32_C(0x4)
36153         uint32_t        flags;
36154         /*
36155          * Setting this bit to 1 indicates that dest_id field contains FID.
36156          * Setting this to 0 indicates that dest_id field contains VNIC or
36157          * VPORT.
36158          */
36159         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_FID \
36160                 UINT32_C(0x1)
36161         /*
36162          * Setting of this flag indicates that the new_dst_id field contains
36163          * RFS ring table index. If this is not set it indicates new_dst_id
36164          * is VNIC or VPORT or function ID.  Note dest_fid and
36165          * dest_rfs_ring_idx can’t be set at the same time.
36166          */
36167         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_RFS_RING_IDX \
36168                 UINT32_C(0x2)
36169         /* This value is an opaque id into CFA data structures. */
36170         uint64_t        ntuple_filter_id;
36171         /*
36172          * If set, this value shall represent the new
36173          * Logical VNIC ID of the destination VNIC for the RX
36174          * path and new network port id of the destination port for
36175          * the TX path.
36176          */
36177         uint32_t        new_dst_id;
36178         /*
36179          * New Logical VNIC ID of the VNIC where traffic is
36180          * mirrored.
36181          */
36182         uint32_t        new_mirror_vnic_id;
36183         /*
36184          * New meter to attach to the flow. Specifying the
36185          * invalid instance ID is used to remove any existing
36186          * meter from the flow.
36187          */
36188         uint16_t        new_meter_instance_id;
36189         /*
36190          * A value of 0xfff is considered invalid and implies the
36191          * instance is not configured.
36192          */
36193         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
36194                 UINT32_C(0xffff)
36195         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \
36196                 HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
36197         uint8_t unused_1[6];
36198 } __rte_packed;
36199
36200 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
36201 struct hwrm_cfa_ntuple_filter_cfg_output {
36202         /* The specific error status for the command. */
36203         uint16_t        error_code;
36204         /* The HWRM command request type. */
36205         uint16_t        req_type;
36206         /* The sequence ID from the original command. */
36207         uint16_t        seq_id;
36208         /* The length of the response data in number of bytes. */
36209         uint16_t        resp_len;
36210         uint8_t unused_0[7];
36211         /*
36212          * This field is used in Output records to indicate that the output
36213          * is completely written to RAM. This field should be read as '1'
36214          * to indicate that the output has been completely written.
36215          * When writing a command completion or response to an internal
36216          * processor, the order of writes has to be such that this field is
36217          * written last.
36218          */
36219         uint8_t valid;
36220 } __rte_packed;
36221
36222 /**************************
36223  * hwrm_cfa_em_flow_alloc *
36224  **************************/
36225
36226
36227 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
36228 struct hwrm_cfa_em_flow_alloc_input {
36229         /* The HWRM command request type. */
36230         uint16_t        req_type;
36231         /*
36232          * The completion ring to send the completion event on. This should
36233          * be the NQ ID returned from the `nq_alloc` HWRM command.
36234          */
36235         uint16_t        cmpl_ring;
36236         /*
36237          * The sequence ID is used by the driver for tracking multiple
36238          * commands. This ID is treated as opaque data by the firmware and
36239          * the value is returned in the `hwrm_resp_hdr` upon completion.
36240          */
36241         uint16_t        seq_id;
36242         /*
36243          * The target ID of the command:
36244          * * 0x0-0xFFF8 - The function ID
36245          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36246          * * 0xFFFD - Reserved for user-space HWRM interface
36247          * * 0xFFFF - HWRM
36248          */
36249         uint16_t        target_id;
36250         /*
36251          * A physical address pointer pointing to a host buffer that the
36252          * command's response data will be written. This can be either a host
36253          * physical address (HPA) or a guest physical address (GPA) and must
36254          * point to a physically contiguous block of memory.
36255          */
36256         uint64_t        resp_addr;
36257         uint32_t        flags;
36258         /*
36259          * Enumeration denoting the RX, TX type of the resource.
36260          * This enumeration is used for resources that are similar for both
36261          * TX and RX paths of the chip.
36262          */
36263         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH         UINT32_C(0x1)
36264         /* tx path */
36265         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX        UINT32_C(0x0)
36266         /* rx path */
36267         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX        UINT32_C(0x1)
36268         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST \
36269                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
36270         /*
36271          * Setting of this flag indicates enabling of a byte counter for a
36272          * given flow.
36273          */
36274         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR     UINT32_C(0x2)
36275         /*
36276          * Setting of this flag indicates enabling of a packet counter for a
36277          * given flow.
36278          */
36279         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR      UINT32_C(0x4)
36280         /*
36281          * Setting of this flag indicates de-capsulation action for the
36282          * given flow.
36283          */
36284         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP        UINT32_C(0x8)
36285         /*
36286          * Setting of this flag indicates encapsulation action for the
36287          * given flow.
36288          */
36289         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP        UINT32_C(0x10)
36290         /*
36291          * Setting of this flag indicates drop action. If this flag is not
36292          * set, then it should be considered accept action.
36293          */
36294         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP         UINT32_C(0x20)
36295         /*
36296          * Setting of this flag indicates that a meter is expected to be
36297          * attached to this flow. This hint can be used when choosing the
36298          * action record format required for the flow.
36299          */
36300         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER        UINT32_C(0x40)
36301         uint32_t        enables;
36302         /*
36303          * This bit must be '1' for the l2_filter_id field to be
36304          * configured.
36305          */
36306         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
36307                 UINT32_C(0x1)
36308         /*
36309          * This bit must be '1' for the tunnel_type field to be
36310          * configured.
36311          */
36312         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
36313                 UINT32_C(0x2)
36314         /*
36315          * This bit must be '1' for the tunnel_id field to be
36316          * configured.
36317          */
36318         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID \
36319                 UINT32_C(0x4)
36320         /*
36321          * This bit must be '1' for the src_macaddr field to be
36322          * configured.
36323          */
36324         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR \
36325                 UINT32_C(0x8)
36326         /*
36327          * This bit must be '1' for the dst_macaddr field to be
36328          * configured.
36329          */
36330         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR \
36331                 UINT32_C(0x10)
36332         /*
36333          * This bit must be '1' for the ovlan_vid field to be
36334          * configured.
36335          */
36336         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID \
36337                 UINT32_C(0x20)
36338         /*
36339          * This bit must be '1' for the ivlan_vid field to be
36340          * configured.
36341          */
36342         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID \
36343                 UINT32_C(0x40)
36344         /*
36345          * This bit must be '1' for the ethertype field to be
36346          * configured.
36347          */
36348         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE \
36349                 UINT32_C(0x80)
36350         /*
36351          * This bit must be '1' for the src_ipaddr field to be
36352          * configured.
36353          */
36354         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR \
36355                 UINT32_C(0x100)
36356         /*
36357          * This bit must be '1' for the dst_ipaddr field to be
36358          * configured.
36359          */
36360         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR \
36361                 UINT32_C(0x200)
36362         /*
36363          * This bit must be '1' for the ipaddr_type field to be
36364          * configured.
36365          */
36366         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
36367                 UINT32_C(0x400)
36368         /*
36369          * This bit must be '1' for the ip_protocol field to be
36370          * configured.
36371          */
36372         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
36373                 UINT32_C(0x800)
36374         /*
36375          * This bit must be '1' for the src_port field to be
36376          * configured.
36377          */
36378         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT \
36379                 UINT32_C(0x1000)
36380         /*
36381          * This bit must be '1' for the dst_port field to be
36382          * configured.
36383          */
36384         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT \
36385                 UINT32_C(0x2000)
36386         /*
36387          * This bit must be '1' for the dst_id field to be
36388          * configured.
36389          */
36390         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID \
36391                 UINT32_C(0x4000)
36392         /*
36393          * This bit must be '1' for the mirror_vnic_id field to be
36394          * configured.
36395          */
36396         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
36397                 UINT32_C(0x8000)
36398         /*
36399          * This bit must be '1' for the encap_record_id field to be
36400          * configured.
36401          */
36402         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID \
36403                 UINT32_C(0x10000)
36404         /*
36405          * This bit must be '1' for the meter_instance_id field to be
36406          * configured.
36407          */
36408         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID \
36409                 UINT32_C(0x20000)
36410         /*
36411          * This value identifies a set of CFA data structures used for an L2
36412          * context.
36413          */
36414         uint64_t        l2_filter_id;
36415         /* Tunnel Type. */
36416         uint8_t tunnel_type;
36417         /* Non-tunnel */
36418         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
36419                 UINT32_C(0x0)
36420         /* Virtual eXtensible Local Area Network (VXLAN) */
36421         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
36422                 UINT32_C(0x1)
36423         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
36424         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
36425                 UINT32_C(0x2)
36426         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
36427         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
36428                 UINT32_C(0x3)
36429         /* IP in IP */
36430         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
36431                 UINT32_C(0x4)
36432         /* Generic Network Virtualization Encapsulation (Geneve) */
36433         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
36434                 UINT32_C(0x5)
36435         /* Multi-Protocol Label Switching (MPLS) */
36436         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
36437                 UINT32_C(0x6)
36438         /* Stateless Transport Tunnel (STT) */
36439         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
36440                 UINT32_C(0x7)
36441         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
36442         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
36443                 UINT32_C(0x8)
36444         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
36445         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
36446                 UINT32_C(0x9)
36447         /*
36448          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
36449          * datagram payload
36450          */
36451         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
36452                 UINT32_C(0xa)
36453         /* Use fixed layer 2 ether type of 0xFFFF */
36454         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
36455                 UINT32_C(0xb)
36456         /*
36457          * IPV6 over virtual eXtensible Local Area Network with GPE header
36458          * (IPV6oVXLANGPE)
36459          */
36460         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
36461                 UINT32_C(0xc)
36462         /* Any tunneled traffic */
36463         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
36464                 UINT32_C(0xff)
36465         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
36466                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
36467         uint8_t unused_0[3];
36468         /*
36469          * Tunnel identifier.
36470          * Virtual Network Identifier (VNI). Only valid with
36471          * tunnel_types VXLAN, NVGRE, and Geneve.
36472          * Only lower 24-bits of VNI field are used
36473          * in setting up the filter.
36474          */
36475         uint32_t        tunnel_id;
36476         /*
36477          * This value indicates the source MAC address in
36478          * the Ethernet header.
36479          */
36480         uint8_t src_macaddr[6];
36481         /* The meter instance to attach to the flow. */
36482         uint16_t        meter_instance_id;
36483         /*
36484          * A value of 0xfff is considered invalid and implies the
36485          * instance is not configured.
36486          */
36487         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID \
36488                 UINT32_C(0xffff)
36489         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST \
36490                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
36491         /*
36492          * This value indicates the destination MAC address in
36493          * the Ethernet header.
36494          */
36495         uint8_t dst_macaddr[6];
36496         /*
36497          * This value indicates the VLAN ID of the outer VLAN tag
36498          * in the Ethernet header.
36499          */
36500         uint16_t        ovlan_vid;
36501         /*
36502          * This value indicates the VLAN ID of the inner VLAN tag
36503          * in the Ethernet header.
36504          */
36505         uint16_t        ivlan_vid;
36506         /* This value indicates the ethertype in the Ethernet header. */
36507         uint16_t        ethertype;
36508         /*
36509          * This value indicates the type of IP address.
36510          * 4 - IPv4
36511          * 6 - IPv6
36512          * All others are invalid.
36513          */
36514         uint8_t ip_addr_type;
36515         /* invalid */
36516         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
36517         /* IPv4 */
36518         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4    UINT32_C(0x4)
36519         /* IPv6 */
36520         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6    UINT32_C(0x6)
36521         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
36522                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
36523         /*
36524          * The value of protocol filed in IP header.
36525          * Applies to UDP and TCP traffic.
36526          * 6 - TCP
36527          * 17 - UDP
36528          */
36529         uint8_t ip_protocol;
36530         /* invalid */
36531         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
36532         /* TCP */
36533         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP     UINT32_C(0x6)
36534         /* UDP */
36535         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP     UINT32_C(0x11)
36536         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST \
36537                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
36538         uint8_t unused_1[2];
36539         /*
36540          * The value of source IP address to be used in filtering.
36541          * For IPv4, first four bytes represent the IP address.
36542          */
36543         uint32_t        src_ipaddr[4];
36544         /*
36545          * big_endian = True
36546          *     The value of destination IP address to be used in filtering.
36547          *     For IPv4, first four bytes represent the IP address.
36548          */
36549         uint32_t        dst_ipaddr[4];
36550         /*
36551          * The value of source port to be used in filtering.
36552          * Applies to UDP and TCP traffic.
36553          */
36554         uint16_t        src_port;
36555         /*
36556          * The value of destination port to be used in filtering.
36557          * Applies to UDP and TCP traffic.
36558          */
36559         uint16_t        dst_port;
36560         /*
36561          * If set, this value shall represent the
36562          * Logical VNIC ID of the destination VNIC for the RX
36563          * path and network port id of the destination port for
36564          * the TX path.
36565          */
36566         uint16_t        dst_id;
36567         /*
36568          * Logical VNIC ID of the VNIC where traffic is
36569          * mirrored.
36570          */
36571         uint16_t        mirror_vnic_id;
36572         /* Logical ID of the encapsulation record. */
36573         uint32_t        encap_record_id;
36574         uint8_t unused_2[4];
36575 } __rte_packed;
36576
36577 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
36578 struct hwrm_cfa_em_flow_alloc_output {
36579         /* The specific error status for the command. */
36580         uint16_t        error_code;
36581         /* The HWRM command request type. */
36582         uint16_t        req_type;
36583         /* The sequence ID from the original command. */
36584         uint16_t        seq_id;
36585         /* The length of the response data in number of bytes. */
36586         uint16_t        resp_len;
36587         /* This value is an opaque id into CFA data structures. */
36588         uint64_t        em_filter_id;
36589         /*
36590          * The flow id value in bit 0-29 is the actual ID of the flow
36591          * associated with this filter and it shall be used to match
36592          * and associate the flow identifier returned in completion
36593          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
36594          * shall indicate no valid flow id.
36595          */
36596         uint32_t        flow_id;
36597         /* Indicate the flow id value. */
36598         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
36599                 UINT32_C(0x3fffffff)
36600         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
36601         /* Indicate type of the flow. */
36602         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
36603                 UINT32_C(0x40000000)
36604         /*
36605          * If this bit set to 0, then it indicates that the flow is
36606          * internal flow.
36607          */
36608         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
36609                 (UINT32_C(0x0) << 30)
36610         /*
36611          * If this bit is set to 1, then it indicates that the flow is
36612          * external flow.
36613          */
36614         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
36615                 (UINT32_C(0x1) << 30)
36616         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
36617                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
36618         /* Indicate the flow direction. */
36619         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
36620                 UINT32_C(0x80000000)
36621         /* If this bit set to 0, then it indicates rx flow. */
36622         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
36623                 (UINT32_C(0x0) << 31)
36624         /* If this bit is set to 1, then it indicates that tx flow. */
36625         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
36626                 (UINT32_C(0x1) << 31)
36627         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
36628                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
36629         uint8_t unused_0[3];
36630         /*
36631          * This field is used in Output records to indicate that the output
36632          * is completely written to RAM. This field should be read as '1'
36633          * to indicate that the output has been completely written.
36634          * When writing a command completion or response to an internal
36635          * processor, the order of writes has to be such that this field is
36636          * written last.
36637          */
36638         uint8_t valid;
36639 } __rte_packed;
36640
36641 /*************************
36642  * hwrm_cfa_em_flow_free *
36643  *************************/
36644
36645
36646 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
36647 struct hwrm_cfa_em_flow_free_input {
36648         /* The HWRM command request type. */
36649         uint16_t        req_type;
36650         /*
36651          * The completion ring to send the completion event on. This should
36652          * be the NQ ID returned from the `nq_alloc` HWRM command.
36653          */
36654         uint16_t        cmpl_ring;
36655         /*
36656          * The sequence ID is used by the driver for tracking multiple
36657          * commands. This ID is treated as opaque data by the firmware and
36658          * the value is returned in the `hwrm_resp_hdr` upon completion.
36659          */
36660         uint16_t        seq_id;
36661         /*
36662          * The target ID of the command:
36663          * * 0x0-0xFFF8 - The function ID
36664          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36665          * * 0xFFFD - Reserved for user-space HWRM interface
36666          * * 0xFFFF - HWRM
36667          */
36668         uint16_t        target_id;
36669         /*
36670          * A physical address pointer pointing to a host buffer that the
36671          * command's response data will be written. This can be either a host
36672          * physical address (HPA) or a guest physical address (GPA) and must
36673          * point to a physically contiguous block of memory.
36674          */
36675         uint64_t        resp_addr;
36676         /* This value is an opaque id into CFA data structures. */
36677         uint64_t        em_filter_id;
36678 } __rte_packed;
36679
36680 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
36681 struct hwrm_cfa_em_flow_free_output {
36682         /* The specific error status for the command. */
36683         uint16_t        error_code;
36684         /* The HWRM command request type. */
36685         uint16_t        req_type;
36686         /* The sequence ID from the original command. */
36687         uint16_t        seq_id;
36688         /* The length of the response data in number of bytes. */
36689         uint16_t        resp_len;
36690         uint8_t unused_0[7];
36691         /*
36692          * This field is used in Output records to indicate that the output
36693          * is completely written to RAM. This field should be read as '1'
36694          * to indicate that the output has been completely written.
36695          * When writing a command completion or response to an internal
36696          * processor, the order of writes has to be such that this field is
36697          * written last.
36698          */
36699         uint8_t valid;
36700 } __rte_packed;
36701
36702 /************************
36703  * hwrm_cfa_meter_qcaps *
36704  ************************/
36705
36706
36707 /* hwrm_cfa_meter_qcaps_input (size:128b/16B) */
36708 struct hwrm_cfa_meter_qcaps_input {
36709         /* The HWRM command request type. */
36710         uint16_t        req_type;
36711         /*
36712          * The completion ring to send the completion event on. This should
36713          * be the NQ ID returned from the `nq_alloc` HWRM command.
36714          */
36715         uint16_t        cmpl_ring;
36716         /*
36717          * The sequence ID is used by the driver for tracking multiple
36718          * commands. This ID is treated as opaque data by the firmware and
36719          * the value is returned in the `hwrm_resp_hdr` upon completion.
36720          */
36721         uint16_t        seq_id;
36722         /*
36723          * The target ID of the command:
36724          * * 0x0-0xFFF8 - The function ID
36725          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36726          * * 0xFFFD - Reserved for user-space HWRM interface
36727          * * 0xFFFF - HWRM
36728          */
36729         uint16_t        target_id;
36730         /*
36731          * A physical address pointer pointing to a host buffer that the
36732          * command's response data will be written. This can be either a host
36733          * physical address (HPA) or a guest physical address (GPA) and must
36734          * point to a physically contiguous block of memory.
36735          */
36736         uint64_t        resp_addr;
36737 } __rte_packed;
36738
36739 /* hwrm_cfa_meter_qcaps_output (size:320b/40B) */
36740 struct hwrm_cfa_meter_qcaps_output {
36741         /* The specific error status for the command. */
36742         uint16_t        error_code;
36743         /* The HWRM command request type. */
36744         uint16_t        req_type;
36745         /* The sequence ID from the original command. */
36746         uint16_t        seq_id;
36747         /* The length of the response data in number of bytes. */
36748         uint16_t        resp_len;
36749         uint32_t        flags;
36750         /*
36751          * Enumeration denoting the clock at which the Meter is running
36752          * with. This enumeration is used for resources that are similar
36753          * for both TX and RX paths of the chip.
36754          */
36755         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_MASK  UINT32_C(0xf)
36756         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_SFT   0
36757         /* 375 MHz */
36758         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_375MHZ  UINT32_C(0x0)
36759         /* 625 MHz */
36760         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ  UINT32_C(0x1)
36761         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_LAST \
36762                 HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ
36763         uint8_t unused_0[4];
36764         /*
36765          * The minimum guaranteed number of tx meter profiles supported
36766          * for this function.
36767          */
36768         uint16_t        min_tx_profile;
36769         /*
36770          * The maximum non-guaranteed number of tx meter profiles supported
36771          * for this function.
36772          */
36773         uint16_t        max_tx_profile;
36774         /*
36775          * The minimum guaranteed number of rx meter profiles supported
36776          * for this function.
36777          */
36778         uint16_t        min_rx_profile;
36779         /*
36780          * The maximum non-guaranteed number of rx meter profiles supported
36781          * for this function.
36782          */
36783         uint16_t        max_rx_profile;
36784         /*
36785          * The minimum guaranteed number of tx meter instances supported
36786          * for this function.
36787          */
36788         uint16_t        min_tx_instance;
36789         /*
36790          * The maximum non-guaranteed number of tx meter instances supported
36791          * for this function.
36792          */
36793         uint16_t        max_tx_instance;
36794         /*
36795          * The minimum guaranteed number of rx meter instances supported
36796          * for this function.
36797          */
36798         uint16_t        min_rx_instance;
36799         /*
36800          * The maximum non-guaranteed number of rx meter instances supported
36801          * for this function.
36802          */
36803         uint16_t        max_rx_instance;
36804         uint8_t unused_1[7];
36805         /*
36806          * This field is used in Output records to indicate that the output
36807          * is completely written to RAM. This field should be read as '1'
36808          * to indicate that the output has been completely written.
36809          * When writing a command completion or response to an internal
36810          * processor, the order of writes has to be such that this field is
36811          * written last.
36812          */
36813         uint8_t valid;
36814 } __rte_packed;
36815
36816 /********************************
36817  * hwrm_cfa_meter_profile_alloc *
36818  ********************************/
36819
36820
36821 /* hwrm_cfa_meter_profile_alloc_input (size:320b/40B) */
36822 struct hwrm_cfa_meter_profile_alloc_input {
36823         /* The HWRM command request type. */
36824         uint16_t        req_type;
36825         /*
36826          * The completion ring to send the completion event on. This should
36827          * be the NQ ID returned from the `nq_alloc` HWRM command.
36828          */
36829         uint16_t        cmpl_ring;
36830         /*
36831          * The sequence ID is used by the driver for tracking multiple
36832          * commands. This ID is treated as opaque data by the firmware and
36833          * the value is returned in the `hwrm_resp_hdr` upon completion.
36834          */
36835         uint16_t        seq_id;
36836         /*
36837          * The target ID of the command:
36838          * * 0x0-0xFFF8 - The function ID
36839          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
36840          * * 0xFFFD - Reserved for user-space HWRM interface
36841          * * 0xFFFF - HWRM
36842          */
36843         uint16_t        target_id;
36844         /*
36845          * A physical address pointer pointing to a host buffer that the
36846          * command's response data will be written. This can be either a host
36847          * physical address (HPA) or a guest physical address (GPA) and must
36848          * point to a physically contiguous block of memory.
36849          */
36850         uint64_t        resp_addr;
36851         uint8_t flags;
36852         /*
36853          * Enumeration denoting the RX, TX type of the resource.
36854          * This enumeration is used for resources that are similar for both
36855          * TX and RX paths of the chip.
36856          */
36857         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH     UINT32_C(0x1)
36858         /* tx path */
36859         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX \
36860                 UINT32_C(0x0)
36861         /* rx path */
36862         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX \
36863                 UINT32_C(0x1)
36864         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST \
36865                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
36866         /* The meter algorithm type. */
36867         uint8_t meter_type;
36868         /* RFC 2697 (srTCM) */
36869         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 \
36870                 UINT32_C(0x0)
36871         /* RFC 2698 (trTCM) */
36872         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 \
36873                 UINT32_C(0x1)
36874         /* RFC 4115 (trTCM) */
36875         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 \
36876                 UINT32_C(0x2)
36877         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_LAST \
36878                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115
36879         /*
36880          * This field is reserved for the future use.
36881          * It shall be set to 0.
36882          */
36883         uint16_t        reserved1;
36884         /*
36885          * This field is reserved for the future use.
36886          * It shall be set to 0.
36887          */
36888         uint32_t        reserved2;
36889         /* A meter rate specified in bytes-per-second. */
36890         uint32_t        commit_rate;
36891         /* The bandwidth value. */
36892         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK \
36893                 UINT32_C(0xfffffff)
36894         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT \
36895                 0
36896         /* The granularity of the value (bits or bytes). */
36897         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE \
36898                 UINT32_C(0x10000000)
36899         /* Value is in bits. */
36900         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS \
36901                 (UINT32_C(0x0) << 28)
36902         /* Value is in bytes. */
36903         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES \
36904                 (UINT32_C(0x1) << 28)
36905         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST \
36906                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
36907         /* bw_value_unit is 3 b */
36908         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
36909                 UINT32_C(0xe0000000)
36910         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
36911                 29
36912         /* Value is in Mb or MB (base 10). */
36913         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
36914                 (UINT32_C(0x0) << 29)
36915         /* Value is in Kb or KB (base 10). */
36916         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
36917                 (UINT32_C(0x2) << 29)
36918         /* Value is in bits or bytes. */
36919         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
36920                 (UINT32_C(0x4) << 29)
36921         /* Value is in Gb or GB (base 10). */
36922         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
36923                 (UINT32_C(0x6) << 29)
36924         /* Value is in 1/100th of a percentage of total bandwidth. */
36925         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
36926                 (UINT32_C(0x1) << 29)
36927         /* Raw value */
36928         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
36929                 (UINT32_C(0x7) << 29)
36930         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
36931                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
36932         /* A meter burst size specified in bytes. */
36933         uint32_t        commit_burst;
36934         /* The bandwidth value. */
36935         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK \
36936                 UINT32_C(0xfffffff)
36937         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT \
36938                 0
36939         /* The granularity of the value (bits or bytes). */
36940         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE \
36941                 UINT32_C(0x10000000)
36942         /* Value is in bits. */
36943         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS \
36944                 (UINT32_C(0x0) << 28)
36945         /* Value is in bytes. */
36946         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES \
36947                 (UINT32_C(0x1) << 28)
36948         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST \
36949                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
36950         /* bw_value_unit is 3 b */
36951         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
36952                 UINT32_C(0xe0000000)
36953         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
36954                 29
36955         /* Value is in Mb or MB (base 10). */
36956         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
36957                 (UINT32_C(0x0) << 29)
36958         /* Value is in Kb or KB (base 10). */
36959         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
36960                 (UINT32_C(0x2) << 29)
36961         /* Value is in bits or bytes. */
36962         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
36963                 (UINT32_C(0x4) << 29)
36964         /* Value is in Gb or GB (base 10). */
36965         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
36966                 (UINT32_C(0x6) << 29)
36967         /* Value is in 1/100th of a percentage of total bandwidth. */
36968         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
36969                 (UINT32_C(0x1) << 29)
36970         /* Invalid value */
36971         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
36972                 (UINT32_C(0x7) << 29)
36973         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
36974                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
36975         /* A meter rate specified in bytes-per-second. */
36976         uint32_t        excess_peak_rate;
36977         /* The bandwidth value. */
36978         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
36979                 UINT32_C(0xfffffff)
36980         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
36981                 0
36982         /* The granularity of the value (bits or bytes). */
36983         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE \
36984                 UINT32_C(0x10000000)
36985         /* Value is in bits. */
36986         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
36987                 (UINT32_C(0x0) << 28)
36988         /* Value is in bytes. */
36989         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
36990                 (UINT32_C(0x1) << 28)
36991         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
36992                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
36993         /* bw_value_unit is 3 b */
36994         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
36995                 UINT32_C(0xe0000000)
36996         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
36997                 29
36998         /* Value is in Mb or MB (base 10). */
36999         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
37000                 (UINT32_C(0x0) << 29)
37001         /* Value is in Kb or KB (base 10). */
37002         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
37003                 (UINT32_C(0x2) << 29)
37004         /* Value is in bits or bytes. */
37005         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
37006                 (UINT32_C(0x4) << 29)
37007         /* Value is in Gb or GB (base 10). */
37008         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
37009                 (UINT32_C(0x6) << 29)
37010         /* Value is in 1/100th of a percentage of total bandwidth. */
37011         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
37012                 (UINT32_C(0x1) << 29)
37013         /* Raw unit */
37014         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
37015                 (UINT32_C(0x7) << 29)
37016         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
37017                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
37018         /* A meter burst size specified in bytes. */
37019         uint32_t        excess_peak_burst;
37020         /* The bandwidth value. */
37021         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
37022                 UINT32_C(0xfffffff)
37023         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
37024                 0
37025         /* The granularity of the value (bits or bytes). */
37026         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE \
37027                 UINT32_C(0x10000000)
37028         /* Value is in bits. */
37029         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
37030                 (UINT32_C(0x0) << 28)
37031         /* Value is in bytes. */
37032         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
37033                 (UINT32_C(0x1) << 28)
37034         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
37035                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
37036         /* bw_value_unit is 3 b */
37037         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
37038                 UINT32_C(0xe0000000)
37039         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
37040                 29
37041         /* Value is in Mb or MB (base 10). */
37042         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
37043                 (UINT32_C(0x0) << 29)
37044         /* Value is in Kb or KB (base 10). */
37045         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
37046                 (UINT32_C(0x2) << 29)
37047         /* Value is in bits or bytes. */
37048         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
37049                 (UINT32_C(0x4) << 29)
37050         /* Value is in Gb or GB (base 10). */
37051         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
37052                 (UINT32_C(0x6) << 29)
37053         /* Value is in 1/100th of a percentage of total bandwidth. */
37054         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
37055                 (UINT32_C(0x1) << 29)
37056         /* Invalid unit */
37057         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
37058                 (UINT32_C(0x7) << 29)
37059         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
37060                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
37061 } __rte_packed;
37062
37063 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
37064 struct hwrm_cfa_meter_profile_alloc_output {
37065         /* The specific error status for the command. */
37066         uint16_t        error_code;
37067         /* The HWRM command request type. */
37068         uint16_t        req_type;
37069         /* The sequence ID from the original command. */
37070         uint16_t        seq_id;
37071         /* The length of the response data in number of bytes. */
37072         uint16_t        resp_len;
37073         /* This value identifies a meter profile in CFA. */
37074         uint16_t        meter_profile_id;
37075         /*
37076          * A value of 0xfff is considered invalid and implies the
37077          * profile is not configured.
37078          */
37079         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID \
37080                 UINT32_C(0xffff)
37081         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_LAST \
37082                 HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID
37083         uint8_t unused_0[5];
37084         /*
37085          * This field is used in Output records to indicate that the output
37086          * is completely written to RAM. This field should be read as '1'
37087          * to indicate that the output has been completely written.
37088          * When writing a command completion or response to an internal
37089          * processor, the order of writes has to be such that this field is
37090          * written last.
37091          */
37092         uint8_t valid;
37093 } __rte_packed;
37094
37095 /*******************************
37096  * hwrm_cfa_meter_profile_free *
37097  *******************************/
37098
37099
37100 /* hwrm_cfa_meter_profile_free_input (size:192b/24B) */
37101 struct hwrm_cfa_meter_profile_free_input {
37102         /* The HWRM command request type. */
37103         uint16_t        req_type;
37104         /*
37105          * The completion ring to send the completion event on. This should
37106          * be the NQ ID returned from the `nq_alloc` HWRM command.
37107          */
37108         uint16_t        cmpl_ring;
37109         /*
37110          * The sequence ID is used by the driver for tracking multiple
37111          * commands. This ID is treated as opaque data by the firmware and
37112          * the value is returned in the `hwrm_resp_hdr` upon completion.
37113          */
37114         uint16_t        seq_id;
37115         /*
37116          * The target ID of the command:
37117          * * 0x0-0xFFF8 - The function ID
37118          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37119          * * 0xFFFD - Reserved for user-space HWRM interface
37120          * * 0xFFFF - HWRM
37121          */
37122         uint16_t        target_id;
37123         /*
37124          * A physical address pointer pointing to a host buffer that the
37125          * command's response data will be written. This can be either a host
37126          * physical address (HPA) or a guest physical address (GPA) and must
37127          * point to a physically contiguous block of memory.
37128          */
37129         uint64_t        resp_addr;
37130         uint8_t flags;
37131         /*
37132          * Enumeration denoting the RX, TX type of the resource.
37133          * This enumeration is used for resources that are similar for both
37134          * TX and RX paths of the chip.
37135          */
37136         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
37137         /* tx path */
37138         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX \
37139                 UINT32_C(0x0)
37140         /* rx path */
37141         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX \
37142                 UINT32_C(0x1)
37143         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST \
37144                 HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
37145         uint8_t unused_0;
37146         /* This value identifies a meter profile in CFA. */
37147         uint16_t        meter_profile_id;
37148         /*
37149          * A value of 0xfff is considered invalid and implies the
37150          * profile is not configured.
37151          */
37152         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID \
37153                 UINT32_C(0xffff)
37154         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST \
37155                 HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
37156         uint8_t unused_1[4];
37157 } __rte_packed;
37158
37159 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
37160 struct hwrm_cfa_meter_profile_free_output {
37161         /* The specific error status for the command. */
37162         uint16_t        error_code;
37163         /* The HWRM command request type. */
37164         uint16_t        req_type;
37165         /* The sequence ID from the original command. */
37166         uint16_t        seq_id;
37167         /* The length of the response data in number of bytes. */
37168         uint16_t        resp_len;
37169         uint8_t unused_0[7];
37170         /*
37171          * This field is used in Output records to indicate that the output
37172          * is completely written to RAM. This field should be read as '1'
37173          * to indicate that the output has been completely written.
37174          * When writing a command completion or response to an internal
37175          * processor, the order of writes has to be such that this field is
37176          * written last.
37177          */
37178         uint8_t valid;
37179 } __rte_packed;
37180
37181 /******************************
37182  * hwrm_cfa_meter_profile_cfg *
37183  ******************************/
37184
37185
37186 /* hwrm_cfa_meter_profile_cfg_input (size:320b/40B) */
37187 struct hwrm_cfa_meter_profile_cfg_input {
37188         /* The HWRM command request type. */
37189         uint16_t        req_type;
37190         /*
37191          * The completion ring to send the completion event on. This should
37192          * be the NQ ID returned from the `nq_alloc` HWRM command.
37193          */
37194         uint16_t        cmpl_ring;
37195         /*
37196          * The sequence ID is used by the driver for tracking multiple
37197          * commands. This ID is treated as opaque data by the firmware and
37198          * the value is returned in the `hwrm_resp_hdr` upon completion.
37199          */
37200         uint16_t        seq_id;
37201         /*
37202          * The target ID of the command:
37203          * * 0x0-0xFFF8 - The function ID
37204          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37205          * * 0xFFFD - Reserved for user-space HWRM interface
37206          * * 0xFFFF - HWRM
37207          */
37208         uint16_t        target_id;
37209         /*
37210          * A physical address pointer pointing to a host buffer that the
37211          * command's response data will be written. This can be either a host
37212          * physical address (HPA) or a guest physical address (GPA) and must
37213          * point to a physically contiguous block of memory.
37214          */
37215         uint64_t        resp_addr;
37216         uint8_t flags;
37217         /*
37218          * Enumeration denoting the RX, TX type of the resource.
37219          * This enumeration is used for resources that are similar for both
37220          * TX and RX paths of the chip.
37221          */
37222         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
37223         /* tx path */
37224         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
37225         /* rx path */
37226         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
37227         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST \
37228                 HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
37229         /* The meter algorithm type. */
37230         uint8_t meter_type;
37231         /* RFC 2697 (srTCM) */
37232         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 \
37233                 UINT32_C(0x0)
37234         /* RFC 2698 (trTCM) */
37235         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 \
37236                 UINT32_C(0x1)
37237         /* RFC 4115 (trTCM) */
37238         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 \
37239                 UINT32_C(0x2)
37240         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_LAST \
37241                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115
37242         /* This value identifies a meter profile in CFA. */
37243         uint16_t        meter_profile_id;
37244         /*
37245          * A value of 0xfff is considered invalid and implies the
37246          * profile is not configured.
37247          */
37248         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID \
37249                 UINT32_C(0xffff)
37250         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_LAST \
37251                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID
37252         /*
37253          * This field is reserved for the future use.
37254          * It shall be set to 0.
37255          */
37256         uint32_t        reserved;
37257         /* A meter rate specified in bytes-per-second. */
37258         uint32_t        commit_rate;
37259         /* The bandwidth value. */
37260         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK \
37261                 UINT32_C(0xfffffff)
37262         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT \
37263                 0
37264         /* The granularity of the value (bits or bytes). */
37265         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE \
37266                 UINT32_C(0x10000000)
37267         /* Value is in bits. */
37268         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS \
37269                 (UINT32_C(0x0) << 28)
37270         /* Value is in bytes. */
37271         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES \
37272                 (UINT32_C(0x1) << 28)
37273         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST \
37274                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
37275         /* bw_value_unit is 3 b */
37276         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
37277                 UINT32_C(0xe0000000)
37278         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
37279                 29
37280         /* Value is in Mb or MB (base 10). */
37281         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
37282                 (UINT32_C(0x0) << 29)
37283         /* Value is in Kb or KB (base 10). */
37284         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
37285                 (UINT32_C(0x2) << 29)
37286         /* Value is in bits or bytes. */
37287         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
37288                 (UINT32_C(0x4) << 29)
37289         /* Value is in Gb or GB (base 10). */
37290         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
37291                 (UINT32_C(0x6) << 29)
37292         /* Value is in 1/100th of a percentage of total bandwidth. */
37293         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
37294                 (UINT32_C(0x1) << 29)
37295         /* Raw value */
37296         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
37297                 (UINT32_C(0x7) << 29)
37298         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
37299                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
37300         /* A meter burst size specified in bytes. */
37301         uint32_t        commit_burst;
37302         /* The bandwidth value. */
37303         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK \
37304                 UINT32_C(0xfffffff)
37305         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT \
37306                 0
37307         /* The granularity of the value (bits or bytes). */
37308         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE \
37309                 UINT32_C(0x10000000)
37310         /* Value is in bits. */
37311         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS \
37312                 (UINT32_C(0x0) << 28)
37313         /* Value is in bytes. */
37314         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES \
37315                 (UINT32_C(0x1) << 28)
37316         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST \
37317                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
37318         /* bw_value_unit is 3 b */
37319         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
37320                 UINT32_C(0xe0000000)
37321         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
37322                 29
37323         /* Value is in Mb or MB (base 10). */
37324         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
37325                 (UINT32_C(0x0) << 29)
37326         /* Value is in Kb or KB (base 10). */
37327         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
37328                 (UINT32_C(0x2) << 29)
37329         /* Value is in bits or bytes. */
37330         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
37331                 (UINT32_C(0x4) << 29)
37332         /* Value is in Gb or GB (base 10). */
37333         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
37334                 (UINT32_C(0x6) << 29)
37335         /* Value is in 1/100th of a percentage of total bandwidth. */
37336         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
37337                 (UINT32_C(0x1) << 29)
37338         /* Invalid value */
37339         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
37340                 (UINT32_C(0x7) << 29)
37341         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
37342                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
37343         /* A meter rate specified in bytes-per-second. */
37344         uint32_t        excess_peak_rate;
37345         /* The bandwidth value. */
37346         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
37347                 UINT32_C(0xfffffff)
37348         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
37349                 0
37350         /* The granularity of the value (bits or bytes). */
37351         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE \
37352                 UINT32_C(0x10000000)
37353         /* Value is in bits. */
37354         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
37355                 (UINT32_C(0x0) << 28)
37356         /* Value is in bytes. */
37357         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
37358                 (UINT32_C(0x1) << 28)
37359         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
37360                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
37361         /* bw_value_unit is 3 b */
37362         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
37363                 UINT32_C(0xe0000000)
37364         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
37365                 29
37366         /* Value is in Mb or MB (base 10). */
37367         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
37368                 (UINT32_C(0x0) << 29)
37369         /* Value is in Kb or KB (base 10). */
37370         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
37371                 (UINT32_C(0x2) << 29)
37372         /* Value is in bits or bytes. */
37373         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
37374                 (UINT32_C(0x4) << 29)
37375         /* Value is in Gb or GB (base 10). */
37376         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
37377                 (UINT32_C(0x6) << 29)
37378         /* Value is in 1/100th of a percentage of total bandwidth. */
37379         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
37380                 (UINT32_C(0x1) << 29)
37381         /* Raw unit */
37382         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
37383                 (UINT32_C(0x7) << 29)
37384         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
37385                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
37386         /* A meter burst size specified in bytes. */
37387         uint32_t        excess_peak_burst;
37388         /* The bandwidth value. */
37389         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
37390                 UINT32_C(0xfffffff)
37391         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
37392                 0
37393         /* The granularity of the value (bits or bytes). */
37394         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE \
37395                 UINT32_C(0x10000000)
37396         /* Value is in bits. */
37397         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
37398                 (UINT32_C(0x0) << 28)
37399         /* Value is in bytes. */
37400         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
37401                 (UINT32_C(0x1) << 28)
37402         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
37403                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
37404         /* bw_value_unit is 3 b */
37405         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
37406                 UINT32_C(0xe0000000)
37407         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
37408                 29
37409         /* Value is in Mb or MB (base 10). */
37410         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
37411                 (UINT32_C(0x0) << 29)
37412         /* Value is in Kb or KB (base 10). */
37413         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
37414                 (UINT32_C(0x2) << 29)
37415         /* Value is in bits or bytes. */
37416         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
37417                 (UINT32_C(0x4) << 29)
37418         /* Value is in Gb or GB (base 10). */
37419         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
37420                 (UINT32_C(0x6) << 29)
37421         /* Value is in 1/100th of a percentage of total bandwidth. */
37422         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
37423                 (UINT32_C(0x1) << 29)
37424         /* Invalid unit */
37425         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
37426                 (UINT32_C(0x7) << 29)
37427         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
37428                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
37429 } __rte_packed;
37430
37431 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
37432 struct hwrm_cfa_meter_profile_cfg_output {
37433         /* The specific error status for the command. */
37434         uint16_t        error_code;
37435         /* The HWRM command request type. */
37436         uint16_t        req_type;
37437         /* The sequence ID from the original command. */
37438         uint16_t        seq_id;
37439         /* The length of the response data in number of bytes. */
37440         uint16_t        resp_len;
37441         uint8_t unused_0[7];
37442         /*
37443          * This field is used in Output records to indicate that the output
37444          * is completely written to RAM. This field should be read as '1'
37445          * to indicate that the output has been completely written.
37446          * When writing a command completion or response to an internal
37447          * processor, the order of writes has to be such that this field is
37448          * written last.
37449          */
37450         uint8_t valid;
37451 } __rte_packed;
37452
37453 /*********************************
37454  * hwrm_cfa_meter_instance_alloc *
37455  *********************************/
37456
37457
37458 /* hwrm_cfa_meter_instance_alloc_input (size:192b/24B) */
37459 struct hwrm_cfa_meter_instance_alloc_input {
37460         /* The HWRM command request type. */
37461         uint16_t        req_type;
37462         /*
37463          * The completion ring to send the completion event on. This should
37464          * be the NQ ID returned from the `nq_alloc` HWRM command.
37465          */
37466         uint16_t        cmpl_ring;
37467         /*
37468          * The sequence ID is used by the driver for tracking multiple
37469          * commands. This ID is treated as opaque data by the firmware and
37470          * the value is returned in the `hwrm_resp_hdr` upon completion.
37471          */
37472         uint16_t        seq_id;
37473         /*
37474          * The target ID of the command:
37475          * * 0x0-0xFFF8 - The function ID
37476          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37477          * * 0xFFFD - Reserved for user-space HWRM interface
37478          * * 0xFFFF - HWRM
37479          */
37480         uint16_t        target_id;
37481         /*
37482          * A physical address pointer pointing to a host buffer that the
37483          * command's response data will be written. This can be either a host
37484          * physical address (HPA) or a guest physical address (GPA) and must
37485          * point to a physically contiguous block of memory.
37486          */
37487         uint64_t        resp_addr;
37488         uint8_t flags;
37489         /*
37490          * Enumeration denoting the RX, TX type of the resource.
37491          * This enumeration is used for resources that are similar for both
37492          * TX and RX paths of the chip.
37493          */
37494         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH \
37495                 UINT32_C(0x1)
37496         /* tx path */
37497         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX \
37498                 UINT32_C(0x0)
37499         /* rx path */
37500         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX \
37501                 UINT32_C(0x1)
37502         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST \
37503                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
37504         uint8_t unused_0;
37505         /* This value identifies a meter profile in CFA. */
37506         uint16_t        meter_profile_id;
37507         /*
37508          * A value of 0xffff is considered invalid and implies the
37509          * profile is not configured.
37510          */
37511         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID \
37512                 UINT32_C(0xffff)
37513         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST \
37514                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
37515         uint8_t unused_1[4];
37516 } __rte_packed;
37517
37518 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
37519 struct hwrm_cfa_meter_instance_alloc_output {
37520         /* The specific error status for the command. */
37521         uint16_t        error_code;
37522         /* The HWRM command request type. */
37523         uint16_t        req_type;
37524         /* The sequence ID from the original command. */
37525         uint16_t        seq_id;
37526         /* The length of the response data in number of bytes. */
37527         uint16_t        resp_len;
37528         /* This value identifies a meter instance in CFA. */
37529         uint16_t        meter_instance_id;
37530         /*
37531          * A value of 0xffff is considered invalid and implies the
37532          * instance is not configured.
37533          */
37534         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID \
37535                 UINT32_C(0xffff)
37536         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_LAST \
37537                 HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID
37538         uint8_t unused_0[5];
37539         /*
37540          * This field is used in Output records to indicate that the output
37541          * is completely written to RAM. This field should be read as '1'
37542          * to indicate that the output has been completely written.
37543          * When writing a command completion or response to an internal
37544          * processor, the order of writes has to be such that this field is
37545          * written last.
37546          */
37547         uint8_t valid;
37548 } __rte_packed;
37549
37550 /*******************************
37551  * hwrm_cfa_meter_instance_cfg *
37552  *******************************/
37553
37554
37555 /* hwrm_cfa_meter_instance_cfg_input (size:192b/24B) */
37556 struct hwrm_cfa_meter_instance_cfg_input {
37557         /* The HWRM command request type. */
37558         uint16_t        req_type;
37559         /*
37560          * The completion ring to send the completion event on. This should
37561          * be the NQ ID returned from the `nq_alloc` HWRM command.
37562          */
37563         uint16_t        cmpl_ring;
37564         /*
37565          * The sequence ID is used by the driver for tracking multiple
37566          * commands. This ID is treated as opaque data by the firmware and
37567          * the value is returned in the `hwrm_resp_hdr` upon completion.
37568          */
37569         uint16_t        seq_id;
37570         /*
37571          * The target ID of the command:
37572          * * 0x0-0xFFF8 - The function ID
37573          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37574          * * 0xFFFD - Reserved for user-space HWRM interface
37575          * * 0xFFFF - HWRM
37576          */
37577         uint16_t        target_id;
37578         /*
37579          * A physical address pointer pointing to a host buffer that the
37580          * command's response data will be written. This can be either a host
37581          * physical address (HPA) or a guest physical address (GPA) and must
37582          * point to a physically contiguous block of memory.
37583          */
37584         uint64_t        resp_addr;
37585         uint8_t flags;
37586         /*
37587          * Enumeration denoting the RX, TX type of the resource.
37588          * This enumeration is used for resources that are similar for both
37589          * TX and RX paths of the chip.
37590          */
37591         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
37592         /* tx path */
37593         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_TX \
37594                 UINT32_C(0x0)
37595         /* rx path */
37596         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX \
37597                 UINT32_C(0x1)
37598         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_LAST \
37599                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX
37600         uint8_t unused_0;
37601         /*
37602          * This value identifies a new meter profile to be associated with
37603          * the meter instance specified in this command.
37604          */
37605         uint16_t        meter_profile_id;
37606         /*
37607          * A value of 0xffff is considered invalid and implies the
37608          * profile is not configured.
37609          */
37610         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID \
37611                 UINT32_C(0xffff)
37612         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_LAST \
37613                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID
37614         /*
37615          * This value identifies the ID of a meter instance that needs to be
37616          * updated with a new meter profile specified in this command.
37617          */
37618         uint16_t        meter_instance_id;
37619         uint8_t unused_1[2];
37620 } __rte_packed;
37621
37622 /* hwrm_cfa_meter_instance_cfg_output (size:128b/16B) */
37623 struct hwrm_cfa_meter_instance_cfg_output {
37624         /* The specific error status for the command. */
37625         uint16_t        error_code;
37626         /* The HWRM command request type. */
37627         uint16_t        req_type;
37628         /* The sequence ID from the original command. */
37629         uint16_t        seq_id;
37630         /* The length of the response data in number of bytes. */
37631         uint16_t        resp_len;
37632         uint8_t unused_0[7];
37633         /*
37634          * This field is used in Output records to indicate that the output
37635          * is completely written to RAM. This field should be read as '1'
37636          * to indicate that the output has been completely written.
37637          * When writing a command completion or response to an internal
37638          * processor, the order of writes has to be such that this field is
37639          * written last.
37640          */
37641         uint8_t valid;
37642 } __rte_packed;
37643
37644 /********************************
37645  * hwrm_cfa_meter_instance_free *
37646  ********************************/
37647
37648
37649 /* hwrm_cfa_meter_instance_free_input (size:192b/24B) */
37650 struct hwrm_cfa_meter_instance_free_input {
37651         /* The HWRM command request type. */
37652         uint16_t        req_type;
37653         /*
37654          * The completion ring to send the completion event on. This should
37655          * be the NQ ID returned from the `nq_alloc` HWRM command.
37656          */
37657         uint16_t        cmpl_ring;
37658         /*
37659          * The sequence ID is used by the driver for tracking multiple
37660          * commands. This ID is treated as opaque data by the firmware and
37661          * the value is returned in the `hwrm_resp_hdr` upon completion.
37662          */
37663         uint16_t        seq_id;
37664         /*
37665          * The target ID of the command:
37666          * * 0x0-0xFFF8 - The function ID
37667          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37668          * * 0xFFFD - Reserved for user-space HWRM interface
37669          * * 0xFFFF - HWRM
37670          */
37671         uint16_t        target_id;
37672         /*
37673          * A physical address pointer pointing to a host buffer that the
37674          * command's response data will be written. This can be either a host
37675          * physical address (HPA) or a guest physical address (GPA) and must
37676          * point to a physically contiguous block of memory.
37677          */
37678         uint64_t        resp_addr;
37679         uint8_t flags;
37680         /*
37681          * Enumeration denoting the RX, TX type of the resource.
37682          * This enumeration is used for resources that are similar for both
37683          * TX and RX paths of the chip.
37684          */
37685         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
37686         /* tx path */
37687         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX \
37688                 UINT32_C(0x0)
37689         /* rx path */
37690         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX \
37691                 UINT32_C(0x1)
37692         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST \
37693                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
37694         uint8_t unused_0;
37695         /* This value identifies a meter instance in CFA. */
37696         uint16_t        meter_instance_id;
37697         /*
37698          * A value of 0xfff is considered invalid and implies the
37699          * instance is not configured.
37700          */
37701         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID \
37702                 UINT32_C(0xffff)
37703         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST \
37704                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
37705         uint8_t unused_1[4];
37706 } __rte_packed;
37707
37708 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
37709 struct hwrm_cfa_meter_instance_free_output {
37710         /* The specific error status for the command. */
37711         uint16_t        error_code;
37712         /* The HWRM command request type. */
37713         uint16_t        req_type;
37714         /* The sequence ID from the original command. */
37715         uint16_t        seq_id;
37716         /* The length of the response data in number of bytes. */
37717         uint16_t        resp_len;
37718         uint8_t unused_0[7];
37719         /*
37720          * This field is used in Output records to indicate that the output
37721          * is completely written to RAM. This field should be read as '1'
37722          * to indicate that the output has been completely written.
37723          * When writing a command completion or response to an internal
37724          * processor, the order of writes has to be such that this field is
37725          * written last.
37726          */
37727         uint8_t valid;
37728 } __rte_packed;
37729
37730 /*******************************
37731  * hwrm_cfa_decap_filter_alloc *
37732  *******************************/
37733
37734
37735 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */
37736 struct hwrm_cfa_decap_filter_alloc_input {
37737         /* The HWRM command request type. */
37738         uint16_t        req_type;
37739         /*
37740          * The completion ring to send the completion event on. This should
37741          * be the NQ ID returned from the `nq_alloc` HWRM command.
37742          */
37743         uint16_t        cmpl_ring;
37744         /*
37745          * The sequence ID is used by the driver for tracking multiple
37746          * commands. This ID is treated as opaque data by the firmware and
37747          * the value is returned in the `hwrm_resp_hdr` upon completion.
37748          */
37749         uint16_t        seq_id;
37750         /*
37751          * The target ID of the command:
37752          * * 0x0-0xFFF8 - The function ID
37753          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
37754          * * 0xFFFD - Reserved for user-space HWRM interface
37755          * * 0xFFFF - HWRM
37756          */
37757         uint16_t        target_id;
37758         /*
37759          * A physical address pointer pointing to a host buffer that the
37760          * command's response data will be written. This can be either a host
37761          * physical address (HPA) or a guest physical address (GPA) and must
37762          * point to a physically contiguous block of memory.
37763          */
37764         uint64_t        resp_addr;
37765         uint32_t        flags;
37766         /* ovs_tunnel is 1 b */
37767         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL \
37768                 UINT32_C(0x1)
37769         uint32_t        enables;
37770         /*
37771          * This bit must be '1' for the tunnel_type field to be
37772          * configured.
37773          */
37774         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
37775                 UINT32_C(0x1)
37776         /*
37777          * This bit must be '1' for the tunnel_id field to be
37778          * configured.
37779          */
37780         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID \
37781                 UINT32_C(0x2)
37782         /*
37783          * This bit must be '1' for the src_macaddr field to be
37784          * configured.
37785          */
37786         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
37787                 UINT32_C(0x4)
37788         /*
37789          * This bit must be '1' for the dst_macaddr field to be
37790          * configured.
37791          */
37792         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
37793                 UINT32_C(0x8)
37794         /*
37795          * This bit must be '1' for the ovlan_vid field to be
37796          * configured.
37797          */
37798         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID \
37799                 UINT32_C(0x10)
37800         /*
37801          * This bit must be '1' for the ivlan_vid field to be
37802          * configured.
37803          */
37804         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID \
37805                 UINT32_C(0x20)
37806         /*
37807          * This bit must be '1' for the t_ovlan_vid field to be
37808          * configured.
37809          */
37810         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID \
37811                 UINT32_C(0x40)
37812         /*
37813          * This bit must be '1' for the t_ivlan_vid field to be
37814          * configured.
37815          */
37816         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID \
37817                 UINT32_C(0x80)
37818         /*
37819          * This bit must be '1' for the ethertype field to be
37820          * configured.
37821          */
37822         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
37823                 UINT32_C(0x100)
37824         /*
37825          * This bit must be '1' for the src_ipaddr field to be
37826          * configured.
37827          */
37828         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
37829                 UINT32_C(0x200)
37830         /*
37831          * This bit must be '1' for the dst_ipaddr field to be
37832          * configured.
37833          */
37834         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
37835                 UINT32_C(0x400)
37836         /*
37837          * This bit must be '1' for the ipaddr_type field to be
37838          * configured.
37839          */
37840         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
37841                 UINT32_C(0x800)
37842         /*
37843          * This bit must be '1' for the ip_protocol field to be
37844          * configured.
37845          */
37846         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
37847                 UINT32_C(0x1000)
37848         /*
37849          * This bit must be '1' for the src_port field to be
37850          * configured.
37851          */
37852         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
37853                 UINT32_C(0x2000)
37854         /*
37855          * This bit must be '1' for the dst_port field to be
37856          * configured.
37857          */
37858         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
37859                 UINT32_C(0x4000)
37860         /*
37861          * This bit must be '1' for the dst_id field to be
37862          * configured.
37863          */
37864         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
37865                 UINT32_C(0x8000)
37866         /*
37867          * This bit must be '1' for the mirror_vnic_id field to be
37868          * configured.
37869          */
37870         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
37871                 UINT32_C(0x10000)
37872         /*
37873          * Tunnel identifier.
37874          * Virtual Network Identifier (VNI). Only valid with
37875          * tunnel_types VXLAN, NVGRE, and Geneve.
37876          * Only lower 24-bits of VNI field are used
37877          * in setting up the filter.
37878          */
37879         uint32_t        tunnel_id;
37880         /* Tunnel Type. */
37881         uint8_t tunnel_type;
37882         /* Non-tunnel */
37883         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
37884                 UINT32_C(0x0)
37885         /* Virtual eXtensible Local Area Network (VXLAN) */
37886         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
37887                 UINT32_C(0x1)
37888         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
37889         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
37890                 UINT32_C(0x2)
37891         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
37892         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
37893                 UINT32_C(0x3)
37894         /* IP in IP */
37895         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
37896                 UINT32_C(0x4)
37897         /* Generic Network Virtualization Encapsulation (Geneve) */
37898         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
37899                 UINT32_C(0x5)
37900         /* Multi-Protocol Label Switching (MPLS) */
37901         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
37902                 UINT32_C(0x6)
37903         /* Stateless Transport Tunnel (STT) */
37904         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
37905                 UINT32_C(0x7)
37906         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
37907         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
37908                 UINT32_C(0x8)
37909         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
37910         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
37911                 UINT32_C(0x9)
37912         /*
37913          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
37914          * datagram payload
37915          */
37916         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
37917                 UINT32_C(0xa)
37918         /* Use fixed layer 2 ether type of 0xFFFF */
37919         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
37920                 UINT32_C(0xb)
37921         /*
37922          * IPV6 over virtual eXtensible Local Area Network with GPE header
37923          * (IPV6oVXLANGPE)
37924          */
37925         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
37926                 UINT32_C(0xc)
37927         /* Any tunneled traffic */
37928         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
37929                 UINT32_C(0xff)
37930         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
37931                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
37932         uint8_t unused_0;
37933         uint16_t        unused_1;
37934         /*
37935          * This value indicates the source MAC address in
37936          * the Ethernet header.
37937          */
37938         uint8_t src_macaddr[6];
37939         uint8_t unused_2[2];
37940         /*
37941          * This value indicates the destination MAC address in
37942          * the Ethernet header.
37943          */
37944         uint8_t dst_macaddr[6];
37945         /*
37946          * This value indicates the VLAN ID of the outer VLAN tag
37947          * in the Ethernet header.
37948          */
37949         uint16_t        ovlan_vid;
37950         /*
37951          * This value indicates the VLAN ID of the inner VLAN tag
37952          * in the Ethernet header.
37953          */
37954         uint16_t        ivlan_vid;
37955         /*
37956          * This value indicates the VLAN ID of the outer VLAN tag
37957          * in the tunnel Ethernet header.
37958          */
37959         uint16_t        t_ovlan_vid;
37960         /*
37961          * This value indicates the VLAN ID of the inner VLAN tag
37962          * in the tunnel Ethernet header.
37963          */
37964         uint16_t        t_ivlan_vid;
37965         /* This value indicates the ethertype in the Ethernet header. */
37966         uint16_t        ethertype;
37967         /*
37968          * This value indicates the type of IP address.
37969          * 4 - IPv4
37970          * 6 - IPv6
37971          * All others are invalid.
37972          */
37973         uint8_t ip_addr_type;
37974         /* invalid */
37975         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
37976                 UINT32_C(0x0)
37977         /* IPv4 */
37978         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
37979                 UINT32_C(0x4)
37980         /* IPv6 */
37981         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
37982                 UINT32_C(0x6)
37983         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
37984                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
37985         /*
37986          * The value of protocol filed in IP header.
37987          * Applies to UDP and TCP traffic.
37988          * 6 - TCP
37989          * 17 - UDP
37990          */
37991         uint8_t ip_protocol;
37992         /* invalid */
37993         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
37994                 UINT32_C(0x0)
37995         /* TCP */
37996         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
37997                 UINT32_C(0x6)
37998         /* UDP */
37999         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
38000                 UINT32_C(0x11)
38001         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
38002                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
38003         uint16_t        unused_3;
38004         uint32_t        unused_4;
38005         /*
38006          * The value of source IP address to be used in filtering.
38007          * For IPv4, first four bytes represent the IP address.
38008          */
38009         uint32_t        src_ipaddr[4];
38010         /*
38011          * The value of destination IP address to be used in filtering.
38012          * For IPv4, first four bytes represent the IP address.
38013          */
38014         uint32_t        dst_ipaddr[4];
38015         /*
38016          * The value of source port to be used in filtering.
38017          * Applies to UDP and TCP traffic.
38018          */
38019         uint16_t        src_port;
38020         /*
38021          * The value of destination port to be used in filtering.
38022          * Applies to UDP and TCP traffic.
38023          */
38024         uint16_t        dst_port;
38025         /*
38026          * If set, this value shall represent the
38027          * Logical VNIC ID of the destination VNIC for the RX
38028          * path.
38029          */
38030         uint16_t        dst_id;
38031         /*
38032          * If set, this value shall represent the L2 context that matches the
38033          * L2 information of the decap filter.
38034          */
38035         uint16_t        l2_ctxt_ref_id;
38036 } __rte_packed;
38037
38038 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
38039 struct hwrm_cfa_decap_filter_alloc_output {
38040         /* The specific error status for the command. */
38041         uint16_t        error_code;
38042         /* The HWRM command request type. */
38043         uint16_t        req_type;
38044         /* The sequence ID from the original command. */
38045         uint16_t        seq_id;
38046         /* The length of the response data in number of bytes. */
38047         uint16_t        resp_len;
38048         /* This value is an opaque id into CFA data structures. */
38049         uint32_t        decap_filter_id;
38050         uint8_t unused_0[3];
38051         /*
38052          * This field is used in Output records to indicate that the output
38053          * is completely written to RAM. This field should be read as '1'
38054          * to indicate that the output has been completely written.
38055          * When writing a command completion or response to an internal
38056          * processor, the order of writes has to be such that this field is
38057          * written last.
38058          */
38059         uint8_t valid;
38060 } __rte_packed;
38061
38062 /******************************
38063  * hwrm_cfa_decap_filter_free *
38064  ******************************/
38065
38066
38067 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */
38068 struct hwrm_cfa_decap_filter_free_input {
38069         /* The HWRM command request type. */
38070         uint16_t        req_type;
38071         /*
38072          * The completion ring to send the completion event on. This should
38073          * be the NQ ID returned from the `nq_alloc` HWRM command.
38074          */
38075         uint16_t        cmpl_ring;
38076         /*
38077          * The sequence ID is used by the driver for tracking multiple
38078          * commands. This ID is treated as opaque data by the firmware and
38079          * the value is returned in the `hwrm_resp_hdr` upon completion.
38080          */
38081         uint16_t        seq_id;
38082         /*
38083          * The target ID of the command:
38084          * * 0x0-0xFFF8 - The function ID
38085          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38086          * * 0xFFFD - Reserved for user-space HWRM interface
38087          * * 0xFFFF - HWRM
38088          */
38089         uint16_t        target_id;
38090         /*
38091          * A physical address pointer pointing to a host buffer that the
38092          * command's response data will be written. This can be either a host
38093          * physical address (HPA) or a guest physical address (GPA) and must
38094          * point to a physically contiguous block of memory.
38095          */
38096         uint64_t        resp_addr;
38097         /* This value is an opaque id into CFA data structures. */
38098         uint32_t        decap_filter_id;
38099         uint8_t unused_0[4];
38100 } __rte_packed;
38101
38102 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
38103 struct hwrm_cfa_decap_filter_free_output {
38104         /* The specific error status for the command. */
38105         uint16_t        error_code;
38106         /* The HWRM command request type. */
38107         uint16_t        req_type;
38108         /* The sequence ID from the original command. */
38109         uint16_t        seq_id;
38110         /* The length of the response data in number of bytes. */
38111         uint16_t        resp_len;
38112         uint8_t unused_0[7];
38113         /*
38114          * This field is used in Output records to indicate that the output
38115          * is completely written to RAM. This field should be read as '1'
38116          * to indicate that the output has been completely written.
38117          * When writing a command completion or response to an internal
38118          * processor, the order of writes has to be such that this field is
38119          * written last.
38120          */
38121         uint8_t valid;
38122 } __rte_packed;
38123
38124 /***********************
38125  * hwrm_cfa_flow_alloc *
38126  ***********************/
38127
38128
38129 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */
38130 struct hwrm_cfa_flow_alloc_input {
38131         /* The HWRM command request type. */
38132         uint16_t        req_type;
38133         /*
38134          * The completion ring to send the completion event on. This should
38135          * be the NQ ID returned from the `nq_alloc` HWRM command.
38136          */
38137         uint16_t        cmpl_ring;
38138         /*
38139          * The sequence ID is used by the driver for tracking multiple
38140          * commands. This ID is treated as opaque data by the firmware and
38141          * the value is returned in the `hwrm_resp_hdr` upon completion.
38142          */
38143         uint16_t        seq_id;
38144         /*
38145          * The target ID of the command:
38146          * * 0x0-0xFFF8 - The function ID
38147          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38148          * * 0xFFFD - Reserved for user-space HWRM interface
38149          * * 0xFFFF - HWRM
38150          */
38151         uint16_t        target_id;
38152         /*
38153          * A physical address pointer pointing to a host buffer that the
38154          * command's response data will be written. This can be either a host
38155          * physical address (HPA) or a guest physical address (GPA) and must
38156          * point to a physically contiguous block of memory.
38157          */
38158         uint64_t        resp_addr;
38159         uint16_t        flags;
38160         /* tunnel is 1 b */
38161         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL \
38162                 UINT32_C(0x1)
38163         /* num_vlan is 2 b */
38164         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK \
38165                 UINT32_C(0x6)
38166         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT           1
38167         /* no tags */
38168         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE \
38169                 (UINT32_C(0x0) << 1)
38170         /* 1 tag */
38171         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE \
38172                 (UINT32_C(0x1) << 1)
38173         /* 2 tags */
38174         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO \
38175                 (UINT32_C(0x2) << 1)
38176         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST \
38177                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
38178         /* Enumeration denoting the Flow Type. */
38179         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK \
38180                 UINT32_C(0x38)
38181         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT           3
38182         /* L2 flow */
38183         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2 \
38184                 (UINT32_C(0x0) << 3)
38185         /* IPV4 flow */
38186         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4 \
38187                 (UINT32_C(0x1) << 3)
38188         /* IPV6 flow */
38189         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6 \
38190                 (UINT32_C(0x2) << 3)
38191         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST \
38192                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
38193         /*
38194          * when set to 1, indicates TX flow offload for function specified
38195          * in src_fid and the dst_fid should be set to invalid value. To
38196          * indicate a VM to VM flow, both of the path_tx and path_rx flags
38197          * need to be set. For virtio vSwitch offload case, the src_fid and
38198          * dst_fid is set to the same fid value. For the SRIOV vSwitch
38199          * offload case, the src_fid and dst_fid must be set to the same VF
38200          * FID belong to the children VFs of the same PF to indicate VM to
38201          * VM flow.
38202          */
38203         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX \
38204                 UINT32_C(0x40)
38205         /*
38206          * when set to 1, indicates RX flow offload for function specified
38207          * in dst_fid and the src_fid should be set to invalid value.
38208          */
38209         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX \
38210                 UINT32_C(0x80)
38211         /*
38212          * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan
38213          * header is required and the VXLAN VNI value is stored in the first
38214          * 24 bits of the dmac field. This flag is only valid when the flow
38215          * direction is RX.
38216          */
38217         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI \
38218                 UINT32_C(0x100)
38219         /*
38220          * Set to 1 to indicate vhost_id is specified in the outer_vlan_tci
38221          * field.
38222          */
38223         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_VHOST_ID_USE_VLAN \
38224                 UINT32_C(0x200)
38225         /*
38226          * Tx Flow: vf fid.
38227          * Rx Flow: pf fid.
38228          */
38229         uint16_t        src_fid;
38230         /* Tunnel handle valid when tunnel flag is set. */
38231         uint32_t        tunnel_handle;
38232         uint16_t        action_flags;
38233         /*
38234          * Setting of this flag indicates drop action. If this flag is not
38235          * set, then it should be considered accept action.
38236          */
38237         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD \
38238                 UINT32_C(0x1)
38239         /* recycle is 1 b */
38240         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE \
38241                 UINT32_C(0x2)
38242         /*
38243          * Setting of this flag indicates drop action. If this flag is not
38244          * set, then it should be considered accept action.
38245          */
38246         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP \
38247                 UINT32_C(0x4)
38248         /* meter is 1 b */
38249         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER \
38250                 UINT32_C(0x8)
38251         /* tunnel is 1 b */
38252         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL \
38253                 UINT32_C(0x10)
38254         /* nat_src is 1 b */
38255         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC \
38256                 UINT32_C(0x20)
38257         /* nat_dest is 1 b */
38258         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST \
38259                 UINT32_C(0x40)
38260         /* nat_ipv4_address is 1 b */
38261         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS \
38262                 UINT32_C(0x80)
38263         /* l2_header_rewrite is 1 b */
38264         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE \
38265                 UINT32_C(0x100)
38266         /* ttl_decrement is 1 b */
38267         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT \
38268                 UINT32_C(0x200)
38269         /*
38270          * If set to 1 and flow direction is TX, it indicates decap of L2
38271          * header and encap of tunnel header. If set to 1 and flow direction
38272          * is RX, it indicates decap of tunnel header and encap L2 header.
38273          * The type of tunnel is specified in the tunnel_type field.
38274          */
38275         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP \
38276                 UINT32_C(0x400)
38277         /* If set to 1, flow aging is enabled for this flow. */
38278         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FLOW_AGING_ENABLED \
38279                 UINT32_C(0x800)
38280         /*
38281          * If set to 1 an attempt will be made to try to offload this flow
38282          * to the most optimal flow table resource. If set to 0, the flow
38283          * will be placed to the default flow table resource.
38284          */
38285         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_PRI_HINT \
38286                 UINT32_C(0x1000)
38287         /*
38288          * If set to 1 there will be no attempt to allocate an on-chip try
38289          * to offload this flow. If set to 0, which will keep compatibility
38290          * with the older drivers, will cause the FW to attempt to allocate
38291          * an on-chip flow counter for the newly created flow. This will
38292          * keep the existing behavior with EM flows which always had an
38293          * associated flow counter.
38294          */
38295         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NO_FLOW_COUNTER_ALLOC \
38296                 UINT32_C(0x2000)
38297         /*
38298          * Tx Flow: pf or vf fid.
38299          * Rx Flow: vf fid.
38300          */
38301         uint16_t        dst_fid;
38302         /* VLAN tpid, valid when push_vlan flag is set. */
38303         uint16_t        l2_rewrite_vlan_tpid;
38304         /* VLAN tci, valid when push_vlan flag is set. */
38305         uint16_t        l2_rewrite_vlan_tci;
38306         /* Meter id, valid when meter flag is set. */
38307         uint16_t        act_meter_id;
38308         /* Flow with the same l2 context tcam key. */
38309         uint16_t        ref_flow_handle;
38310         /* This value sets the match value for the ethertype. */
38311         uint16_t        ethertype;
38312         /* valid when num tags is 1 or 2. */
38313         uint16_t        outer_vlan_tci;
38314         /* This value sets the match value for the Destination MAC address. */
38315         uint16_t        dmac[3];
38316         /* valid when num tags is 2. */
38317         uint16_t        inner_vlan_tci;
38318         /* This value sets the match value for the Source MAC address. */
38319         uint16_t        smac[3];
38320         /* The bit length of destination IP address mask. */
38321         uint8_t ip_dst_mask_len;
38322         /* The bit length of source IP address mask. */
38323         uint8_t ip_src_mask_len;
38324         /* The value of destination IPv4/IPv6 address. */
38325         uint32_t        ip_dst[4];
38326         /* The source IPv4/IPv6 address. */
38327         uint32_t        ip_src[4];
38328         /*
38329          * The value of source port.
38330          * Applies to UDP and TCP traffic.
38331          */
38332         uint16_t        l4_src_port;
38333         /*
38334          * The value of source port mask.
38335          * Applies to UDP and TCP traffic.
38336          */
38337         uint16_t        l4_src_port_mask;
38338         /*
38339          * The value of destination port.
38340          * Applies to UDP and TCP traffic.
38341          */
38342         uint16_t        l4_dst_port;
38343         /*
38344          * The value of destination port mask.
38345          * Applies to UDP and TCP traffic.
38346          */
38347         uint16_t        l4_dst_port_mask;
38348         /*
38349          * NAT IPv4/6 address based on address type flag.
38350          * 0 values are ignored.
38351          */
38352         uint32_t        nat_ip_address[4];
38353         /* L2 header re-write Destination MAC address. */
38354         uint16_t        l2_rewrite_dmac[3];
38355         /*
38356          * The NAT source/destination port based on direction flag.
38357          * Applies to UDP and TCP traffic.
38358          * 0 values are ignored.
38359          */
38360         uint16_t        nat_port;
38361         /* L2 header re-write Source MAC address. */
38362         uint16_t        l2_rewrite_smac[3];
38363         /* The value of ip protocol. */
38364         uint8_t ip_proto;
38365         /* Tunnel Type. */
38366         uint8_t tunnel_type;
38367         /* Non-tunnel */
38368         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
38369                 UINT32_C(0x0)
38370         /* Virtual eXtensible Local Area Network (VXLAN) */
38371         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
38372                 UINT32_C(0x1)
38373         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
38374         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
38375                 UINT32_C(0x2)
38376         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
38377         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
38378                 UINT32_C(0x3)
38379         /* IP in IP */
38380         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
38381                 UINT32_C(0x4)
38382         /* Generic Network Virtualization Encapsulation (Geneve) */
38383         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
38384                 UINT32_C(0x5)
38385         /* Multi-Protocol Label Switching (MPLS) */
38386         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
38387                 UINT32_C(0x6)
38388         /* Stateless Transport Tunnel (STT) */
38389         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
38390                 UINT32_C(0x7)
38391         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
38392         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
38393                 UINT32_C(0x8)
38394         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
38395         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
38396                 UINT32_C(0x9)
38397         /*
38398          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
38399          * datagram payload
38400          */
38401         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
38402                 UINT32_C(0xa)
38403         /* Use fixed layer 2 ether type of 0xFFFF */
38404         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
38405                 UINT32_C(0xb)
38406         /*
38407          * IPV6 over virtual eXtensible Local Area Network with GPE header
38408          * (IPV6oVXLANGPE)
38409          */
38410         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
38411                 UINT32_C(0xc)
38412         /* Any tunneled traffic */
38413         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
38414                 UINT32_C(0xff)
38415         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
38416                 HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
38417 } __rte_packed;
38418
38419 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
38420 struct hwrm_cfa_flow_alloc_output {
38421         /* The specific error status for the command. */
38422         uint16_t        error_code;
38423         /* The HWRM command request type. */
38424         uint16_t        req_type;
38425         /* The sequence ID from the original command. */
38426         uint16_t        seq_id;
38427         /* The length of the response data in number of bytes. */
38428         uint16_t        resp_len;
38429         /* Flow record index. */
38430         uint16_t        flow_handle;
38431         uint8_t unused_0[2];
38432         /*
38433          * The flow id value in bit 0-29 is the actual ID of the flow
38434          * associated with this filter and it shall be used to match
38435          * and associate the flow identifier returned in completion
38436          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
38437          * shall indicate no valid flow id.
38438          */
38439         uint32_t        flow_id;
38440         /* Indicate the flow id value. */
38441         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
38442                 UINT32_C(0x3fffffff)
38443         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
38444         /* Indicate type of the flow. */
38445         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
38446                 UINT32_C(0x40000000)
38447         /*
38448          * If this bit set to 0, then it indicates that the flow is
38449          * internal flow.
38450          */
38451         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
38452                 (UINT32_C(0x0) << 30)
38453         /*
38454          * If this bit is set to 1, then it indicates that the flow is
38455          * external flow.
38456          */
38457         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
38458                 (UINT32_C(0x1) << 30)
38459         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
38460                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
38461         /* Indicate the flow direction. */
38462         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
38463                 UINT32_C(0x80000000)
38464         /* If this bit set to 0, then it indicates rx flow. */
38465         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
38466                 (UINT32_C(0x0) << 31)
38467         /* If this bit is set to 1, then it indicates that tx flow. */
38468         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
38469                 (UINT32_C(0x1) << 31)
38470         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
38471                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
38472         /* This value identifies a set of CFA data structures used for a flow. */
38473         uint64_t        ext_flow_handle;
38474         uint32_t        flow_counter_id;
38475         uint8_t unused_1[3];
38476         /*
38477          * This field is used in Output records to indicate that the output
38478          * is completely written to RAM. This field should be read as '1'
38479          * to indicate that the output has been completely written.
38480          * When writing a command completion or response to an internal
38481          * processor, the order of writes has to be such that this field is
38482          * written last.
38483          */
38484         uint8_t valid;
38485 } __rte_packed;
38486
38487 /* hwrm_cfa_flow_alloc_cmd_err (size:64b/8B) */
38488 struct hwrm_cfa_flow_alloc_cmd_err {
38489         /*
38490          * command specific error codes that goes to
38491          * the cmd_err field in Common HWRM Error Response.
38492          */
38493         uint8_t code;
38494         /* Unknown error */
38495         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_UNKNOWN         UINT32_C(0x0)
38496         /* No more L2 Context TCAM */
38497         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_L2_CONTEXT_TCAM UINT32_C(0x1)
38498         /* No more action records */
38499         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_ACTION_RECORD   UINT32_C(0x2)
38500         /* No more flow counters */
38501         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_COUNTER    UINT32_C(0x3)
38502         /* No more wild-card TCAM */
38503         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_WILD_CARD_TCAM  UINT32_C(0x4)
38504         /* Hash collsion in exact match tables */
38505         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_HASH_COLLISION  UINT32_C(0x5)
38506         /* Key is already installed */
38507         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_KEY_EXISTS      UINT32_C(0x6)
38508         /* Flow Context DB is out of resource */
38509         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB    UINT32_C(0x7)
38510         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_LAST \
38511                 HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB
38512         uint8_t unused_0[7];
38513 } __rte_packed;
38514
38515 /**********************
38516  * hwrm_cfa_flow_free *
38517  **********************/
38518
38519
38520 /* hwrm_cfa_flow_free_input (size:256b/32B) */
38521 struct hwrm_cfa_flow_free_input {
38522         /* The HWRM command request type. */
38523         uint16_t        req_type;
38524         /*
38525          * The completion ring to send the completion event on. This should
38526          * be the NQ ID returned from the `nq_alloc` HWRM command.
38527          */
38528         uint16_t        cmpl_ring;
38529         /*
38530          * The sequence ID is used by the driver for tracking multiple
38531          * commands. This ID is treated as opaque data by the firmware and
38532          * the value is returned in the `hwrm_resp_hdr` upon completion.
38533          */
38534         uint16_t        seq_id;
38535         /*
38536          * The target ID of the command:
38537          * * 0x0-0xFFF8 - The function ID
38538          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38539          * * 0xFFFD - Reserved for user-space HWRM interface
38540          * * 0xFFFF - HWRM
38541          */
38542         uint16_t        target_id;
38543         /*
38544          * A physical address pointer pointing to a host buffer that the
38545          * command's response data will be written. This can be either a host
38546          * physical address (HPA) or a guest physical address (GPA) and must
38547          * point to a physically contiguous block of memory.
38548          */
38549         uint64_t        resp_addr;
38550         /* Flow record index. */
38551         uint16_t        flow_handle;
38552         uint16_t        unused_0;
38553         /* Flow counter id to be freed. */
38554         uint32_t        flow_counter_id;
38555         /* This value identifies a set of CFA data structures used for a flow. */
38556         uint64_t        ext_flow_handle;
38557 } __rte_packed;
38558
38559 /* hwrm_cfa_flow_free_output (size:256b/32B) */
38560 struct hwrm_cfa_flow_free_output {
38561         /* The specific error status for the command. */
38562         uint16_t        error_code;
38563         /* The HWRM command request type. */
38564         uint16_t        req_type;
38565         /* The sequence ID from the original command. */
38566         uint16_t        seq_id;
38567         /* The length of the response data in number of bytes. */
38568         uint16_t        resp_len;
38569         /* packet is 64 b */
38570         uint64_t        packet;
38571         /* byte is 64 b */
38572         uint64_t        byte;
38573         uint8_t unused_0[7];
38574         /*
38575          * This field is used in Output records to indicate that the output
38576          * is completely written to RAM. This field should be read as '1'
38577          * to indicate that the output has been completely written.
38578          * When writing a command completion or response to an internal
38579          * processor, the order of writes has to be such that this field is
38580          * written last.
38581          */
38582         uint8_t valid;
38583 } __rte_packed;
38584
38585 /* hwrm_cfa_flow_action_data (size:960b/120B) */
38586 struct hwrm_cfa_flow_action_data {
38587         uint16_t        action_flags;
38588         /* Setting of this flag indicates accept action. */
38589         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FWD \
38590                 UINT32_C(0x1)
38591         /* Setting of this flag indicates recycle action. */
38592         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_RECYCLE \
38593                 UINT32_C(0x2)
38594         /* Setting of this flag indicates drop action. */
38595         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DROP \
38596                 UINT32_C(0x4)
38597         /* Setting of this flag indicates meter action. */
38598         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_METER \
38599                 UINT32_C(0x8)
38600         /* Setting of this flag indicates tunnel action. */
38601         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL \
38602                 UINT32_C(0x10)
38603         /*
38604          * If set to 1 and flow direction is TX, it indicates decap of L2
38605          * header and encap of tunnel header. If set to 1 and flow direction
38606          * is RX, it indicates decap of tunnel header and encap L2 header.
38607          */
38608         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL_IP \
38609                 UINT32_C(0x20)
38610         /* Setting of this flag indicates ttl decrement action. */
38611         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TTL_DECREMENT \
38612                 UINT32_C(0x40)
38613         /* If set to 1, flow aging is enabled for this flow. */
38614         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FLOW_AGING_ENABLED \
38615                 UINT32_C(0x80)
38616         /* Setting of this flag indicates encap action. */
38617         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_ENCAP \
38618                 UINT32_C(0x100)
38619         /* Setting of this flag indicates decap action. */
38620         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DECAP \
38621                 UINT32_C(0x200)
38622         /* Meter id. */
38623         uint16_t        act_meter_id;
38624         /* VNIC id. */
38625         uint16_t        vnic_id;
38626         /* vport number. */
38627         uint16_t        vport_id;
38628         /* The NAT source/destination. */
38629         uint16_t        nat_port;
38630         uint16_t        unused_0[3];
38631         /* NAT IPv4/IPv6 address. */
38632         uint32_t        nat_ip_address[4];
38633         /* Encapsulation Type. */
38634         uint8_t encap_type;
38635         /* Virtual eXtensible Local Area Network (VXLAN) */
38636         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN        UINT32_C(0x1)
38637         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
38638         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_NVGRE        UINT32_C(0x2)
38639         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
38640         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2GRE        UINT32_C(0x3)
38641         /* IP in IP */
38642         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPIP         UINT32_C(0x4)
38643         /* Generic Network Virtualization Encapsulation (Geneve) */
38644         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_GENEVE       UINT32_C(0x5)
38645         /* Multi-Protocol Label Switching (MPLS) */
38646         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_MPLS         UINT32_C(0x6)
38647         /* VLAN */
38648         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VLAN         UINT32_C(0x7)
38649         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
38650         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE        UINT32_C(0x8)
38651         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
38652         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_V4     UINT32_C(0x9)
38653         /*
38654          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
38655          * datagram payload
38656          */
38657         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE_V1     UINT32_C(0xa)
38658         /* Use fixed layer 2 ether type of 0xFFFF */
38659         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2_ETYPE     UINT32_C(0xb)
38660         /*
38661          * IPV6 over virtual eXtensible Local Area Network with GPE header
38662          * (IPV6oVXLANGPE)
38663          */
38664         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
38665         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_LAST \
38666                 HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6
38667         uint8_t unused[7];
38668         /* This value is encap data for the associated encap type. */
38669         uint32_t        encap_data[20];
38670 } __rte_packed;
38671
38672 /* hwrm_cfa_flow_tunnel_hdr_data (size:64b/8B) */
38673 struct hwrm_cfa_flow_tunnel_hdr_data {
38674         /* Tunnel Type. */
38675         uint8_t tunnel_type;
38676         /* Non-tunnel */
38677         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NONTUNNEL \
38678                 UINT32_C(0x0)
38679         /* Virtual eXtensible Local Area Network (VXLAN) */
38680         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN \
38681                 UINT32_C(0x1)
38682         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
38683         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NVGRE \
38684                 UINT32_C(0x2)
38685         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
38686         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2GRE \
38687                 UINT32_C(0x3)
38688         /* IP in IP */
38689         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPIP \
38690                 UINT32_C(0x4)
38691         /* Generic Network Virtualization Encapsulation (Geneve) */
38692         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_GENEVE \
38693                 UINT32_C(0x5)
38694         /* Multi-Protocol Label Switching (MPLS) */
38695         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_MPLS \
38696                 UINT32_C(0x6)
38697         /* Stateless Transport Tunnel (STT) */
38698         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_STT \
38699                 UINT32_C(0x7)
38700         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
38701         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE \
38702                 UINT32_C(0x8)
38703         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
38704         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_V4 \
38705                 UINT32_C(0x9)
38706         /*
38707          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
38708          * datagram payload
38709          */
38710         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE_V1 \
38711                 UINT32_C(0xa)
38712         /* Use fixed layer 2 ether type of 0xFFFF */
38713         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2_ETYPE \
38714                 UINT32_C(0xb)
38715         /*
38716          * IPV6 over virtual eXtensible Local Area Network with GPE header
38717          * (IPV6oVXLANGPE)
38718          */
38719         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE_V6 \
38720                 UINT32_C(0xc)
38721         /* Any tunneled traffic */
38722         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL \
38723                 UINT32_C(0xff)
38724         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_LAST \
38725                 HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL
38726         uint8_t unused[3];
38727         /*
38728          * Tunnel identifier.
38729          * Virtual Network Identifier (VNI).
38730          */
38731         uint32_t        tunnel_id;
38732 } __rte_packed;
38733
38734 /* hwrm_cfa_flow_l4_key_data (size:64b/8B) */
38735 struct hwrm_cfa_flow_l4_key_data {
38736         /* The value of source port. */
38737         uint16_t        l4_src_port;
38738         /* The value of destination port. */
38739         uint16_t        l4_dst_port;
38740         uint32_t        unused;
38741 } __rte_packed;
38742
38743 /* hwrm_cfa_flow_l3_key_data (size:512b/64B) */
38744 struct hwrm_cfa_flow_l3_key_data {
38745         /* The value of ip protocol. */
38746         uint8_t ip_protocol;
38747         uint8_t unused_0[7];
38748         /* The value of destination IPv4/IPv6 address. */
38749         uint32_t        ip_dst[4];
38750         /* The source IPv4/IPv6 address. */
38751         uint32_t        ip_src[4];
38752         /* NAT IPv4/IPv6 address. */
38753         uint32_t        nat_ip_address[4];
38754         uint32_t        unused[2];
38755 } __rte_packed;
38756
38757 /* hwrm_cfa_flow_l2_key_data (size:448b/56B) */
38758 struct hwrm_cfa_flow_l2_key_data {
38759         /* Destination MAC address. */
38760         uint16_t        dmac[3];
38761         uint16_t        unused_0;
38762         /* Source MAC address. */
38763         uint16_t        smac[3];
38764         uint16_t        unused_1;
38765         /* L2 header re-write Destination MAC address. */
38766         uint16_t        l2_rewrite_dmac[3];
38767         uint16_t        unused_2;
38768         /* L2 header re-write Source MAC address. */
38769         uint16_t        l2_rewrite_smac[3];
38770         /* Ethertype. */
38771         uint16_t        ethertype;
38772         /* Number of VLAN tags. */
38773         uint16_t        num_vlan_tags;
38774         /* VLAN tpid. */
38775         uint16_t        l2_rewrite_vlan_tpid;
38776         /* VLAN tci. */
38777         uint16_t        l2_rewrite_vlan_tci;
38778         uint8_t unused_3[2];
38779         /* Outer VLAN TPID. */
38780         uint16_t        ovlan_tpid;
38781         /* Outer VLAN TCI. */
38782         uint16_t        ovlan_tci;
38783         /* Inner VLAN TPID. */
38784         uint16_t        ivlan_tpid;
38785         /* Inner VLAN TCI. */
38786         uint16_t        ivlan_tci;
38787         uint8_t unused[8];
38788 } __rte_packed;
38789
38790 /* hwrm_cfa_flow_key_data (size:4160b/520B) */
38791 struct hwrm_cfa_flow_key_data {
38792         /* Flow associated tunnel L2 header key info. */
38793         uint32_t        t_l2_key_data[14];
38794         /* Flow associated tunnel L2 header mask info. */
38795         uint32_t        t_l2_key_mask[14];
38796         /* Flow associated tunnel L3 header key info. */
38797         uint32_t        t_l3_key_data[16];
38798         /* Flow associated tunnel L3 header mask info. */
38799         uint32_t        t_l3_key_mask[16];
38800         /* Flow associated tunnel L4 header key info. */
38801         uint32_t        t_l4_key_data[2];
38802         /* Flow associated tunnel L4 header mask info. */
38803         uint32_t        t_l4_key_mask[2];
38804         /* Flow associated tunnel header info. */
38805         uint32_t        tunnel_hdr[2];
38806         /* Flow associated L2 header key info. */
38807         uint32_t        l2_key_data[14];
38808         /* Flow associated L2 header mask info. */
38809         uint32_t        l2_key_mask[14];
38810         /* Flow associated L3 header key info. */
38811         uint32_t        l3_key_data[16];
38812         /* Flow associated L3 header mask info. */
38813         uint32_t        l3_key_mask[16];
38814         /* Flow associated L4 header key info. */
38815         uint32_t        l4_key_data[2];
38816         /* Flow associated L4 header mask info. */
38817         uint32_t        l4_key_mask[2];
38818 } __rte_packed;
38819
38820 /**********************
38821  * hwrm_cfa_flow_info *
38822  **********************/
38823
38824
38825 /* hwrm_cfa_flow_info_input (size:256b/32B) */
38826 struct hwrm_cfa_flow_info_input {
38827         /* The HWRM command request type. */
38828         uint16_t        req_type;
38829         /*
38830          * The completion ring to send the completion event on. This should
38831          * be the NQ ID returned from the `nq_alloc` HWRM command.
38832          */
38833         uint16_t        cmpl_ring;
38834         /*
38835          * The sequence ID is used by the driver for tracking multiple
38836          * commands. This ID is treated as opaque data by the firmware and
38837          * the value is returned in the `hwrm_resp_hdr` upon completion.
38838          */
38839         uint16_t        seq_id;
38840         /*
38841          * The target ID of the command:
38842          * * 0x0-0xFFF8 - The function ID
38843          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38844          * * 0xFFFD - Reserved for user-space HWRM interface
38845          * * 0xFFFF - HWRM
38846          */
38847         uint16_t        target_id;
38848         /*
38849          * A physical address pointer pointing to a host buffer that the
38850          * command's response data will be written. This can be either a host
38851          * physical address (HPA) or a guest physical address (GPA) and must
38852          * point to a physically contiguous block of memory.
38853          */
38854         uint64_t        resp_addr;
38855         /* Flow record index. */
38856         uint16_t        flow_handle;
38857         /* Max flow handle */
38858         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK \
38859                 UINT32_C(0xfff)
38860         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_SFT        0
38861         /* CNP flow handle */
38862         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT \
38863                 UINT32_C(0x1000)
38864         /* RoCEv1 flow handle */
38865         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT \
38866                 UINT32_C(0x2000)
38867         /* RoCEv2 flow handle */
38868         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT \
38869                 UINT32_C(0x4000)
38870         /* Direction rx = 1 */
38871         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX \
38872                 UINT32_C(0x8000)
38873         uint8_t unused_0[6];
38874         /* This value identifies a set of CFA data structures used for a flow. */
38875         uint64_t        ext_flow_handle;
38876 } __rte_packed;
38877
38878 /* hwrm_cfa_flow_info_output (size:5632b/704B) */
38879 struct hwrm_cfa_flow_info_output {
38880         /* The specific error status for the command. */
38881         uint16_t        error_code;
38882         /* The HWRM command request type. */
38883         uint16_t        req_type;
38884         /* The sequence ID from the original command. */
38885         uint16_t        seq_id;
38886         /* The length of the response data in number of bytes. */
38887         uint16_t        resp_len;
38888         uint8_t flags;
38889         /* When set to 1, indicates the configuration is the TX flow. */
38890         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_TX     UINT32_C(0x1)
38891         /* When set to 1, indicates the configuration is the RX flow. */
38892         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_RX     UINT32_C(0x2)
38893         /* profile is 8 b */
38894         uint8_t profile;
38895         /* src_fid is 16 b */
38896         uint16_t        src_fid;
38897         /* dst_fid is 16 b */
38898         uint16_t        dst_fid;
38899         /* l2_ctxt_id is 16 b */
38900         uint16_t        l2_ctxt_id;
38901         /* em_info is 64 b */
38902         uint64_t        em_info;
38903         /* tcam_info is 64 b */
38904         uint64_t        tcam_info;
38905         /* vfp_tcam_info is 64 b */
38906         uint64_t        vfp_tcam_info;
38907         /* ar_id is 16 b */
38908         uint16_t        ar_id;
38909         /* flow_handle is 16 b */
38910         uint16_t        flow_handle;
38911         /* tunnel_handle is 32 b */
38912         uint32_t        tunnel_handle;
38913         /* The flow aging timer for the flow, the unit is 100 milliseconds */
38914         uint16_t        flow_timer;
38915         uint8_t unused_0[6];
38916         /* Flow associated L2, L3 and L4 headers info. */
38917         uint32_t        flow_key_data[130];
38918         /* Flow associated action record info. */
38919         uint32_t        flow_action_info[30];
38920         uint8_t unused_1[7];
38921         /*
38922          * This field is used in Output records to indicate that the output
38923          * is completely written to RAM. This field should be read as '1'
38924          * to indicate that the output has been completely written.
38925          * When writing a command completion or response to an internal
38926          * processor, the order of writes has to be such that this field is
38927          * written last.
38928          */
38929         uint8_t valid;
38930 } __rte_packed;
38931
38932 /***********************
38933  * hwrm_cfa_flow_flush *
38934  ***********************/
38935
38936
38937 /* hwrm_cfa_flow_flush_input (size:256b/32B) */
38938 struct hwrm_cfa_flow_flush_input {
38939         /* The HWRM command request type. */
38940         uint16_t        req_type;
38941         /*
38942          * The completion ring to send the completion event on. This should
38943          * be the NQ ID returned from the `nq_alloc` HWRM command.
38944          */
38945         uint16_t        cmpl_ring;
38946         /*
38947          * The sequence ID is used by the driver for tracking multiple
38948          * commands. This ID is treated as opaque data by the firmware and
38949          * the value is returned in the `hwrm_resp_hdr` upon completion.
38950          */
38951         uint16_t        seq_id;
38952         /*
38953          * The target ID of the command:
38954          * * 0x0-0xFFF8 - The function ID
38955          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
38956          * * 0xFFFD - Reserved for user-space HWRM interface
38957          * * 0xFFFF - HWRM
38958          */
38959         uint16_t        target_id;
38960         /*
38961          * A physical address pointer pointing to a host buffer that the
38962          * command's response data will be written. This can be either a host
38963          * physical address (HPA) or a guest physical address (GPA) and must
38964          * point to a physically contiguous block of memory.
38965          */
38966         uint64_t        resp_addr;
38967         /* flags is 32 b */
38968         uint32_t        flags;
38969         /*
38970          * Set to 1 to indicate the page size, page layers, and
38971          * flow_handle_table_dma_addr fields are valid. The flow flush
38972          * operation should only flush the flows from the flow table
38973          * specified. This flag is set to 0 by older driver. For older
38974          * firmware, setting this flag has no effect.
38975          */
38976         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_TABLE_VALID \
38977                 UINT32_C(0x1)
38978         /*
38979          * Set to 1 to indicate flow flush operation to cleanup all the
38980          * flows, meters, CFA context memory tables etc. This flag is set to
38981          * 0 by older driver. For older firmware, setting this flag has no
38982          * effect.
38983          */
38984         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_ALL \
38985                 UINT32_C(0x2)
38986         /*
38987          * Set to 1 to indicate flow flush operation to cleanup all the
38988          * flows by the caller. This flag is set to 0 by older driver. For
38989          * older firmware, setting this flag has no effect.
38990          */
38991         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_PORT \
38992                 UINT32_C(0x4)
38993         /*
38994          * Set to 1 to indicate the flow counter IDs are included in the
38995          * flow table.
38996          */
38997         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_INCL_FC \
38998                 UINT32_C(0x8000000)
38999         /*
39000          * This specifies the size of flow handle entries provided by the
39001          * driver in the flow table specified below. Only two flow handle
39002          * size enums are defined.
39003          */
39004         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_MASK \
39005                 UINT32_C(0xc0000000)
39006         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_SFT \
39007                 30
39008         /* The flow handle is 16bit */
39009         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_16BIT \
39010                 (UINT32_C(0x0) << 30)
39011         /* The flow handle is 64bit */
39012         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT \
39013                 (UINT32_C(0x1) << 30)
39014         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_LAST \
39015                 HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT
39016         /* Specify page size of the flow table memory. */
39017         uint8_t page_size;
39018         /* The page size is 4K */
39019         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
39020         /* The page size is 8K */
39021         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
39022         /* The page size is 64K */
39023         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
39024         /* The page size is 256K */
39025         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
39026         /* The page size is 1M */
39027         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
39028         /* The page size is 2M */
39029         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
39030         /* The page size is 4M */
39031         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
39032         /* The page size is 1G */
39033         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
39034         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_LAST \
39035                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G
39036         /* FLow table memory indirect levels. */
39037         uint8_t page_level;
39038         /* PBL pointer is physical start address. */
39039         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
39040         /* PBL pointer points to PTE table. */
39041         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
39042         /*
39043          * PBL pointer points to PDE table with each entry pointing to PTE
39044          * tables.
39045          */
39046         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
39047         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LAST \
39048                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2
39049         /* number of flows in the flow table */
39050         uint16_t        num_flows;
39051         /* Pointer to the PBL, or PDL depending on number of levels */
39052         uint64_t        page_dir;
39053 } __rte_packed;
39054
39055 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
39056 struct hwrm_cfa_flow_flush_output {
39057         /* The specific error status for the command. */
39058         uint16_t        error_code;
39059         /* The HWRM command request type. */
39060         uint16_t        req_type;
39061         /* The sequence ID from the original command. */
39062         uint16_t        seq_id;
39063         /* The length of the response data in number of bytes. */
39064         uint16_t        resp_len;
39065         uint8_t unused_0[7];
39066         /*
39067          * This field is used in Output records to indicate that the output
39068          * is completely written to RAM. This field should be read as '1'
39069          * to indicate that the output has been completely written.
39070          * When writing a command completion or response to an internal
39071          * processor, the order of writes has to be such that this field is
39072          * written last.
39073          */
39074         uint8_t valid;
39075 } __rte_packed;
39076
39077 /***********************
39078  * hwrm_cfa_flow_stats *
39079  ***********************/
39080
39081
39082 /* hwrm_cfa_flow_stats_input (size:640b/80B) */
39083 struct hwrm_cfa_flow_stats_input {
39084         /* The HWRM command request type. */
39085         uint16_t        req_type;
39086         /*
39087          * The completion ring to send the completion event on. This should
39088          * be the NQ ID returned from the `nq_alloc` HWRM command.
39089          */
39090         uint16_t        cmpl_ring;
39091         /*
39092          * The sequence ID is used by the driver for tracking multiple
39093          * commands. This ID is treated as opaque data by the firmware and
39094          * the value is returned in the `hwrm_resp_hdr` upon completion.
39095          */
39096         uint16_t        seq_id;
39097         /*
39098          * The target ID of the command:
39099          * * 0x0-0xFFF8 - The function ID
39100          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39101          * * 0xFFFD - Reserved for user-space HWRM interface
39102          * * 0xFFFF - HWRM
39103          */
39104         uint16_t        target_id;
39105         /*
39106          * A physical address pointer pointing to a host buffer that the
39107          * command's response data will be written. This can be either a host
39108          * physical address (HPA) or a guest physical address (GPA) and must
39109          * point to a physically contiguous block of memory.
39110          */
39111         uint64_t        resp_addr;
39112         /* Flow handle. */
39113         uint16_t        num_flows;
39114         /* Flow handle. */
39115         uint16_t        flow_handle_0;
39116         /* Flow handle. */
39117         uint16_t        flow_handle_1;
39118         /* Flow handle. */
39119         uint16_t        flow_handle_2;
39120         /* Flow handle. */
39121         uint16_t        flow_handle_3;
39122         /* Flow handle. */
39123         uint16_t        flow_handle_4;
39124         /* Flow handle. */
39125         uint16_t        flow_handle_5;
39126         /* Flow handle. */
39127         uint16_t        flow_handle_6;
39128         /* Flow handle. */
39129         uint16_t        flow_handle_7;
39130         /* Flow handle. */
39131         uint16_t        flow_handle_8;
39132         /* Flow handle. */
39133         uint16_t        flow_handle_9;
39134         uint8_t unused_0[2];
39135         /* Flow ID of a flow. */
39136         uint32_t        flow_id_0;
39137         /* Flow ID of a flow. */
39138         uint32_t        flow_id_1;
39139         /* Flow ID of a flow. */
39140         uint32_t        flow_id_2;
39141         /* Flow ID of a flow. */
39142         uint32_t        flow_id_3;
39143         /* Flow ID of a flow. */
39144         uint32_t        flow_id_4;
39145         /* Flow ID of a flow. */
39146         uint32_t        flow_id_5;
39147         /* Flow ID of a flow. */
39148         uint32_t        flow_id_6;
39149         /* Flow ID of a flow. */
39150         uint32_t        flow_id_7;
39151         /* Flow ID of a flow. */
39152         uint32_t        flow_id_8;
39153         /* Flow ID of a flow. */
39154         uint32_t        flow_id_9;
39155 } __rte_packed;
39156
39157 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
39158 struct hwrm_cfa_flow_stats_output {
39159         /* The specific error status for the command. */
39160         uint16_t        error_code;
39161         /* The HWRM command request type. */
39162         uint16_t        req_type;
39163         /* The sequence ID from the original command. */
39164         uint16_t        seq_id;
39165         /* The length of the response data in number of bytes. */
39166         uint16_t        resp_len;
39167         /* packet_0 is 64 b */
39168         uint64_t        packet_0;
39169         /* packet_1 is 64 b */
39170         uint64_t        packet_1;
39171         /* packet_2 is 64 b */
39172         uint64_t        packet_2;
39173         /* packet_3 is 64 b */
39174         uint64_t        packet_3;
39175         /* packet_4 is 64 b */
39176         uint64_t        packet_4;
39177         /* packet_5 is 64 b */
39178         uint64_t        packet_5;
39179         /* packet_6 is 64 b */
39180         uint64_t        packet_6;
39181         /* packet_7 is 64 b */
39182         uint64_t        packet_7;
39183         /* packet_8 is 64 b */
39184         uint64_t        packet_8;
39185         /* packet_9 is 64 b */
39186         uint64_t        packet_9;
39187         /* byte_0 is 64 b */
39188         uint64_t        byte_0;
39189         /* byte_1 is 64 b */
39190         uint64_t        byte_1;
39191         /* byte_2 is 64 b */
39192         uint64_t        byte_2;
39193         /* byte_3 is 64 b */
39194         uint64_t        byte_3;
39195         /* byte_4 is 64 b */
39196         uint64_t        byte_4;
39197         /* byte_5 is 64 b */
39198         uint64_t        byte_5;
39199         /* byte_6 is 64 b */
39200         uint64_t        byte_6;
39201         /* byte_7 is 64 b */
39202         uint64_t        byte_7;
39203         /* byte_8 is 64 b */
39204         uint64_t        byte_8;
39205         /* byte_9 is 64 b */
39206         uint64_t        byte_9;
39207         uint8_t unused_0[7];
39208         /*
39209          * This field is used in Output records to indicate that the output
39210          * is completely written to RAM. This field should be read as '1'
39211          * to indicate that the output has been completely written.
39212          * When writing a command completion or response to an internal
39213          * processor, the order of writes has to be such that this field is
39214          * written last.
39215          */
39216         uint8_t valid;
39217 } __rte_packed;
39218
39219 /***********************************
39220  * hwrm_cfa_flow_aging_timer_reset *
39221  ***********************************/
39222
39223
39224 /* hwrm_cfa_flow_aging_timer_reset_input (size:256b/32B) */
39225 struct hwrm_cfa_flow_aging_timer_reset_input {
39226         /* The HWRM command request type. */
39227         uint16_t        req_type;
39228         /*
39229          * The completion ring to send the completion event on. This should
39230          * be the NQ ID returned from the `nq_alloc` HWRM command.
39231          */
39232         uint16_t        cmpl_ring;
39233         /*
39234          * The sequence ID is used by the driver for tracking multiple
39235          * commands. This ID is treated as opaque data by the firmware and
39236          * the value is returned in the `hwrm_resp_hdr` upon completion.
39237          */
39238         uint16_t        seq_id;
39239         /*
39240          * The target ID of the command:
39241          * * 0x0-0xFFF8 - The function ID
39242          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39243          * * 0xFFFD - Reserved for user-space HWRM interface
39244          * * 0xFFFF - HWRM
39245          */
39246         uint16_t        target_id;
39247         /*
39248          * A physical address pointer pointing to a host buffer that the
39249          * command's response data will be written. This can be either a host
39250          * physical address (HPA) or a guest physical address (GPA) and must
39251          * point to a physically contiguous block of memory.
39252          */
39253         uint64_t        resp_addr;
39254         /* Flow record index. */
39255         uint16_t        flow_handle;
39256         uint8_t unused_0[2];
39257         /*
39258          * New flow timer value for the flow specified in the ext_flow_handle.
39259          * The flow timer unit is 100ms.
39260          */
39261         uint32_t        flow_timer;
39262         /* This value identifies a set of CFA data structures used for a flow. */
39263         uint64_t        ext_flow_handle;
39264 } __rte_packed;
39265
39266 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
39267 struct hwrm_cfa_flow_aging_timer_reset_output {
39268         /* The specific error status for the command. */
39269         uint16_t        error_code;
39270         /* The HWRM command request type. */
39271         uint16_t        req_type;
39272         /* The sequence ID from the original command. */
39273         uint16_t        seq_id;
39274         /* The length of the response data in number of bytes. */
39275         uint16_t        resp_len;
39276         uint8_t unused_0[7];
39277         /*
39278          * This field is used in Output records to indicate that the output
39279          * is completely written to RAM. This field should be read as '1'
39280          * to indicate that the output has been completely written.
39281          * When writing a command completion or response to an internal
39282          * processor, the order of writes has to be such that this field is
39283          * written last.
39284          */
39285         uint8_t valid;
39286 } __rte_packed;
39287
39288 /***************************
39289  * hwrm_cfa_flow_aging_cfg *
39290  ***************************/
39291
39292
39293 /* hwrm_cfa_flow_aging_cfg_input (size:384b/48B) */
39294 struct hwrm_cfa_flow_aging_cfg_input {
39295         /* The HWRM command request type. */
39296         uint16_t        req_type;
39297         /*
39298          * The completion ring to send the completion event on. This should
39299          * be the NQ ID returned from the `nq_alloc` HWRM command.
39300          */
39301         uint16_t        cmpl_ring;
39302         /*
39303          * The sequence ID is used by the driver for tracking multiple
39304          * commands. This ID is treated as opaque data by the firmware and
39305          * the value is returned in the `hwrm_resp_hdr` upon completion.
39306          */
39307         uint16_t        seq_id;
39308         /*
39309          * The target ID of the command:
39310          * * 0x0-0xFFF8 - The function ID
39311          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39312          * * 0xFFFD - Reserved for user-space HWRM interface
39313          * * 0xFFFF - HWRM
39314          */
39315         uint16_t        target_id;
39316         /*
39317          * A physical address pointer pointing to a host buffer that the
39318          * command's response data will be written. This can be either a host
39319          * physical address (HPA) or a guest physical address (GPA) and must
39320          * point to a physically contiguous block of memory.
39321          */
39322         uint64_t        resp_addr;
39323         /* The bit field to enable per flow aging configuration. */
39324         uint16_t        enables;
39325         /*
39326          * This bit must be '1' for the tcp flow timer field to be
39327          * configured
39328          */
39329         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FLOW_TIMER \
39330                 UINT32_C(0x1)
39331         /*
39332          * This bit must be '1' for the tcp finish timer field to be
39333          * configured
39334          */
39335         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FIN_TIMER \
39336                 UINT32_C(0x2)
39337         /*
39338          * This bit must be '1' for the udp flow timer field to be
39339          * configured
39340          */
39341         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_UDP_FLOW_TIMER \
39342                 UINT32_C(0x4)
39343         /*
39344          * This bit must be '1' for the eem dma interval field to be
39345          * configured
39346          */
39347         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_DMA_INTERVAL \
39348                 UINT32_C(0x8)
39349         /*
39350          * This bit must be '1' for the eem notice interval field to be
39351          * configured
39352          */
39353         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_NOTICE_INTERVAL \
39354                 UINT32_C(0x10)
39355         /*
39356          * This bit must be '1' for the eem context memory maximum entries
39357          * field to be configured
39358          */
39359         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MAX_ENTRIES \
39360                 UINT32_C(0x20)
39361         /*
39362          * This bit must be '1' for the eem context memory ID field to be
39363          * configured
39364          */
39365         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_ID \
39366                 UINT32_C(0x40)
39367         /*
39368          * This bit must be '1' for the eem context memory type field to be
39369          * configured
39370          */
39371         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MEM_TYPE \
39372                 UINT32_C(0x80)
39373         uint8_t flags;
39374         /* Enumeration denoting the RX, TX type of the resource. */
39375         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH       UINT32_C(0x1)
39376         /* tx path */
39377         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_TX      UINT32_C(0x0)
39378         /* rx path */
39379         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX      UINT32_C(0x1)
39380         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_LAST \
39381                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX
39382         /*
39383          * Enumeration denoting the enable, disable eem flow aging
39384          * configuration.
39385          */
39386         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM        UINT32_C(0x2)
39387         /* tx path */
39388         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_DISABLE \
39389                 (UINT32_C(0x0) << 1)
39390         /* rx path */
39391         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE \
39392                 (UINT32_C(0x1) << 1)
39393         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_LAST \
39394                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE
39395         uint8_t unused_0;
39396         /*
39397          * The flow aging timer for all TCP flows, the unit is 100
39398          * milliseconds.
39399          */
39400         uint32_t        tcp_flow_timer;
39401         /*
39402          * The TCP finished timer for all TCP flows, the unit is 100
39403          * milliseconds.
39404          */
39405         uint32_t        tcp_fin_timer;
39406         /*
39407          * The flow aging timer for all UDP flows, the unit is 100
39408          * milliseconds.
39409          */
39410         uint32_t        udp_flow_timer;
39411         /*
39412          * The interval to dma eem ejection data to host memory, the unit is
39413          * milliseconds.
39414          */
39415         uint16_t        eem_dma_interval;
39416         /*
39417          * The interval to notify driver to read the eem ejection data, the
39418          * unit is milliseconds.
39419          */
39420         uint16_t        eem_notice_interval;
39421         /* The maximum entries number in the eem context memory. */
39422         uint32_t        eem_ctx_max_entries;
39423         /* The context memory ID for eem flow aging. */
39424         uint16_t        eem_ctx_id;
39425         uint16_t        eem_ctx_mem_type;
39426         /*
39427          * The content of context memory is eem ejection data, the size of
39428          * each entry is 4 bytes.
39429          */
39430         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA \
39431                 UINT32_C(0x0)
39432         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_LAST \
39433                 HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA
39434         uint8_t unused_1[4];
39435 } __rte_packed;
39436
39437 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
39438 struct hwrm_cfa_flow_aging_cfg_output {
39439         /* The specific error status for the command. */
39440         uint16_t        error_code;
39441         /* The HWRM command request type. */
39442         uint16_t        req_type;
39443         /* The sequence ID from the original command. */
39444         uint16_t        seq_id;
39445         /* The length of the response data in number of bytes. */
39446         uint16_t        resp_len;
39447         uint8_t unused_0[7];
39448         /*
39449          * This field is used in Output records to indicate that the output
39450          * is completely written to RAM. This field should be read as '1'
39451          * to indicate that the output has been completely written.
39452          * When writing a command completion or response to an internal
39453          * processor, the order of writes has to be such that this field is
39454          * written last.
39455          */
39456         uint8_t valid;
39457 } __rte_packed;
39458
39459 /****************************
39460  * hwrm_cfa_flow_aging_qcfg *
39461  ****************************/
39462
39463
39464 /* hwrm_cfa_flow_aging_qcfg_input (size:192b/24B) */
39465 struct hwrm_cfa_flow_aging_qcfg_input {
39466         /* The HWRM command request type. */
39467         uint16_t        req_type;
39468         /*
39469          * The completion ring to send the completion event on. This should
39470          * be the NQ ID returned from the `nq_alloc` HWRM command.
39471          */
39472         uint16_t        cmpl_ring;
39473         /*
39474          * The sequence ID is used by the driver for tracking multiple
39475          * commands. This ID is treated as opaque data by the firmware and
39476          * the value is returned in the `hwrm_resp_hdr` upon completion.
39477          */
39478         uint16_t        seq_id;
39479         /*
39480          * The target ID of the command:
39481          * * 0x0-0xFFF8 - The function ID
39482          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39483          * * 0xFFFD - Reserved for user-space HWRM interface
39484          * * 0xFFFF - HWRM
39485          */
39486         uint16_t        target_id;
39487         /*
39488          * A physical address pointer pointing to a host buffer that the
39489          * command's response data will be written. This can be either a host
39490          * physical address (HPA) or a guest physical address (GPA) and must
39491          * point to a physically contiguous block of memory.
39492          */
39493         uint64_t        resp_addr;
39494         /*
39495          * The direction for the flow aging configuration, 1 is rx path, 2 is
39496          * tx path.
39497          */
39498         uint8_t flags;
39499         /* Enumeration denoting the RX, TX type of the resource. */
39500         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
39501         /* tx path */
39502         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
39503         /* rx path */
39504         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
39505         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST \
39506                 HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
39507         uint8_t unused_0[7];
39508 } __rte_packed;
39509
39510 /* hwrm_cfa_flow_aging_qcfg_output (size:320b/40B) */
39511 struct hwrm_cfa_flow_aging_qcfg_output {
39512         /* The specific error status for the command. */
39513         uint16_t        error_code;
39514         /* The HWRM command request type. */
39515         uint16_t        req_type;
39516         /* The sequence ID from the original command. */
39517         uint16_t        seq_id;
39518         /* The length of the response data in number of bytes. */
39519         uint16_t        resp_len;
39520         /*
39521          * The current flow aging timer for all TCP flows, the unit is 100
39522          * millisecond.
39523          */
39524         uint32_t        tcp_flow_timer;
39525         /*
39526          * The current TCP finished timer for all TCP flows, the unit is 100
39527          * millisecond.
39528          */
39529         uint32_t        tcp_fin_timer;
39530         /*
39531          * The current flow aging timer for all UDP flows, the unit is 100
39532          * millisecond.
39533          */
39534         uint32_t        udp_flow_timer;
39535         /*
39536          * The interval to dma eem ejection data to host memory, the unit is
39537          * milliseconds.
39538          */
39539         uint16_t        eem_dma_interval;
39540         /*
39541          * The interval to notify driver to read the eem ejection data, the
39542          * unit is milliseconds.
39543          */
39544         uint16_t        eem_notice_interval;
39545         /* The maximum entries number in the eem context memory. */
39546         uint32_t        eem_ctx_max_entries;
39547         /* The context memory ID for eem flow aging. */
39548         uint16_t        eem_ctx_id;
39549         /* The context memory type for eem flow aging. */
39550         uint16_t        eem_ctx_mem_type;
39551         uint8_t unused_0[7];
39552         /*
39553          * This field is used in Output records to indicate that the output
39554          * is completely written to RAM. This field should be read as '1'
39555          * to indicate that the output has been completely written.
39556          * When writing a command completion or response to an internal
39557          * processor, the order of writes has to be such that this field is
39558          * written last.
39559          */
39560         uint8_t valid;
39561 } __rte_packed;
39562
39563 /*****************************
39564  * hwrm_cfa_flow_aging_qcaps *
39565  *****************************/
39566
39567
39568 /* hwrm_cfa_flow_aging_qcaps_input (size:192b/24B) */
39569 struct hwrm_cfa_flow_aging_qcaps_input {
39570         /* The HWRM command request type. */
39571         uint16_t        req_type;
39572         /*
39573          * The completion ring to send the completion event on. This should
39574          * be the NQ ID returned from the `nq_alloc` HWRM command.
39575          */
39576         uint16_t        cmpl_ring;
39577         /*
39578          * The sequence ID is used by the driver for tracking multiple
39579          * commands. This ID is treated as opaque data by the firmware and
39580          * the value is returned in the `hwrm_resp_hdr` upon completion.
39581          */
39582         uint16_t        seq_id;
39583         /*
39584          * The target ID of the command:
39585          * * 0x0-0xFFF8 - The function ID
39586          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39587          * * 0xFFFD - Reserved for user-space HWRM interface
39588          * * 0xFFFF - HWRM
39589          */
39590         uint16_t        target_id;
39591         /*
39592          * A physical address pointer pointing to a host buffer that the
39593          * command's response data will be written. This can be either a host
39594          * physical address (HPA) or a guest physical address (GPA) and must
39595          * point to a physically contiguous block of memory.
39596          */
39597         uint64_t        resp_addr;
39598         /*
39599          * The direction for the flow aging configuration, 1 is rx path, 2 is
39600          * tx path.
39601          */
39602         uint8_t flags;
39603         /* Enumeration denoting the RX, TX type of the resource. */
39604         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH     UINT32_C(0x1)
39605         /* tx path */
39606         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
39607         /* rx path */
39608         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
39609         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST \
39610                 HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
39611         uint8_t unused_0[7];
39612 } __rte_packed;
39613
39614 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
39615 struct hwrm_cfa_flow_aging_qcaps_output {
39616         /* The specific error status for the command. */
39617         uint16_t        error_code;
39618         /* The HWRM command request type. */
39619         uint16_t        req_type;
39620         /* The sequence ID from the original command. */
39621         uint16_t        seq_id;
39622         /* The length of the response data in number of bytes. */
39623         uint16_t        resp_len;
39624         /*
39625          * The maximum flow aging timer for all TCP flows, the unit is 100
39626          * millisecond.
39627          */
39628         uint32_t        max_tcp_flow_timer;
39629         /*
39630          * The maximum TCP finished timer for all TCP flows, the unit is 100
39631          * millisecond.
39632          */
39633         uint32_t        max_tcp_fin_timer;
39634         /*
39635          * The maximum flow aging timer for all UDP flows, the unit is 100
39636          * millisecond.
39637          */
39638         uint32_t        max_udp_flow_timer;
39639         /* The maximum aging flows that HW can support. */
39640         uint32_t        max_aging_flows;
39641         uint8_t unused_0[7];
39642         /*
39643          * This field is used in Output records to indicate that the output
39644          * is completely written to RAM. This field should be read as '1'
39645          * to indicate that the output has been completely written.
39646          * When writing a command completion or response to an internal
39647          * processor, the order of writes has to be such that this field is
39648          * written last.
39649          */
39650         uint8_t valid;
39651 } __rte_packed;
39652
39653 /**********************************
39654  * hwrm_cfa_tcp_flag_process_qcfg *
39655  **********************************/
39656
39657
39658 /* hwrm_cfa_tcp_flag_process_qcfg_input (size:128b/16B) */
39659 struct hwrm_cfa_tcp_flag_process_qcfg_input {
39660         /* The HWRM command request type. */
39661         uint16_t        req_type;
39662         /*
39663          * The completion ring to send the completion event on. This should
39664          * be the NQ ID returned from the `nq_alloc` HWRM command.
39665          */
39666         uint16_t        cmpl_ring;
39667         /*
39668          * The sequence ID is used by the driver for tracking multiple
39669          * commands. This ID is treated as opaque data by the firmware and
39670          * the value is returned in the `hwrm_resp_hdr` upon completion.
39671          */
39672         uint16_t        seq_id;
39673         /*
39674          * The target ID of the command:
39675          * * 0x0-0xFFF8 - The function ID
39676          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39677          * * 0xFFFD - Reserved for user-space HWRM interface
39678          * * 0xFFFF - HWRM
39679          */
39680         uint16_t        target_id;
39681         /*
39682          * A physical address pointer pointing to a host buffer that the
39683          * command's response data will be written. This can be either a host
39684          * physical address (HPA) or a guest physical address (GPA) and must
39685          * point to a physically contiguous block of memory.
39686          */
39687         uint64_t        resp_addr;
39688 } __rte_packed;
39689
39690 /* hwrm_cfa_tcp_flag_process_qcfg_output (size:192b/24B) */
39691 struct hwrm_cfa_tcp_flag_process_qcfg_output {
39692         /* The specific error status for the command. */
39693         uint16_t        error_code;
39694         /* The HWRM command request type. */
39695         uint16_t        req_type;
39696         /* The sequence ID from the original command. */
39697         uint16_t        seq_id;
39698         /* The length of the response data in number of bytes. */
39699         uint16_t        resp_len;
39700         /* The port 0 RX mirror action record ID. */
39701         uint16_t        rx_ar_id_port0;
39702         /* The port 1 RX mirror action record ID. */
39703         uint16_t        rx_ar_id_port1;
39704         /*
39705          * The port 0 RX action record ID for TX TCP flag packets from
39706          * loopback path.
39707          */
39708         uint16_t        tx_ar_id_port0;
39709         /*
39710          * The port 1 RX action record ID for TX TCP flag packets from
39711          * loopback path.
39712          */
39713         uint16_t        tx_ar_id_port1;
39714         uint8_t unused_0[7];
39715         /*
39716          * This field is used in Output records to indicate that the output
39717          * is completely written to RAM. This field should be read as '1'
39718          * to indicate that the output has been completely written.
39719          * When writing a command completion or response to an internal
39720          * processor, the order of writes has to be such that this field is
39721          * written last.
39722          */
39723         uint8_t valid;
39724 } __rte_packed;
39725
39726 /**************************
39727  * hwrm_cfa_vf_pair_alloc *
39728  **************************/
39729
39730
39731 /* hwrm_cfa_vf_pair_alloc_input (size:448b/56B) */
39732 struct hwrm_cfa_vf_pair_alloc_input {
39733         /* The HWRM command request type. */
39734         uint16_t        req_type;
39735         /*
39736          * The completion ring to send the completion event on. This should
39737          * be the NQ ID returned from the `nq_alloc` HWRM command.
39738          */
39739         uint16_t        cmpl_ring;
39740         /*
39741          * The sequence ID is used by the driver for tracking multiple
39742          * commands. This ID is treated as opaque data by the firmware and
39743          * the value is returned in the `hwrm_resp_hdr` upon completion.
39744          */
39745         uint16_t        seq_id;
39746         /*
39747          * The target ID of the command:
39748          * * 0x0-0xFFF8 - The function ID
39749          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39750          * * 0xFFFD - Reserved for user-space HWRM interface
39751          * * 0xFFFF - HWRM
39752          */
39753         uint16_t        target_id;
39754         /*
39755          * A physical address pointer pointing to a host buffer that the
39756          * command's response data will be written. This can be either a host
39757          * physical address (HPA) or a guest physical address (GPA) and must
39758          * point to a physically contiguous block of memory.
39759          */
39760         uint64_t        resp_addr;
39761         /* Logical VF number (range: 0 -> MAX_VFS -1). */
39762         uint16_t        vf_a_id;
39763         /* Logical VF number (range: 0 -> MAX_VFS -1). */
39764         uint16_t        vf_b_id;
39765         uint8_t unused_0[4];
39766         /* VF Pair name (32 byte string). */
39767         char    pair_name[32];
39768 } __rte_packed;
39769
39770 /* hwrm_cfa_vf_pair_alloc_output (size:128b/16B) */
39771 struct hwrm_cfa_vf_pair_alloc_output {
39772         /* The specific error status for the command. */
39773         uint16_t        error_code;
39774         /* The HWRM command request type. */
39775         uint16_t        req_type;
39776         /* The sequence ID from the original command. */
39777         uint16_t        seq_id;
39778         /* The length of the response data in number of bytes. */
39779         uint16_t        resp_len;
39780         uint8_t unused_0[7];
39781         /*
39782          * This field is used in Output records to indicate that the output
39783          * is completely written to RAM. This field should be read as '1'
39784          * to indicate that the output has been completely written.
39785          * When writing a command completion or response to an internal
39786          * processor, the order of writes has to be such that this field is
39787          * written last.
39788          */
39789         uint8_t valid;
39790 } __rte_packed;
39791
39792 /*************************
39793  * hwrm_cfa_vf_pair_free *
39794  *************************/
39795
39796
39797 /* hwrm_cfa_vf_pair_free_input (size:384b/48B) */
39798 struct hwrm_cfa_vf_pair_free_input {
39799         /* The HWRM command request type. */
39800         uint16_t        req_type;
39801         /*
39802          * The completion ring to send the completion event on. This should
39803          * be the NQ ID returned from the `nq_alloc` HWRM command.
39804          */
39805         uint16_t        cmpl_ring;
39806         /*
39807          * The sequence ID is used by the driver for tracking multiple
39808          * commands. This ID is treated as opaque data by the firmware and
39809          * the value is returned in the `hwrm_resp_hdr` upon completion.
39810          */
39811         uint16_t        seq_id;
39812         /*
39813          * The target ID of the command:
39814          * * 0x0-0xFFF8 - The function ID
39815          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39816          * * 0xFFFD - Reserved for user-space HWRM interface
39817          * * 0xFFFF - HWRM
39818          */
39819         uint16_t        target_id;
39820         /*
39821          * A physical address pointer pointing to a host buffer that the
39822          * command's response data will be written. This can be either a host
39823          * physical address (HPA) or a guest physical address (GPA) and must
39824          * point to a physically contiguous block of memory.
39825          */
39826         uint64_t        resp_addr;
39827         /* VF Pair name (32 byte string). */
39828         char    pair_name[32];
39829 } __rte_packed;
39830
39831 /* hwrm_cfa_vf_pair_free_output (size:128b/16B) */
39832 struct hwrm_cfa_vf_pair_free_output {
39833         /* The specific error status for the command. */
39834         uint16_t        error_code;
39835         /* The HWRM command request type. */
39836         uint16_t        req_type;
39837         /* The sequence ID from the original command. */
39838         uint16_t        seq_id;
39839         /* The length of the response data in number of bytes. */
39840         uint16_t        resp_len;
39841         uint8_t unused_0[7];
39842         /*
39843          * This field is used in Output records to indicate that the output
39844          * is completely written to RAM. This field should be read as '1'
39845          * to indicate that the output has been completely written.
39846          * When writing a command completion or response to an internal
39847          * processor, the order of writes has to be such that this field is
39848          * written last.
39849          */
39850         uint8_t valid;
39851 } __rte_packed;
39852
39853 /*************************
39854  * hwrm_cfa_vf_pair_info *
39855  *************************/
39856
39857
39858 /* hwrm_cfa_vf_pair_info_input (size:448b/56B) */
39859 struct hwrm_cfa_vf_pair_info_input {
39860         /* The HWRM command request type. */
39861         uint16_t        req_type;
39862         /*
39863          * The completion ring to send the completion event on. This should
39864          * be the NQ ID returned from the `nq_alloc` HWRM command.
39865          */
39866         uint16_t        cmpl_ring;
39867         /*
39868          * The sequence ID is used by the driver for tracking multiple
39869          * commands. This ID is treated as opaque data by the firmware and
39870          * the value is returned in the `hwrm_resp_hdr` upon completion.
39871          */
39872         uint16_t        seq_id;
39873         /*
39874          * The target ID of the command:
39875          * * 0x0-0xFFF8 - The function ID
39876          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39877          * * 0xFFFD - Reserved for user-space HWRM interface
39878          * * 0xFFFF - HWRM
39879          */
39880         uint16_t        target_id;
39881         /*
39882          * A physical address pointer pointing to a host buffer that the
39883          * command's response data will be written. This can be either a host
39884          * physical address (HPA) or a guest physical address (GPA) and must
39885          * point to a physically contiguous block of memory.
39886          */
39887         uint64_t        resp_addr;
39888         uint32_t        flags;
39889         /* If this flag is set, lookup by name else lookup by index. */
39890         #define HWRM_CFA_VF_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE     UINT32_C(0x1)
39891         /* vf pair table index. */
39892         uint16_t        vf_pair_index;
39893         uint8_t unused_0[2];
39894         /* VF Pair name (32 byte string). */
39895         char    vf_pair_name[32];
39896 } __rte_packed;
39897
39898 /* hwrm_cfa_vf_pair_info_output (size:512b/64B) */
39899 struct hwrm_cfa_vf_pair_info_output {
39900         /* The specific error status for the command. */
39901         uint16_t        error_code;
39902         /* The HWRM command request type. */
39903         uint16_t        req_type;
39904         /* The sequence ID from the original command. */
39905         uint16_t        seq_id;
39906         /* The length of the response data in number of bytes. */
39907         uint16_t        resp_len;
39908         /* vf pair table index. */
39909         uint16_t        next_vf_pair_index;
39910         /* vf pair member a's vf_fid. */
39911         uint16_t        vf_a_fid;
39912         /* vf pair member a's Linux logical VF number. */
39913         uint16_t        vf_a_index;
39914         /* vf pair member b's vf_fid. */
39915         uint16_t        vf_b_fid;
39916         /* vf pair member a's Linux logical VF number. */
39917         uint16_t        vf_b_index;
39918         /* vf pair state. */
39919         uint8_t pair_state;
39920         /* Pair has been allocated */
39921         #define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
39922         /* Both pair members are active */
39923         #define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE    UINT32_C(0x2)
39924         #define HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_LAST \
39925                 HWRM_CFA_VF_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
39926         uint8_t unused_0[5];
39927         /* VF Pair name (32 byte string). */
39928         char    pair_name[32];
39929         uint8_t unused_1[7];
39930         /*
39931          * This field is used in Output records to indicate that the output
39932          * is completely written to RAM. This field should be read as '1'
39933          * to indicate that the output has been completely written.
39934          * When writing a command completion or response to an internal
39935          * processor, the order of writes has to be such that this field is
39936          * written last.
39937          */
39938         uint8_t valid;
39939 } __rte_packed;
39940
39941 /***********************
39942  * hwrm_cfa_pair_alloc *
39943  ***********************/
39944
39945
39946 /* hwrm_cfa_pair_alloc_input (size:576b/72B) */
39947 struct hwrm_cfa_pair_alloc_input {
39948         /* The HWRM command request type. */
39949         uint16_t        req_type;
39950         /*
39951          * The completion ring to send the completion event on. This should
39952          * be the NQ ID returned from the `nq_alloc` HWRM command.
39953          */
39954         uint16_t        cmpl_ring;
39955         /*
39956          * The sequence ID is used by the driver for tracking multiple
39957          * commands. This ID is treated as opaque data by the firmware and
39958          * the value is returned in the `hwrm_resp_hdr` upon completion.
39959          */
39960         uint16_t        seq_id;
39961         /*
39962          * The target ID of the command:
39963          * * 0x0-0xFFF8 - The function ID
39964          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
39965          * * 0xFFFD - Reserved for user-space HWRM interface
39966          * * 0xFFFF - HWRM
39967          */
39968         uint16_t        target_id;
39969         /*
39970          * A physical address pointer pointing to a host buffer that the
39971          * command's response data will be written. This can be either a host
39972          * physical address (HPA) or a guest physical address (GPA) and must
39973          * point to a physically contiguous block of memory.
39974          */
39975         uint64_t        resp_addr;
39976         /*
39977          * Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair,
39978          *            5-rep2fn_mod, 6-rep2fn_modall, 7-rep2fn_truflow).
39979          */
39980         uint16_t        pair_mode;
39981         /* Pair between VF on local host with PF or VF on specified host. */
39982         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_VF2FN \
39983                 UINT32_C(0x0)
39984         /* Pair between REP on local host with PF or VF on specified host. */
39985         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN \
39986                 UINT32_C(0x1)
39987         /* Pair between REP on local host with REP on specified host. */
39988         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2REP \
39989                 UINT32_C(0x2)
39990         /* Pair for the proxy interface. */
39991         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_PROXY \
39992                 UINT32_C(0x3)
39993         /* Pair for the PF interface. */
39994         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_PFPAIR \
39995                 UINT32_C(0x4)
39996         /* Modify existing rep2fn pair and move pair to new PF. */
39997         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_MOD \
39998                 UINT32_C(0x5)
39999         /*
40000          * Modify existing rep2fn pairs paired with same PF and move pairs
40001          * to new PF.
40002          */
40003         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_MODALL \
40004                 UINT32_C(0x6)
40005         /*
40006          * Truflow pair between REP on local host with PF or VF on specified
40007          * host.
40008          */
40009         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_TRUFLOW \
40010                 UINT32_C(0x7)
40011         #define HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_LAST \
40012                 HWRM_CFA_PAIR_ALLOC_INPUT_PAIR_MODE_REP2FN_TRUFLOW
40013         /* Logical VF number (range: 0 -> MAX_VFS -1). */
40014         uint16_t        vf_a_id;
40015         /* Logical Host (0xff-local host). */
40016         uint8_t host_b_id;
40017         /* Logical PF (0xff-PF for command channel). */
40018         uint8_t pf_b_id;
40019         /* Logical VF number (range: 0 -> MAX_VFS -1). */
40020         uint16_t        vf_b_id;
40021         /* Loopback port (0xff-internal loopback), valid for mode-3. */
40022         uint8_t port_id;
40023         /* Priority used for encap of loopback packets valid for mode-3. */
40024         uint8_t pri;
40025         /* New PF for rep2fn modify, valid for mode 5. */
40026         uint16_t        new_pf_fid;
40027         uint32_t        enables;
40028         /*
40029          * This bit must be '1' for the q_ab field to be
40030          * configured.
40031          */
40032         #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_Q_AB_VALID      UINT32_C(0x1)
40033         /*
40034          * This bit must be '1' for the q_ba field to be
40035          * configured.
40036          */
40037         #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_Q_BA_VALID      UINT32_C(0x2)
40038         /*
40039          * This bit must be '1' for the fc_ab field to be
40040          * configured.
40041          */
40042         #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_FC_AB_VALID     UINT32_C(0x4)
40043         /*
40044          * This bit must be '1' for the fc_ba field to be
40045          * configured.
40046          */
40047         #define HWRM_CFA_PAIR_ALLOC_INPUT_ENABLES_FC_BA_VALID     UINT32_C(0x8)
40048         /* VF Pair name (32 byte string). */
40049         char    pair_name[32];
40050         /*
40051          * The q_ab value specifies the logical index of the TX/RX CoS
40052          * queue to be assigned for traffic in the A to B direction of
40053          * the interface pair. The default value is 0.
40054          */
40055         uint8_t q_ab;
40056         /*
40057          * The q_ba value specifies the logical index of the TX/RX CoS
40058          * queue to be assigned for traffic in the B to A direction of
40059          * the interface pair. The default value is 1.
40060          */
40061         uint8_t q_ba;
40062         /*
40063          * Specifies whether RX ring flow control is disabled (0) or enabled
40064          * (1) in the A to B direction. The default value is 0, meaning that
40065          * packets will be dropped when the B-side RX rings are full.
40066          */
40067         uint8_t fc_ab;
40068         /*
40069          * Specifies whether RX ring flow control is disabled (0) or enabled
40070          * (1) in the B to A direction. The default value is 1, meaning that
40071          * the RX CoS queue will be flow controlled when the A-side RX rings
40072          * are full.
40073          */
40074         uint8_t fc_ba;
40075         uint8_t unused_1[4];
40076 } __rte_packed;
40077
40078 /* hwrm_cfa_pair_alloc_output (size:192b/24B) */
40079 struct hwrm_cfa_pair_alloc_output {
40080         /* The specific error status for the command. */
40081         uint16_t        error_code;
40082         /* The HWRM command request type. */
40083         uint16_t        req_type;
40084         /* The sequence ID from the original command. */
40085         uint16_t        seq_id;
40086         /* The length of the response data in number of bytes. */
40087         uint16_t        resp_len;
40088         /* Only valid for modes 1 and 2. */
40089         uint16_t        rx_cfa_code_a;
40090         /* Only valid for modes 1 and 2. */
40091         uint16_t        tx_cfa_action_a;
40092         /* Only valid for mode 2. */
40093         uint16_t        rx_cfa_code_b;
40094         /* Only valid for mode 2. */
40095         uint16_t        tx_cfa_action_b;
40096         uint8_t unused_0[7];
40097         /*
40098          * This field is used in Output records to indicate that the output
40099          * is completely written to RAM. This field should be read as '1'
40100          * to indicate that the output has been completely written.
40101          * When writing a command completion or response to an internal
40102          * processor, the order of writes has to be such that this field is
40103          * written last.
40104          */
40105         uint8_t valid;
40106 } __rte_packed;
40107
40108 /**********************
40109  * hwrm_cfa_pair_free *
40110  **********************/
40111
40112
40113 /* hwrm_cfa_pair_free_input (size:448b/56B) */
40114 struct hwrm_cfa_pair_free_input {
40115         /* The HWRM command request type. */
40116         uint16_t        req_type;
40117         /*
40118          * The completion ring to send the completion event on. This should
40119          * be the NQ ID returned from the `nq_alloc` HWRM command.
40120          */
40121         uint16_t        cmpl_ring;
40122         /*
40123          * The sequence ID is used by the driver for tracking multiple
40124          * commands. This ID is treated as opaque data by the firmware and
40125          * the value is returned in the `hwrm_resp_hdr` upon completion.
40126          */
40127         uint16_t        seq_id;
40128         /*
40129          * The target ID of the command:
40130          * * 0x0-0xFFF8 - The function ID
40131          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40132          * * 0xFFFD - Reserved for user-space HWRM interface
40133          * * 0xFFFF - HWRM
40134          */
40135         uint16_t        target_id;
40136         /*
40137          * A physical address pointer pointing to a host buffer that the
40138          * command's response data will be written. This can be either a host
40139          * physical address (HPA) or a guest physical address (GPA) and must
40140          * point to a physically contiguous block of memory.
40141          */
40142         uint64_t        resp_addr;
40143         /* VF Pair name (32 byte string). */
40144         char    pair_name[32];
40145         /* Logical PF (0xff-PF for command channel). */
40146         uint8_t pf_b_id;
40147         uint8_t unused_0[3];
40148         /* Logical VF number (range: 0 -> MAX_VFS -1). */
40149         uint16_t        vf_id;
40150         /*
40151          * Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair,
40152          *            5-rep2fn_mod, 6-rep2fn_modall, 7-rep2fn_truflow).
40153          */
40154         uint16_t        pair_mode;
40155         /* Pair between VF on local host with PF or VF on specified host. */
40156         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_VF2FN          UINT32_C(0x0)
40157         /* Pair between REP on local host with PF or VF on specified host. */
40158         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN         UINT32_C(0x1)
40159         /* Pair between REP on local host with REP on specified host. */
40160         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2REP        UINT32_C(0x2)
40161         /* Pair for the proxy interface. */
40162         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_PROXY          UINT32_C(0x3)
40163         /* Pair for the PF interface. */
40164         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_PFPAIR         UINT32_C(0x4)
40165         /* Modify existing rep2fn pair and move pair to new PF. */
40166         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_MOD     UINT32_C(0x5)
40167         /*
40168          * Modify existing rep2fn pairs paired with same PF and move pairs
40169          * to new PF.
40170          */
40171         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_MODALL  UINT32_C(0x6)
40172         /*
40173          * Truflow pair between REP on local host with PF or VF on
40174          * specified host.
40175          */
40176         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_TRUFLOW UINT32_C(0x7)
40177         #define HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_LAST \
40178                 HWRM_CFA_PAIR_FREE_INPUT_PAIR_MODE_REP2FN_TRUFLOW
40179 } __rte_packed;
40180
40181 /* hwrm_cfa_pair_free_output (size:128b/16B) */
40182 struct hwrm_cfa_pair_free_output {
40183         /* The specific error status for the command. */
40184         uint16_t        error_code;
40185         /* The HWRM command request type. */
40186         uint16_t        req_type;
40187         /* The sequence ID from the original command. */
40188         uint16_t        seq_id;
40189         /* The length of the response data in number of bytes. */
40190         uint16_t        resp_len;
40191         uint8_t unused_0[7];
40192         /*
40193          * This field is used in Output records to indicate that the output
40194          * is completely written to RAM. This field should be read as '1'
40195          * to indicate that the output has been completely written.
40196          * When writing a command completion or response to an internal
40197          * processor, the order of writes has to be such that this field is
40198          * written last.
40199          */
40200         uint8_t valid;
40201 } __rte_packed;
40202
40203 /**********************
40204  * hwrm_cfa_pair_info *
40205  **********************/
40206
40207
40208 /* hwrm_cfa_pair_info_input (size:448b/56B) */
40209 struct hwrm_cfa_pair_info_input {
40210         /* The HWRM command request type. */
40211         uint16_t        req_type;
40212         /*
40213          * The completion ring to send the completion event on. This should
40214          * be the NQ ID returned from the `nq_alloc` HWRM command.
40215          */
40216         uint16_t        cmpl_ring;
40217         /*
40218          * The sequence ID is used by the driver for tracking multiple
40219          * commands. This ID is treated as opaque data by the firmware and
40220          * the value is returned in the `hwrm_resp_hdr` upon completion.
40221          */
40222         uint16_t        seq_id;
40223         /*
40224          * The target ID of the command:
40225          * * 0x0-0xFFF8 - The function ID
40226          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40227          * * 0xFFFD - Reserved for user-space HWRM interface
40228          * * 0xFFFF - HWRM
40229          */
40230         uint16_t        target_id;
40231         /*
40232          * A physical address pointer pointing to a host buffer that the
40233          * command's response data will be written. This can be either a host
40234          * physical address (HPA) or a guest physical address (GPA) and must
40235          * point to a physically contiguous block of memory.
40236          */
40237         uint64_t        resp_addr;
40238         uint32_t        flags;
40239         /* If this flag is set, lookup by name else lookup by index. */
40240         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE      UINT32_C(0x1)
40241         /* If this flag is set, lookup by PF id and VF id. */
40242         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE     UINT32_C(0x2)
40243         /* Pair table index. */
40244         uint16_t        pair_index;
40245         /* Pair pf index. */
40246         uint8_t pair_pfid;
40247         /* Pair vf index. */
40248         uint8_t pair_vfid;
40249         /* Pair name (32 byte string). */
40250         char    pair_name[32];
40251 } __rte_packed;
40252
40253 /* hwrm_cfa_pair_info_output (size:576b/72B) */
40254 struct hwrm_cfa_pair_info_output {
40255         /* The specific error status for the command. */
40256         uint16_t        error_code;
40257         /* The HWRM command request type. */
40258         uint16_t        req_type;
40259         /* The sequence ID from the original command. */
40260         uint16_t        seq_id;
40261         /* The length of the response data in number of bytes. */
40262         uint16_t        resp_len;
40263         /* Pair table index. */
40264         uint16_t        next_pair_index;
40265         /* Pair member a's fid. */
40266         uint16_t        a_fid;
40267         /* Logical host number. */
40268         uint8_t host_a_index;
40269         /* Logical PF number. */
40270         uint8_t pf_a_index;
40271         /* Pair member a's Linux logical VF number. */
40272         uint16_t        vf_a_index;
40273         /* Rx CFA code. */
40274         uint16_t        rx_cfa_code_a;
40275         /* Tx CFA action. */
40276         uint16_t        tx_cfa_action_a;
40277         /* Pair member b's fid. */
40278         uint16_t        b_fid;
40279         /* Logical host number. */
40280         uint8_t host_b_index;
40281         /* Logical PF number. */
40282         uint8_t pf_b_index;
40283         /* Pair member a's Linux logical VF number. */
40284         uint16_t        vf_b_index;
40285         /* Rx CFA code. */
40286         uint16_t        rx_cfa_code_b;
40287         /* Tx CFA action. */
40288         uint16_t        tx_cfa_action_b;
40289         /* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */
40290         uint8_t pair_mode;
40291         /* Pair between VF on local host with PF or VF on specified host. */
40292         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN   UINT32_C(0x0)
40293         /* Pair between REP on local host with PF or VF on specified host. */
40294         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN  UINT32_C(0x1)
40295         /* Pair between REP on local host with REP on specified host. */
40296         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
40297         /* Pair for the proxy interface. */
40298         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY   UINT32_C(0x3)
40299         /* Pair for the PF interface. */
40300         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR  UINT32_C(0x4)
40301         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST \
40302                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR
40303         /* Pair state. */
40304         uint8_t pair_state;
40305         /* Pair has been allocated */
40306         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
40307         /* Both pair members are active */
40308         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE    UINT32_C(0x2)
40309         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST \
40310                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
40311         /* Pair name (32 byte string). */
40312         char    pair_name[32];
40313         uint8_t unused_0[7];
40314         /*
40315          * This field is used in Output records to indicate that the output
40316          * is completely written to RAM. This field should be read as '1'
40317          * to indicate that the output has been completely written.
40318          * When writing a command completion or response to an internal
40319          * processor, the order of writes has to be such that this field is
40320          * written last.
40321          */
40322         uint8_t valid;
40323 } __rte_packed;
40324
40325 /**********************
40326  * hwrm_cfa_vfr_alloc *
40327  **********************/
40328
40329
40330 /* hwrm_cfa_vfr_alloc_input (size:448b/56B) */
40331 struct hwrm_cfa_vfr_alloc_input {
40332         /* The HWRM command request type. */
40333         uint16_t        req_type;
40334         /*
40335          * The completion ring to send the completion event on. This should
40336          * be the NQ ID returned from the `nq_alloc` HWRM command.
40337          */
40338         uint16_t        cmpl_ring;
40339         /*
40340          * The sequence ID is used by the driver for tracking multiple
40341          * commands. This ID is treated as opaque data by the firmware and
40342          * the value is returned in the `hwrm_resp_hdr` upon completion.
40343          */
40344         uint16_t        seq_id;
40345         /*
40346          * The target ID of the command:
40347          * * 0x0-0xFFF8 - The function ID
40348          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40349          * * 0xFFFD - Reserved for user-space HWRM interface
40350          * * 0xFFFF - HWRM
40351          */
40352         uint16_t        target_id;
40353         /*
40354          * A physical address pointer pointing to a host buffer that the
40355          * command's response data will be written. This can be either a host
40356          * physical address (HPA) or a guest physical address (GPA) and must
40357          * point to a physically contiguous block of memory.
40358          */
40359         uint64_t        resp_addr;
40360         /* Logical VF number (range: 0 -> MAX_VFS -1). */
40361         uint16_t        vf_id;
40362         /*
40363          * This field is reserved for the future use.
40364          * It shall be set to 0.
40365          */
40366         uint16_t        reserved;
40367         uint8_t unused_0[4];
40368         /* VF Representor name (32 byte string). */
40369         char    vfr_name[32];
40370 } __rte_packed;
40371
40372 /* hwrm_cfa_vfr_alloc_output (size:128b/16B) */
40373 struct hwrm_cfa_vfr_alloc_output {
40374         /* The specific error status for the command. */
40375         uint16_t        error_code;
40376         /* The HWRM command request type. */
40377         uint16_t        req_type;
40378         /* The sequence ID from the original command. */
40379         uint16_t        seq_id;
40380         /* The length of the response data in number of bytes. */
40381         uint16_t        resp_len;
40382         /* Rx CFA code. */
40383         uint16_t        rx_cfa_code;
40384         /* Tx CFA action. */
40385         uint16_t        tx_cfa_action;
40386         uint8_t unused_0[3];
40387         /*
40388          * This field is used in Output records to indicate that the output
40389          * is completely written to RAM. This field should be read as '1'
40390          * to indicate that the output has been completely written.
40391          * When writing a command completion or response to an internal
40392          * processor, the order of writes has to be such that this field is
40393          * written last.
40394          */
40395         uint8_t valid;
40396 } __rte_packed;
40397
40398 /*********************
40399  * hwrm_cfa_vfr_free *
40400  *********************/
40401
40402
40403 /* hwrm_cfa_vfr_free_input (size:448b/56B) */
40404 struct hwrm_cfa_vfr_free_input {
40405         /* The HWRM command request type. */
40406         uint16_t        req_type;
40407         /*
40408          * The completion ring to send the completion event on. This should
40409          * be the NQ ID returned from the `nq_alloc` HWRM command.
40410          */
40411         uint16_t        cmpl_ring;
40412         /*
40413          * The sequence ID is used by the driver for tracking multiple
40414          * commands. This ID is treated as opaque data by the firmware and
40415          * the value is returned in the `hwrm_resp_hdr` upon completion.
40416          */
40417         uint16_t        seq_id;
40418         /*
40419          * The target ID of the command:
40420          * * 0x0-0xFFF8 - The function ID
40421          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40422          * * 0xFFFD - Reserved for user-space HWRM interface
40423          * * 0xFFFF - HWRM
40424          */
40425         uint16_t        target_id;
40426         /*
40427          * A physical address pointer pointing to a host buffer that the
40428          * command's response data will be written. This can be either a host
40429          * physical address (HPA) or a guest physical address (GPA) and must
40430          * point to a physically contiguous block of memory.
40431          */
40432         uint64_t        resp_addr;
40433         /* VF Representor name (32 byte string). */
40434         char    vfr_name[32];
40435         /* Logical VF number (range: 0 -> MAX_VFS -1). */
40436         uint16_t        vf_id;
40437         /*
40438          * This field is reserved for the future use.
40439          * It shall be set to 0.
40440          */
40441         uint16_t        reserved;
40442         uint8_t unused_0[4];
40443 } __rte_packed;
40444
40445 /* hwrm_cfa_vfr_free_output (size:128b/16B) */
40446 struct hwrm_cfa_vfr_free_output {
40447         /* The specific error status for the command. */
40448         uint16_t        error_code;
40449         /* The HWRM command request type. */
40450         uint16_t        req_type;
40451         /* The sequence ID from the original command. */
40452         uint16_t        seq_id;
40453         /* The length of the response data in number of bytes. */
40454         uint16_t        resp_len;
40455         uint8_t unused_0[7];
40456         /*
40457          * This field is used in Output records to indicate that the output
40458          * is completely written to RAM. This field should be read as '1'
40459          * to indicate that the output has been completely written.
40460          * When writing a command completion or response to an internal
40461          * processor, the order of writes has to be such that this field is
40462          * written last.
40463          */
40464         uint8_t valid;
40465 } __rte_packed;
40466
40467 /***************************************
40468  * hwrm_cfa_redirect_query_tunnel_type *
40469  ***************************************/
40470
40471
40472 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */
40473 struct hwrm_cfa_redirect_query_tunnel_type_input {
40474         /* The HWRM command request type. */
40475         uint16_t        req_type;
40476         /*
40477          * The completion ring to send the completion event on. This should
40478          * be the NQ ID returned from the `nq_alloc` HWRM command.
40479          */
40480         uint16_t        cmpl_ring;
40481         /*
40482          * The sequence ID is used by the driver for tracking multiple
40483          * commands. This ID is treated as opaque data by the firmware and
40484          * the value is returned in the `hwrm_resp_hdr` upon completion.
40485          */
40486         uint16_t        seq_id;
40487         /*
40488          * The target ID of the command:
40489          * * 0x0-0xFFF8 - The function ID
40490          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40491          * * 0xFFFD - Reserved for user-space HWRM interface
40492          * * 0xFFFF - HWRM
40493          */
40494         uint16_t        target_id;
40495         /*
40496          * A physical address pointer pointing to a host buffer that the
40497          * command's response data will be written. This can be either a host
40498          * physical address (HPA) or a guest physical address (GPA) and must
40499          * point to a physically contiguous block of memory.
40500          */
40501         uint64_t        resp_addr;
40502         /* The source function id. */
40503         uint16_t        src_fid;
40504         uint8_t unused_0[6];
40505 } __rte_packed;
40506
40507 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
40508 struct hwrm_cfa_redirect_query_tunnel_type_output {
40509         /* The specific error status for the command. */
40510         uint16_t        error_code;
40511         /* The HWRM command request type. */
40512         uint16_t        req_type;
40513         /* The sequence ID from the original command. */
40514         uint16_t        seq_id;
40515         /* The length of the response data in number of bytes. */
40516         uint16_t        resp_len;
40517         /* Tunnel Mask. */
40518         uint32_t        tunnel_mask;
40519         /* Non-tunnel */
40520         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL \
40521                 UINT32_C(0x1)
40522         /* Virtual eXtensible Local Area Network (VXLAN) */
40523         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN \
40524                 UINT32_C(0x2)
40525         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
40526         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE \
40527                 UINT32_C(0x4)
40528         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
40529         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE \
40530                 UINT32_C(0x8)
40531         /* IP in IP */
40532         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP \
40533                 UINT32_C(0x10)
40534         /* Generic Network Virtualization Encapsulation (Geneve) */
40535         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE \
40536                 UINT32_C(0x20)
40537         /* Multi-Protocol Label Switching (MPLS) */
40538         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS \
40539                 UINT32_C(0x40)
40540         /* Stateless Transport Tunnel (STT) */
40541         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT \
40542                 UINT32_C(0x80)
40543         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
40544         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE \
40545                 UINT32_C(0x100)
40546         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
40547         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4 \
40548                 UINT32_C(0x200)
40549         /*
40550          * Enhance Generic Routing Encapsulation (GRE version 1) inside IP
40551          * datagram payload
40552          */
40553         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1 \
40554                 UINT32_C(0x400)
40555         /* Any tunneled traffic */
40556         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL \
40557                 UINT32_C(0x800)
40558         /* Use fixed layer 2 ether type of 0xFFFF */
40559         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2_ETYPE \
40560                 UINT32_C(0x1000)
40561         /*
40562          * IPV6 over virtual eXtensible Local Area Network with GPE header
40563          * (IPV6oVXLANGPE)
40564          */
40565         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE_V6 \
40566                 UINT32_C(0x2000)
40567         uint8_t unused_0[3];
40568         /*
40569          * This field is used in Output records to indicate that the output
40570          * is completely written to RAM. This field should be read as '1'
40571          * to indicate that the output has been completely written.
40572          * When writing a command completion or response to an internal
40573          * processor, the order of writes has to be such that this field is
40574          * written last.
40575          */
40576         uint8_t valid;
40577 } __rte_packed;
40578
40579 /*************************
40580  * hwrm_cfa_ctx_mem_rgtr *
40581  *************************/
40582
40583
40584 /* hwrm_cfa_ctx_mem_rgtr_input (size:256b/32B) */
40585 struct hwrm_cfa_ctx_mem_rgtr_input {
40586         /* The HWRM command request type. */
40587         uint16_t        req_type;
40588         /*
40589          * The completion ring to send the completion event on. This should
40590          * be the NQ ID returned from the `nq_alloc` HWRM command.
40591          */
40592         uint16_t        cmpl_ring;
40593         /*
40594          * The sequence ID is used by the driver for tracking multiple
40595          * commands. This ID is treated as opaque data by the firmware and
40596          * the value is returned in the `hwrm_resp_hdr` upon completion.
40597          */
40598         uint16_t        seq_id;
40599         /*
40600          * The target ID of the command:
40601          * * 0x0-0xFFF8 - The function ID
40602          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40603          * * 0xFFFD - Reserved for user-space HWRM interface
40604          * * 0xFFFF - HWRM
40605          */
40606         uint16_t        target_id;
40607         /*
40608          * A physical address pointer pointing to a host buffer that the
40609          * command's response data will be written. This can be either a host
40610          * physical address (HPA) or a guest physical address (GPA) and must
40611          * point to a physically contiguous block of memory.
40612          */
40613         uint64_t        resp_addr;
40614         uint16_t        flags;
40615         /* Counter PBL indirect levels. */
40616         uint8_t page_level;
40617         /* PBL pointer is physical start address. */
40618         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
40619         /* PBL pointer points to PTE table. */
40620         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
40621         /*
40622          * PBL pointer points to PDE table with each entry pointing to PTE
40623          * tables.
40624          */
40625         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
40626         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LAST \
40627                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
40628         /* Page size. */
40629         uint8_t page_size;
40630         /* 4KB page size. */
40631         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
40632         /* 8KB page size. */
40633         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
40634         /* 64KB page size. */
40635         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
40636         /* 256KB page size. */
40637         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
40638         /* 1MB page size. */
40639         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
40640         /* 2MB page size. */
40641         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
40642         /* 4MB page size. */
40643         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
40644         /* 1GB page size. */
40645         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
40646         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_LAST \
40647                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G
40648         uint32_t        unused_0;
40649         /* Pointer to the PBL, or PDL depending on number of levels */
40650         uint64_t        page_dir;
40651 } __rte_packed;
40652
40653 /* hwrm_cfa_ctx_mem_rgtr_output (size:128b/16B) */
40654 struct hwrm_cfa_ctx_mem_rgtr_output {
40655         /* The specific error status for the command. */
40656         uint16_t        error_code;
40657         /* The HWRM command request type. */
40658         uint16_t        req_type;
40659         /* The sequence ID from the original command. */
40660         uint16_t        seq_id;
40661         /* The length of the response data in number of bytes. */
40662         uint16_t        resp_len;
40663         /*
40664          * Id/Handle to the recently register context memory. This handle is
40665          * passed to the CFA feature.
40666          */
40667         uint16_t        ctx_id;
40668         uint8_t unused_0[5];
40669         /*
40670          * This field is used in Output records to indicate that the output
40671          * is completely written to RAM. This field should be read as '1'
40672          * to indicate that the output has been completely written.
40673          * When writing a command completion or response to an internal
40674          * processor, the order of writes has to be such that this field is
40675          * written last.
40676          */
40677         uint8_t valid;
40678 } __rte_packed;
40679
40680 /***************************
40681  * hwrm_cfa_ctx_mem_unrgtr *
40682  ***************************/
40683
40684
40685 /* hwrm_cfa_ctx_mem_unrgtr_input (size:192b/24B) */
40686 struct hwrm_cfa_ctx_mem_unrgtr_input {
40687         /* The HWRM command request type. */
40688         uint16_t        req_type;
40689         /*
40690          * The completion ring to send the completion event on. This should
40691          * be the NQ ID returned from the `nq_alloc` HWRM command.
40692          */
40693         uint16_t        cmpl_ring;
40694         /*
40695          * The sequence ID is used by the driver for tracking multiple
40696          * commands. This ID is treated as opaque data by the firmware and
40697          * the value is returned in the `hwrm_resp_hdr` upon completion.
40698          */
40699         uint16_t        seq_id;
40700         /*
40701          * The target ID of the command:
40702          * * 0x0-0xFFF8 - The function ID
40703          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40704          * * 0xFFFD - Reserved for user-space HWRM interface
40705          * * 0xFFFF - HWRM
40706          */
40707         uint16_t        target_id;
40708         /*
40709          * A physical address pointer pointing to a host buffer that the
40710          * command's response data will be written. This can be either a host
40711          * physical address (HPA) or a guest physical address (GPA) and must
40712          * point to a physically contiguous block of memory.
40713          */
40714         uint64_t        resp_addr;
40715         /*
40716          * Id/Handle to the recently register context memory. This handle is
40717          * passed to the CFA feature.
40718          */
40719         uint16_t        ctx_id;
40720         uint8_t unused_0[6];
40721 } __rte_packed;
40722
40723 /* hwrm_cfa_ctx_mem_unrgtr_output (size:128b/16B) */
40724 struct hwrm_cfa_ctx_mem_unrgtr_output {
40725         /* The specific error status for the command. */
40726         uint16_t        error_code;
40727         /* The HWRM command request type. */
40728         uint16_t        req_type;
40729         /* The sequence ID from the original command. */
40730         uint16_t        seq_id;
40731         /* The length of the response data in number of bytes. */
40732         uint16_t        resp_len;
40733         uint8_t unused_0[7];
40734         /*
40735          * This field is used in Output records to indicate that the output
40736          * is completely written to RAM. This field should be read as '1'
40737          * to indicate that the output has been completely written.
40738          * When writing a command completion or response to an internal
40739          * processor, the order of writes has to be such that this field is
40740          * written last.
40741          */
40742         uint8_t valid;
40743 } __rte_packed;
40744
40745 /*************************
40746  * hwrm_cfa_ctx_mem_qctx *
40747  *************************/
40748
40749
40750 /* hwrm_cfa_ctx_mem_qctx_input (size:192b/24B) */
40751 struct hwrm_cfa_ctx_mem_qctx_input {
40752         /* The HWRM command request type. */
40753         uint16_t        req_type;
40754         /*
40755          * The completion ring to send the completion event on. This should
40756          * be the NQ ID returned from the `nq_alloc` HWRM command.
40757          */
40758         uint16_t        cmpl_ring;
40759         /*
40760          * The sequence ID is used by the driver for tracking multiple
40761          * commands. This ID is treated as opaque data by the firmware and
40762          * the value is returned in the `hwrm_resp_hdr` upon completion.
40763          */
40764         uint16_t        seq_id;
40765         /*
40766          * The target ID of the command:
40767          * * 0x0-0xFFF8 - The function ID
40768          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40769          * * 0xFFFD - Reserved for user-space HWRM interface
40770          * * 0xFFFF - HWRM
40771          */
40772         uint16_t        target_id;
40773         /*
40774          * A physical address pointer pointing to a host buffer that the
40775          * command's response data will be written. This can be either a host
40776          * physical address (HPA) or a guest physical address (GPA) and must
40777          * point to a physically contiguous block of memory.
40778          */
40779         uint64_t        resp_addr;
40780         /*
40781          * Id/Handle to the recently register context memory. This handle is
40782          * passed to the CFA feature.
40783          */
40784         uint16_t        ctx_id;
40785         uint8_t unused_0[6];
40786 } __rte_packed;
40787
40788 /* hwrm_cfa_ctx_mem_qctx_output (size:256b/32B) */
40789 struct hwrm_cfa_ctx_mem_qctx_output {
40790         /* The specific error status for the command. */
40791         uint16_t        error_code;
40792         /* The HWRM command request type. */
40793         uint16_t        req_type;
40794         /* The sequence ID from the original command. */
40795         uint16_t        seq_id;
40796         /* The length of the response data in number of bytes. */
40797         uint16_t        resp_len;
40798         uint16_t        flags;
40799         /* Counter PBL indirect levels. */
40800         uint8_t page_level;
40801         /* PBL pointer is physical start address. */
40802         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
40803         /* PBL pointer points to PTE table. */
40804         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
40805         /*
40806          * PBL pointer points to PDE table with each entry pointing to PTE
40807          * tables.
40808          */
40809         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
40810         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LAST \
40811                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2
40812         /* Page size. */
40813         uint8_t page_size;
40814         /* 4KB page size. */
40815         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
40816         /* 8KB page size. */
40817         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
40818         /* 64KB page size. */
40819         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
40820         /* 256KB page size. */
40821         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
40822         /* 1MB page size. */
40823         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
40824         /* 2MB page size. */
40825         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
40826         /* 4MB page size. */
40827         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
40828         /* 1GB page size. */
40829         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
40830         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_LAST \
40831                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G
40832         uint8_t unused_0[4];
40833         /* Pointer to the PBL, or PDL depending on number of levels */
40834         uint64_t        page_dir;
40835         uint8_t unused_1[7];
40836         /*
40837          * This field is used in Output records to indicate that the output
40838          * is completely written to RAM. This field should be read as '1'
40839          * to indicate that the output has been completely written.
40840          * When writing a command completion or response to an internal
40841          * processor, the order of writes has to be such that this field is
40842          * written last.
40843          */
40844         uint8_t valid;
40845 } __rte_packed;
40846
40847 /**************************
40848  * hwrm_cfa_ctx_mem_qcaps *
40849  **************************/
40850
40851
40852 /* hwrm_cfa_ctx_mem_qcaps_input (size:128b/16B) */
40853 struct hwrm_cfa_ctx_mem_qcaps_input {
40854         /* The HWRM command request type. */
40855         uint16_t        req_type;
40856         /*
40857          * The completion ring to send the completion event on. This should
40858          * be the NQ ID returned from the `nq_alloc` HWRM command.
40859          */
40860         uint16_t        cmpl_ring;
40861         /*
40862          * The sequence ID is used by the driver for tracking multiple
40863          * commands. This ID is treated as opaque data by the firmware and
40864          * the value is returned in the `hwrm_resp_hdr` upon completion.
40865          */
40866         uint16_t        seq_id;
40867         /*
40868          * The target ID of the command:
40869          * * 0x0-0xFFF8 - The function ID
40870          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40871          * * 0xFFFD - Reserved for user-space HWRM interface
40872          * * 0xFFFF - HWRM
40873          */
40874         uint16_t        target_id;
40875         /*
40876          * A physical address pointer pointing to a host buffer that the
40877          * command's response data will be written. This can be either a host
40878          * physical address (HPA) or a guest physical address (GPA) and must
40879          * point to a physically contiguous block of memory.
40880          */
40881         uint64_t        resp_addr;
40882 } __rte_packed;
40883
40884 /* hwrm_cfa_ctx_mem_qcaps_output (size:128b/16B) */
40885 struct hwrm_cfa_ctx_mem_qcaps_output {
40886         /* The specific error status for the command. */
40887         uint16_t        error_code;
40888         /* The HWRM command request type. */
40889         uint16_t        req_type;
40890         /* The sequence ID from the original command. */
40891         uint16_t        seq_id;
40892         /* The length of the response data in number of bytes. */
40893         uint16_t        resp_len;
40894         /*
40895          * Indicates the maximum number of context memory which can be
40896          * registered.
40897          */
40898         uint16_t        max_entries;
40899         uint8_t unused_0[5];
40900         /*
40901          * This field is used in Output records to indicate that the output
40902          * is completely written to RAM. This field should be read as '1'
40903          * to indicate that the output has been completely written.
40904          * When writing a command completion or response to an internal
40905          * processor, the order of writes has to be such that this field is
40906          * written last.
40907          */
40908         uint8_t valid;
40909 } __rte_packed;
40910
40911 /**************************
40912  * hwrm_cfa_counter_qcaps *
40913  **************************/
40914
40915
40916 /* hwrm_cfa_counter_qcaps_input (size:128b/16B) */
40917 struct hwrm_cfa_counter_qcaps_input {
40918         /* The HWRM command request type. */
40919         uint16_t        req_type;
40920         /*
40921          * The completion ring to send the completion event on. This should
40922          * be the NQ ID returned from the `nq_alloc` HWRM command.
40923          */
40924         uint16_t        cmpl_ring;
40925         /*
40926          * The sequence ID is used by the driver for tracking multiple
40927          * commands. This ID is treated as opaque data by the firmware and
40928          * the value is returned in the `hwrm_resp_hdr` upon completion.
40929          */
40930         uint16_t        seq_id;
40931         /*
40932          * The target ID of the command:
40933          * * 0x0-0xFFF8 - The function ID
40934          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
40935          * * 0xFFFD - Reserved for user-space HWRM interface
40936          * * 0xFFFF - HWRM
40937          */
40938         uint16_t        target_id;
40939         /*
40940          * A physical address pointer pointing to a host buffer that the
40941          * command's response data will be written. This can be either a host
40942          * physical address (HPA) or a guest physical address (GPA) and must
40943          * point to a physically contiguous block of memory.
40944          */
40945         uint64_t        resp_addr;
40946 } __rte_packed;
40947
40948 /* hwrm_cfa_counter_qcaps_output (size:576b/72B) */
40949 struct hwrm_cfa_counter_qcaps_output {
40950         /* The specific error status for the command. */
40951         uint16_t        error_code;
40952         /* The HWRM command request type. */
40953         uint16_t        req_type;
40954         /* The sequence ID from the original command. */
40955         uint16_t        seq_id;
40956         /* The length of the response data in number of bytes. */
40957         uint16_t        resp_len;
40958         uint32_t        flags;
40959         /* Enumeration denoting the supported CFA counter format. */
40960         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT \
40961                 UINT32_C(0x1)
40962         /* CFA counter types are not supported. */
40963         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_NONE \
40964                 UINT32_C(0x0)
40965         /* 64-bit packet counters followed by 64-bit byte counters format. */
40966         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT \
40967                 UINT32_C(0x1)
40968         #define HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_LAST \
40969                 HWRM_CFA_COUNTER_QCAPS_OUTPUT_FLAGS_COUNTER_FORMAT_64_BIT
40970         uint32_t        unused_0;
40971         /*
40972          * Minimum guaranteed number of flow counters supported for this
40973          * function, in RX direction.
40974          */
40975         uint32_t        min_rx_fc;
40976         /*
40977          * Maximum non-guaranteed number of flow counters supported for this
40978          * function, in RX direction.
40979          */
40980         uint32_t        max_rx_fc;
40981         /*
40982          * Minimum guaranteed number of flow counters supported for this
40983          * function, in TX direction.
40984          */
40985         uint32_t        min_tx_fc;
40986         /*
40987          * Maximum non-guaranteed number of flow counters supported for this
40988          * function, in TX direction.
40989          */
40990         uint32_t        max_tx_fc;
40991         /*
40992          * Minimum guaranteed number of extension flow counters supported for
40993          * this function, in RX direction.
40994          */
40995         uint32_t        min_rx_efc;
40996         /*
40997          * Maximum non-guaranteed number of extension flow counters supported
40998          * for this function, in RX direction.
40999          */
41000         uint32_t        max_rx_efc;
41001         /*
41002          * Minimum guaranteed number of extension flow counters supported for
41003          * this function, in TX direction.
41004          */
41005         uint32_t        min_tx_efc;
41006         /*
41007          * Maximum non-guaranteed number of extension flow counters supported
41008          * for this function, in TX direction.
41009          */
41010         uint32_t        max_tx_efc;
41011         /*
41012          * Minimum guaranteed number of meter drop counters supported for
41013          * this function, in RX direction.
41014          */
41015         uint32_t        min_rx_mdc;
41016         /*
41017          * Maximum non-guaranteed number of meter drop counters supported for
41018          * this function, in RX direction.
41019          */
41020         uint32_t        max_rx_mdc;
41021         /*
41022          * Minimum guaranteed number of meter drop counters supported for this
41023          * function, in TX direction.
41024          */
41025         uint32_t        min_tx_mdc;
41026         /*
41027          * Maximum non-guaranteed number of meter drop counters supported for
41028          * this function, in TX direction.
41029          */
41030         uint32_t        max_tx_mdc;
41031         /*
41032          * Maximum guaranteed number of flow counters which can be used during
41033          * flow alloc.
41034          */
41035         uint32_t        max_flow_alloc_fc;
41036         uint8_t unused_1[3];
41037         /*
41038          * This field is used in Output records to indicate that the output
41039          * is completely written to RAM. This field should be read as '1'
41040          * to indicate that the output has been completely written.
41041          * When writing a command completion or response to an internal
41042          * processor, the order of writes has to be such that this field is
41043          * written last.
41044          */
41045         uint8_t valid;
41046 } __rte_packed;
41047
41048 /************************
41049  * hwrm_cfa_counter_cfg *
41050  ************************/
41051
41052
41053 /* hwrm_cfa_counter_cfg_input (size:256b/32B) */
41054 struct hwrm_cfa_counter_cfg_input {
41055         /* The HWRM command request type. */
41056         uint16_t        req_type;
41057         /*
41058          * The completion ring to send the completion event on. This should
41059          * be the NQ ID returned from the `nq_alloc` HWRM command.
41060          */
41061         uint16_t        cmpl_ring;
41062         /*
41063          * The sequence ID is used by the driver for tracking multiple
41064          * commands. This ID is treated as opaque data by the firmware and
41065          * the value is returned in the `hwrm_resp_hdr` upon completion.
41066          */
41067         uint16_t        seq_id;
41068         /*
41069          * The target ID of the command:
41070          * * 0x0-0xFFF8 - The function ID
41071          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41072          * * 0xFFFD - Reserved for user-space HWRM interface
41073          * * 0xFFFF - HWRM
41074          */
41075         uint16_t        target_id;
41076         /*
41077          * A physical address pointer pointing to a host buffer that the
41078          * command's response data will be written. This can be either a host
41079          * physical address (HPA) or a guest physical address (GPA) and must
41080          * point to a physically contiguous block of memory.
41081          */
41082         uint64_t        resp_addr;
41083         uint16_t        flags;
41084         /* Enumeration denoting the configuration mode. */
41085         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE \
41086                 UINT32_C(0x1)
41087         /* Disable the configuration mode. */
41088         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_DISABLE \
41089                 UINT32_C(0x0)
41090         /* Enable the configuration mode. */
41091         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE \
41092                 UINT32_C(0x1)
41093         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_LAST \
41094                 HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_CFG_MODE_ENABLE
41095         /* Enumeration denoting the RX, TX type of the resource. */
41096         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH \
41097                 UINT32_C(0x2)
41098         /* Tx path. */
41099         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_TX \
41100                 (UINT32_C(0x0) << 1)
41101         /* Rx path. */
41102         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX \
41103                 (UINT32_C(0x1) << 1)
41104         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_LAST \
41105                 HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_PATH_RX
41106         /* Enumeration denoting the data transfer mode. */
41107         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_MASK \
41108                 UINT32_C(0xc)
41109         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_SFT       2
41110         /* Push mode. */
41111         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PUSH \
41112                 (UINT32_C(0x0) << 2)
41113         /* Pull mode. */
41114         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL \
41115                 (UINT32_C(0x1) << 2)
41116         /* Pull on async update. */
41117         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC \
41118                 (UINT32_C(0x2) << 2)
41119         #define HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_LAST \
41120                 HWRM_CFA_COUNTER_CFG_INPUT_FLAGS_DATA_TRANSFER_MODE_PULL_ASYNC
41121         uint16_t        counter_type;
41122         /* Flow counters. */
41123         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_FC  UINT32_C(0x0)
41124         /* Extended flow counters. */
41125         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_EFC UINT32_C(0x1)
41126         /* Meter drop counters. */
41127         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC UINT32_C(0x2)
41128         #define HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_LAST \
41129                 HWRM_CFA_COUNTER_CFG_INPUT_COUNTER_TYPE_MDC
41130         /* Ctx memory handle to be used for the counter. */
41131         uint16_t        ctx_id;
41132         /* Counter update cadence hint (only in Push mode). */
41133         uint16_t        update_tmr_ms;
41134         /* Total number of entries. */
41135         uint32_t        num_entries;
41136         uint32_t        unused_0;
41137 } __rte_packed;
41138
41139 /* hwrm_cfa_counter_cfg_output (size:128b/16B) */
41140 struct hwrm_cfa_counter_cfg_output {
41141         /* The specific error status for the command. */
41142         uint16_t        error_code;
41143         /* The HWRM command request type. */
41144         uint16_t        req_type;
41145         /* The sequence ID from the original command. */
41146         uint16_t        seq_id;
41147         /* The length of the response data in number of bytes. */
41148         uint16_t        resp_len;
41149         uint8_t unused_0[7];
41150         /*
41151          * This field is used in Output records to indicate that the output
41152          * is completely written to RAM. This field should be read as '1'
41153          * to indicate that the output has been completely written.
41154          * When writing a command completion or response to an internal
41155          * processor, the order of writes has to be such that this field is
41156          * written last.
41157          */
41158         uint8_t valid;
41159 } __rte_packed;
41160
41161 /***************************
41162  * hwrm_cfa_counter_qstats *
41163  ***************************/
41164
41165
41166 /* hwrm_cfa_counter_qstats_input (size:320b/40B) */
41167 struct hwrm_cfa_counter_qstats_input {
41168         /* The HWRM command request type. */
41169         uint16_t        req_type;
41170         /*
41171          * The completion ring to send the completion event on. This should
41172          * be the NQ ID returned from the `nq_alloc` HWRM command.
41173          */
41174         uint16_t        cmpl_ring;
41175         /*
41176          * The sequence ID is used by the driver for tracking multiple
41177          * commands. This ID is treated as opaque data by the firmware and
41178          * the value is returned in the `hwrm_resp_hdr` upon completion.
41179          */
41180         uint16_t        seq_id;
41181         /*
41182          * The target ID of the command:
41183          * * 0x0-0xFFF8 - The function ID
41184          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41185          * * 0xFFFD - Reserved for user-space HWRM interface
41186          * * 0xFFFF - HWRM
41187          */
41188         uint16_t        target_id;
41189         /*
41190          * A physical address pointer pointing to a host buffer that the
41191          * command's response data will be written. This can be either a host
41192          * physical address (HPA) or a guest physical address (GPA) and must
41193          * point to a physically contiguous block of memory.
41194          */
41195         uint64_t        resp_addr;
41196         uint16_t        flags;
41197         /* Enumeration denoting the RX, TX type of the resource. */
41198         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH     UINT32_C(0x1)
41199         /* Tx path. */
41200         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
41201         /* Rx path. */
41202         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
41203         #define HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_LAST \
41204                 HWRM_CFA_COUNTER_QSTATS_INPUT_FLAGS_PATH_RX
41205         uint16_t        counter_type;
41206         uint16_t        input_flow_ctx_id;
41207         uint16_t        num_entries;
41208         uint16_t        delta_time_ms;
41209         uint16_t        meter_instance_id;
41210         uint16_t        mdc_ctx_id;
41211         uint8_t unused_0[2];
41212         uint64_t        expected_count;
41213 } __rte_packed;
41214
41215 /* hwrm_cfa_counter_qstats_output (size:128b/16B) */
41216 struct hwrm_cfa_counter_qstats_output {
41217         /* The specific error status for the command. */
41218         uint16_t        error_code;
41219         /* The HWRM command request type. */
41220         uint16_t        req_type;
41221         /* The sequence ID from the original command. */
41222         uint16_t        seq_id;
41223         /* The length of the response data in number of bytes. */
41224         uint16_t        resp_len;
41225         uint8_t unused_0[7];
41226         /*
41227          * This field is used in Output records to indicate that the output
41228          * is completely written to RAM. This field should be read as '1'
41229          * to indicate that the output has been completely written.
41230          * When writing a command completion or response to an internal
41231          * processor, the order of writes has to be such that this field is
41232          * written last.
41233          */
41234         uint8_t valid;
41235 } __rte_packed;
41236
41237 /**********************
41238  * hwrm_cfa_eem_qcaps *
41239  **********************/
41240
41241
41242 /* hwrm_cfa_eem_qcaps_input (size:192b/24B) */
41243 struct hwrm_cfa_eem_qcaps_input {
41244         /* The HWRM command request type. */
41245         uint16_t        req_type;
41246         /*
41247          * The completion ring to send the completion event on. This should
41248          * be the NQ ID returned from the `nq_alloc` HWRM command.
41249          */
41250         uint16_t        cmpl_ring;
41251         /*
41252          * The sequence ID is used by the driver for tracking multiple
41253          * commands. This ID is treated as opaque data by the firmware and
41254          * the value is returned in the `hwrm_resp_hdr` upon completion.
41255          */
41256         uint16_t        seq_id;
41257         /*
41258          * The target ID of the command:
41259          * * 0x0-0xFFF8 - The function ID
41260          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41261          * * 0xFFFD - Reserved for user-space HWRM interface
41262          * * 0xFFFF - HWRM
41263          */
41264         uint16_t        target_id;
41265         /*
41266          * A physical address pointer pointing to a host buffer that the
41267          * command's response data will be written. This can be either a host
41268          * physical address (HPA) or a guest physical address (GPA) and must
41269          * point to a physically contiguous block of memory.
41270          */
41271         uint64_t        resp_addr;
41272         uint32_t        flags;
41273         /*
41274          * When set to 1, indicates the configuration will apply to TX flows
41275          * which are to be offloaded.
41276          * Note if this bit is set then the path_rx bit can't be set.
41277          */
41278         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_TX \
41279                 UINT32_C(0x1)
41280         /*
41281          * When set to 1, indicates the configuration will apply to RX flows
41282          * which are to be offloaded.
41283          * Note if this bit is set then the path_tx bit can't be set.
41284          */
41285         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_RX \
41286                 UINT32_C(0x2)
41287         /* When set to 1, all offloaded flows will be sent to EEM. */
41288         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD \
41289                 UINT32_C(0x4)
41290         uint32_t        unused_0;
41291 } __rte_packed;
41292
41293 /* hwrm_cfa_eem_qcaps_output (size:320b/40B) */
41294 struct hwrm_cfa_eem_qcaps_output {
41295         /* The specific error status for the command. */
41296         uint16_t        error_code;
41297         /* The HWRM command request type. */
41298         uint16_t        req_type;
41299         /* The sequence ID from the original command. */
41300         uint16_t        seq_id;
41301         /* The length of the response data in number of bytes. */
41302         uint16_t        resp_len;
41303         uint32_t        flags;
41304         /*
41305          * When set to 1, indicates the configuration will apply to TX flows
41306          * which are to be offloaded.
41307          * Note if this bit is set then the path_rx bit can't be set.
41308          */
41309         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_TX \
41310                 UINT32_C(0x1)
41311         /*
41312          * When set to 1, indicates the configuration will apply to RX flows
41313          * which are to be offloaded.
41314          * Note if this bit is set then the path_tx bit can't be set.
41315          */
41316         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_RX \
41317                 UINT32_C(0x2)
41318         /*
41319          * When set to 1, indicates the FW supports the Centralized
41320          * Memory Model. The concept designates one entity for the
41321          * memory allocation while all others ‘subscribe’ to it.
41322          */
41323         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
41324                 UINT32_C(0x4)
41325         /*
41326          * When set to 1, indicates the FW supports the Detached
41327          * Centralized Memory Model. The memory is allocated and managed
41328          * as a separate entity. All PFs and VFs will be granted direct
41329          * or semi-direct access to the allocated memory while none of
41330          * which can interfere with the management of the memory.
41331          */
41332         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
41333                 UINT32_C(0x8)
41334         uint32_t        unused_0;
41335         uint32_t        supported;
41336         /*
41337          * If set to 1, then EEM KEY0 table is supported using crc32 hash.
41338          * If set to 0, EEM KEY0 table is not supported.
41339          */
41340         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE \
41341                 UINT32_C(0x1)
41342         /*
41343          * If set to 1, then EEM KEY1 table is supported using lookup3 hash.
41344          * If set to 0, EEM KEY1 table is not supported.
41345          */
41346         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE \
41347                 UINT32_C(0x2)
41348         /*
41349          * If set to 1, then EEM External Record table is supported.
41350          * If set to 0, EEM External Record table is not supported.
41351          * (This table includes action record, EFC pointers, encap pointers)
41352          */
41353         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE \
41354                 UINT32_C(0x4)
41355         /*
41356          * If set to 1, then EEM External Flow Counters table is supported.
41357          * If set to 0, EEM External Flow Counters table is not supported.
41358          */
41359         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE \
41360                 UINT32_C(0x8)
41361         /*
41362          * If set to 1, then FID table used for implicit flow flush is
41363          * supported.
41364          * If set to 0, then FID table used for implicit flow flush is
41365          * not supported.
41366          */
41367         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE \
41368                 UINT32_C(0x10)
41369         /*
41370          * The maximum number of entries supported by EEM. When configuring
41371          * the host memory, the number of numbers of entries that can
41372          * supported are:
41373          *     32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M, 128M
41374          *     entries.
41375          * Any value that are not these values, the FW will round down to the
41376          * closest support number of entries.
41377          */
41378         uint32_t        max_entries_supported;
41379         /* The entry size in bytes of each entry in the EEM KEY0/KEY1 tables. */
41380         uint16_t        key_entry_size;
41381         /* The entry size in bytes of each entry in the EEM RECORD tables. */
41382         uint16_t        record_entry_size;
41383         /* The entry size in bytes of each entry in the EEM EFC tables. */
41384         uint16_t        efc_entry_size;
41385         /* The FID size in bytes of each entry in the EEM FID tables. */
41386         uint16_t        fid_entry_size;
41387         uint8_t unused_1[7];
41388         /*
41389          * This field is used in Output records to indicate that the output
41390          * is completely written to RAM. This field should be read as '1'
41391          * to indicate that the output has been completely written.
41392          * When writing a command completion or response to an internal
41393          * processor, the order of writes has to be such that this field is
41394          * written last.
41395          */
41396         uint8_t valid;
41397 } __rte_packed;
41398
41399 /********************
41400  * hwrm_cfa_eem_cfg *
41401  ********************/
41402
41403
41404 /* hwrm_cfa_eem_cfg_input (size:384b/48B) */
41405 struct hwrm_cfa_eem_cfg_input {
41406         /* The HWRM command request type. */
41407         uint16_t        req_type;
41408         /*
41409          * The completion ring to send the completion event on. This should
41410          * be the NQ ID returned from the `nq_alloc` HWRM command.
41411          */
41412         uint16_t        cmpl_ring;
41413         /*
41414          * The sequence ID is used by the driver for tracking multiple
41415          * commands. This ID is treated as opaque data by the firmware and
41416          * the value is returned in the `hwrm_resp_hdr` upon completion.
41417          */
41418         uint16_t        seq_id;
41419         /*
41420          * The target ID of the command:
41421          * * 0x0-0xFFF8 - The function ID
41422          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41423          * * 0xFFFD - Reserved for user-space HWRM interface
41424          * * 0xFFFF - HWRM
41425          */
41426         uint16_t        target_id;
41427         /*
41428          * A physical address pointer pointing to a host buffer that the
41429          * command's response data will be written. This can be either a host
41430          * physical address (HPA) or a guest physical address (GPA) and must
41431          * point to a physically contiguous block of memory.
41432          */
41433         uint64_t        resp_addr;
41434         uint32_t        flags;
41435         /*
41436          * When set to 1, indicates the configuration will apply to TX flows
41437          * which are to be offloaded.
41438          * Note if this bit is set then the path_rx bit can't be set.
41439          */
41440         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_TX \
41441                 UINT32_C(0x1)
41442         /*
41443          * When set to 1, indicates the configuration will apply to RX flows
41444          * which are to be offloaded.
41445          * Note if this bit is set then the path_tx bit can't be set.
41446          */
41447         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_RX \
41448                 UINT32_C(0x2)
41449         /* When set to 1, all offloaded flows will be sent to EEM. */
41450         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD \
41451                 UINT32_C(0x4)
41452         /* When set to 1, secondary, 0 means primary. */
41453         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_SECONDARY_PF \
41454                 UINT32_C(0x8)
41455         /*
41456          * Group_id which used by Firmware to identify memory pools belonging
41457          * to certain group.
41458          */
41459         uint16_t        group_id;
41460         uint16_t        unused_0;
41461         /*
41462          * Configured EEM with the given number of entries. All the EEM tables
41463          * KEY0, KEY1, RECORD, EFC all have the same number of entries and all
41464          * tables will be configured using this value. Current minimum value
41465          * is 32k. Current maximum value is 128M.
41466          */
41467         uint32_t        num_entries;
41468         uint32_t        unused_1;
41469         /* Configured EEM with the given context if for KEY0 table. */
41470         uint16_t        key0_ctx_id;
41471         /* Configured EEM with the given context if for KEY1 table. */
41472         uint16_t        key1_ctx_id;
41473         /* Configured EEM with the given context if for RECORD table. */
41474         uint16_t        record_ctx_id;
41475         /* Configured EEM with the given context if for EFC table. */
41476         uint16_t        efc_ctx_id;
41477         /* Configured EEM with the given context if for EFC table. */
41478         uint16_t        fid_ctx_id;
41479         uint16_t        unused_2;
41480         uint32_t        unused_3;
41481 } __rte_packed;
41482
41483 /* hwrm_cfa_eem_cfg_output (size:128b/16B) */
41484 struct hwrm_cfa_eem_cfg_output {
41485         /* The specific error status for the command. */
41486         uint16_t        error_code;
41487         /* The HWRM command request type. */
41488         uint16_t        req_type;
41489         /* The sequence ID from the original command. */
41490         uint16_t        seq_id;
41491         /* The length of the response data in number of bytes. */
41492         uint16_t        resp_len;
41493         uint8_t unused_0[7];
41494         /*
41495          * This field is used in Output records to indicate that the output
41496          * is completely written to RAM. This field should be read as '1'
41497          * to indicate that the output has been completely written.
41498          * When writing a command completion or response to an internal
41499          * processor, the order of writes has to be such that this field is
41500          * written last.
41501          */
41502         uint8_t valid;
41503 } __rte_packed;
41504
41505 /*********************
41506  * hwrm_cfa_eem_qcfg *
41507  *********************/
41508
41509
41510 /* hwrm_cfa_eem_qcfg_input (size:192b/24B) */
41511 struct hwrm_cfa_eem_qcfg_input {
41512         /* The HWRM command request type. */
41513         uint16_t        req_type;
41514         /*
41515          * The completion ring to send the completion event on. This should
41516          * be the NQ ID returned from the `nq_alloc` HWRM command.
41517          */
41518         uint16_t        cmpl_ring;
41519         /*
41520          * The sequence ID is used by the driver for tracking multiple
41521          * commands. This ID is treated as opaque data by the firmware and
41522          * the value is returned in the `hwrm_resp_hdr` upon completion.
41523          */
41524         uint16_t        seq_id;
41525         /*
41526          * The target ID of the command:
41527          * * 0x0-0xFFF8 - The function ID
41528          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41529          * * 0xFFFD - Reserved for user-space HWRM interface
41530          * * 0xFFFF - HWRM
41531          */
41532         uint16_t        target_id;
41533         /*
41534          * A physical address pointer pointing to a host buffer that the
41535          * command's response data will be written. This can be either a host
41536          * physical address (HPA) or a guest physical address (GPA) and must
41537          * point to a physically contiguous block of memory.
41538          */
41539         uint64_t        resp_addr;
41540         uint32_t        flags;
41541         /* When set to 1, indicates the configuration is the TX flow. */
41542         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
41543         /* When set to 1, indicates the configuration is the RX flow. */
41544         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
41545         uint32_t        unused_0;
41546 } __rte_packed;
41547
41548 /* hwrm_cfa_eem_qcfg_output (size:256b/32B) */
41549 struct hwrm_cfa_eem_qcfg_output {
41550         /* The specific error status for the command. */
41551         uint16_t        error_code;
41552         /* The HWRM command request type. */
41553         uint16_t        req_type;
41554         /* The sequence ID from the original command. */
41555         uint16_t        seq_id;
41556         /* The length of the response data in number of bytes. */
41557         uint16_t        resp_len;
41558         uint32_t        flags;
41559         /* When set to 1, indicates the configuration is the TX flow. */
41560         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_TX \
41561                 UINT32_C(0x1)
41562         /* When set to 1, indicates the configuration is the RX flow. */
41563         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_RX \
41564                 UINT32_C(0x2)
41565         /* When set to 1, all offloaded flows will be sent to EEM. */
41566         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD \
41567                 UINT32_C(0x4)
41568         /* The number of entries the FW has configured for EEM. */
41569         uint32_t        num_entries;
41570         /* Configured EEM with the given context if for KEY0 table. */
41571         uint16_t        key0_ctx_id;
41572         /* Configured EEM with the given context if for KEY1 table. */
41573         uint16_t        key1_ctx_id;
41574         /* Configured EEM with the given context if for RECORD table. */
41575         uint16_t        record_ctx_id;
41576         /* Configured EEM with the given context if for EFC table. */
41577         uint16_t        efc_ctx_id;
41578         /* Configured EEM with the given context if for EFC table. */
41579         uint16_t        fid_ctx_id;
41580         uint8_t unused_2[5];
41581         /*
41582          * This field is used in Output records to indicate that the output
41583          * is completely written to RAM. This field should be read as '1'
41584          * to indicate that the output has been completely written.
41585          * When writing a command completion or response to an internal
41586          * processor, the order of writes has to be such that this field is
41587          * written last.
41588          */
41589         uint8_t valid;
41590 } __rte_packed;
41591
41592 /*******************
41593  * hwrm_cfa_eem_op *
41594  *******************/
41595
41596
41597 /* hwrm_cfa_eem_op_input (size:192b/24B) */
41598 struct hwrm_cfa_eem_op_input {
41599         /* The HWRM command request type. */
41600         uint16_t        req_type;
41601         /*
41602          * The completion ring to send the completion event on. This should
41603          * be the NQ ID returned from the `nq_alloc` HWRM command.
41604          */
41605         uint16_t        cmpl_ring;
41606         /*
41607          * The sequence ID is used by the driver for tracking multiple
41608          * commands. This ID is treated as opaque data by the firmware and
41609          * the value is returned in the `hwrm_resp_hdr` upon completion.
41610          */
41611         uint16_t        seq_id;
41612         /*
41613          * The target ID of the command:
41614          * * 0x0-0xFFF8 - The function ID
41615          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41616          * * 0xFFFD - Reserved for user-space HWRM interface
41617          * * 0xFFFF - HWRM
41618          */
41619         uint16_t        target_id;
41620         /*
41621          * A physical address pointer pointing to a host buffer that the
41622          * command's response data will be written. This can be either a host
41623          * physical address (HPA) or a guest physical address (GPA) and must
41624          * point to a physically contiguous block of memory.
41625          */
41626         uint64_t        resp_addr;
41627         uint32_t        flags;
41628         /*
41629          * When set to 1, indicates the host memory which is passed will be
41630          * used for the TX flow offload function specified in fid.
41631          * Note if this bit is set then the path_rx bit can't be set.
41632          */
41633         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
41634         /*
41635          * When set to 1, indicates the host memory which is passed will be
41636          * used for the RX flow offload function specified in fid.
41637          * Note if this bit is set then the path_tx bit can't be set.
41638          */
41639         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
41640         uint16_t        unused_0;
41641         /* The number of EEM key table entries to be configured. */
41642         uint16_t        op;
41643         /* This value is reserved and should not be used. */
41644         #define HWRM_CFA_EEM_OP_INPUT_OP_RESERVED    UINT32_C(0x0)
41645         /*
41646          * To properly stop EEM and ensure there are no DMA's, the caller
41647          * must disable EEM for the given PF, using this call. This will
41648          * safely disable EEM and ensure that all DMA'ed to the
41649          * keys/records/efc have been completed.
41650          */
41651         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_DISABLE UINT32_C(0x1)
41652         /*
41653          * Once the EEM host memory has been configured, EEM options have
41654          * been configured. Then the caller should enable EEM for the given
41655          * PF. Note once this call has been made, then the EEM mechanism
41656          * will be active and DMA's will occur as packets are processed.
41657          */
41658         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_ENABLE  UINT32_C(0x2)
41659         /*
41660          * Clear EEM settings for the given PF so that the register values
41661          * are reset back to there initial state.
41662          */
41663         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP UINT32_C(0x3)
41664         #define HWRM_CFA_EEM_OP_INPUT_OP_LAST \
41665                 HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP
41666 } __rte_packed;
41667
41668 /* hwrm_cfa_eem_op_output (size:128b/16B) */
41669 struct hwrm_cfa_eem_op_output {
41670         /* The specific error status for the command. */
41671         uint16_t        error_code;
41672         /* The HWRM command request type. */
41673         uint16_t        req_type;
41674         /* The sequence ID from the original command. */
41675         uint16_t        seq_id;
41676         /* The length of the response data in number of bytes. */
41677         uint16_t        resp_len;
41678         uint8_t unused_0[7];
41679         /*
41680          * This field is used in Output records to indicate that the output
41681          * is completely written to RAM. This field should be read as '1'
41682          * to indicate that the output has been completely written.
41683          * When writing a command completion or response to an internal
41684          * processor, the order of writes has to be such that this field is
41685          * written last.
41686          */
41687         uint8_t valid;
41688 } __rte_packed;
41689
41690 /********************************
41691  * hwrm_cfa_adv_flow_mgnt_qcaps *
41692  ********************************/
41693
41694
41695 /* hwrm_cfa_adv_flow_mgnt_qcaps_input (size:256b/32B) */
41696 struct hwrm_cfa_adv_flow_mgnt_qcaps_input {
41697         /* The HWRM command request type. */
41698         uint16_t        req_type;
41699         /*
41700          * The completion ring to send the completion event on. This should
41701          * be the NQ ID returned from the `nq_alloc` HWRM command.
41702          */
41703         uint16_t        cmpl_ring;
41704         /*
41705          * The sequence ID is used by the driver for tracking multiple
41706          * commands. This ID is treated as opaque data by the firmware and
41707          * the value is returned in the `hwrm_resp_hdr` upon completion.
41708          */
41709         uint16_t        seq_id;
41710         /*
41711          * The target ID of the command:
41712          * * 0x0-0xFFF8 - The function ID
41713          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41714          * * 0xFFFD - Reserved for user-space HWRM interface
41715          * * 0xFFFF - HWRM
41716          */
41717         uint16_t        target_id;
41718         /*
41719          * A physical address pointer pointing to a host buffer that the
41720          * command's response data will be written. This can be either a host
41721          * physical address (HPA) or a guest physical address (GPA) and must
41722          * point to a physically contiguous block of memory.
41723          */
41724         uint64_t        resp_addr;
41725         uint32_t        unused_0[4];
41726 } __rte_packed;
41727
41728 /* hwrm_cfa_adv_flow_mgnt_qcaps_output (size:128b/16B) */
41729 struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
41730         /* The specific error status for the command. */
41731         uint16_t        error_code;
41732         /* The HWRM command request type. */
41733         uint16_t        req_type;
41734         /* The sequence ID from the original command. */
41735         uint16_t        seq_id;
41736         /* The length of the response data in number of bytes. */
41737         uint16_t        resp_len;
41738         uint32_t        flags;
41739         /*
41740          * Value of 1 to indicate firmware support 16-bit flow handle.
41741          * Value of 0 to indicate firmware not support 16-bit flow handle.
41742          */
41743         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_16BIT_SUPPORTED \
41744                 UINT32_C(0x1)
41745         /*
41746          * Value of 1 to indicate firmware support 64-bit flow handle.
41747          * Value of 0 to indicate firmware not support 64-bit flow handle.
41748          */
41749         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_64BIT_SUPPORTED \
41750                 UINT32_C(0x2)
41751         /*
41752          * Value of 1 to indicate firmware support flow batch delete
41753          * operation through HWRM_CFA_FLOW_FLUSH command.
41754          * Value of 0 to indicate that the firmware does not support flow
41755          * batch delete operation.
41756          */
41757         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_BATCH_DELETE_SUPPORTED \
41758                 UINT32_C(0x4)
41759         /*
41760          * Value of 1 to indicate that the firmware support flow reset all
41761          * operation through HWRM_CFA_FLOW_FLUSH command.
41762          * Value of 0 indicates firmware does not support flow reset all
41763          * operation.
41764          */
41765         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_RESET_ALL_SUPPORTED \
41766                 UINT32_C(0x8)
41767         /*
41768          * Value of 1 to indicate that firmware supports use of FID as
41769          * dest_id in HWRM_CFA_NTUPLE_ALLOC/CFG commands.
41770          * Value of 0 indicates firmware does not support use of FID as
41771          * dest_id.
41772          */
41773         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_DEST_FUNC_SUPPORTED \
41774                 UINT32_C(0x10)
41775         /*
41776          * Value of 1 to indicate that firmware supports TX EEM flows.
41777          * Value of 0 indicates firmware does not support TX EEM flows.
41778          */
41779         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TX_EEM_FLOW_SUPPORTED \
41780                 UINT32_C(0x20)
41781         /*
41782          * Value of 1 to indicate that firmware supports RX EEM flows.
41783          * Value of 0 indicates firmware does not support RX EEM flows.
41784          */
41785         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RX_EEM_FLOW_SUPPORTED \
41786                 UINT32_C(0x40)
41787         /*
41788          * Value of 1 to indicate that firmware supports the dynamic
41789          * allocation of an on-chip flow counter which can be used for EEM
41790          * flows. Value of 0 indicates firmware does not support the dynamic
41791          * allocation of an on-chip flow counter.
41792          */
41793         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_COUNTER_ALLOC_SUPPORTED \
41794                 UINT32_C(0x80)
41795         /*
41796          * Value of 1 to indicate that firmware supports setting of
41797          * rfs_ring_tbl_idx in HWRM_CFA_NTUPLE_ALLOC command.
41798          * Value of 0 indicates firmware does not support rfs_ring_tbl_idx.
41799          */
41800         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_SUPPORTED \
41801                 UINT32_C(0x100)
41802         /*
41803          * Value of 1 to indicate that firmware supports untagged matching
41804          * criteria on HWRM_CFA_L2_FILTER_ALLOC command. Value of 0
41805          * indicates firmware does not support untagged matching.
41806          */
41807         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_UNTAGGED_VLAN_SUPPORTED \
41808                 UINT32_C(0x200)
41809         /*
41810          * Value of 1 to indicate that firmware supports XDP filter. Value
41811          * of 0 indicates firmware does not support XDP filter.
41812          */
41813         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_XDP_SUPPORTED \
41814                 UINT32_C(0x400)
41815         /*
41816          * Value of 1 to indicate that the firmware support L2 header source
41817          * fields matching criteria on HWRM_CFA_L2_FILTER_ALLOC command.
41818          * Value of 0 indicates firmware does not support L2 header source
41819          * fields matching.
41820          */
41821         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_HEADER_SOURCE_FIELDS_SUPPORTED \
41822                 UINT32_C(0x800)
41823         /*
41824          * If set to 1, firmware is capable of supporting ARP ethertype as
41825          * matching criteria for HWRM_CFA_NTUPLE_FILTER_ALLOC command on the
41826          * RX direction. By default, this flag should be 0 for older version
41827          * of firmware.
41828          */
41829         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ARP_SUPPORTED \
41830                 UINT32_C(0x1000)
41831         /*
41832          * Value of 1 to indicate that firmware supports setting of
41833          * rfs_ring_tbl_idx in dst_id field of the HWRM_CFA_NTUPLE_ALLOC
41834          * command. Value of 0 indicates firmware does not support
41835          * rfs_ring_tbl_idx in dst_id field.
41836          */
41837         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_V2_SUPPORTED \
41838                 UINT32_C(0x2000)
41839         /*
41840          * If set to 1, firmware is capable of supporting IPv4/IPv6 as
41841          * ethertype in HWRM_CFA_NTUPLE_FILTER_ALLOC command on the RX
41842          * direction. By default, this flag should be 0 for older version
41843          * of firmware.
41844          */
41845         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_RX_ETHERTYPE_IP_SUPPORTED \
41846                 UINT32_C(0x4000)
41847         /*
41848          * When this bit is '1', it indicates that core firmware is
41849          * capable of TruFlow. Driver can restrict sending HWRM CFA_FLOW_XXX
41850          * and CFA_ENCAP_XXX, CFA_DECAP_XXX commands.
41851          */
41852         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TRUFLOW_CAPABLE \
41853                 UINT32_C(0x8000)
41854         /*
41855          * If set to 1, firmware is capable of supporting L2/ROCE as
41856          * traffic type in flags field of HWRM_CFA_L2_FILTER_ALLOC command.
41857          * By default, this flag should be 0 for older version of firmware.
41858          */
41859         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_FILTER_TRAFFIC_TYPE_L2_ROCE_SUPPORTED \
41860                 UINT32_C(0x10000)
41861         uint8_t unused_0[3];
41862         /*
41863          * This field is used in Output records to indicate that the output
41864          * is completely written to RAM. This field should be read as '1'
41865          * to indicate that the output has been completely written.
41866          * When writing a command completion or response to an internal
41867          * processor, the order of writes has to be such that this field is
41868          * written last.
41869          */
41870         uint8_t valid;
41871 } __rte_packed;
41872
41873 /******************
41874  * hwrm_cfa_tflib *
41875  ******************/
41876
41877
41878 /* hwrm_cfa_tflib_input (size:1024b/128B) */
41879 struct hwrm_cfa_tflib_input {
41880         /* The HWRM command request type. */
41881         uint16_t        req_type;
41882         /*
41883          * The completion ring to send the completion event on. This should
41884          * be the NQ ID returned from the `nq_alloc` HWRM command.
41885          */
41886         uint16_t        cmpl_ring;
41887         /*
41888          * The sequence ID is used by the driver for tracking multiple
41889          * commands. This ID is treated as opaque data by the firmware and
41890          * the value is returned in the `hwrm_resp_hdr` upon completion.
41891          */
41892         uint16_t        seq_id;
41893         /*
41894          * The target ID of the command:
41895          * * 0x0-0xFFF8 - The function ID
41896          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41897          * * 0xFFFD - Reserved for user-space HWRM interface
41898          * * 0xFFFF - HWRM
41899          */
41900         uint16_t        target_id;
41901         /*
41902          * A physical address pointer pointing to a host buffer that the
41903          * command's response data will be written. This can be either a host
41904          * physical address (HPA) or a guest physical address (GPA) and must
41905          * point to a physically contiguous block of memory.
41906          */
41907         uint64_t        resp_addr;
41908         /* TFLIB message type. */
41909         uint16_t        tf_type;
41910         /* TFLIB message subtype. */
41911         uint16_t        tf_subtype;
41912         /* unused. */
41913         uint8_t unused0[4];
41914         /* TFLIB request data. */
41915         uint32_t        tf_req[26];
41916 } __rte_packed;
41917
41918 /* hwrm_cfa_tflib_output (size:5632b/704B) */
41919 struct hwrm_cfa_tflib_output {
41920         /* The specific error status for the command. */
41921         uint16_t        error_code;
41922         /* The HWRM command request type. */
41923         uint16_t        req_type;
41924         /* The sequence ID from the original command. */
41925         uint16_t        seq_id;
41926         /* The length of the response data in number of bytes. */
41927         uint16_t        resp_len;
41928         /* TFLIB message type. */
41929         uint16_t        tf_type;
41930         /* TFLIB message subtype. */
41931         uint16_t        tf_subtype;
41932         /* TFLIB response code */
41933         uint32_t        tf_resp_code;
41934         /* TFLIB response data. */
41935         uint32_t        tf_resp[170];
41936         /* unused. */
41937         uint8_t unused1[7];
41938         /*
41939          * This field is used in Output records to indicate that the output
41940          * is completely written to RAM. This field should be read as '1'
41941          * to indicate that the output has been completely written.
41942          * When writing a command completion or response to an internal
41943          * processor, the order of writes has to be such that this field is
41944          * written last.
41945          */
41946         uint8_t valid;
41947 } __rte_packed;
41948
41949 /***********
41950  * hwrm_tf *
41951  ***********/
41952
41953
41954 /* hwrm_tf_input (size:1024b/128B) */
41955 struct hwrm_tf_input {
41956         /* The HWRM command request type. */
41957         uint16_t        req_type;
41958         /*
41959          * The completion ring to send the completion event on. This should
41960          * be the NQ ID returned from the `nq_alloc` HWRM command.
41961          */
41962         uint16_t        cmpl_ring;
41963         /*
41964          * The sequence ID is used by the driver for tracking multiple
41965          * commands. This ID is treated as opaque data by the firmware and
41966          * the value is returned in the `hwrm_resp_hdr` upon completion.
41967          */
41968         uint16_t        seq_id;
41969         /*
41970          * The target ID of the command:
41971          * * 0x0-0xFFF8 - The function ID
41972          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
41973          * * 0xFFFD - Reserved for user-space HWRM interface
41974          * * 0xFFFF - HWRM
41975          */
41976         uint16_t        target_id;
41977         /*
41978          * A physical address pointer pointing to a host buffer that the
41979          * command's response data will be written. This can be either a host
41980          * physical address (HPA) or a guest physical address (GPA) and must
41981          * point to a physically contiguous block of memory.
41982          */
41983         uint64_t        resp_addr;
41984         /* TF message type. */
41985         uint16_t        type;
41986         /* TF message subtype. */
41987         uint16_t        subtype;
41988         /* unused. */
41989         uint8_t unused0[4];
41990         /* TF request data. */
41991         uint32_t        req[26];
41992 } __rte_packed;
41993
41994 /* hwrm_tf_output (size:5632b/704B) */
41995 struct hwrm_tf_output {
41996         /* The specific error status for the command. */
41997         uint16_t        error_code;
41998         /* The HWRM command request type. */
41999         uint16_t        req_type;
42000         /* The sequence ID from the original command. */
42001         uint16_t        seq_id;
42002         /* The length of the response data in number of bytes. */
42003         uint16_t        resp_len;
42004         /* TF message type. */
42005         uint16_t        type;
42006         /* TF message subtype. */
42007         uint16_t        subtype;
42008         /* TF response code */
42009         uint32_t        resp_code;
42010         /* TF response data. */
42011         uint32_t        resp[170];
42012         /* unused. */
42013         uint8_t unused1[7];
42014         /*
42015          * This field is used in Output records to indicate that the
42016          * output is completely written to RAM. This field should be
42017          * read as '1' to indicate that the output has been
42018          * completely written.  When writing a command completion or
42019          * response to an internal processor, the order of writes has
42020          * to be such that this field is written last.
42021          */
42022         uint8_t valid;
42023 } __rte_packed;
42024
42025 /***********************
42026  * hwrm_tf_version_get *
42027  ***********************/
42028
42029
42030 /* hwrm_tf_version_get_input (size:128b/16B) */
42031 struct hwrm_tf_version_get_input {
42032         /* The HWRM command request type. */
42033         uint16_t        req_type;
42034         /*
42035          * The completion ring to send the completion event on. This should
42036          * be the NQ ID returned from the `nq_alloc` HWRM command.
42037          */
42038         uint16_t        cmpl_ring;
42039         /*
42040          * The sequence ID is used by the driver for tracking multiple
42041          * commands. This ID is treated as opaque data by the firmware and
42042          * the value is returned in the `hwrm_resp_hdr` upon completion.
42043          */
42044         uint16_t        seq_id;
42045         /*
42046          * The target ID of the command:
42047          * * 0x0-0xFFF8 - The function ID
42048          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42049          * * 0xFFFD - Reserved for user-space HWRM interface
42050          * * 0xFFFF - HWRM
42051          */
42052         uint16_t        target_id;
42053         /*
42054          * A physical address pointer pointing to a host buffer that the
42055          * command's response data will be written. This can be either a host
42056          * physical address (HPA) or a guest physical address (GPA) and must
42057          * point to a physically contiguous block of memory.
42058          */
42059         uint64_t        resp_addr;
42060 } __rte_packed;
42061
42062 /* hwrm_tf_version_get_output (size:128b/16B) */
42063 struct hwrm_tf_version_get_output {
42064         /* The specific error status for the command. */
42065         uint16_t        error_code;
42066         /* The HWRM command request type. */
42067         uint16_t        req_type;
42068         /* The sequence ID from the original command. */
42069         uint16_t        seq_id;
42070         /* The length of the response data in number of bytes. */
42071         uint16_t        resp_len;
42072         /* Version Major number. */
42073         uint8_t major;
42074         /* Version Minor number. */
42075         uint8_t minor;
42076         /* Version Update number. */
42077         uint8_t update;
42078         /* unused. */
42079         uint8_t unused0[4];
42080         /*
42081          * This field is used in Output records to indicate that the output
42082          * is completely written to RAM. This field should be read as '1'
42083          * to indicate that the output has been completely written.
42084          * When writing a command completion or response to an internal
42085          * processor, the order of writes has to be such that this field is
42086          * written last.
42087          */
42088         uint8_t valid;
42089 } __rte_packed;
42090
42091 /************************
42092  * hwrm_tf_session_open *
42093  ************************/
42094
42095
42096 /* hwrm_tf_session_open_input (size:640b/80B) */
42097 struct hwrm_tf_session_open_input {
42098         /* The HWRM command request type. */
42099         uint16_t        req_type;
42100         /*
42101          * The completion ring to send the completion event on. This should
42102          * be the NQ ID returned from the `nq_alloc` HWRM command.
42103          */
42104         uint16_t        cmpl_ring;
42105         /*
42106          * The sequence ID is used by the driver for tracking multiple
42107          * commands. This ID is treated as opaque data by the firmware and
42108          * the value is returned in the `hwrm_resp_hdr` upon completion.
42109          */
42110         uint16_t        seq_id;
42111         /*
42112          * The target ID of the command:
42113          * * 0x0-0xFFF8 - The function ID
42114          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42115          * * 0xFFFD - Reserved for user-space HWRM interface
42116          * * 0xFFFF - HWRM
42117          */
42118         uint16_t        target_id;
42119         /*
42120          * A physical address pointer pointing to a host buffer that the
42121          * command's response data will be written. This can be either a host
42122          * physical address (HPA) or a guest physical address (GPA) and must
42123          * point to a physically contiguous block of memory.
42124          */
42125         uint64_t        resp_addr;
42126         /* Name of the session. */
42127         uint8_t session_name[64];
42128 } __rte_packed;
42129
42130 /* hwrm_tf_session_open_output (size:192b/24B) */
42131 struct hwrm_tf_session_open_output {
42132         /* The specific error status for the command. */
42133         uint16_t        error_code;
42134         /* The HWRM command request type. */
42135         uint16_t        req_type;
42136         /* The sequence ID from the original command. */
42137         uint16_t        seq_id;
42138         /* The length of the response data in number of bytes. */
42139         uint16_t        resp_len;
42140         /*
42141          * Unique session identifier for the session created by the
42142          * firmware.
42143          */
42144         uint32_t        fw_session_id;
42145         /*
42146          * Unique session client identifier for the first client on
42147          * the newly created session.
42148          */
42149         uint32_t        fw_session_client_id;
42150         uint32_t        flags;
42151         /* Indicates if the shared session has been created. */
42152         #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION \
42153                 UINT32_C(0x1)
42154         /*
42155          * If this bit set to 0, then it indicates the shared session
42156          * has been created by another session.
42157          */
42158         #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_NOT_CREATOR \
42159                 UINT32_C(0x0)
42160         /*
42161          * If this bit is set to 1, then it indicates the shared session
42162          * is created by this session.
42163          */
42164         #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR \
42165                 UINT32_C(0x1)
42166         #define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_LAST \
42167                 HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR
42168         /* unused. */
42169         uint8_t unused1[3];
42170         /*
42171          * This field is used in Output records to indicate that the output
42172          * is completely written to RAM. This field should be read as '1'
42173          * to indicate that the output has been completely written.
42174          * When writing a command completion or response to an internal
42175          * processor, the order of writes has to be such that this field is
42176          * written last.
42177          */
42178         uint8_t valid;
42179 } __rte_packed;
42180
42181 /**************************
42182  * hwrm_tf_session_attach *
42183  **************************/
42184
42185
42186 /* hwrm_tf_session_attach_input (size:704b/88B) */
42187 struct hwrm_tf_session_attach_input {
42188         /* The HWRM command request type. */
42189         uint16_t        req_type;
42190         /*
42191          * The completion ring to send the completion event on. This should
42192          * be the NQ ID returned from the `nq_alloc` HWRM command.
42193          */
42194         uint16_t        cmpl_ring;
42195         /*
42196          * The sequence ID is used by the driver for tracking multiple
42197          * commands. This ID is treated as opaque data by the firmware and
42198          * the value is returned in the `hwrm_resp_hdr` upon completion.
42199          */
42200         uint16_t        seq_id;
42201         /*
42202          * The target ID of the command:
42203          * * 0x0-0xFFF8 - The function ID
42204          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42205          * * 0xFFFD - Reserved for user-space HWRM interface
42206          * * 0xFFFF - HWRM
42207          */
42208         uint16_t        target_id;
42209         /*
42210          * A physical address pointer pointing to a host buffer that the
42211          * command's response data will be written. This can be either a host
42212          * physical address (HPA) or a guest physical address (GPA) and must
42213          * point to a physically contiguous block of memory.
42214          */
42215         uint64_t        resp_addr;
42216         /*
42217          * Unique session identifier for the session that the attach
42218          * request want to attach to. This value originates from the
42219          * shared session memory that the attach request opened by
42220          * way of the 'attach name' that was passed in to the core
42221          * attach API.
42222          * The fw_session_id of the attach session includes PCIe bus
42223          * info to distinguish the PF and session info to identify
42224          * the associated TruFlow session.
42225          */
42226         uint32_t        attach_fw_session_id;
42227         /* unused. */
42228         uint32_t        unused0;
42229         /* Name of the session it self. */
42230         uint8_t session_name[64];
42231 } __rte_packed;
42232
42233 /* hwrm_tf_session_attach_output (size:128b/16B) */
42234 struct hwrm_tf_session_attach_output {
42235         /* The specific error status for the command. */
42236         uint16_t        error_code;
42237         /* The HWRM command request type. */
42238         uint16_t        req_type;
42239         /* The sequence ID from the original command. */
42240         uint16_t        seq_id;
42241         /* The length of the response data in number of bytes. */
42242         uint16_t        resp_len;
42243         /*
42244          * Unique session identifier for the session created by the
42245          * firmware. It includes PCIe bus info to distinguish the PF
42246          * and session info to identify the associated TruFlow
42247          * session. This fw_session_id is unique to the attach
42248          * request.
42249          */
42250         uint32_t        fw_session_id;
42251         /* unused. */
42252         uint8_t unused0[3];
42253         /*
42254          * This field is used in Output records to indicate that the output
42255          * is completely written to RAM. This field should be read as '1'
42256          * to indicate that the output has been completely written.
42257          * When writing a command completion or response to an internal
42258          * processor, the order of writes has to be such that this field is
42259          * written last.
42260          */
42261         uint8_t valid;
42262 } __rte_packed;
42263
42264 /****************************
42265  * hwrm_tf_session_register *
42266  ****************************/
42267
42268
42269 /* hwrm_tf_session_register_input (size:704b/88B) */
42270 struct hwrm_tf_session_register_input {
42271         /* The HWRM command request type. */
42272         uint16_t        req_type;
42273         /*
42274          * The completion ring to send the completion event on. This should
42275          * be the NQ ID returned from the `nq_alloc` HWRM command.
42276          */
42277         uint16_t        cmpl_ring;
42278         /*
42279          * The sequence ID is used by the driver for tracking multiple
42280          * commands. This ID is treated as opaque data by the firmware and
42281          * the value is returned in the `hwrm_resp_hdr` upon completion.
42282          */
42283         uint16_t        seq_id;
42284         /*
42285          * The target ID of the command:
42286          * * 0x0-0xFFF8 - The function ID
42287          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42288          * * 0xFFFD - Reserved for user-space HWRM interface
42289          * * 0xFFFF - HWRM
42290          */
42291         uint16_t        target_id;
42292         /*
42293          * A physical address pointer pointing to a host buffer that the
42294          * command's response data will be written. This can be either a host
42295          * physical address (HPA) or a guest physical address (GPA) and must
42296          * point to a physically contiguous block of memory.
42297          */
42298         uint64_t        resp_addr;
42299         /*
42300          * Unique session identifier for the session that the
42301          * register request want to create a new client on. This
42302          * value originates from the first open request.
42303          * The fw_session_id of the attach session includes PCIe bus
42304          * info to distinguish the PF and session info to identify
42305          * the associated TruFlow session.
42306          */
42307         uint32_t        fw_session_id;
42308         /* unused. */
42309         uint32_t        unused0;
42310         /* Name of the session client. */
42311         uint8_t session_client_name[64];
42312 } __rte_packed;
42313
42314 /* hwrm_tf_session_register_output (size:128b/16B) */
42315 struct hwrm_tf_session_register_output {
42316         /* The specific error status for the command. */
42317         uint16_t        error_code;
42318         /* The HWRM command request type. */
42319         uint16_t        req_type;
42320         /* The sequence ID from the original command. */
42321         uint16_t        seq_id;
42322         /* The length of the response data in number of bytes. */
42323         uint16_t        resp_len;
42324         /*
42325          * Unique session client identifier for the session created
42326          * by the firmware. It includes the session the client it
42327          * attached to and session client info.
42328          */
42329         uint32_t        fw_session_client_id;
42330         /* unused. */
42331         uint8_t unused0[3];
42332         /*
42333          * This field is used in Output records to indicate that the output
42334          * is completely written to RAM. This field should be read as '1'
42335          * to indicate that the output has been completely written.
42336          * When writing a command completion or response to an internal
42337          * processor, the order of writes has to be such that this field is
42338          * written last.
42339          */
42340         uint8_t valid;
42341 } __rte_packed;
42342
42343 /******************************
42344  * hwrm_tf_session_unregister *
42345  ******************************/
42346
42347
42348 /* hwrm_tf_session_unregister_input (size:192b/24B) */
42349 struct hwrm_tf_session_unregister_input {
42350         /* The HWRM command request type. */
42351         uint16_t        req_type;
42352         /*
42353          * The completion ring to send the completion event on. This should
42354          * be the NQ ID returned from the `nq_alloc` HWRM command.
42355          */
42356         uint16_t        cmpl_ring;
42357         /*
42358          * The sequence ID is used by the driver for tracking multiple
42359          * commands. This ID is treated as opaque data by the firmware and
42360          * the value is returned in the `hwrm_resp_hdr` upon completion.
42361          */
42362         uint16_t        seq_id;
42363         /*
42364          * The target ID of the command:
42365          * * 0x0-0xFFF8 - The function ID
42366          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42367          * * 0xFFFD - Reserved for user-space HWRM interface
42368          * * 0xFFFF - HWRM
42369          */
42370         uint16_t        target_id;
42371         /*
42372          * A physical address pointer pointing to a host buffer that the
42373          * command's response data will be written. This can be either a host
42374          * physical address (HPA) or a guest physical address (GPA) and must
42375          * point to a physically contiguous block of memory.
42376          */
42377         uint64_t        resp_addr;
42378         /*
42379          * Unique session identifier for the session that the
42380          * unregister request want to close a session client on.
42381          */
42382         uint32_t        fw_session_id;
42383         /*
42384          * Unique session client identifier for the session that the
42385          * unregister request want to close.
42386          */
42387         uint32_t        fw_session_client_id;
42388 } __rte_packed;
42389
42390 /* hwrm_tf_session_unregister_output (size:128b/16B) */
42391 struct hwrm_tf_session_unregister_output {
42392         /* The specific error status for the command. */
42393         uint16_t        error_code;
42394         /* The HWRM command request type. */
42395         uint16_t        req_type;
42396         /* The sequence ID from the original command. */
42397         uint16_t        seq_id;
42398         /* The length of the response data in number of bytes. */
42399         uint16_t        resp_len;
42400         /* unused. */
42401         uint8_t unused0[7];
42402         /*
42403          * This field is used in Output records to indicate that the output
42404          * is completely written to RAM. This field should be read as '1'
42405          * to indicate that the output has been completely written.
42406          * When writing a command completion or response to an internal
42407          * processor, the order of writes has to be such that this field is
42408          * written last.
42409          */
42410         uint8_t valid;
42411 } __rte_packed;
42412
42413 /*************************
42414  * hwrm_tf_session_close *
42415  *************************/
42416
42417
42418 /* hwrm_tf_session_close_input (size:192b/24B) */
42419 struct hwrm_tf_session_close_input {
42420         /* The HWRM command request type. */
42421         uint16_t        req_type;
42422         /*
42423          * The completion ring to send the completion event on. This should
42424          * be the NQ ID returned from the `nq_alloc` HWRM command.
42425          */
42426         uint16_t        cmpl_ring;
42427         /*
42428          * The sequence ID is used by the driver for tracking multiple
42429          * commands. This ID is treated as opaque data by the firmware and
42430          * the value is returned in the `hwrm_resp_hdr` upon completion.
42431          */
42432         uint16_t        seq_id;
42433         /*
42434          * The target ID of the command:
42435          * * 0x0-0xFFF8 - The function ID
42436          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42437          * * 0xFFFD - Reserved for user-space HWRM interface
42438          * * 0xFFFF - HWRM
42439          */
42440         uint16_t        target_id;
42441         /*
42442          * A physical address pointer pointing to a host buffer that the
42443          * command's response data will be written. This can be either a host
42444          * physical address (HPA) or a guest physical address (GPA) and must
42445          * point to a physically contiguous block of memory.
42446          */
42447         uint64_t        resp_addr;
42448         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42449         uint32_t        fw_session_id;
42450         /* unused. */
42451         uint8_t unused0[4];
42452 } __rte_packed;
42453
42454 /* hwrm_tf_session_close_output (size:128b/16B) */
42455 struct hwrm_tf_session_close_output {
42456         /* The specific error status for the command. */
42457         uint16_t        error_code;
42458         /* The HWRM command request type. */
42459         uint16_t        req_type;
42460         /* The sequence ID from the original command. */
42461         uint16_t        seq_id;
42462         /* The length of the response data in number of bytes. */
42463         uint16_t        resp_len;
42464         /* unused. */
42465         uint8_t unused0[7];
42466         /*
42467          * This field is used in Output records to indicate that the output
42468          * is completely written to RAM. This field should be read as '1'
42469          * to indicate that the output has been completely written.
42470          * When writing a command completion or response to an internal
42471          * processor, the order of writes has to be such that this field
42472          * is written last.
42473          */
42474         uint8_t valid;
42475 } __rte_packed;
42476
42477 /************************
42478  * hwrm_tf_session_qcfg *
42479  ************************/
42480
42481
42482 /* hwrm_tf_session_qcfg_input (size:192b/24B) */
42483 struct hwrm_tf_session_qcfg_input {
42484         /* The HWRM command request type. */
42485         uint16_t        req_type;
42486         /*
42487          * The completion ring to send the completion event on. This should
42488          * be the NQ ID returned from the `nq_alloc` HWRM command.
42489          */
42490         uint16_t        cmpl_ring;
42491         /*
42492          * The sequence ID is used by the driver for tracking multiple
42493          * commands. This ID is treated as opaque data by the firmware and
42494          * the value is returned in the `hwrm_resp_hdr` upon completion.
42495          */
42496         uint16_t        seq_id;
42497         /*
42498          * The target ID of the command:
42499          * * 0x0-0xFFF8 - The function ID
42500          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42501          * * 0xFFFD - Reserved for user-space HWRM interface
42502          * * 0xFFFF - HWRM
42503          */
42504         uint16_t        target_id;
42505         /*
42506          * A physical address pointer pointing to a host buffer that the
42507          * command's response data will be written. This can be either a host
42508          * physical address (HPA) or a guest physical address (GPA) and must
42509          * point to a physically contiguous block of memory.
42510          */
42511         uint64_t        resp_addr;
42512         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42513         uint32_t        fw_session_id;
42514         /* unused. */
42515         uint8_t unused0[4];
42516 } __rte_packed;
42517
42518 /* hwrm_tf_session_qcfg_output (size:128b/16B) */
42519 struct hwrm_tf_session_qcfg_output {
42520         /* The specific error status for the command. */
42521         uint16_t        error_code;
42522         /* The HWRM command request type. */
42523         uint16_t        req_type;
42524         /* The sequence ID from the original command. */
42525         uint16_t        seq_id;
42526         /* The length of the response data in number of bytes. */
42527         uint16_t        resp_len;
42528         /* RX action control settings flags. */
42529         uint8_t rx_act_flags;
42530         /*
42531          * A value of 1 in this field indicates that Global Flow ID
42532          * reporting into cfa_code and cfa_metadata is enabled.
42533          */
42534         #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_GFID_EN \
42535                 UINT32_C(0x1)
42536         /*
42537          * A value of 1 in this field indicates that both inner and outer
42538          * are stripped and inner tag is passed.
42539          * Enabled.
42540          */
42541         #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_ABCR_VTAG_DLT_BOTH \
42542                 UINT32_C(0x2)
42543         /*
42544          * A value of 1 in this field indicates that the re-use of
42545          * existing tunnel L2 header SMAC is enabled for
42546          * Non-tunnel L2, L2-L3 and IP-IP tunnel.
42547          */
42548         #define HWRM_TF_SESSION_QCFG_OUTPUT_RX_ACT_FLAGS_TECT_SMAC_OVR_RUTNSL2 \
42549                 UINT32_C(0x4)
42550         /* TX Action control settings flags. */
42551         uint8_t tx_act_flags;
42552         /* Disabled. */
42553         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_ABCR_VEB_EN \
42554                 UINT32_C(0x1)
42555         /*
42556          * When set to 1 any GRE tunnels will include the
42557          * optional Key field.
42558          */
42559         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_GRE_SET_K \
42560                 UINT32_C(0x2)
42561         /*
42562          * When set to 1, for GRE tunnels, the IPV6 Traffic Class (TC)
42563          * field of the outer header is inherited from the inner header
42564          * (if present) or the fixed value as taken from the encap
42565          * record.
42566          */
42567         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV6_TC_IH \
42568                 UINT32_C(0x4)
42569         /*
42570          * When set to 1, for GRE tunnels, the IPV4 Type Of Service (TOS)
42571          * field of the outer header is inherited from the inner header
42572          * (if present) or the fixed value as taken from the encap record.
42573          */
42574         #define HWRM_TF_SESSION_QCFG_OUTPUT_TX_ACT_FLAGS_TECT_IPV4_TOS_IH \
42575                 UINT32_C(0x8)
42576         /* unused. */
42577         uint8_t unused0[5];
42578         /*
42579          * This field is used in Output records to indicate that the output
42580          * is completely written to RAM. This field should be read as '1'
42581          * to indicate that the output has been completely written.
42582          * When writing a command completion or response to an internal
42583          * processor, the order of writes has to be such that this field
42584          * is written last.
42585          */
42586         uint8_t valid;
42587 } __rte_packed;
42588
42589 /******************************
42590  * hwrm_tf_session_resc_qcaps *
42591  ******************************/
42592
42593
42594 /* hwrm_tf_session_resc_qcaps_input (size:256b/32B) */
42595 struct hwrm_tf_session_resc_qcaps_input {
42596         /* The HWRM command request type. */
42597         uint16_t        req_type;
42598         /*
42599          * The completion ring to send the completion event on. This should
42600          * be the NQ ID returned from the `nq_alloc` HWRM command.
42601          */
42602         uint16_t        cmpl_ring;
42603         /*
42604          * The sequence ID is used by the driver for tracking multiple
42605          * commands. This ID is treated as opaque data by the firmware and
42606          * the value is returned in the `hwrm_resp_hdr` upon completion.
42607          */
42608         uint16_t        seq_id;
42609         /*
42610          * The target ID of the command:
42611          * * 0x0-0xFFF8 - The function ID
42612          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42613          * * 0xFFFD - Reserved for user-space HWRM interface
42614          * * 0xFFFF - HWRM
42615          */
42616         uint16_t        target_id;
42617         /*
42618          * A physical address pointer pointing to a host buffer that the
42619          * command's response data will be written. This can be either a host
42620          * physical address (HPA) or a guest physical address (GPA) and must
42621          * point to a physically contiguous block of memory.
42622          */
42623         uint64_t        resp_addr;
42624         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42625         uint32_t        fw_session_id;
42626         /* Control flags. */
42627         uint16_t        flags;
42628         /* Indicates the flow direction. */
42629         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR     UINT32_C(0x1)
42630         /* If this bit set to 0, then it indicates rx flow. */
42631         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
42632         /* If this bit is set to 1, then it indicates that tx flow. */
42633         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
42634         #define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_LAST \
42635                 HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX
42636         /*
42637          * Defines the size of the provided qcaps_addr array
42638          * buffer. The size should be set to the Resource Manager
42639          * provided max number of qcaps entries which is device
42640          * specific. Resource Manager gets the max size from HCAPI
42641          * RM.
42642          */
42643         uint16_t        qcaps_size;
42644         /*
42645          * This is the DMA address for the qcaps output data array
42646          * buffer. Array is of tf_rm_resc_req_entry type and is
42647          * device specific.
42648          */
42649         uint64_t        qcaps_addr;
42650 } __rte_packed;
42651
42652 /* hwrm_tf_session_resc_qcaps_output (size:192b/24B) */
42653 struct hwrm_tf_session_resc_qcaps_output {
42654         /* The specific error status for the command. */
42655         uint16_t        error_code;
42656         /* The HWRM command request type. */
42657         uint16_t        req_type;
42658         /* The sequence ID from the original command. */
42659         uint16_t        seq_id;
42660         /* The length of the response data in number of bytes. */
42661         uint16_t        resp_len;
42662         /* Control flags. */
42663         uint32_t        flags;
42664         /* Session reservation strategy. */
42665         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_MASK \
42666                 UINT32_C(0x3)
42667         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_SFT \
42668                 0
42669         /* Static partitioning. */
42670         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_STATIC \
42671                 UINT32_C(0x0)
42672         /* Strategy 1. */
42673         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_1 \
42674                 UINT32_C(0x1)
42675         /* Strategy 2. */
42676         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_2 \
42677                 UINT32_C(0x2)
42678         /* Strategy 3. */
42679         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3 \
42680                 UINT32_C(0x3)
42681         #define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_LAST \
42682                 HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3
42683         /*
42684          * Size of the returned qcaps_addr data array buffer. The
42685          * value cannot exceed the size defined by the input msg,
42686          * qcaps_size.
42687          */
42688         uint16_t        size;
42689         /* unused. */
42690         uint16_t        unused0;
42691         /* unused. */
42692         uint8_t unused1[7];
42693         /*
42694          * This field is used in Output records to indicate that the output
42695          * is completely written to RAM. This field should be read as '1'
42696          * to indicate that the output has been completely written.
42697          * When writing a command completion or response to an internal
42698          * processor, the order of writes has to be such that this field is
42699          * written last.
42700          */
42701         uint8_t valid;
42702 } __rte_packed;
42703
42704 /******************************
42705  * hwrm_tf_session_resc_alloc *
42706  ******************************/
42707
42708
42709 /* hwrm_tf_session_resc_alloc_input (size:320b/40B) */
42710 struct hwrm_tf_session_resc_alloc_input {
42711         /* The HWRM command request type. */
42712         uint16_t        req_type;
42713         /*
42714          * The completion ring to send the completion event on. This should
42715          * be the NQ ID returned from the `nq_alloc` HWRM command.
42716          */
42717         uint16_t        cmpl_ring;
42718         /*
42719          * The sequence ID is used by the driver for tracking multiple
42720          * commands. This ID is treated as opaque data by the firmware and
42721          * the value is returned in the `hwrm_resp_hdr` upon completion.
42722          */
42723         uint16_t        seq_id;
42724         /*
42725          * The target ID of the command:
42726          * * 0x0-0xFFF8 - The function ID
42727          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42728          * * 0xFFFD - Reserved for user-space HWRM interface
42729          * * 0xFFFF - HWRM
42730          */
42731         uint16_t        target_id;
42732         /*
42733          * A physical address pointer pointing to a host buffer that the
42734          * command's response data will be written. This can be either a host
42735          * physical address (HPA) or a guest physical address (GPA) and must
42736          * point to a physically contiguous block of memory.
42737          */
42738         uint64_t        resp_addr;
42739         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42740         uint32_t        fw_session_id;
42741         /* Control flags. */
42742         uint16_t        flags;
42743         /* Indicates the flow direction. */
42744         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR     UINT32_C(0x1)
42745         /* If this bit set to 0, then it indicates rx flow. */
42746         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
42747         /* If this bit is set to 1, then it indicates that tx flow. */
42748         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
42749         #define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_LAST \
42750                 HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX
42751         /*
42752          * Defines the array size of the provided req_addr and
42753          * resv_addr array buffers. Should be set to the number of
42754          * request entries.
42755          */
42756         uint16_t        req_size;
42757         /*
42758          * This is the DMA address for the request input data array
42759          * buffer. Array is of tf_rm_resc_req_entry type. Size of the
42760          * array buffer is provided by the 'req_size' field in this
42761          * message.
42762          */
42763         uint64_t        req_addr;
42764         /*
42765          * This is the DMA address for the resc output data array
42766          * buffer. Array is of tf_rm_resc_entry type. Size of the array
42767          * buffer is provided by the 'req_size' field in this
42768          * message.
42769          */
42770         uint64_t        resc_addr;
42771 } __rte_packed;
42772
42773 /* hwrm_tf_session_resc_alloc_output (size:128b/16B) */
42774 struct hwrm_tf_session_resc_alloc_output {
42775         /* The specific error status for the command. */
42776         uint16_t        error_code;
42777         /* The HWRM command request type. */
42778         uint16_t        req_type;
42779         /* The sequence ID from the original command. */
42780         uint16_t        seq_id;
42781         /* The length of the response data in number of bytes. */
42782         uint16_t        resp_len;
42783         /*
42784          * Size of the returned tf_rm_resc_entry data array. The value
42785          * cannot exceed the req_size defined by the input msg. The data
42786          * array is returned using the resv_addr specified DMA
42787          * address also provided by the input msg.
42788          */
42789         uint16_t        size;
42790         /* unused. */
42791         uint8_t unused0[5];
42792         /*
42793          * This field is used in Output records to indicate that the output
42794          * is completely written to RAM. This field should be read as '1'
42795          * to indicate that the output has been completely written.
42796          * When writing a command completion or response to an internal
42797          * processor, the order of writes has to be such that this field is
42798          * written last.
42799          */
42800         uint8_t valid;
42801 } __rte_packed;
42802
42803 /*****************************
42804  * hwrm_tf_session_resc_free *
42805  *****************************/
42806
42807
42808 /* hwrm_tf_session_resc_free_input (size:256b/32B) */
42809 struct hwrm_tf_session_resc_free_input {
42810         /* The HWRM command request type. */
42811         uint16_t        req_type;
42812         /*
42813          * The completion ring to send the completion event on. This should
42814          * be the NQ ID returned from the `nq_alloc` HWRM command.
42815          */
42816         uint16_t        cmpl_ring;
42817         /*
42818          * The sequence ID is used by the driver for tracking multiple
42819          * commands. This ID is treated as opaque data by the firmware and
42820          * the value is returned in the `hwrm_resp_hdr` upon completion.
42821          */
42822         uint16_t        seq_id;
42823         /*
42824          * The target ID of the command:
42825          * * 0x0-0xFFF8 - The function ID
42826          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42827          * * 0xFFFD - Reserved for user-space HWRM interface
42828          * * 0xFFFF - HWRM
42829          */
42830         uint16_t        target_id;
42831         /*
42832          * A physical address pointer pointing to a host buffer that the
42833          * command's response data will be written. This can be either a host
42834          * physical address (HPA) or a guest physical address (GPA) and must
42835          * point to a physically contiguous block of memory.
42836          */
42837         uint64_t        resp_addr;
42838         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42839         uint32_t        fw_session_id;
42840         /* Control flags. */
42841         uint16_t        flags;
42842         /* Indicates the flow direction. */
42843         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR     UINT32_C(0x1)
42844         /* If this bit set to 0, then it indicates rx flow. */
42845         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
42846         /* If this bit is set to 1, then it indicates that tx flow. */
42847         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
42848         #define HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_LAST \
42849                 HWRM_TF_SESSION_RESC_FREE_INPUT_FLAGS_DIR_TX
42850         /*
42851          * Defines the size, in bytes, of the provided free_addr
42852          * buffer.
42853          */
42854         uint16_t        free_size;
42855         /*
42856          * This is the DMA address for the free input data array
42857          * buffer.  Array is of tf_rm_resc_entry type. Size of the
42858          * buffer is provided by the 'free_size' field of this
42859          * message.
42860          */
42861         uint64_t        free_addr;
42862 } __rte_packed;
42863
42864 /* hwrm_tf_session_resc_free_output (size:128b/16B) */
42865 struct hwrm_tf_session_resc_free_output {
42866         /* The specific error status for the command. */
42867         uint16_t        error_code;
42868         /* The HWRM command request type. */
42869         uint16_t        req_type;
42870         /* The sequence ID from the original command. */
42871         uint16_t        seq_id;
42872         /* The length of the response data in number of bytes. */
42873         uint16_t        resp_len;
42874         /* unused. */
42875         uint8_t unused0[7];
42876         /*
42877          * This field is used in Output records to indicate that the output
42878          * is completely written to RAM. This field should be read as '1'
42879          * to indicate that the output has been completely written.
42880          * When writing a command completion or response to an internal
42881          * processor, the order of writes has to be such that this field is
42882          * written last.
42883          */
42884         uint8_t valid;
42885 } __rte_packed;
42886
42887 /******************************
42888  * hwrm_tf_session_resc_flush *
42889  ******************************/
42890
42891
42892 /* hwrm_tf_session_resc_flush_input (size:256b/32B) */
42893 struct hwrm_tf_session_resc_flush_input {
42894         /* The HWRM command request type. */
42895         uint16_t        req_type;
42896         /*
42897          * The completion ring to send the completion event on. This should
42898          * be the NQ ID returned from the `nq_alloc` HWRM command.
42899          */
42900         uint16_t        cmpl_ring;
42901         /*
42902          * The sequence ID is used by the driver for tracking multiple
42903          * commands. This ID is treated as opaque data by the firmware and
42904          * the value is returned in the `hwrm_resp_hdr` upon completion.
42905          */
42906         uint16_t        seq_id;
42907         /*
42908          * The target ID of the command:
42909          * * 0x0-0xFFF8 - The function ID
42910          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42911          * * 0xFFFD - Reserved for user-space HWRM interface
42912          * * 0xFFFF - HWRM
42913          */
42914         uint16_t        target_id;
42915         /*
42916          * A physical address pointer pointing to a host buffer that the
42917          * command's response data will be written. This can be either a host
42918          * physical address (HPA) or a guest physical address (GPA) and must
42919          * point to a physically contiguous block of memory.
42920          */
42921         uint64_t        resp_addr;
42922         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
42923         uint32_t        fw_session_id;
42924         /* Control flags. */
42925         uint16_t        flags;
42926         /* Indicates the flow direction. */
42927         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR     UINT32_C(0x1)
42928         /* If this bit set to 0, then it indicates rx flow. */
42929         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
42930         /* If this bit is set to 1, then it indicates that tx flow. */
42931         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
42932         #define HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_LAST \
42933                 HWRM_TF_SESSION_RESC_FLUSH_INPUT_FLAGS_DIR_TX
42934         /*
42935          * Defines the size, in bytes, of the provided flush_addr
42936          * buffer.
42937          */
42938         uint16_t        flush_size;
42939         /*
42940          * This is the DMA address for the flush input data array
42941          * buffer.  Array of tf_rm_resc_entry type. Size of the
42942          * buffer is provided by the 'flush_size' field in this
42943          * message.
42944          */
42945         uint64_t        flush_addr;
42946 } __rte_packed;
42947
42948 /* hwrm_tf_session_resc_flush_output (size:128b/16B) */
42949 struct hwrm_tf_session_resc_flush_output {
42950         /* The specific error status for the command. */
42951         uint16_t        error_code;
42952         /* The HWRM command request type. */
42953         uint16_t        req_type;
42954         /* The sequence ID from the original command. */
42955         uint16_t        seq_id;
42956         /* The length of the response data in number of bytes. */
42957         uint16_t        resp_len;
42958         /* unused. */
42959         uint8_t unused0[7];
42960         /*
42961          * This field is used in Output records to indicate that the output
42962          * is completely written to RAM. This field should be read as '1'
42963          * to indicate that the output has been completely written.
42964          * When writing a command completion or response to an internal
42965          * processor, the order of writes has to be such that this field is
42966          * written last.
42967          */
42968         uint8_t valid;
42969 } __rte_packed;
42970
42971 /*****************************
42972  * hwrm_tf_session_resc_info *
42973  *****************************/
42974
42975
42976 /* hwrm_tf_session_resc_info_input (size:320b/40B) */
42977 struct hwrm_tf_session_resc_info_input {
42978         /* The HWRM command request type. */
42979         uint16_t        req_type;
42980         /*
42981          * The completion ring to send the completion event on. This should
42982          * be the NQ ID returned from the `nq_alloc` HWRM command.
42983          */
42984         uint16_t        cmpl_ring;
42985         /*
42986          * The sequence ID is used by the driver for tracking multiple
42987          * commands. This ID is treated as opaque data by the firmware and
42988          * the value is returned in the `hwrm_resp_hdr` upon completion.
42989          */
42990         uint16_t        seq_id;
42991         /*
42992          * The target ID of the command:
42993          * * 0x0-0xFFF8 - The function ID
42994          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
42995          * * 0xFFFD - Reserved for user-space HWRM interface
42996          * * 0xFFFF - HWRM
42997          */
42998         uint16_t        target_id;
42999         /*
43000          * A physical address pointer pointing to a host buffer that the
43001          * command's response data will be written. This can be either a host
43002          * physical address (HPA) or a guest physical address (GPA) and must
43003          * point to a physically contiguous block of memory.
43004          */
43005         uint64_t        resp_addr;
43006         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43007         uint32_t        fw_session_id;
43008         /* Control flags. */
43009         uint16_t        flags;
43010         /* Indicates the flow direction. */
43011         #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR     UINT32_C(0x1)
43012         /* If this bit set to 0, then it indicates rx flow. */
43013         #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
43014         /* If this bit is set to 1, then it indicates tx flow. */
43015         #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
43016         #define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_LAST \
43017                 HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX
43018         /*
43019          * Defines the array size of the provided req_addr and
43020          * resv_addr array buffers. Should be set to the number of
43021          * request entries.
43022          */
43023         uint16_t        req_size;
43024         /*
43025          * This is the DMA address for the request input data array
43026          * buffer. Array is of tf_rm_resc_req_entry type. Size of the
43027          * array buffer is provided by the 'req_size' field in this
43028          * message.
43029          */
43030         uint64_t        req_addr;
43031         /*
43032          * This is the DMA address for the resc output data array
43033          * buffer. Array is of tf_rm_resc_entry type. Size of the array
43034          * buffer is provided by the 'req_size' field in this
43035          * message.
43036          */
43037         uint64_t        resc_addr;
43038 } __rte_packed;
43039
43040 /* hwrm_tf_session_resc_info_output (size:128b/16B) */
43041 struct hwrm_tf_session_resc_info_output {
43042         /* The specific error status for the command. */
43043         uint16_t        error_code;
43044         /* The HWRM command request type. */
43045         uint16_t        req_type;
43046         /* The sequence ID from the original command. */
43047         uint16_t        seq_id;
43048         /* The length of the response data in number of bytes. */
43049         uint16_t        resp_len;
43050         /*
43051          * Size of the returned tf_rm_resc_entry data array. The value
43052          * cannot exceed the req_size defined by the input msg. The data
43053          * array is returned using the resv_addr specified DMA
43054          * address also provided by the input msg.
43055          */
43056         uint16_t        size;
43057         /* unused. */
43058         uint8_t unused0[5];
43059         /*
43060          * This field is used in Output records to indicate that the output
43061          * is completely written to RAM. This field should be read as '1'
43062          * to indicate that the output has been completely written.
43063          * When writing a command completion or response to an internal
43064          * processor, the order of writes has to be such that this field is
43065          * written last.
43066          */
43067         uint8_t valid;
43068 } __rte_packed;
43069
43070 /* TruFlow RM capability of a resource. */
43071 /* tf_rm_resc_req_entry (size:64b/8B) */
43072 struct tf_rm_resc_req_entry {
43073         /* Type of the resource, defined globally in HCAPI RM. */
43074         uint32_t        type;
43075         /* Minimum value. */
43076         uint16_t        min;
43077         /* Maximum value. */
43078         uint16_t        max;
43079 } __rte_packed;
43080
43081 /* TruFlow RM reservation information. */
43082 /* tf_rm_resc_entry (size:64b/8B) */
43083 struct tf_rm_resc_entry {
43084         /* Type of the resource, defined globally in HCAPI RM. */
43085         uint32_t        type;
43086         /* Start offset. */
43087         uint16_t        start;
43088         /* Number of resources. */
43089         uint16_t        stride;
43090 } __rte_packed;
43091
43092 /************************
43093  * hwrm_tf_tbl_type_get *
43094  ************************/
43095
43096
43097 /* hwrm_tf_tbl_type_get_input (size:256b/32B) */
43098 struct hwrm_tf_tbl_type_get_input {
43099         /* The HWRM command request type. */
43100         uint16_t        req_type;
43101         /*
43102          * The completion ring to send the completion event on. This should
43103          * be the NQ ID returned from the `nq_alloc` HWRM command.
43104          */
43105         uint16_t        cmpl_ring;
43106         /*
43107          * The sequence ID is used by the driver for tracking multiple
43108          * commands. This ID is treated as opaque data by the firmware and
43109          * the value is returned in the `hwrm_resp_hdr` upon completion.
43110          */
43111         uint16_t        seq_id;
43112         /*
43113          * The target ID of the command:
43114          * * 0x0-0xFFF8 - The function ID
43115          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43116          * * 0xFFFD - Reserved for user-space HWRM interface
43117          * * 0xFFFF - HWRM
43118          */
43119         uint16_t        target_id;
43120         /*
43121          * A physical address pointer pointing to a host buffer that the
43122          * command's response data will be written. This can be either a host
43123          * physical address (HPA) or a guest physical address (GPA) and must
43124          * point to a physically contiguous block of memory.
43125          */
43126         uint64_t        resp_addr;
43127         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43128         uint32_t        fw_session_id;
43129         /* Control flags. */
43130         uint16_t        flags;
43131         /* Indicates the flow direction. */
43132         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
43133         /* If this bit set to 0, then it indicates rx flow. */
43134         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
43135         /* If this bit is set to 1, then it indicates that tx flow. */
43136         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
43137         #define HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_LAST \
43138                 HWRM_TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX
43139         /* unused. */
43140         uint8_t unused0[2];
43141         /*
43142          * Type of the resource, defined globally in the
43143          * hwrm_tf_resc_type enum.
43144          */
43145         uint32_t        type;
43146         /* Index of the type to retrieve. */
43147         uint32_t        index;
43148 } __rte_packed;
43149
43150 /* hwrm_tf_tbl_type_get_output (size:1216b/152B) */
43151 struct hwrm_tf_tbl_type_get_output {
43152         /* The specific error status for the command. */
43153         uint16_t        error_code;
43154         /* The HWRM command request type. */
43155         uint16_t        req_type;
43156         /* The sequence ID from the original command. */
43157         uint16_t        seq_id;
43158         /* The length of the response data in number of bytes. */
43159         uint16_t        resp_len;
43160         /* Response code. */
43161         uint32_t        resp_code;
43162         /* Response size. */
43163         uint16_t        size;
43164         /* unused */
43165         uint16_t        unused0;
43166         /* Response data. */
43167         uint8_t data[128];
43168         /* unused */
43169         uint8_t unused1[7];
43170         /*
43171          * This field is used in Output records to indicate that the output
43172          * is completely written to RAM. This field should be read as '1'
43173          * to indicate that the output has been completely written.
43174          * When writing a command completion or response to an internal
43175          * processor, the order of writes has to be such that this field
43176          * is written last.
43177          */
43178         uint8_t valid;
43179 } __rte_packed;
43180
43181 /************************
43182  * hwrm_tf_tbl_type_set *
43183  ************************/
43184
43185
43186 /* hwrm_tf_tbl_type_set_input (size:1024b/128B) */
43187 struct hwrm_tf_tbl_type_set_input {
43188         /* The HWRM command request type. */
43189         uint16_t        req_type;
43190         /*
43191          * The completion ring to send the completion event on. This should
43192          * be the NQ ID returned from the `nq_alloc` HWRM command.
43193          */
43194         uint16_t        cmpl_ring;
43195         /*
43196          * The sequence ID is used by the driver for tracking multiple
43197          * commands. This ID is treated as opaque data by the firmware and
43198          * the value is returned in the `hwrm_resp_hdr` upon completion.
43199          */
43200         uint16_t        seq_id;
43201         /*
43202          * The target ID of the command:
43203          * * 0x0-0xFFF8 - The function ID
43204          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43205          * * 0xFFFD - Reserved for user-space HWRM interface
43206          * * 0xFFFF - HWRM
43207          */
43208         uint16_t        target_id;
43209         /*
43210          * A physical address pointer pointing to a host buffer that the
43211          * command's response data will be written. This can be either a host
43212          * physical address (HPA) or a guest physical address (GPA) and must
43213          * point to a physically contiguous block of memory.
43214          */
43215         uint64_t        resp_addr;
43216         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43217         uint32_t        fw_session_id;
43218         /* Control flags. */
43219         uint16_t        flags;
43220         /* Indicates the flow direction. */
43221         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
43222         /* If this bit set to 0, then it indicates rx flow. */
43223         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
43224         /* If this bit is set to 1, then it indicates that tx flow. */
43225         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
43226         #define HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_LAST \
43227                 HWRM_TF_TBL_TYPE_SET_INPUT_FLAGS_DIR_TX
43228         /* unused. */
43229         uint8_t unused0[2];
43230         /*
43231          * Type of the resource, defined globally in the
43232          * hwrm_tf_resc_type enum.
43233          */
43234         uint32_t        type;
43235         /* Index of the type to retrieve. */
43236         uint32_t        index;
43237         /* Size of the data to set. */
43238         uint16_t        size;
43239         /* unused */
43240         uint8_t unused1[6];
43241         /* Data to be set. */
43242         uint8_t data[88];
43243 } __rte_packed;
43244
43245 /* hwrm_tf_tbl_type_set_output (size:128b/16B) */
43246 struct hwrm_tf_tbl_type_set_output {
43247         /* The specific error status for the command. */
43248         uint16_t        error_code;
43249         /* The HWRM command request type. */
43250         uint16_t        req_type;
43251         /* The sequence ID from the original command. */
43252         uint16_t        seq_id;
43253         /* The length of the response data in number of bytes. */
43254         uint16_t        resp_len;
43255         /* unused. */
43256         uint8_t unused0[7];
43257         /*
43258          * This field is used in Output records to indicate that the output
43259          * is completely written to RAM. This field should be read as '1'
43260          * to indicate that the output has been completely written.
43261          * When writing a command completion or response to an internal
43262          * processor, the order of writes has to be such that this field
43263          * is written last.
43264          */
43265         uint8_t valid;
43266 } __rte_packed;
43267
43268 /**************************
43269  * hwrm_tf_ctxt_mem_alloc *
43270  **************************/
43271
43272
43273 /* hwrm_tf_ctxt_mem_alloc_input (size:192b/24B) */
43274 struct hwrm_tf_ctxt_mem_alloc_input {
43275         /* The HWRM command request type. */
43276         uint16_t        req_type;
43277         /*
43278          * The completion ring to send the completion event on. This should
43279          * be the NQ ID returned from the `nq_alloc` HWRM command.
43280          */
43281         uint16_t        cmpl_ring;
43282         /*
43283          * The sequence ID is used by the driver for tracking multiple
43284          * commands. This ID is treated as opaque data by the firmware and
43285          * the value is returned in the `hwrm_resp_hdr` upon completion.
43286          */
43287         uint16_t        seq_id;
43288         /*
43289          * The target ID of the command:
43290          * * 0x0-0xFFF8 - The function ID
43291          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43292          * * 0xFFFD - Reserved for user-space HWRM interface
43293          * * 0xFFFF - HWRM
43294          */
43295         uint16_t        target_id;
43296         /*
43297          * A physical address pointer pointing to a host buffer that the
43298          * command's response data will be written. This can be either a host
43299          * physical address (HPA) or a guest physical address (GPA) and must
43300          * point to a physically contiguous block of memory.
43301          */
43302         uint64_t        resp_addr;
43303         /* Size in KB of memory to be allocated. */
43304         uint32_t        mem_size;
43305         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43306         uint32_t        fw_session_id;
43307 } __rte_packed;
43308
43309 /* hwrm_tf_ctxt_mem_alloc_output (size:192b/24B) */
43310 struct hwrm_tf_ctxt_mem_alloc_output {
43311         /* The specific error status for the command. */
43312         uint16_t        error_code;
43313         /* The HWRM command request type. */
43314         uint16_t        req_type;
43315         /* The sequence ID from the original command. */
43316         uint16_t        seq_id;
43317         /* The length of the response data in number of bytes. */
43318         uint16_t        resp_len;
43319         /* Pointer to the PBL, or PDL depending on number of levels */
43320         uint64_t        page_dir;
43321         /* Size of memory allocated. */
43322         uint32_t        mem_size;
43323         /* Counter PBL indirect levels. */
43324         uint8_t page_level;
43325         /* PBL pointer is physical start address. */
43326         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
43327         /* PBL pointer points to PTE table. */
43328         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
43329         /*
43330          * PBL pointer points to PDE table with each entry pointing
43331          * to PTE tables.
43332          */
43333         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
43334         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LAST \
43335                 HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_LEVEL_LVL_2
43336         /* Page size. */
43337         uint8_t page_size;
43338         /* 4KB page size. */
43339         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
43340         /* 8KB page size. */
43341         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
43342         /* 64KB page size. */
43343         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
43344         /* 128KB page size. */
43345         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_128K UINT32_C(0x5)
43346         /* 256KB page size. */
43347         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
43348         /* 512KB page size. */
43349         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_512K UINT32_C(0x7)
43350         /* 1MB page size. */
43351         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
43352         /* 2MB page size. */
43353         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
43354         /* 4MB page size. */
43355         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
43356         /* 8MB page size. */
43357         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_8M   UINT32_C(0xb)
43358         /* 1GB page size. */
43359         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
43360         #define HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_LAST \
43361                 HWRM_TF_CTXT_MEM_ALLOC_OUTPUT_PAGE_SIZE_1G
43362         /* unused. */
43363         uint8_t unused0;
43364         /*
43365          * This field is used in Output records to indicate that the
43366          * output is completely written to RAM. This field should be
43367          * read as '1' to indicate that the output has been
43368          * completely written.  When writing a command completion or
43369          * response to an internal processor, the order of writes has
43370          * to be such that this field is written last.
43371          */
43372         uint8_t valid;
43373 } __rte_packed;
43374
43375 /*************************
43376  * hwrm_tf_ctxt_mem_free *
43377  *************************/
43378
43379
43380 /* hwrm_tf_ctxt_mem_free_input (size:320b/40B) */
43381 struct hwrm_tf_ctxt_mem_free_input {
43382         /* The HWRM command request type. */
43383         uint16_t        req_type;
43384         /*
43385          * The completion ring to send the completion event on. This should
43386          * be the NQ ID returned from the `nq_alloc` HWRM command.
43387          */
43388         uint16_t        cmpl_ring;
43389         /*
43390          * The sequence ID is used by the driver for tracking multiple
43391          * commands. This ID is treated as opaque data by the firmware and
43392          * the value is returned in the `hwrm_resp_hdr` upon completion.
43393          */
43394         uint16_t        seq_id;
43395         /*
43396          * The target ID of the command:
43397          * * 0x0-0xFFF8 - The function ID
43398          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43399          * * 0xFFFD - Reserved for user-space HWRM interface
43400          * * 0xFFFF - HWRM
43401          */
43402         uint16_t        target_id;
43403         /*
43404          * A physical address pointer pointing to a host buffer that the
43405          * command's response data will be written. This can be either a host
43406          * physical address (HPA) or a guest physical address (GPA) and must
43407          * point to a physically contiguous block of memory.
43408          */
43409         uint64_t        resp_addr;
43410         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43411         uint32_t        fw_session_id;
43412         /* Counter PBL indirect levels. */
43413         uint8_t page_level;
43414         /* PBL pointer is physical start address. */
43415         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
43416         /* PBL pointer points to PTE table. */
43417         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
43418         /*
43419          * PBL pointer points to PDE table with each entry pointing
43420          * to PTE tables.
43421          */
43422         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
43423         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LAST \
43424                 HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_LEVEL_LVL_2
43425         /* Page size. */
43426         uint8_t page_size;
43427         /* 4KB page size. */
43428         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
43429         /* 8KB page size. */
43430         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
43431         /* 64KB page size. */
43432         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
43433         /* 128KB page size. */
43434         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_128K UINT32_C(0x5)
43435         /* 256KB page size. */
43436         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
43437         /* 512KB page size. */
43438         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_512K UINT32_C(0x7)
43439         /* 1MB page size. */
43440         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
43441         /* 2MB page size. */
43442         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
43443         /* 4MB page size. */
43444         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
43445         /* 8MB page size. */
43446         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_8M   UINT32_C(0xb)
43447         /* 1GB page size. */
43448         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
43449         #define HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_LAST \
43450                 HWRM_TF_CTXT_MEM_FREE_INPUT_PAGE_SIZE_1G
43451         /* unused. */
43452         uint8_t unused0[2];
43453         /* Pointer to the PBL, or PDL depending on number of levels */
43454         uint64_t        page_dir;
43455         /* Size of memory allocated. */
43456         uint32_t        mem_size;
43457         /* unused. */
43458         uint8_t unused1[4];
43459 } __rte_packed;
43460
43461 /* hwrm_tf_ctxt_mem_free_output (size:128b/16B) */
43462 struct hwrm_tf_ctxt_mem_free_output {
43463         /* The specific error status for the command. */
43464         uint16_t        error_code;
43465         /* The HWRM command request type. */
43466         uint16_t        req_type;
43467         /* The sequence ID from the original command. */
43468         uint16_t        seq_id;
43469         /* The length of the response data in number of bytes. */
43470         uint16_t        resp_len;
43471         /* unused. */
43472         uint8_t unused0[7];
43473         /*
43474          * This field is used in Output records to indicate that the
43475          * output is completely written to RAM. This field should be
43476          * read as '1' to indicate that the output has been
43477          * completely written.  When writing a command completion or
43478          * response to an internal processor, the order of writes has
43479          * to be such that this field is written last.
43480          */
43481         uint8_t valid;
43482 } __rte_packed;
43483
43484 /*************************
43485  * hwrm_tf_ctxt_mem_rgtr *
43486  *************************/
43487
43488
43489 /* hwrm_tf_ctxt_mem_rgtr_input (size:256b/32B) */
43490 struct hwrm_tf_ctxt_mem_rgtr_input {
43491         /* The HWRM command request type. */
43492         uint16_t        req_type;
43493         /*
43494          * The completion ring to send the completion event on. This should
43495          * be the NQ ID returned from the `nq_alloc` HWRM command.
43496          */
43497         uint16_t        cmpl_ring;
43498         /*
43499          * The sequence ID is used by the driver for tracking multiple
43500          * commands. This ID is treated as opaque data by the firmware and
43501          * the value is returned in the `hwrm_resp_hdr` upon completion.
43502          */
43503         uint16_t        seq_id;
43504         /*
43505          * The target ID of the command:
43506          * * 0x0-0xFFF8 - The function ID
43507          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43508          * * 0xFFFD - Reserved for user-space HWRM interface
43509          * * 0xFFFF - HWRM
43510          */
43511         uint16_t        target_id;
43512         /*
43513          * A physical address pointer pointing to a host buffer that the
43514          * command's response data will be written. This can be either a host
43515          * physical address (HPA) or a guest physical address (GPA) and must
43516          * point to a physically contiguous block of memory.
43517          */
43518         uint64_t        resp_addr;
43519         /* Control flags. */
43520         uint16_t        flags;
43521         /* Counter PBL indirect levels. */
43522         uint8_t page_level;
43523         /* PBL pointer is physical start address. */
43524         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
43525         /* PBL pointer points to PTE table. */
43526         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
43527         /*
43528          * PBL pointer points to PDE table with each entry pointing
43529          * to PTE tables.
43530          */
43531         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
43532         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LAST \
43533                 HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
43534         /* Page size. */
43535         uint8_t page_size;
43536         /* 4KB page size. */
43537         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
43538         /* 8KB page size. */
43539         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
43540         /* 64KB page size. */
43541         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
43542         /* 128KB page size. */
43543         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_128K UINT32_C(0x5)
43544         /* 256KB page size. */
43545         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
43546         /* 512KB page size. */
43547         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_512K UINT32_C(0x7)
43548         /* 1MB page size. */
43549         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
43550         /* 2MB page size. */
43551         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
43552         /* 4MB page size. */
43553         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
43554         /* 8MB page size. */
43555         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_8M   UINT32_C(0xb)
43556         /* 1GB page size. */
43557         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
43558         #define HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_LAST \
43559                 HWRM_TF_CTXT_MEM_RGTR_INPUT_PAGE_SIZE_1G
43560         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43561         uint32_t        fw_session_id;
43562         /* Pointer to the PBL, or PDL depending on number of levels */
43563         uint64_t        page_dir;
43564 } __rte_packed;
43565
43566 /* hwrm_tf_ctxt_mem_rgtr_output (size:128b/16B) */
43567 struct hwrm_tf_ctxt_mem_rgtr_output {
43568         /* The specific error status for the command. */
43569         uint16_t        error_code;
43570         /* The HWRM command request type. */
43571         uint16_t        req_type;
43572         /* The sequence ID from the original command. */
43573         uint16_t        seq_id;
43574         /* The length of the response data in number of bytes. */
43575         uint16_t        resp_len;
43576         /*
43577          * Id/Handle to the recently register context memory. This
43578          * handle is passed to the TF session.
43579          */
43580         uint16_t        ctx_id;
43581         /* unused. */
43582         uint8_t unused0[5];
43583         /*
43584          * This field is used in Output records to indicate that the
43585          * output is completely written to RAM. This field should be
43586          * read as '1' to indicate that the output has been
43587          * completely written.  When writing a command completion or
43588          * response to an internal processor, the order of writes has
43589          * to be such that this field is written last.
43590          */
43591         uint8_t valid;
43592 } __rte_packed;
43593
43594 /***************************
43595  * hwrm_tf_ctxt_mem_unrgtr *
43596  ***************************/
43597
43598
43599 /* hwrm_tf_ctxt_mem_unrgtr_input (size:192b/24B) */
43600 struct hwrm_tf_ctxt_mem_unrgtr_input {
43601         /* The HWRM command request type. */
43602         uint16_t        req_type;
43603         /*
43604          * The completion ring to send the completion event on. This should
43605          * be the NQ ID returned from the `nq_alloc` HWRM command.
43606          */
43607         uint16_t        cmpl_ring;
43608         /*
43609          * The sequence ID is used by the driver for tracking multiple
43610          * commands. This ID is treated as opaque data by the firmware and
43611          * the value is returned in the `hwrm_resp_hdr` upon completion.
43612          */
43613         uint16_t        seq_id;
43614         /*
43615          * The target ID of the command:
43616          * * 0x0-0xFFF8 - The function ID
43617          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43618          * * 0xFFFD - Reserved for user-space HWRM interface
43619          * * 0xFFFF - HWRM
43620          */
43621         uint16_t        target_id;
43622         /*
43623          * A physical address pointer pointing to a host buffer that the
43624          * command's response data will be written. This can be either a host
43625          * physical address (HPA) or a guest physical address (GPA) and must
43626          * point to a physically contiguous block of memory.
43627          */
43628         uint64_t        resp_addr;
43629         /*
43630          * Id/Handle to the recently register context memory. This
43631          * handle is passed to the TF session.
43632          */
43633         uint16_t        ctx_id;
43634         /* unused. */
43635         uint8_t unused0[2];
43636         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43637         uint32_t        fw_session_id;
43638 } __rte_packed;
43639
43640 /* hwrm_tf_ctxt_mem_unrgtr_output (size:128b/16B) */
43641 struct hwrm_tf_ctxt_mem_unrgtr_output {
43642         /* The specific error status for the command. */
43643         uint16_t        error_code;
43644         /* The HWRM command request type. */
43645         uint16_t        req_type;
43646         /* The sequence ID from the original command. */
43647         uint16_t        seq_id;
43648         /* The length of the response data in number of bytes. */
43649         uint16_t        resp_len;
43650         /* unused. */
43651         uint8_t unused0[7];
43652         /*
43653          * This field is used in Output records to indicate that the
43654          * output is completely written to RAM. This field should be
43655          * read as '1' to indicate that the output has been
43656          * completely written.  When writing a command completion or
43657          * response to an internal processor, the order of writes has
43658          * to be such that this field is written last.
43659          */
43660         uint8_t valid;
43661 } __rte_packed;
43662
43663 /************************
43664  * hwrm_tf_ext_em_qcaps *
43665  ************************/
43666
43667
43668 /* hwrm_tf_ext_em_qcaps_input (size:192b/24B) */
43669 struct hwrm_tf_ext_em_qcaps_input {
43670         /* The HWRM command request type. */
43671         uint16_t        req_type;
43672         /*
43673          * The completion ring to send the completion event on. This should
43674          * be the NQ ID returned from the `nq_alloc` HWRM command.
43675          */
43676         uint16_t        cmpl_ring;
43677         /*
43678          * The sequence ID is used by the driver for tracking multiple
43679          * commands. This ID is treated as opaque data by the firmware and
43680          * the value is returned in the `hwrm_resp_hdr` upon completion.
43681          */
43682         uint16_t        seq_id;
43683         /*
43684          * The target ID of the command:
43685          * * 0x0-0xFFF8 - The function ID
43686          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43687          * * 0xFFFD - Reserved for user-space HWRM interface
43688          * * 0xFFFF - HWRM
43689          */
43690         uint16_t        target_id;
43691         /*
43692          * A physical address pointer pointing to a host buffer that the
43693          * command's response data will be written. This can be either a host
43694          * physical address (HPA) or a guest physical address (GPA) and must
43695          * point to a physically contiguous block of memory.
43696          */
43697         uint64_t        resp_addr;
43698         /* Control flags. */
43699         uint32_t        flags;
43700         /* Indicates the flow direction. */
43701         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR \
43702                 UINT32_C(0x1)
43703         /* If this bit set to 0, then it indicates rx flow. */
43704         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_RX \
43705                 UINT32_C(0x0)
43706         /* If this bit is set to 1, then it indicates that tx flow. */
43707         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_TX \
43708                 UINT32_C(0x1)
43709         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_LAST \
43710                 HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_DIR_TX
43711         /* When set to 1, all offloaded flows will be sent to EXT EM. */
43712         #define HWRM_TF_EXT_EM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD \
43713                 UINT32_C(0x2)
43714         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43715         uint32_t        fw_session_id;
43716 } __rte_packed;
43717
43718 /* hwrm_tf_ext_em_qcaps_output (size:384b/48B) */
43719 struct hwrm_tf_ext_em_qcaps_output {
43720         /* The specific error status for the command. */
43721         uint16_t        error_code;
43722         /* The HWRM command request type. */
43723         uint16_t        req_type;
43724         /* The sequence ID from the original command. */
43725         uint16_t        seq_id;
43726         /* The length of the response data in number of bytes. */
43727         uint16_t        resp_len;
43728         uint32_t        flags;
43729         /*
43730          * When set to 1, indicates the FW supports the Centralized
43731          * Memory Model. The concept designates one entity for the
43732          * memory allocation while all others ‘subscribe’ to it.
43733          */
43734         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
43735                 UINT32_C(0x1)
43736         /*
43737          * When set to 1, indicates the FW supports the Detached
43738          * Centralized Memory Model. The memory is allocated and managed
43739          * as a separate entity. All PFs and VFs will be granted direct
43740          * or semi-direct access to the allocated memory while none of
43741          * which can interfere with the management of the memory.
43742          */
43743         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
43744                 UINT32_C(0x2)
43745         /* When set to 1, indicates FW support for host based EEM memory. */
43746         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_HOST_MEMORY_SUPPORTED \
43747                 UINT32_C(0x4)
43748         /* When set to 1, indicates FW support for on-chip based EEM memory. */
43749         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_FLAGS_FW_MEMORY_SUPPORTED \
43750                 UINT32_C(0x8)
43751         /* unused. */
43752         uint32_t        unused0;
43753         /* Support flags. */
43754         uint32_t        supported;
43755         /*
43756          * If set to 1, then EXT EM KEY0 table is supported using
43757          * crc32 hash.
43758          * If set to 0, EXT EM KEY0 table is not supported.
43759          */
43760         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE \
43761                 UINT32_C(0x1)
43762         /*
43763          * If set to 1, then EXT EM KEY1 table is supported using
43764          * lookup3 hash.
43765          * If set to 0, EXT EM KEY1 table is not supported.
43766          */
43767         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE \
43768                 UINT32_C(0x2)
43769         /*
43770          * If set to 1, then EXT EM External Record table is supported.
43771          * If set to 0, EXT EM External Record table is not
43772          * supported.  (This table includes action record, EFC
43773          * pointers, encap pointers)
43774          */
43775         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE \
43776                 UINT32_C(0x4)
43777         /*
43778          * If set to 1, then EXT EM External Flow Counters table is
43779          * supported.
43780          * If set to 0, EXT EM External Flow Counters table is not
43781          * supported.
43782          */
43783         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE \
43784                 UINT32_C(0x8)
43785         /*
43786          * If set to 1, then FID table used for implicit flow flush
43787          * is supported.
43788          * If set to 0, then FID table used for implicit flow flush
43789          * is not supported.
43790          */
43791         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE \
43792                 UINT32_C(0x10)
43793         /*
43794          * If set to 1, then table scopes are supported.
43795          * If set to 0, then table scopes are not supported.
43796          */
43797         #define HWRM_TF_EXT_EM_QCAPS_OUTPUT_SUPPORTED_TBL_SCOPES \
43798                 UINT32_C(0x20)
43799         /*
43800          * The maximum number of entries supported by EXT EM. When
43801          * configuring the host memory the number of numbers of
43802          * entries that can supported are -
43803          *      32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M,
43804          *      128M entries.
43805          * Any value that are not these values, the FW will round
43806          * down to the closest support number of entries.
43807          */
43808         uint32_t        max_entries_supported;
43809         /*
43810          * The entry size in bytes of each entry in the EXT EM
43811          * KEY0/KEY1 tables.
43812          */
43813         uint16_t        key_entry_size;
43814         /*
43815          * The entry size in bytes of each entry in the EXT EM RECORD
43816          * tables.
43817          */
43818         uint16_t        record_entry_size;
43819         /* The entry size in bytes of each entry in the EXT EM EFC tables. */
43820         uint16_t        efc_entry_size;
43821         /* The FID size in bytes of each entry in the EXT EM FID tables. */
43822         uint16_t        fid_entry_size;
43823         /* Maximum number of ctxt mem allocations allowed. */
43824         uint32_t        max_ctxt_mem_allocs;
43825         /*
43826          * Maximum number of static buckets that can be assigned to lookup
43827          * table scopes.
43828          */
43829         uint32_t        max_static_buckets;
43830         /* unused. */
43831         uint8_t unused1[7];
43832         /*
43833          * This field is used in Output records to indicate that the
43834          * output is completely written to RAM. This field should be
43835          * read as '1' to indicate that the output has been
43836          * completely written.  When writing a command completion or
43837          * response to an internal processor, the order of writes has
43838          * to be such that this field is written last.
43839          */
43840         uint8_t valid;
43841 } __rte_packed;
43842
43843 /*********************
43844  * hwrm_tf_ext_em_op *
43845  *********************/
43846
43847
43848 /* hwrm_tf_ext_em_op_input (size:256b/32B) */
43849 struct hwrm_tf_ext_em_op_input {
43850         /* The HWRM command request type. */
43851         uint16_t        req_type;
43852         /*
43853          * The completion ring to send the completion event on. This should
43854          * be the NQ ID returned from the `nq_alloc` HWRM command.
43855          */
43856         uint16_t        cmpl_ring;
43857         /*
43858          * The sequence ID is used by the driver for tracking multiple
43859          * commands. This ID is treated as opaque data by the firmware and
43860          * the value is returned in the `hwrm_resp_hdr` upon completion.
43861          */
43862         uint16_t        seq_id;
43863         /*
43864          * The target ID of the command:
43865          * * 0x0-0xFFF8 - The function ID
43866          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43867          * * 0xFFFD - Reserved for user-space HWRM interface
43868          * * 0xFFFF - HWRM
43869          */
43870         uint16_t        target_id;
43871         /*
43872          * A physical address pointer pointing to a host buffer that the
43873          * command's response data will be written. This can be either a host
43874          * physical address (HPA) or a guest physical address (GPA) and must
43875          * point to a physically contiguous block of memory.
43876          */
43877         uint64_t        resp_addr;
43878         /* Control flags. */
43879         uint16_t        flags;
43880         /* Indicates the flow direction. */
43881         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR     UINT32_C(0x1)
43882         /* If this bit set to 0, then it indicates rx flow. */
43883         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
43884         /* If this bit is set to 1, then it indicates that tx flow. */
43885         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
43886         #define HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_LAST \
43887                 HWRM_TF_EXT_EM_OP_INPUT_FLAGS_DIR_TX
43888         /* unused. */
43889         uint16_t        unused0;
43890         /* The number of EXT EM key table entries to be configured. */
43891         uint16_t        op;
43892         /* This value is reserved and should not be used. */
43893         #define HWRM_TF_EXT_EM_OP_INPUT_OP_RESERVED       UINT32_C(0x0)
43894         /*
43895          * To properly stop EXT EM and ensure there are no DMA's,
43896          * the caller must disable EXT EM for the given PF, using
43897          * this call. This will safely disable EXT EM and ensure
43898          * that all DMA'ed to the keys/records/efc have been
43899          * completed.
43900          */
43901         #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_DISABLE UINT32_C(0x1)
43902         /*
43903          * Once the EXT EM host memory has been configured, EXT EM
43904          * options have been configured. Then the caller should
43905          * enable EXT EM for the given PF. Note once this call has
43906          * been made, then the EXT EM mechanism will be active and
43907          * DMA's will occur as packets are processed.
43908          */
43909         #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_ENABLE  UINT32_C(0x2)
43910         /*
43911          * Clear EXT EM settings for the given PF so that the
43912          * register values are reset back to their initial state.
43913          */
43914         #define HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_CLEANUP UINT32_C(0x3)
43915         #define HWRM_TF_EXT_EM_OP_INPUT_OP_LAST \
43916                 HWRM_TF_EXT_EM_OP_INPUT_OP_EXT_EM_CLEANUP
43917         /* unused. */
43918         uint16_t        unused1;
43919         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
43920         uint32_t        fw_session_id;
43921         /* unused. */
43922         uint32_t        unused2;
43923 } __rte_packed;
43924
43925 /* hwrm_tf_ext_em_op_output (size:128b/16B) */
43926 struct hwrm_tf_ext_em_op_output {
43927         /* The specific error status for the command. */
43928         uint16_t        error_code;
43929         /* The HWRM command request type. */
43930         uint16_t        req_type;
43931         /* The sequence ID from the original command. */
43932         uint16_t        seq_id;
43933         /* The length of the response data in number of bytes. */
43934         uint16_t        resp_len;
43935         /* unused. */
43936         uint8_t unused0[7];
43937         /*
43938          * This field is used in Output records to indicate that the
43939          * output is completely written to RAM. This field should be
43940          * read as '1' to indicate that the output has been
43941          * completely written.  When writing a command completion or
43942          * response to an internal processor, the order of writes has
43943          * to be such that this field is written last.
43944          */
43945         uint8_t valid;
43946 } __rte_packed;
43947
43948 /**********************
43949  * hwrm_tf_ext_em_cfg *
43950  **********************/
43951
43952
43953 /* hwrm_tf_ext_em_cfg_input (size:512b/64B) */
43954 struct hwrm_tf_ext_em_cfg_input {
43955         /* The HWRM command request type. */
43956         uint16_t        req_type;
43957         /*
43958          * The completion ring to send the completion event on. This should
43959          * be the NQ ID returned from the `nq_alloc` HWRM command.
43960          */
43961         uint16_t        cmpl_ring;
43962         /*
43963          * The sequence ID is used by the driver for tracking multiple
43964          * commands. This ID is treated as opaque data by the firmware and
43965          * the value is returned in the `hwrm_resp_hdr` upon completion.
43966          */
43967         uint16_t        seq_id;
43968         /*
43969          * The target ID of the command:
43970          * * 0x0-0xFFF8 - The function ID
43971          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
43972          * * 0xFFFD - Reserved for user-space HWRM interface
43973          * * 0xFFFF - HWRM
43974          */
43975         uint16_t        target_id;
43976         /*
43977          * A physical address pointer pointing to a host buffer that the
43978          * command's response data will be written. This can be either a host
43979          * physical address (HPA) or a guest physical address (GPA) and must
43980          * point to a physically contiguous block of memory.
43981          */
43982         uint64_t        resp_addr;
43983         /* Control flags. */
43984         uint32_t        flags;
43985         /* Indicates the flow direction. */
43986         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR \
43987                 UINT32_C(0x1)
43988         /* If this bit set to 0, then it indicates rx flow. */
43989         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_RX \
43990                 UINT32_C(0x0)
43991         /* If this bit is set to 1, then it indicates that tx flow. */
43992         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_TX \
43993                 UINT32_C(0x1)
43994         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_LAST \
43995                 HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_DIR_TX
43996         /* When set to 1, all offloaded flows will be sent to EXT EM. */
43997         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD \
43998                 UINT32_C(0x2)
43999         /* When set to 1, secondary, 0 means primary. */
44000         #define HWRM_TF_EXT_EM_CFG_INPUT_FLAGS_SECONDARY_PF \
44001                 UINT32_C(0x4)
44002         /*
44003          * Group_id which used by Firmware to identify memory pools belonging
44004          * to certain group.
44005          */
44006         uint16_t        group_id;
44007         /*
44008          * Dynamically reconfigure EEM pending cache every 1/10th of second.
44009          * If set to 0 it will disable the EEM HW flush of the pending cache.
44010          */
44011         uint8_t flush_interval;
44012         /* unused. */
44013         uint8_t unused0;
44014         /*
44015          * Configured EXT EM with the given number of entries. All
44016          * the EXT EM tables KEY0, KEY1, RECORD, EFC all have the
44017          * same number of entries and all tables will be configured
44018          * using this value. Current minimum value is 32k. Current
44019          * maximum value is 128M.
44020          */
44021         uint32_t        num_entries;
44022         uint32_t        enables;
44023         /*
44024          * This bit must be '1' for the group_id field to be
44025          * configured.
44026          */
44027         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_GROUP_ID \
44028                 UINT32_C(0x1)
44029         /*
44030          * This bit must be '1' for the flush_interval field to be
44031          * configured.
44032          */
44033         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_FLUSH_INTERVAL \
44034                 UINT32_C(0x2)
44035         /*
44036          * This bit must be '1' for the num_entries field to be
44037          * configured.
44038          */
44039         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_NUM_ENTRIES \
44040                 UINT32_C(0x4)
44041         /*
44042          * This bit must be '1' for the key0_ctx_id field to be
44043          * configured.
44044          */
44045         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_KEY0_CTX_ID \
44046                 UINT32_C(0x8)
44047         /*
44048          * This bit must be '1' for the key1_ctx_id field to be
44049          * configured.
44050          */
44051         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_KEY1_CTX_ID \
44052                 UINT32_C(0x10)
44053         /*
44054          * This bit must be '1' for the record_ctx_id field to be
44055          * configured.
44056          */
44057         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_RECORD_CTX_ID \
44058                 UINT32_C(0x20)
44059         /*
44060          * This bit must be '1' for the efc_ctx_id field to be
44061          * configured.
44062          */
44063         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_EFC_CTX_ID \
44064                 UINT32_C(0x40)
44065         /*
44066          * This bit must be '1' for the fid_ctx_id field to be
44067          * configured.
44068          */
44069         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_FID_CTX_ID \
44070                 UINT32_C(0x80)
44071         /*
44072          * This bit must be '1' for the action_ctx_id field to be
44073          * configured.
44074          */
44075         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_ACTION_CTX_ID \
44076                 UINT32_C(0x100)
44077         /*
44078          * This bit must be '1' for the action_tbl_scope field to be
44079          * configured.
44080          */
44081         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_ACTION_TBL_SCOPE \
44082                 UINT32_C(0x200)
44083         /*
44084          * This bit must be '1' for the lkup_ctx_id field to be
44085          * configured.
44086          */
44087         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_CTX_ID \
44088                 UINT32_C(0x400)
44089         /*
44090          * This bit must be '1' for the lkup_tbl_scope field to be
44091          * configured.
44092          */
44093         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_TBL_SCOPE \
44094                 UINT32_C(0x800)
44095         /*
44096          * This bit must be '1' for the lkup_static_buckets field to be
44097          * configured.
44098          */
44099         #define HWRM_TF_EXT_EM_CFG_INPUT_ENABLES_LKUP_STATIC_BUCKETS \
44100                 UINT32_C(0x1000)
44101         /* Configured EXT EM with the given context if for KEY0 table. */
44102         uint16_t        key0_ctx_id;
44103         /* Configured EXT EM with the given context if for KEY1 table. */
44104         uint16_t        key1_ctx_id;
44105         /* Configured EXT EM with the given context if for RECORD table. */
44106         uint16_t        record_ctx_id;
44107         /* Configured EXT EM with the given context if for EFC table. */
44108         uint16_t        efc_ctx_id;
44109         /* Configured EXT EM with the given context if for EFC table. */
44110         uint16_t        fid_ctx_id;
44111         /* Context id of action table scope. */
44112         uint16_t        action_ctx_id;
44113         /* Table scope id used for action record entries. */
44114         uint16_t        action_tbl_scope;
44115         /* Context id of lookup table scope. */
44116         uint16_t        lkup_ctx_id;
44117         /* Table scope id used for EM lookup entries. */
44118         uint16_t        lkup_tbl_scope;
44119         /* unused. */
44120         uint16_t        unused1;
44121         /*
44122          * Number of 32B static buckets to be allocated at the beginning
44123          * of table scope.
44124          */
44125         uint32_t        lkup_static_buckets;
44126         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
44127         uint32_t        fw_session_id;
44128         /* unused. */
44129         uint32_t        unused2;
44130 } __rte_packed;
44131
44132 /* hwrm_tf_ext_em_cfg_output (size:128b/16B) */
44133 struct hwrm_tf_ext_em_cfg_output {
44134         /* The specific error status for the command. */
44135         uint16_t        error_code;
44136         /* The HWRM command request type. */
44137         uint16_t        req_type;
44138         /* The sequence ID from the original command. */
44139         uint16_t        seq_id;
44140         /* The length of the response data in number of bytes. */
44141         uint16_t        resp_len;
44142         /* unused. */
44143         uint8_t unused0[7];
44144         /*
44145          * This field is used in Output records to indicate that the
44146          * output is completely written to RAM. This field should be
44147          * read as '1' to indicate that the output has been
44148          * completely written.  When writing a command completion or
44149          * response to an internal processor, the order of writes has
44150          * to be such that this field is written last.
44151          */
44152         uint8_t valid;
44153 } __rte_packed;
44154
44155 /***********************
44156  * hwrm_tf_ext_em_qcfg *
44157  ***********************/
44158
44159
44160 /* hwrm_tf_ext_em_qcfg_input (size:192b/24B) */
44161 struct hwrm_tf_ext_em_qcfg_input {
44162         /* The HWRM command request type. */
44163         uint16_t        req_type;
44164         /*
44165          * The completion ring to send the completion event on. This should
44166          * be the NQ ID returned from the `nq_alloc` HWRM command.
44167          */
44168         uint16_t        cmpl_ring;
44169         /*
44170          * The sequence ID is used by the driver for tracking multiple
44171          * commands. This ID is treated as opaque data by the firmware and
44172          * the value is returned in the `hwrm_resp_hdr` upon completion.
44173          */
44174         uint16_t        seq_id;
44175         /*
44176          * The target ID of the command:
44177          * * 0x0-0xFFF8 - The function ID
44178          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44179          * * 0xFFFD - Reserved for user-space HWRM interface
44180          * * 0xFFFF - HWRM
44181          */
44182         uint16_t        target_id;
44183         /*
44184          * A physical address pointer pointing to a host buffer that the
44185          * command's response data will be written. This can be either a host
44186          * physical address (HPA) or a guest physical address (GPA) and must
44187          * point to a physically contiguous block of memory.
44188          */
44189         uint64_t        resp_addr;
44190         /* Control flags. */
44191         uint32_t        flags;
44192         /* Indicates the flow direction. */
44193         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR     UINT32_C(0x1)
44194         /* If this bit set to 0, then it indicates rx flow. */
44195         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
44196         /* If this bit is set to 1, then it indicates that tx flow. */
44197         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
44198         #define HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_LAST \
44199                 HWRM_TF_EXT_EM_QCFG_INPUT_FLAGS_DIR_TX
44200         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
44201         uint32_t        fw_session_id;
44202 } __rte_packed;
44203
44204 /* hwrm_tf_ext_em_qcfg_output (size:448b/56B) */
44205 struct hwrm_tf_ext_em_qcfg_output {
44206         /* The specific error status for the command. */
44207         uint16_t        error_code;
44208         /* The HWRM command request type. */
44209         uint16_t        req_type;
44210         /* The sequence ID from the original command. */
44211         uint16_t        seq_id;
44212         /* The length of the response data in number of bytes. */
44213         uint16_t        resp_len;
44214         /* Control flags. */
44215         uint32_t        flags;
44216         /* Indicates the flow direction. */
44217         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR \
44218                 UINT32_C(0x1)
44219         /* If this bit set to 0, then it indicates rx flow. */
44220         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_RX \
44221                 UINT32_C(0x0)
44222         /* If this bit is set to 1, then it indicates that tx flow. */
44223         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_TX \
44224                 UINT32_C(0x1)
44225         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_LAST \
44226                 HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_DIR_TX
44227         /* When set to 1, all offloaded flows will be sent to EXT EM. */
44228         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD \
44229                 UINT32_C(0x2)
44230         /* The number of entries the FW has configured for EXT EM. */
44231         uint32_t        num_entries;
44232         /* Configured EXT EM with the given context if for KEY0 table. */
44233         uint16_t        key0_ctx_id;
44234         /* Configured EXT EM with the given context if for KEY1 table. */
44235         uint16_t        key1_ctx_id;
44236         /* Configured EXT EM with the given context if for RECORD table. */
44237         uint16_t        record_ctx_id;
44238         /* Configured EXT EM with the given context if for EFC table. */
44239         uint16_t        efc_ctx_id;
44240         /* Configured EXT EM with the given context if for EFC table. */
44241         uint16_t        fid_ctx_id;
44242         /* unused. */
44243         uint16_t        unused0;
44244         uint32_t        supported;
44245         /* This bit must be '1' for the group_id field is set. */
44246         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_GROUP_ID \
44247                 UINT32_C(0x1)
44248         /* This bit must be '1' for the flush_interval field is set. */
44249         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_FLUSH_INTERVAL \
44250                 UINT32_C(0x2)
44251         /* This bit must be '1' for the num_entries field is set. */
44252         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_NUM_ENTRIES \
44253                 UINT32_C(0x4)
44254         /* This bit must be '1' for the key0_ctx_id field is set. */
44255         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_KEY0_CTX_ID \
44256                 UINT32_C(0x8)
44257         /* This bit must be '1' for the key1_ctx_id field is set. */
44258         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_KEY1_CTX_ID \
44259                 UINT32_C(0x10)
44260         /* This bit must be '1' for the record_ctx_id field is set. */
44261         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_RECORD_CTX_ID \
44262                 UINT32_C(0x20)
44263         /* This bit must be '1' for the efc_ctx_id field is set. */
44264         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_EFC_CTX_ID \
44265                 UINT32_C(0x40)
44266         /* This bit must be '1' for the fid_ctx_id field is set. */
44267         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_FID_CTX_ID \
44268                 UINT32_C(0x80)
44269         /* This bit must be '1' for the action_ctx_id field is set. */
44270         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_ACTION_CTX_ID \
44271                 UINT32_C(0x100)
44272         /* This bit must be '1' for the action_tbl_scope field is set. */
44273         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_ACTION_TBL_SCOPE \
44274                 UINT32_C(0x200)
44275         /* This bit must be '1' for the lkup_ctx_id field is set. */
44276         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_CTX_ID \
44277                 UINT32_C(0x400)
44278         /* This bit must be '1' for the lkup_tbl_scope field is set. */
44279         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_TBL_SCOPE \
44280                 UINT32_C(0x800)
44281         /* This bit must be '1' for the lkup_static_buckets field is set. */
44282         #define HWRM_TF_EXT_EM_QCFG_OUTPUT_SUPPORTED_LKUP_STATIC_BUCKETS \
44283                 UINT32_C(0x1000)
44284         /*
44285          * Group id is used by firmware to identify memory pools belonging
44286          * to certain group.
44287          */
44288         uint16_t        group_id;
44289         /* EEM pending cache flush interval in 1/10th of second. */
44290         uint8_t flush_interval;
44291         /* unused. */
44292         uint8_t unused1;
44293         /* Context id of action table scope. */
44294         uint16_t        action_ctx_id;
44295         /* Table scope id used for action record entries. */
44296         uint16_t        action_tbl_scope;
44297         /* Context id of lookup table scope. */
44298         uint16_t        lkup_ctx_id;
44299         /* Table scope id used for EM lookup entries. */
44300         uint16_t        lkup_tbl_scope;
44301         /*
44302          * Number of 32B static buckets to be allocated at the beginning
44303          * of table scope.
44304          */
44305         uint32_t        lkup_static_buckets;
44306         /* unused. */
44307         uint8_t unused2[7];
44308         /*
44309          * This field is used in Output records to indicate that the
44310          * output is completely written to RAM. This field should be
44311          * read as '1' to indicate that the output has been
44312          * completely written.  When writing a command completion or
44313          * response to an internal processor, the order of writes has
44314          * to be such that this field is written last.
44315          */
44316         uint8_t valid;
44317 } __rte_packed;
44318
44319 /*********************
44320  * hwrm_tf_em_insert *
44321  *********************/
44322
44323
44324 /* hwrm_tf_em_insert_input (size:832b/104B) */
44325 struct hwrm_tf_em_insert_input {
44326         /* The HWRM command request type. */
44327         uint16_t        req_type;
44328         /*
44329          * The completion ring to send the completion event on. This should
44330          * be the NQ ID returned from the `nq_alloc` HWRM command.
44331          */
44332         uint16_t        cmpl_ring;
44333         /*
44334          * The sequence ID is used by the driver for tracking multiple
44335          * commands. This ID is treated as opaque data by the firmware and
44336          * the value is returned in the `hwrm_resp_hdr` upon completion.
44337          */
44338         uint16_t        seq_id;
44339         /*
44340          * The target ID of the command:
44341          * * 0x0-0xFFF8 - The function ID
44342          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44343          * * 0xFFFD - Reserved for user-space HWRM interface
44344          * * 0xFFFF - HWRM
44345          */
44346         uint16_t        target_id;
44347         /*
44348          * A physical address pointer pointing to a host buffer that the
44349          * command's response data will be written. This can be either a host
44350          * physical address (HPA) or a guest physical address (GPA) and must
44351          * point to a physically contiguous block of memory.
44352          */
44353         uint64_t        resp_addr;
44354         /* Firmware Session Id. */
44355         uint32_t        fw_session_id;
44356         /* Control Flags. */
44357         uint16_t        flags;
44358         /* Indicates the flow direction. */
44359         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR     UINT32_C(0x1)
44360         /* If this bit set to 0, then it indicates rx flow. */
44361         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
44362         /* If this bit is set to 1, then it indicates that tx flow. */
44363         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
44364         #define HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_LAST \
44365                 HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX
44366         /* Reported match strength. */
44367         uint16_t        strength;
44368         /* Index to action. */
44369         uint32_t        action_ptr;
44370         /* Index of EM record. */
44371         uint32_t        em_record_idx;
44372         /* EM Key value. */
44373         uint64_t        em_key[8];
44374         /* Number of bits in em_key. */
44375         uint16_t        em_key_bitlen;
44376         /* unused. */
44377         uint16_t        unused0[3];
44378 } __rte_packed;
44379
44380 /* hwrm_tf_em_insert_output (size:128b/16B) */
44381 struct hwrm_tf_em_insert_output {
44382         /* The specific error status for the command. */
44383         uint16_t        error_code;
44384         /* The HWRM command request type. */
44385         uint16_t        req_type;
44386         /* The sequence ID from the original command. */
44387         uint16_t        seq_id;
44388         /* The length of the response data in number of bytes. */
44389         uint16_t        resp_len;
44390         /* EM record pointer index. */
44391         uint16_t        rptr_index;
44392         /* EM record offset 0~3. */
44393         uint8_t rptr_entry;
44394         /* Number of word entries consumed by the key. */
44395         uint8_t num_of_entries;
44396         /* unused. */
44397         uint32_t        unused0;
44398 } __rte_packed;
44399
44400 /**************************
44401  * hwrm_tf_em_hash_insert *
44402  **************************/
44403
44404
44405 /* hwrm_tf_em_hash_insert_input (size:1024b/128B) */
44406 struct hwrm_tf_em_hash_insert_input {
44407         /* The HWRM command request type. */
44408         uint16_t        req_type;
44409         /*
44410          * The completion ring to send the completion event on. This should
44411          * be the NQ ID returned from the `nq_alloc` HWRM command.
44412          */
44413         uint16_t        cmpl_ring;
44414         /*
44415          * The sequence ID is used by the driver for tracking multiple
44416          * commands. This ID is treated as opaque data by the firmware and
44417          * the value is returned in the `hwrm_resp_hdr` upon completion.
44418          */
44419         uint16_t        seq_id;
44420         /*
44421          * The target ID of the command:
44422          * * 0x0-0xFFF8 - The function ID
44423          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44424          * * 0xFFFD - Reserved for user-space HWRM interface
44425          * * 0xFFFF - HWRM
44426          */
44427         uint16_t        target_id;
44428         /*
44429          * A physical address pointer pointing to a host buffer that the
44430          * command's response data will be written. This can be either a host
44431          * physical address (HPA) or a guest physical address (GPA) and must
44432          * point to a physically contiguous block of memory.
44433          */
44434         uint64_t        resp_addr;
44435         /* Firmware Session Id. */
44436         uint32_t        fw_session_id;
44437         /* Control Flags. */
44438         uint16_t        flags;
44439         /* Indicates the flow direction. */
44440         #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR     UINT32_C(0x1)
44441         /* If this bit set to 0, then it indicates rx flow. */
44442         #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
44443         /* If this bit is set to 1, then it indicates that tx flow. */
44444         #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
44445         #define HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_LAST \
44446                 HWRM_TF_EM_HASH_INSERT_INPUT_FLAGS_DIR_TX
44447         /* Number of bits in the EM record. */
44448         uint16_t        em_record_size_bits;
44449         /* CRC32 hash of key. */
44450         uint32_t        key0_hash;
44451         /* Lookup3 hash of key. */
44452         uint32_t        key1_hash;
44453         /* Index of EM record. */
44454         uint32_t        em_record_idx;
44455         /* Unused. */
44456         uint32_t        unused0;
44457         /* EM record. */
44458         uint64_t        em_record[11];
44459 } __rte_packed;
44460
44461 /* hwrm_tf_em_hash_insert_output (size:128b/16B) */
44462 struct hwrm_tf_em_hash_insert_output {
44463         /* The specific error status for the command. */
44464         uint16_t        error_code;
44465         /* The HWRM command request type. */
44466         uint16_t        req_type;
44467         /* The sequence ID from the original command. */
44468         uint16_t        seq_id;
44469         /* The length of the response data in number of bytes. */
44470         uint16_t        resp_len;
44471         /* EM record pointer index. */
44472         uint16_t        rptr_index;
44473         /* EM record offset 0~3. */
44474         uint8_t rptr_entry;
44475         /* Number of word entries consumed by the key. */
44476         uint8_t num_of_entries;
44477         /* unused. */
44478         uint32_t        unused0;
44479 } __rte_packed;
44480
44481 /*********************
44482  * hwrm_tf_em_delete *
44483  *********************/
44484
44485
44486 /* hwrm_tf_em_delete_input (size:832b/104B) */
44487 struct hwrm_tf_em_delete_input {
44488         /* The HWRM command request type. */
44489         uint16_t        req_type;
44490         /*
44491          * The completion ring to send the completion event on. This should
44492          * be the NQ ID returned from the `nq_alloc` HWRM command.
44493          */
44494         uint16_t        cmpl_ring;
44495         /*
44496          * The sequence ID is used by the driver for tracking multiple
44497          * commands. This ID is treated as opaque data by the firmware and
44498          * the value is returned in the `hwrm_resp_hdr` upon completion.
44499          */
44500         uint16_t        seq_id;
44501         /*
44502          * The target ID of the command:
44503          * * 0x0-0xFFF8 - The function ID
44504          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44505          * * 0xFFFD - Reserved for user-space HWRM interface
44506          * * 0xFFFF - HWRM
44507          */
44508         uint16_t        target_id;
44509         /*
44510          * A physical address pointer pointing to a host buffer that the
44511          * command's response data will be written. This can be either a host
44512          * physical address (HPA) or a guest physical address (GPA) and must
44513          * point to a physically contiguous block of memory.
44514          */
44515         uint64_t        resp_addr;
44516         /* Session Id. */
44517         uint32_t        fw_session_id;
44518         /* Control flags. */
44519         uint16_t        flags;
44520         /* Indicates the flow direction. */
44521         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR     UINT32_C(0x1)
44522         /* If this bit set to 0, then it indicates rx flow. */
44523         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
44524         /* If this bit is set to 1, then it indicates that tx flow. */
44525         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
44526         #define HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_LAST \
44527                 HWRM_TF_EM_DELETE_INPUT_FLAGS_DIR_TX
44528         /* Unused0 */
44529         uint16_t        unused0;
44530         /* EM internal flow hanndle. */
44531         uint64_t        flow_handle;
44532         /* EM Key value */
44533         uint64_t        em_key[8];
44534         /* Number of bits in em_key. */
44535         uint16_t        em_key_bitlen;
44536         /* unused. */
44537         uint16_t        unused1[3];
44538 } __rte_packed;
44539
44540 /* hwrm_tf_em_delete_output (size:128b/16B) */
44541 struct hwrm_tf_em_delete_output {
44542         /* The specific error status for the command. */
44543         uint16_t        error_code;
44544         /* The HWRM command request type. */
44545         uint16_t        req_type;
44546         /* The sequence ID from the original command. */
44547         uint16_t        seq_id;
44548         /* The length of the response data in number of bytes. */
44549         uint16_t        resp_len;
44550         /* Original stack allocation index. */
44551         uint16_t        em_index;
44552         /* unused. */
44553         uint16_t        unused0[3];
44554 } __rte_packed;
44555
44556 /*******************
44557  * hwrm_tf_em_move *
44558  *******************/
44559
44560
44561 /* hwrm_tf_em_move_input (size:320b/40B) */
44562 struct hwrm_tf_em_move_input {
44563         /* The HWRM command request type. */
44564         uint16_t        req_type;
44565         /*
44566          * The completion ring to send the completion event on. This should
44567          * be the NQ ID returned from the `nq_alloc` HWRM command.
44568          */
44569         uint16_t        cmpl_ring;
44570         /*
44571          * The sequence ID is used by the driver for tracking multiple
44572          * commands. This ID is treated as opaque data by the firmware and
44573          * the value is returned in the `hwrm_resp_hdr` upon completion.
44574          */
44575         uint16_t        seq_id;
44576         /*
44577          * The target ID of the command:
44578          * * 0x0-0xFFF8 - The function ID
44579          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44580          * * 0xFFFD - Reserved for user-space HWRM interface
44581          * * 0xFFFF - HWRM
44582          */
44583         uint16_t        target_id;
44584         /*
44585          * A physical address pointer pointing to a host buffer that the
44586          * command's response data will be written. This can be either a host
44587          * physical address (HPA) or a guest physical address (GPA) and must
44588          * point to a physically contiguous block of memory.
44589          */
44590         uint64_t        resp_addr;
44591         /* Session Id. */
44592         uint32_t        fw_session_id;
44593         /* Control flags. */
44594         uint16_t        flags;
44595         /* Indicates the flow direction. */
44596         #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR     UINT32_C(0x1)
44597         /* If this bit set to 0, then it indicates rx flow. */
44598         #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
44599         /* If this bit is set to 1, then it indicates tx flow. */
44600         #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
44601         #define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_LAST \
44602                 HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX
44603         /* Number of EM entry blocks */
44604         uint16_t        num_blocks;
44605         /* New index for entry */
44606         uint32_t        new_index;
44607         /* Unused */
44608         uint32_t        unused0;
44609         /* EM internal flow handle. */
44610         uint64_t        flow_handle;
44611 } __rte_packed;
44612
44613 /* hwrm_tf_em_move_output (size:128b/16B) */
44614 struct hwrm_tf_em_move_output {
44615         /* The specific error status for the command. */
44616         uint16_t        error_code;
44617         /* The HWRM command request type. */
44618         uint16_t        req_type;
44619         /* The sequence ID from the original command. */
44620         uint16_t        seq_id;
44621         /* The length of the response data in number of bytes. */
44622         uint16_t        resp_len;
44623         /* Index of old entry. */
44624         uint16_t        em_index;
44625         /* unused. */
44626         uint16_t        unused0[3];
44627 } __rte_packed;
44628
44629 /********************
44630  * hwrm_tf_tcam_set *
44631  ********************/
44632
44633
44634 /* hwrm_tf_tcam_set_input (size:1024b/128B) */
44635 struct hwrm_tf_tcam_set_input {
44636         /* The HWRM command request type. */
44637         uint16_t        req_type;
44638         /*
44639          * The completion ring to send the completion event on. This should
44640          * be the NQ ID returned from the `nq_alloc` HWRM command.
44641          */
44642         uint16_t        cmpl_ring;
44643         /*
44644          * The sequence ID is used by the driver for tracking multiple
44645          * commands. This ID is treated as opaque data by the firmware and
44646          * the value is returned in the `hwrm_resp_hdr` upon completion.
44647          */
44648         uint16_t        seq_id;
44649         /*
44650          * The target ID of the command:
44651          * * 0x0-0xFFF8 - The function ID
44652          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44653          * * 0xFFFD - Reserved for user-space HWRM interface
44654          * * 0xFFFF - HWRM
44655          */
44656         uint16_t        target_id;
44657         /*
44658          * A physical address pointer pointing to a host buffer that the
44659          * command's response data will be written. This can be either a host
44660          * physical address (HPA) or a guest physical address (GPA) and must
44661          * point to a physically contiguous block of memory.
44662          */
44663         uint64_t        resp_addr;
44664         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
44665         uint32_t        fw_session_id;
44666         /* Control flags. */
44667         uint32_t        flags;
44668         /* Indicates the flow direction. */
44669         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
44670         /* If this bit set to 0, then it indicates rx flow. */
44671         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
44672         /* If this bit is set to 1, then it indicates that tx flow. */
44673         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
44674         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_LAST \
44675                 HWRM_TF_TCAM_SET_INPUT_FLAGS_DIR_TX
44676         /*
44677          * Indicate device data is being sent via DMA, the device
44678          * data is packing does not change.
44679          */
44680         #define HWRM_TF_TCAM_SET_INPUT_FLAGS_DMA     UINT32_C(0x2)
44681         /*
44682          * TCAM type of the resource, defined globally in the
44683          * hwrm_tf_resc_type enum.
44684          */
44685         uint32_t        type;
44686         /* Index of TCAM entry. */
44687         uint16_t        idx;
44688         /* Number of bytes in the TCAM key. */
44689         uint8_t key_size;
44690         /* Number of bytes in the TCAM result. */
44691         uint8_t result_size;
44692         /*
44693          * Offset from which the mask bytes start in the device data
44694          * array, key offset is always 0.
44695          */
44696         uint8_t mask_offset;
44697         /* Offset from which the result bytes start in the device data array. */
44698         uint8_t result_offset;
44699         /* unused. */
44700         uint8_t unused0[6];
44701         /*
44702          * TCAM key located at offset 0, mask located at mask_offsec
44703          * and result at result_offsec for the device.
44704          */
44705         uint8_t dev_data[88];
44706 } __rte_packed;
44707
44708 /* hwrm_tf_tcam_set_output (size:128b/16B) */
44709 struct hwrm_tf_tcam_set_output {
44710         /* The specific error status for the command. */
44711         uint16_t        error_code;
44712         /* The HWRM command request type. */
44713         uint16_t        req_type;
44714         /* The sequence ID from the original command. */
44715         uint16_t        seq_id;
44716         /* The length of the response data in number of bytes. */
44717         uint16_t        resp_len;
44718         /* unused. */
44719         uint8_t unused0[7];
44720         /*
44721          * This field is used in Output records to indicate that the
44722          * output is completely written to RAM. This field should be
44723          * read as '1' to indicate that the output has been
44724          * completely written.  When writing a command completion or
44725          * response to an internal processor, the order of writes has
44726          * to be such that this field is written last.
44727          */
44728         uint8_t valid;
44729 } __rte_packed;
44730
44731 /********************
44732  * hwrm_tf_tcam_get *
44733  ********************/
44734
44735
44736 /* hwrm_tf_tcam_get_input (size:256b/32B) */
44737 struct hwrm_tf_tcam_get_input {
44738         /* The HWRM command request type. */
44739         uint16_t        req_type;
44740         /*
44741          * The completion ring to send the completion event on. This should
44742          * be the NQ ID returned from the `nq_alloc` HWRM command.
44743          */
44744         uint16_t        cmpl_ring;
44745         /*
44746          * The sequence ID is used by the driver for tracking multiple
44747          * commands. This ID is treated as opaque data by the firmware and
44748          * the value is returned in the `hwrm_resp_hdr` upon completion.
44749          */
44750         uint16_t        seq_id;
44751         /*
44752          * The target ID of the command:
44753          * * 0x0-0xFFF8 - The function ID
44754          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44755          * * 0xFFFD - Reserved for user-space HWRM interface
44756          * * 0xFFFF - HWRM
44757          */
44758         uint16_t        target_id;
44759         /*
44760          * A physical address pointer pointing to a host buffer that the
44761          * command's response data will be written. This can be either a host
44762          * physical address (HPA) or a guest physical address (GPA) and must
44763          * point to a physically contiguous block of memory.
44764          */
44765         uint64_t        resp_addr;
44766         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
44767         uint32_t        fw_session_id;
44768         /* Control flags. */
44769         uint32_t        flags;
44770         /* Indicates the flow direction. */
44771         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
44772         /* If this bit set to 0, then it indicates rx flow. */
44773         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
44774         /* If this bit is set to 1, then it indicates that tx flow. */
44775         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
44776         #define HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_LAST \
44777                 HWRM_TF_TCAM_GET_INPUT_FLAGS_DIR_TX
44778         /*
44779          * TCAM type of the resource, defined globally in the
44780          * hwrm_tf_resc_type enum.
44781          */
44782         uint32_t        type;
44783         /* Index of a TCAM entry. */
44784         uint16_t        idx;
44785         /* unused. */
44786         uint16_t        unused0;
44787 } __rte_packed;
44788
44789 /* hwrm_tf_tcam_get_output (size:2368b/296B) */
44790 struct hwrm_tf_tcam_get_output {
44791         /* The specific error status for the command. */
44792         uint16_t        error_code;
44793         /* The HWRM command request type. */
44794         uint16_t        req_type;
44795         /* The sequence ID from the original command. */
44796         uint16_t        seq_id;
44797         /* The length of the response data in number of bytes. */
44798         uint16_t        resp_len;
44799         /* Number of bytes in the TCAM key. */
44800         uint8_t key_size;
44801         /* Number of bytes in the TCAM entry. */
44802         uint8_t result_size;
44803         /* Offset from which the mask bytes start in the device data array. */
44804         uint8_t mask_offset;
44805         /* Offset from which the result bytes start in the device data array. */
44806         uint8_t result_offset;
44807         /* unused. */
44808         uint8_t unused0[4];
44809         /*
44810          * TCAM key located at offset 0, mask located at mask_offsec
44811          * and result at result_offsec for the device.
44812          */
44813         uint8_t dev_data[272];
44814         /* unused. */
44815         uint8_t unused1[7];
44816         /*
44817          * This field is used in Output records to indicate that the
44818          * output is completely written to RAM. This field should be
44819          * read as '1' to indicate that the output has been
44820          * completely written.  When writing a command completion or
44821          * response to an internal processor, the order of writes has
44822          * to be such that this field is written last.
44823          */
44824         uint8_t valid;
44825 } __rte_packed;
44826
44827 /*********************
44828  * hwrm_tf_tcam_move *
44829  *********************/
44830
44831
44832 /* hwrm_tf_tcam_move_input (size:1024b/128B) */
44833 struct hwrm_tf_tcam_move_input {
44834         /* The HWRM command request type. */
44835         uint16_t        req_type;
44836         /*
44837          * The completion ring to send the completion event on. This should
44838          * be the NQ ID returned from the `nq_alloc` HWRM command.
44839          */
44840         uint16_t        cmpl_ring;
44841         /*
44842          * The sequence ID is used by the driver for tracking multiple
44843          * commands. This ID is treated as opaque data by the firmware and
44844          * the value is returned in the `hwrm_resp_hdr` upon completion.
44845          */
44846         uint16_t        seq_id;
44847         /*
44848          * The target ID of the command:
44849          * * 0x0-0xFFF8 - The function ID
44850          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44851          * * 0xFFFD - Reserved for user-space HWRM interface
44852          * * 0xFFFF - HWRM
44853          */
44854         uint16_t        target_id;
44855         /*
44856          * A physical address pointer pointing to a host buffer that the
44857          * command's response data will be written. This can be either a host
44858          * physical address (HPA) or a guest physical address (GPA) and must
44859          * point to a physically contiguous block of memory.
44860          */
44861         uint64_t        resp_addr;
44862         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
44863         uint32_t        fw_session_id;
44864         /* Control flags. */
44865         uint32_t        flags;
44866         /* Indicates the flow direction. */
44867         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR     UINT32_C(0x1)
44868         /* If this bit set to 0, then it indicates rx flow. */
44869         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
44870         /* If this bit is set to 1, then it indicates that tx flow. */
44871         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
44872         #define HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_LAST \
44873                 HWRM_TF_TCAM_MOVE_INPUT_FLAGS_DIR_TX
44874         /*
44875          * TCAM type of the resource, defined globally in the
44876          * hwrm_tf_resc_type enum.
44877          */
44878         uint32_t        type;
44879         /* Number of TCAM index pairs to be swapped for the device. */
44880         uint16_t        count;
44881         /* unused. */
44882         uint16_t        unused0;
44883         /* TCAM index pairs to be swapped for the device. */
44884         uint16_t        idx_pairs[48];
44885 } __rte_packed;
44886
44887 /* hwrm_tf_tcam_move_output (size:128b/16B) */
44888 struct hwrm_tf_tcam_move_output {
44889         /* The specific error status for the command. */
44890         uint16_t        error_code;
44891         /* The HWRM command request type. */
44892         uint16_t        req_type;
44893         /* The sequence ID from the original command. */
44894         uint16_t        seq_id;
44895         /* The length of the response data in number of bytes. */
44896         uint16_t        resp_len;
44897         /* unused. */
44898         uint8_t unused0[7];
44899         /*
44900          * This field is used in Output records to indicate that the
44901          * output is completely written to RAM. This field should be
44902          * read as '1' to indicate that the output has been
44903          * completely written.  When writing a command completion or
44904          * response to an internal processor, the order of writes has
44905          * to be such that this field is written last.
44906          */
44907         uint8_t valid;
44908 } __rte_packed;
44909
44910 /*********************
44911  * hwrm_tf_tcam_free *
44912  *********************/
44913
44914
44915 /* hwrm_tf_tcam_free_input (size:1024b/128B) */
44916 struct hwrm_tf_tcam_free_input {
44917         /* The HWRM command request type. */
44918         uint16_t        req_type;
44919         /*
44920          * The completion ring to send the completion event on. This should
44921          * be the NQ ID returned from the `nq_alloc` HWRM command.
44922          */
44923         uint16_t        cmpl_ring;
44924         /*
44925          * The sequence ID is used by the driver for tracking multiple
44926          * commands. This ID is treated as opaque data by the firmware and
44927          * the value is returned in the `hwrm_resp_hdr` upon completion.
44928          */
44929         uint16_t        seq_id;
44930         /*
44931          * The target ID of the command:
44932          * * 0x0-0xFFF8 - The function ID
44933          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
44934          * * 0xFFFD - Reserved for user-space HWRM interface
44935          * * 0xFFFF - HWRM
44936          */
44937         uint16_t        target_id;
44938         /*
44939          * A physical address pointer pointing to a host buffer that the
44940          * command's response data will be written. This can be either a host
44941          * physical address (HPA) or a guest physical address (GPA) and must
44942          * point to a physically contiguous block of memory.
44943          */
44944         uint64_t        resp_addr;
44945         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
44946         uint32_t        fw_session_id;
44947         /* Control flags. */
44948         uint32_t        flags;
44949         /* Indicates the flow direction. */
44950         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR     UINT32_C(0x1)
44951         /* If this bit set to 0, then it indicates rx flow. */
44952         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
44953         /* If this bit is set to 1, then it indicates that tx flow. */
44954         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
44955         #define HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_LAST \
44956                 HWRM_TF_TCAM_FREE_INPUT_FLAGS_DIR_TX
44957         /*
44958          * TCAM type of the resource, defined globally in the
44959          * hwrm_tf_resc_type enum.
44960          */
44961         uint32_t        type;
44962         /* Number of TCAM index to be deleted for the device. */
44963         uint16_t        count;
44964         /* unused. */
44965         uint16_t        unused0;
44966         /* TCAM index list to be deleted for the device. */
44967         uint16_t        idx_list[48];
44968 } __rte_packed;
44969
44970 /* hwrm_tf_tcam_free_output (size:128b/16B) */
44971 struct hwrm_tf_tcam_free_output {
44972         /* The specific error status for the command. */
44973         uint16_t        error_code;
44974         /* The HWRM command request type. */
44975         uint16_t        req_type;
44976         /* The sequence ID from the original command. */
44977         uint16_t        seq_id;
44978         /* The length of the response data in number of bytes. */
44979         uint16_t        resp_len;
44980         /* unused. */
44981         uint8_t unused0[7];
44982         /*
44983          * This field is used in Output records to indicate that the
44984          * output is completely written to RAM. This field should be
44985          * read as '1' to indicate that the output has been
44986          * completely written.  When writing a command completion or
44987          * response to an internal processor, the order of writes has
44988          * to be such that this field is written last.
44989          */
44990         uint8_t valid;
44991 } __rte_packed;
44992
44993 /**************************
44994  * hwrm_tf_global_cfg_set *
44995  **************************/
44996
44997
44998 /* hwrm_tf_global_cfg_set_input (size:448b/56B) */
44999 struct hwrm_tf_global_cfg_set_input {
45000         /* The HWRM command request type. */
45001         uint16_t        req_type;
45002         /*
45003          * The completion ring to send the completion event on. This should
45004          * be the NQ ID returned from the `nq_alloc` HWRM command.
45005          */
45006         uint16_t        cmpl_ring;
45007         /*
45008          * The sequence ID is used by the driver for tracking multiple
45009          * commands. This ID is treated as opaque data by the firmware and
45010          * the value is returned in the `hwrm_resp_hdr` upon completion.
45011          */
45012         uint16_t        seq_id;
45013         /*
45014          * The target ID of the command:
45015          * * 0x0-0xFFF8 - The function ID
45016          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45017          * * 0xFFFD - Reserved for user-space HWRM interface
45018          * * 0xFFFF - HWRM
45019          */
45020         uint16_t        target_id;
45021         /*
45022          * A physical address pointer pointing to a host buffer that the
45023          * command's response data will be written. This can be either a host
45024          * physical address (HPA) or a guest physical address (GPA) and must
45025          * point to a physically contiguous block of memory.
45026          */
45027         uint64_t        resp_addr;
45028         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
45029         uint32_t        fw_session_id;
45030         /* Control flags. */
45031         uint32_t        flags;
45032         /* Indicates the flow direction. */
45033         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
45034         /* If this bit set to 0, then it indicates rx flow. */
45035         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
45036         /* If this bit is set to 1, then it indicates that tx flow. */
45037         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
45038         #define HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_LAST \
45039                 HWRM_TF_GLOBAL_CFG_SET_INPUT_FLAGS_DIR_TX
45040         /* Global Cfg type */
45041         uint32_t        type;
45042         /* Offset of the type */
45043         uint32_t        offset;
45044         /* Size of the data to set in bytes */
45045         uint16_t        size;
45046         /* unused. */
45047         uint8_t unused0[6];
45048         /* Data to set */
45049         uint8_t data[8];
45050         /* Mask of data to set, 0 indicates no mask */
45051         uint8_t mask[8];
45052 } __rte_packed;
45053
45054 /* hwrm_tf_global_cfg_set_output (size:128b/16B) */
45055 struct hwrm_tf_global_cfg_set_output {
45056         /* The specific error status for the command. */
45057         uint16_t        error_code;
45058         /* The HWRM command request type. */
45059         uint16_t        req_type;
45060         /* The sequence ID from the original command. */
45061         uint16_t        seq_id;
45062         /* The length of the response data in number of bytes. */
45063         uint16_t        resp_len;
45064         /* unused. */
45065         uint8_t unused0[7];
45066         /*
45067          * This field is used in Output records to indicate that the
45068          * output is completely written to RAM. This field should be
45069          * read as '1' to indicate that the output has been
45070          * completely written.  When writing a command completion or
45071          * response to an internal processor, the order of writes has
45072          * to be such that this field is written last.
45073          */
45074         uint8_t valid;
45075 } __rte_packed;
45076
45077 /**************************
45078  * hwrm_tf_global_cfg_get *
45079  **************************/
45080
45081
45082 /* hwrm_tf_global_cfg_get_input (size:320b/40B) */
45083 struct hwrm_tf_global_cfg_get_input {
45084         /* The HWRM command request type. */
45085         uint16_t        req_type;
45086         /*
45087          * The completion ring to send the completion event on. This should
45088          * be the NQ ID returned from the `nq_alloc` HWRM command.
45089          */
45090         uint16_t        cmpl_ring;
45091         /*
45092          * The sequence ID is used by the driver for tracking multiple
45093          * commands. This ID is treated as opaque data by the firmware and
45094          * the value is returned in the `hwrm_resp_hdr` upon completion.
45095          */
45096         uint16_t        seq_id;
45097         /*
45098          * The target ID of the command:
45099          * * 0x0-0xFFF8 - The function ID
45100          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45101          * * 0xFFFD - Reserved for user-space HWRM interface
45102          * * 0xFFFF - HWRM
45103          */
45104         uint16_t        target_id;
45105         /*
45106          * A physical address pointer pointing to a host buffer that the
45107          * command's response data will be written. This can be either a host
45108          * physical address (HPA) or a guest physical address (GPA) and must
45109          * point to a physically contiguous block of memory.
45110          */
45111         uint64_t        resp_addr;
45112         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
45113         uint32_t        fw_session_id;
45114         /* Control flags. */
45115         uint32_t        flags;
45116         /* Indicates the flow direction. */
45117         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
45118         /* If this bit set to 0, then it indicates rx flow. */
45119         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
45120         /* If this bit is set to 1, then it indicates that tx flow. */
45121         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
45122         #define HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_LAST \
45123                 HWRM_TF_GLOBAL_CFG_GET_INPUT_FLAGS_DIR_TX
45124         /* Global Cfg type */
45125         uint32_t        type;
45126         /* Offset of the type */
45127         uint32_t        offset;
45128         /* Size of the data to set in bytes */
45129         uint16_t        size;
45130         /* unused. */
45131         uint8_t unused0[6];
45132 } __rte_packed;
45133
45134 /* hwrm_tf_global_cfg_get_output (size:256b/32B) */
45135 struct hwrm_tf_global_cfg_get_output {
45136         /* The specific error status for the command. */
45137         uint16_t        error_code;
45138         /* The HWRM command request type. */
45139         uint16_t        req_type;
45140         /* The sequence ID from the original command. */
45141         uint16_t        seq_id;
45142         /* The length of the response data in number of bytes. */
45143         uint16_t        resp_len;
45144         /* Size of the data read in bytes */
45145         uint16_t        size;
45146         /* unused. */
45147         uint8_t unused0[6];
45148         /* Data to set */
45149         uint8_t data[16];
45150 } __rte_packed;
45151
45152 /**********************
45153  * hwrm_tf_if_tbl_get *
45154  **********************/
45155
45156
45157 /* hwrm_tf_if_tbl_get_input (size:256b/32B) */
45158 struct hwrm_tf_if_tbl_get_input {
45159         /* The HWRM command request type. */
45160         uint16_t        req_type;
45161         /*
45162          * The completion ring to send the completion event on. This should
45163          * be the NQ ID returned from the `nq_alloc` HWRM command.
45164          */
45165         uint16_t        cmpl_ring;
45166         /*
45167          * The sequence ID is used by the driver for tracking multiple
45168          * commands. This ID is treated as opaque data by the firmware and
45169          * the value is returned in the `hwrm_resp_hdr` upon completion.
45170          */
45171         uint16_t        seq_id;
45172         /*
45173          * The target ID of the command:
45174          * * 0x0-0xFFF8 - The function ID
45175          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45176          * * 0xFFFD - Reserved for user-space HWRM interface
45177          * * 0xFFFF - HWRM
45178          */
45179         uint16_t        target_id;
45180         /*
45181          * A physical address pointer pointing to a host buffer that the
45182          * command's response data will be written. This can be either a host
45183          * physical address (HPA) or a guest physical address (GPA) and must
45184          * point to a physically contiguous block of memory.
45185          */
45186         uint64_t        resp_addr;
45187         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
45188         uint32_t        fw_session_id;
45189         /* Control flags. */
45190         uint16_t        flags;
45191         /* Indicates the flow direction. */
45192         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
45193         /* If this bit set to 0, then it indicates rx flow. */
45194         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
45195         /* If this bit is set to 1, then it indicates that tx flow. */
45196         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
45197         #define HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_LAST \
45198                 HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX
45199         /* Size of the data to set. */
45200         uint16_t        size;
45201         /*
45202          * Type of the resource, defined globally in the
45203          * hwrm_tf_resc_type enum.
45204          */
45205         uint32_t        type;
45206         /* Index of the type to retrieve. */
45207         uint32_t        index;
45208 } __rte_packed;
45209
45210 /* hwrm_tf_if_tbl_get_output (size:256b/32B) */
45211 struct hwrm_tf_if_tbl_get_output {
45212         /* The specific error status for the command. */
45213         uint16_t        error_code;
45214         /* The HWRM command request type. */
45215         uint16_t        req_type;
45216         /* The sequence ID from the original command. */
45217         uint16_t        seq_id;
45218         /* The length of the response data in number of bytes. */
45219         uint16_t        resp_len;
45220         /* Response code. */
45221         uint32_t        resp_code;
45222         /* Response size. */
45223         uint16_t        size;
45224         /* unused */
45225         uint16_t        unused0;
45226         /* Response data. */
45227         uint8_t data[8];
45228         /* unused */
45229         uint8_t unused1[7];
45230         /*
45231          * This field is used in Output records to indicate that the output
45232          * is completely written to RAM. This field should be read as '1'
45233          * to indicate that the output has been completely written.
45234          * When writing a command completion or response to an internal
45235          * processor, the order of writes has to be such that this field
45236          * is written last.
45237          */
45238         uint8_t valid;
45239 } __rte_packed;
45240
45241 /***************************
45242  * hwrm_tf_if_tbl_type_set *
45243  ***************************/
45244
45245
45246 /* hwrm_tf_if_tbl_set_input (size:384b/48B) */
45247 struct hwrm_tf_if_tbl_set_input {
45248         /* The HWRM command request type. */
45249         uint16_t        req_type;
45250         /*
45251          * The completion ring to send the completion event on. This should
45252          * be the NQ ID returned from the `nq_alloc` HWRM command.
45253          */
45254         uint16_t        cmpl_ring;
45255         /*
45256          * The sequence ID is used by the driver for tracking multiple
45257          * commands. This ID is treated as opaque data by the firmware and
45258          * the value is returned in the `hwrm_resp_hdr` upon completion.
45259          */
45260         uint16_t        seq_id;
45261         /*
45262          * The target ID of the command:
45263          * * 0x0-0xFFF8 - The function ID
45264          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45265          * * 0xFFFD - Reserved for user-space HWRM interface
45266          * * 0xFFFF - HWRM
45267          */
45268         uint16_t        target_id;
45269         /*
45270          * A physical address pointer pointing to a host buffer that the
45271          * command's response data will be written. This can be either a host
45272          * physical address (HPA) or a guest physical address (GPA) and must
45273          * point to a physically contiguous block of memory.
45274          */
45275         uint64_t        resp_addr;
45276         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
45277         uint32_t        fw_session_id;
45278         /* Control flags. */
45279         uint16_t        flags;
45280         /* Indicates the flow direction. */
45281         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR     UINT32_C(0x1)
45282         /* If this bit set to 0, then it indicates rx flow. */
45283         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
45284         /* If this bit is set to 1, then it indicates that tx flow. */
45285         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
45286         #define HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_LAST \
45287                 HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX
45288         /* unused. */
45289         uint8_t unused0[2];
45290         /*
45291          * Type of the resource, defined globally in the
45292          * hwrm_tf_resc_type enum.
45293          */
45294         uint32_t        type;
45295         /* Index of the type to set. */
45296         uint32_t        index;
45297         /* Size of the data to set. */
45298         uint16_t        size;
45299         /* unused */
45300         uint8_t unused1[6];
45301         /* Data to be set. */
45302         uint8_t data[8];
45303 } __rte_packed;
45304
45305 /* hwrm_tf_if_tbl_set_output (size:128b/16B) */
45306 struct hwrm_tf_if_tbl_set_output {
45307         /* The specific error status for the command. */
45308         uint16_t        error_code;
45309         /* The HWRM command request type. */
45310         uint16_t        req_type;
45311         /* The sequence ID from the original command. */
45312         uint16_t        seq_id;
45313         /* The length of the response data in number of bytes. */
45314         uint16_t        resp_len;
45315         /* unused. */
45316         uint8_t unused0[7];
45317         /*
45318          * This field is used in Output records to indicate that the output
45319          * is completely written to RAM. This field should be read as '1'
45320          * to indicate that the output has been completely written.
45321          * When writing a command completion or response to an internal
45322          * processor, the order of writes has to be such that this field
45323          * is written last.
45324          */
45325         uint8_t valid;
45326 } __rte_packed;
45327
45328 /*****************************
45329  * hwrm_tf_tbl_type_bulk_get *
45330  *****************************/
45331
45332
45333 /* hwrm_tf_tbl_type_bulk_get_input (size:384b/48B) */
45334 struct hwrm_tf_tbl_type_bulk_get_input {
45335         /* The HWRM command request type. */
45336         uint16_t        req_type;
45337         /*
45338          * The completion ring to send the completion event on. This should
45339          * be the NQ ID returned from the `nq_alloc` HWRM command.
45340          */
45341         uint16_t        cmpl_ring;
45342         /*
45343          * The sequence ID is used by the driver for tracking multiple
45344          * commands. This ID is treated as opaque data by the firmware and
45345          * the value is returned in the `hwrm_resp_hdr` upon completion.
45346          */
45347         uint16_t        seq_id;
45348         /*
45349          * The target ID of the command:
45350          * * 0x0-0xFFF8 - The function ID
45351          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45352          * * 0xFFFD - Reserved for user-space HWRM interface
45353          * * 0xFFFF - HWRM
45354          */
45355         uint16_t        target_id;
45356         /*
45357          * A physical address pointer pointing to a host buffer that the
45358          * command's response data will be written. This can be either a host
45359          * physical address (HPA) or a guest physical address (GPA) and must
45360          * point to a physically contiguous block of memory.
45361          */
45362         uint64_t        resp_addr;
45363         /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
45364         uint32_t        fw_session_id;
45365         /* Control flags. */
45366         uint16_t        flags;
45367         /* Indicates the flow direction. */
45368         #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR     UINT32_C(0x1)
45369         /* If this bit set to 0, then it indicates rx flow. */
45370         #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
45371         /* If this bit is set to 1, then it indicates that tx flow. */
45372         #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
45373         #define HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_LAST \
45374                 HWRM_TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX
45375         /* unused. */
45376         uint8_t unused0[2];
45377         /*
45378          * Type of the resource, defined globally in the
45379          * hwrm_tf_resc_type enum.
45380          */
45381         uint32_t        type;
45382         /* Starting index of the type to retrieve. */
45383         uint32_t        start_index;
45384         /* Number of entries to retrieve. */
45385         uint32_t        num_entries;
45386         /* Number of entries to retrieve. */
45387         uint32_t        unused1;
45388         /* Host memory where data will be stored. */
45389         uint64_t        host_addr;
45390 } __rte_packed;
45391
45392 /* hwrm_tf_tbl_type_bulk_get_output (size:128b/16B) */
45393 struct hwrm_tf_tbl_type_bulk_get_output {
45394         /* The specific error status for the command. */
45395         uint16_t        error_code;
45396         /* The HWRM command request type. */
45397         uint16_t        req_type;
45398         /* The sequence ID from the original command. */
45399         uint16_t        seq_id;
45400         /* The length of the response data in number of bytes. */
45401         uint16_t        resp_len;
45402         /* Response code. */
45403         uint32_t        resp_code;
45404         /* Response size. */
45405         uint16_t        size;
45406         /* unused */
45407         uint8_t unused0;
45408         /*
45409          * This field is used in Output records to indicate that the output
45410          * is completely written to RAM. This field should be read as '1'
45411          * to indicate that the output has been completely written.
45412          * When writing a command completion or response to an internal
45413          * processor, the order of writes has to be such that this field
45414          * is written last.
45415          */
45416         uint8_t valid;
45417 } __rte_packed;
45418
45419 /******************************
45420  * hwrm_tunnel_dst_port_query *
45421  ******************************/
45422
45423
45424 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
45425 struct hwrm_tunnel_dst_port_query_input {
45426         /* The HWRM command request type. */
45427         uint16_t        req_type;
45428         /*
45429          * The completion ring to send the completion event on. This should
45430          * be the NQ ID returned from the `nq_alloc` HWRM command.
45431          */
45432         uint16_t        cmpl_ring;
45433         /*
45434          * The sequence ID is used by the driver for tracking multiple
45435          * commands. This ID is treated as opaque data by the firmware and
45436          * the value is returned in the `hwrm_resp_hdr` upon completion.
45437          */
45438         uint16_t        seq_id;
45439         /*
45440          * The target ID of the command:
45441          * * 0x0-0xFFF8 - The function ID
45442          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45443          * * 0xFFFD - Reserved for user-space HWRM interface
45444          * * 0xFFFF - HWRM
45445          */
45446         uint16_t        target_id;
45447         /*
45448          * A physical address pointer pointing to a host buffer that the
45449          * command's response data will be written. This can be either a host
45450          * physical address (HPA) or a guest physical address (GPA) and must
45451          * point to a physically contiguous block of memory.
45452          */
45453         uint64_t        resp_addr;
45454         /* Tunnel Type. */
45455         uint8_t tunnel_type;
45456         /* Virtual eXtensible Local Area Network (VXLAN) */
45457         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
45458                 UINT32_C(0x1)
45459         /* Generic Network Virtualization Encapsulation (Geneve) */
45460         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
45461                 UINT32_C(0x5)
45462         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
45463         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 \
45464                 UINT32_C(0x9)
45465         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
45466         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 \
45467                 UINT32_C(0xa)
45468         /* Use fixed layer 2 ether type of 0xFFFF */
45469         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_L2_ETYPE \
45470                 UINT32_C(0xb)
45471         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
45472         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
45473                 UINT32_C(0xc)
45474         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST \
45475                 HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
45476         uint8_t unused_0[7];
45477 } __rte_packed;
45478
45479 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
45480 struct hwrm_tunnel_dst_port_query_output {
45481         /* The specific error status for the command. */
45482         uint16_t        error_code;
45483         /* The HWRM command request type. */
45484         uint16_t        req_type;
45485         /* The sequence ID from the original command. */
45486         uint16_t        seq_id;
45487         /* The length of the response data in number of bytes. */
45488         uint16_t        resp_len;
45489         /*
45490          * This field represents the identifier of L4 destination port
45491          * used for the given tunnel type. This field is valid for
45492          * specific tunnel types that use layer 4 (e.g. UDP)
45493          * transports for tunneling.
45494          */
45495         uint16_t        tunnel_dst_port_id;
45496         /*
45497          * This field represents the value of L4 destination port
45498          * identified by tunnel_dst_port_id. This field is valid for
45499          * specific tunnel types that use layer 4 (e.g. UDP)
45500          * transports for tunneling.
45501          * This field is in network byte order.
45502          *
45503          * A value of 0 means that the destination port is not
45504          * configured.
45505          */
45506         uint16_t        tunnel_dst_port_val;
45507         uint8_t unused_0[3];
45508         /*
45509          * This field is used in Output records to indicate that the output
45510          * is completely written to RAM.  This field should be read as '1'
45511          * to indicate that the output has been completely written.
45512          * When writing a command completion or response to an internal processor,
45513          * the order of writes has to be such that this field is written last.
45514          */
45515         uint8_t valid;
45516 } __rte_packed;
45517
45518 /******************************
45519  * hwrm_tunnel_dst_port_alloc *
45520  ******************************/
45521
45522
45523 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
45524 struct hwrm_tunnel_dst_port_alloc_input {
45525         /* The HWRM command request type. */
45526         uint16_t        req_type;
45527         /*
45528          * The completion ring to send the completion event on. This should
45529          * be the NQ ID returned from the `nq_alloc` HWRM command.
45530          */
45531         uint16_t        cmpl_ring;
45532         /*
45533          * The sequence ID is used by the driver for tracking multiple
45534          * commands. This ID is treated as opaque data by the firmware and
45535          * the value is returned in the `hwrm_resp_hdr` upon completion.
45536          */
45537         uint16_t        seq_id;
45538         /*
45539          * The target ID of the command:
45540          * * 0x0-0xFFF8 - The function ID
45541          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45542          * * 0xFFFD - Reserved for user-space HWRM interface
45543          * * 0xFFFF - HWRM
45544          */
45545         uint16_t        target_id;
45546         /*
45547          * A physical address pointer pointing to a host buffer that the
45548          * command's response data will be written. This can be either a host
45549          * physical address (HPA) or a guest physical address (GPA) and must
45550          * point to a physically contiguous block of memory.
45551          */
45552         uint64_t        resp_addr;
45553         /* Tunnel Type. */
45554         uint8_t tunnel_type;
45555         /* Virtual eXtensible Local Area Network (VXLAN) */
45556         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
45557                 UINT32_C(0x1)
45558         /* Generic Network Virtualization Encapsulation (Geneve) */
45559         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
45560                 UINT32_C(0x5)
45561         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
45562         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
45563                 UINT32_C(0x9)
45564         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
45565         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
45566                 UINT32_C(0xa)
45567         /* Use fixed layer 2 ether type of 0xFFFF */
45568         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
45569                 UINT32_C(0xb)
45570         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
45571         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
45572                 UINT32_C(0xc)
45573         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST \
45574                 HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
45575         uint8_t unused_0;
45576         /*
45577          * This field represents the value of L4 destination port used
45578          * for the given tunnel type. This field is valid for
45579          * specific tunnel types that use layer 4 (e.g. UDP)
45580          * transports for tunneling.
45581          *
45582          * This field is in network byte order.
45583          *
45584          * A value of 0 shall fail the command.
45585          */
45586         uint16_t        tunnel_dst_port_val;
45587         uint8_t unused_1[4];
45588 } __rte_packed;
45589
45590 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
45591 struct hwrm_tunnel_dst_port_alloc_output {
45592         /* The specific error status for the command. */
45593         uint16_t        error_code;
45594         /* The HWRM command request type. */
45595         uint16_t        req_type;
45596         /* The sequence ID from the original command. */
45597         uint16_t        seq_id;
45598         /* The length of the response data in number of bytes. */
45599         uint16_t        resp_len;
45600         /*
45601          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
45602          * types that has l4 destination port parameters.
45603          */
45604         uint16_t        tunnel_dst_port_id;
45605         uint8_t unused_0[5];
45606         /*
45607          * This field is used in Output records to indicate that the output
45608          * is completely written to RAM.  This field should be read as '1'
45609          * to indicate that the output has been completely written.
45610          * When writing a command completion or response to an internal processor,
45611          * the order of writes has to be such that this field is written last.
45612          */
45613         uint8_t valid;
45614 } __rte_packed;
45615
45616 /*****************************
45617  * hwrm_tunnel_dst_port_free *
45618  *****************************/
45619
45620
45621 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
45622 struct hwrm_tunnel_dst_port_free_input {
45623         /* The HWRM command request type. */
45624         uint16_t        req_type;
45625         /*
45626          * The completion ring to send the completion event on. This should
45627          * be the NQ ID returned from the `nq_alloc` HWRM command.
45628          */
45629         uint16_t        cmpl_ring;
45630         /*
45631          * The sequence ID is used by the driver for tracking multiple
45632          * commands. This ID is treated as opaque data by the firmware and
45633          * the value is returned in the `hwrm_resp_hdr` upon completion.
45634          */
45635         uint16_t        seq_id;
45636         /*
45637          * The target ID of the command:
45638          * * 0x0-0xFFF8 - The function ID
45639          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45640          * * 0xFFFD - Reserved for user-space HWRM interface
45641          * * 0xFFFF - HWRM
45642          */
45643         uint16_t        target_id;
45644         /*
45645          * A physical address pointer pointing to a host buffer that the
45646          * command's response data will be written. This can be either a host
45647          * physical address (HPA) or a guest physical address (GPA) and must
45648          * point to a physically contiguous block of memory.
45649          */
45650         uint64_t        resp_addr;
45651         /* Tunnel Type. */
45652         uint8_t tunnel_type;
45653         /* Virtual eXtensible Local Area Network (VXLAN) */
45654         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN \
45655                 UINT32_C(0x1)
45656         /* Generic Network Virtualization Encapsulation (Geneve) */
45657         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE \
45658                 UINT32_C(0x5)
45659         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
45660         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
45661                 UINT32_C(0x9)
45662         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
45663         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
45664                 UINT32_C(0xa)
45665         /* Use fixed layer 2 ether type of 0xFFFF */
45666         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
45667                 UINT32_C(0xb)
45668         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
45669         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
45670                 UINT32_C(0xc)
45671         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST \
45672                 HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
45673         uint8_t unused_0;
45674         /*
45675          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
45676          * types that has l4 destination port parameters.
45677          */
45678         uint16_t        tunnel_dst_port_id;
45679         uint8_t unused_1[4];
45680 } __rte_packed;
45681
45682 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
45683 struct hwrm_tunnel_dst_port_free_output {
45684         /* The specific error status for the command. */
45685         uint16_t        error_code;
45686         /* The HWRM command request type. */
45687         uint16_t        req_type;
45688         /* The sequence ID from the original command. */
45689         uint16_t        seq_id;
45690         /* The length of the response data in number of bytes. */
45691         uint16_t        resp_len;
45692         uint8_t unused_1[7];
45693         /*
45694          * This field is used in Output records to indicate that the output
45695          * is completely written to RAM.  This field should be read as '1'
45696          * to indicate that the output has been completely written.
45697          * When writing a command completion or response to an internal processor,
45698          * the order of writes has to be such that this field is written last.
45699          */
45700         uint8_t valid;
45701 } __rte_packed;
45702
45703 /* Periodic statistics context DMA to host. */
45704 /* ctx_hw_stats (size:1280b/160B) */
45705 struct ctx_hw_stats {
45706         /* Number of received unicast packets */
45707         uint64_t        rx_ucast_pkts;
45708         /* Number of received multicast packets */
45709         uint64_t        rx_mcast_pkts;
45710         /* Number of received broadcast packets */
45711         uint64_t        rx_bcast_pkts;
45712         /* Number of discarded packets on receive path */
45713         uint64_t        rx_discard_pkts;
45714         /* Number of packets on receive path with error */
45715         uint64_t        rx_error_pkts;
45716         /* Number of received bytes for unicast traffic */
45717         uint64_t        rx_ucast_bytes;
45718         /* Number of received bytes for multicast traffic */
45719         uint64_t        rx_mcast_bytes;
45720         /* Number of received bytes for broadcast traffic */
45721         uint64_t        rx_bcast_bytes;
45722         /* Number of transmitted unicast packets */
45723         uint64_t        tx_ucast_pkts;
45724         /* Number of transmitted multicast packets */
45725         uint64_t        tx_mcast_pkts;
45726         /* Number of transmitted broadcast packets */
45727         uint64_t        tx_bcast_pkts;
45728         /* Number of packets on transmit path with error */
45729         uint64_t        tx_error_pkts;
45730         /* Number of discarded packets on transmit path */
45731         uint64_t        tx_discard_pkts;
45732         /* Number of transmitted bytes for unicast traffic */
45733         uint64_t        tx_ucast_bytes;
45734         /* Number of transmitted bytes for multicast traffic */
45735         uint64_t        tx_mcast_bytes;
45736         /* Number of transmitted bytes for broadcast traffic */
45737         uint64_t        tx_bcast_bytes;
45738         /* Number of TPA packets */
45739         uint64_t        tpa_pkts;
45740         /* Number of TPA bytes */
45741         uint64_t        tpa_bytes;
45742         /* Number of TPA events */
45743         uint64_t        tpa_events;
45744         /* Number of TPA aborts */
45745         uint64_t        tpa_aborts;
45746 } __rte_packed;
45747
45748 /*
45749  * Extended periodic statistics context DMA to host. On cards that
45750  * support TPA v2, additional TPA related stats exist and can be retrieved
45751  * by DMA of ctx_hw_stats_ext, rather than legacy ctx_hw_stats structure.
45752  */
45753 /* ctx_hw_stats_ext (size:1408b/176B) */
45754 struct ctx_hw_stats_ext {
45755         /* Number of received unicast packets */
45756         uint64_t        rx_ucast_pkts;
45757         /* Number of received multicast packets */
45758         uint64_t        rx_mcast_pkts;
45759         /* Number of received broadcast packets */
45760         uint64_t        rx_bcast_pkts;
45761         /* Number of discarded packets on receive path */
45762         uint64_t        rx_discard_pkts;
45763         /* Number of packets on receive path with error */
45764         uint64_t        rx_error_pkts;
45765         /* Number of received bytes for unicast traffic */
45766         uint64_t        rx_ucast_bytes;
45767         /* Number of received bytes for multicast traffic */
45768         uint64_t        rx_mcast_bytes;
45769         /* Number of received bytes for broadcast traffic */
45770         uint64_t        rx_bcast_bytes;
45771         /* Number of transmitted unicast packets */
45772         uint64_t        tx_ucast_pkts;
45773         /* Number of transmitted multicast packets */
45774         uint64_t        tx_mcast_pkts;
45775         /* Number of transmitted broadcast packets */
45776         uint64_t        tx_bcast_pkts;
45777         /* Number of packets on transmit path with error */
45778         uint64_t        tx_error_pkts;
45779         /* Number of discarded packets on transmit path */
45780         uint64_t        tx_discard_pkts;
45781         /* Number of transmitted bytes for unicast traffic */
45782         uint64_t        tx_ucast_bytes;
45783         /* Number of transmitted bytes for multicast traffic */
45784         uint64_t        tx_mcast_bytes;
45785         /* Number of transmitted bytes for broadcast traffic */
45786         uint64_t        tx_bcast_bytes;
45787         /* Number of TPA eligible packets */
45788         uint64_t        rx_tpa_eligible_pkt;
45789         /* Number of TPA eligible bytes */
45790         uint64_t        rx_tpa_eligible_bytes;
45791         /* Number of TPA packets */
45792         uint64_t        rx_tpa_pkt;
45793         /* Number of TPA bytes */
45794         uint64_t        rx_tpa_bytes;
45795         /* Number of TPA errors */
45796         uint64_t        rx_tpa_errors;
45797         /* Number of TPA events */
45798         uint64_t        rx_tpa_events;
45799 } __rte_packed;
45800
45801 /* Periodic Engine statistics context DMA to host. */
45802 /* ctx_eng_stats (size:512b/64B) */
45803 struct ctx_eng_stats {
45804         /*
45805          * Count of data bytes into the Engine.
45806          * This includes any user supplied prefix,
45807          * but does not include any predefined
45808          * prefix data.
45809          */
45810         uint64_t        eng_bytes_in;
45811         /* Count of data bytes out of the Engine. */
45812         uint64_t        eng_bytes_out;
45813         /*
45814          * Count, in 4-byte (dword) units, of bytes
45815          * that are input as auxiliary data.
45816          * This includes the aux_cmd data.
45817          */
45818         uint64_t        aux_bytes_in;
45819         /*
45820          * Count, in 4-byte (dword) units, of bytes
45821          * that are output as auxiliary data.
45822          * This count is the buffer space for aux_data
45823          * output provided in the RQE, not the actual
45824          * aux_data written
45825          */
45826         uint64_t        aux_bytes_out;
45827         /* Count of number of commands executed. */
45828         uint64_t        commands;
45829         /*
45830          * Count of number of error commands.
45831          * These are the commands with a
45832          * non-zero status value.
45833          */
45834         uint64_t        error_commands;
45835         /*
45836          * Compression/Encryption Engine usage,
45837          * the unit is count of clock cycles
45838          */
45839         uint64_t        cce_engine_usage;
45840         /*
45841          * De-Compression/De-cryption Engine usage,
45842          * the unit is count of clock cycles
45843          */
45844         uint64_t        cdd_engine_usage;
45845 } __rte_packed;
45846
45847 /***********************
45848  * hwrm_stat_ctx_alloc *
45849  ***********************/
45850
45851
45852 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */
45853 struct hwrm_stat_ctx_alloc_input {
45854         /* The HWRM command request type. */
45855         uint16_t        req_type;
45856         /*
45857          * The completion ring to send the completion event on. This should
45858          * be the NQ ID returned from the `nq_alloc` HWRM command.
45859          */
45860         uint16_t        cmpl_ring;
45861         /*
45862          * The sequence ID is used by the driver for tracking multiple
45863          * commands. This ID is treated as opaque data by the firmware and
45864          * the value is returned in the `hwrm_resp_hdr` upon completion.
45865          */
45866         uint16_t        seq_id;
45867         /*
45868          * The target ID of the command:
45869          * * 0x0-0xFFF8 - The function ID
45870          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45871          * * 0xFFFD - Reserved for user-space HWRM interface
45872          * * 0xFFFF - HWRM
45873          */
45874         uint16_t        target_id;
45875         /*
45876          * A physical address pointer pointing to a host buffer that the
45877          * command's response data will be written. This can be either a host
45878          * physical address (HPA) or a guest physical address (GPA) and must
45879          * point to a physically contiguous block of memory.
45880          */
45881         uint64_t        resp_addr;
45882         /*
45883          * This is the address for statistic block.
45884          * > For new versions of the chip, this address should be 128B
45885          * > aligned.
45886          */
45887         uint64_t        stats_dma_addr;
45888         /*
45889          * The statistic block update period in ms.
45890          * e.g. 250ms, 500ms, 750ms, 1000ms.
45891          * If update_period_ms is 0, then the stats update
45892          * shall be never done and the DMA address shall not be used.
45893          * In this case, the stat block can only be read by
45894          * hwrm_stat_ctx_query command.
45895          * On Ethernet/L2 based devices:
45896          *   if tpa v2 supported (hwrm_vnic_qcaps[max_aggs_supported]>0),
45897          *       ctx_hw_stats_ext is used for DMA,
45898          *   else
45899          *       ctx_hw_stats is used for DMA.
45900          */
45901         uint32_t        update_period_ms;
45902         /*
45903          * This field is used to specify statistics context specific
45904          * configuration flags.
45905          */
45906         uint8_t stat_ctx_flags;
45907         /*
45908          * When this bit is set to '1', the statistics context shall be
45909          * allocated for RoCE traffic only. In this case, traffic other
45910          * than offloaded RoCE traffic shall not be included in this
45911          * statistic context.
45912          * When this bit is set to '0', the statistics context shall be
45913          * used for network traffic or engine traffic.
45914          */
45915         #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE     UINT32_C(0x1)
45916         uint8_t unused_0;
45917         /*
45918          * This is the size of the structure (ctx_hw_stats or
45919          * ctx_hw_stats_ext) that the driver has allocated to be used
45920          * for the periodic DMA updates.
45921          */
45922         uint16_t        stats_dma_length;
45923 } __rte_packed;
45924
45925 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
45926 struct hwrm_stat_ctx_alloc_output {
45927         /* The specific error status for the command. */
45928         uint16_t        error_code;
45929         /* The HWRM command request type. */
45930         uint16_t        req_type;
45931         /* The sequence ID from the original command. */
45932         uint16_t        seq_id;
45933         /* The length of the response data in number of bytes. */
45934         uint16_t        resp_len;
45935         /* This is the statistics context ID value. */
45936         uint32_t        stat_ctx_id;
45937         uint8_t unused_0[3];
45938         /*
45939          * This field is used in Output records to indicate that the output
45940          * is completely written to RAM.  This field should be read as '1'
45941          * to indicate that the output has been completely written.
45942          * When writing a command completion or response to an internal processor,
45943          * the order of writes has to be such that this field is written last.
45944          */
45945         uint8_t valid;
45946 } __rte_packed;
45947
45948 /**********************
45949  * hwrm_stat_ctx_free *
45950  **********************/
45951
45952
45953 /* hwrm_stat_ctx_free_input (size:192b/24B) */
45954 struct hwrm_stat_ctx_free_input {
45955         /* The HWRM command request type. */
45956         uint16_t        req_type;
45957         /*
45958          * The completion ring to send the completion event on. This should
45959          * be the NQ ID returned from the `nq_alloc` HWRM command.
45960          */
45961         uint16_t        cmpl_ring;
45962         /*
45963          * The sequence ID is used by the driver for tracking multiple
45964          * commands. This ID is treated as opaque data by the firmware and
45965          * the value is returned in the `hwrm_resp_hdr` upon completion.
45966          */
45967         uint16_t        seq_id;
45968         /*
45969          * The target ID of the command:
45970          * * 0x0-0xFFF8 - The function ID
45971          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
45972          * * 0xFFFD - Reserved for user-space HWRM interface
45973          * * 0xFFFF - HWRM
45974          */
45975         uint16_t        target_id;
45976         /*
45977          * A physical address pointer pointing to a host buffer that the
45978          * command's response data will be written. This can be either a host
45979          * physical address (HPA) or a guest physical address (GPA) and must
45980          * point to a physically contiguous block of memory.
45981          */
45982         uint64_t        resp_addr;
45983         /* ID of the statistics context that is being queried. */
45984         uint32_t        stat_ctx_id;
45985         uint8_t unused_0[4];
45986 } __rte_packed;
45987
45988 /* hwrm_stat_ctx_free_output (size:128b/16B) */
45989 struct hwrm_stat_ctx_free_output {
45990         /* The specific error status for the command. */
45991         uint16_t        error_code;
45992         /* The HWRM command request type. */
45993         uint16_t        req_type;
45994         /* The sequence ID from the original command. */
45995         uint16_t        seq_id;
45996         /* The length of the response data in number of bytes. */
45997         uint16_t        resp_len;
45998         /* This is the statistics context ID value. */
45999         uint32_t        stat_ctx_id;
46000         uint8_t unused_0[3];
46001         /*
46002          * This field is used in Output records to indicate that the output
46003          * is completely written to RAM.  This field should be read as '1'
46004          * to indicate that the output has been completely written.
46005          * When writing a command completion or response to an internal processor,
46006          * the order of writes has to be such that this field is written last.
46007          */
46008         uint8_t valid;
46009 } __rte_packed;
46010
46011 /***********************
46012  * hwrm_stat_ctx_query *
46013  ***********************/
46014
46015
46016 /* hwrm_stat_ctx_query_input (size:192b/24B) */
46017 struct hwrm_stat_ctx_query_input {
46018         /* The HWRM command request type. */
46019         uint16_t        req_type;
46020         /*
46021          * The completion ring to send the completion event on. This should
46022          * be the NQ ID returned from the `nq_alloc` HWRM command.
46023          */
46024         uint16_t        cmpl_ring;
46025         /*
46026          * The sequence ID is used by the driver for tracking multiple
46027          * commands. This ID is treated as opaque data by the firmware and
46028          * the value is returned in the `hwrm_resp_hdr` upon completion.
46029          */
46030         uint16_t        seq_id;
46031         /*
46032          * The target ID of the command:
46033          * * 0x0-0xFFF8 - The function ID
46034          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46035          * * 0xFFFD - Reserved for user-space HWRM interface
46036          * * 0xFFFF - HWRM
46037          */
46038         uint16_t        target_id;
46039         /*
46040          * A physical address pointer pointing to a host buffer that the
46041          * command's response data will be written. This can be either a host
46042          * physical address (HPA) or a guest physical address (GPA) and must
46043          * point to a physically contiguous block of memory.
46044          */
46045         uint64_t        resp_addr;
46046         /* ID of the statistics context that is being queried. */
46047         uint32_t        stat_ctx_id;
46048         uint8_t flags;
46049         /*
46050          * This bit is set to 1 when request is for a counter mask,
46051          * representing the width of each of the stats counters, rather
46052          * than counters themselves.
46053          */
46054         #define HWRM_STAT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK     UINT32_C(0x1)
46055         uint8_t unused_0[3];
46056 } __rte_packed;
46057
46058 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
46059 struct hwrm_stat_ctx_query_output {
46060         /* The specific error status for the command. */
46061         uint16_t        error_code;
46062         /* The HWRM command request type. */
46063         uint16_t        req_type;
46064         /* The sequence ID from the original command. */
46065         uint16_t        seq_id;
46066         /* The length of the response data in number of bytes. */
46067         uint16_t        resp_len;
46068         /* Number of transmitted unicast packets */
46069         uint64_t        tx_ucast_pkts;
46070         /* Number of transmitted multicast packets */
46071         uint64_t        tx_mcast_pkts;
46072         /* Number of transmitted broadcast packets */
46073         uint64_t        tx_bcast_pkts;
46074         /* Number of packets discarded in transmit path */
46075         uint64_t        tx_discard_pkts;
46076         /* Number of packets in transmit path with error */
46077         uint64_t        tx_error_pkts;
46078         /* Number of transmitted bytes for unicast traffic */
46079         uint64_t        tx_ucast_bytes;
46080         /* Number of transmitted bytes for multicast traffic */
46081         uint64_t        tx_mcast_bytes;
46082         /* Number of transmitted bytes for broadcast traffic */
46083         uint64_t        tx_bcast_bytes;
46084         /* Number of received unicast packets */
46085         uint64_t        rx_ucast_pkts;
46086         /* Number of received multicast packets */
46087         uint64_t        rx_mcast_pkts;
46088         /* Number of received broadcast packets */
46089         uint64_t        rx_bcast_pkts;
46090         /* Number of packets discarded in receive path */
46091         uint64_t        rx_discard_pkts;
46092         /* Number of packets in receive path with errors */
46093         uint64_t        rx_error_pkts;
46094         /* Number of received bytes for unicast traffic */
46095         uint64_t        rx_ucast_bytes;
46096         /* Number of received bytes for multicast traffic */
46097         uint64_t        rx_mcast_bytes;
46098         /* Number of received bytes for broadcast traffic */
46099         uint64_t        rx_bcast_bytes;
46100         /* Number of aggregated unicast packets */
46101         uint64_t        rx_agg_pkts;
46102         /* Number of aggregated unicast bytes */
46103         uint64_t        rx_agg_bytes;
46104         /* Number of aggregation events */
46105         uint64_t        rx_agg_events;
46106         /* Number of aborted aggregations */
46107         uint64_t        rx_agg_aborts;
46108         uint8_t unused_0[7];
46109         /*
46110          * This field is used in Output records to indicate that the output
46111          * is completely written to RAM.  This field should be read as '1'
46112          * to indicate that the output has been completely written.
46113          * When writing a command completion or response to an internal processor,
46114          * the order of writes has to be such that this field is written last.
46115          */
46116         uint8_t valid;
46117 } __rte_packed;
46118
46119 /***************************
46120  * hwrm_stat_ext_ctx_query *
46121  ***************************/
46122
46123
46124 /* hwrm_stat_ext_ctx_query_input (size:192b/24B) */
46125 struct hwrm_stat_ext_ctx_query_input {
46126         /* The HWRM command request type. */
46127         uint16_t        req_type;
46128         /*
46129          * The completion ring to send the completion event on. This should
46130          * be the NQ ID returned from the `nq_alloc` HWRM command.
46131          */
46132         uint16_t        cmpl_ring;
46133         /*
46134          * The sequence ID is used by the driver for tracking multiple
46135          * commands. This ID is treated as opaque data by the firmware and
46136          * the value is returned in the `hwrm_resp_hdr` upon completion.
46137          */
46138         uint16_t        seq_id;
46139         /*
46140          * The target ID of the command:
46141          * * 0x0-0xFFF8 - The function ID
46142          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46143          * * 0xFFFD - Reserved for user-space HWRM interface
46144          * * 0xFFFF - HWRM
46145          */
46146         uint16_t        target_id;
46147         /*
46148          * A physical address pointer pointing to a host buffer that the
46149          * command's response data will be written. This can be either a host
46150          * physical address (HPA) or a guest physical address (GPA) and must
46151          * point to a physically contiguous block of memory.
46152          */
46153         uint64_t        resp_addr;
46154         /* ID of the extended statistics context that is being queried. */
46155         uint32_t        stat_ctx_id;
46156         uint8_t flags;
46157         /*
46158          * This bit is set to 1 when request is for a counter mask,
46159          * representing the width of each of the stats counters, rather
46160          * than counters themselves.
46161          */
46162         #define HWRM_STAT_EXT_CTX_QUERY_INPUT_FLAGS_COUNTER_MASK \
46163                 UINT32_C(0x1)
46164         uint8_t unused_0[3];
46165 } __rte_packed;
46166
46167 /* hwrm_stat_ext_ctx_query_output (size:1536b/192B) */
46168 struct hwrm_stat_ext_ctx_query_output {
46169         /* The specific error status for the command. */
46170         uint16_t        error_code;
46171         /* The HWRM command request type. */
46172         uint16_t        req_type;
46173         /* The sequence ID from the original command. */
46174         uint16_t        seq_id;
46175         /* The length of the response data in number of bytes. */
46176         uint16_t        resp_len;
46177         /* Number of received unicast packets */
46178         uint64_t        rx_ucast_pkts;
46179         /* Number of received multicast packets */
46180         uint64_t        rx_mcast_pkts;
46181         /* Number of received broadcast packets */
46182         uint64_t        rx_bcast_pkts;
46183         /* Number of discarded packets on receive path */
46184         uint64_t        rx_discard_pkts;
46185         /* Number of packets on receive path with error */
46186         uint64_t        rx_error_pkts;
46187         /* Number of received bytes for unicast traffic */
46188         uint64_t        rx_ucast_bytes;
46189         /* Number of received bytes for multicast traffic */
46190         uint64_t        rx_mcast_bytes;
46191         /* Number of received bytes for broadcast traffic */
46192         uint64_t        rx_bcast_bytes;
46193         /* Number of transmitted unicast packets */
46194         uint64_t        tx_ucast_pkts;
46195         /* Number of transmitted multicast packets */
46196         uint64_t        tx_mcast_pkts;
46197         /* Number of transmitted broadcast packets */
46198         uint64_t        tx_bcast_pkts;
46199         /* Number of packets on transmit path with error */
46200         uint64_t        tx_error_pkts;
46201         /* Number of discarded packets on transmit path */
46202         uint64_t        tx_discard_pkts;
46203         /* Number of transmitted bytes for unicast traffic */
46204         uint64_t        tx_ucast_bytes;
46205         /* Number of transmitted bytes for multicast traffic */
46206         uint64_t        tx_mcast_bytes;
46207         /* Number of transmitted bytes for broadcast traffic */
46208         uint64_t        tx_bcast_bytes;
46209         /* Number of TPA eligible packets */
46210         uint64_t        rx_tpa_eligible_pkt;
46211         /* Number of TPA eligible bytes */
46212         uint64_t        rx_tpa_eligible_bytes;
46213         /* Number of TPA packets */
46214         uint64_t        rx_tpa_pkt;
46215         /* Number of TPA bytes */
46216         uint64_t        rx_tpa_bytes;
46217         /* Number of TPA errors */
46218         uint64_t        rx_tpa_errors;
46219         /* Number of TPA events */
46220         uint64_t        rx_tpa_events;
46221         uint8_t unused_0[7];
46222         /*
46223          * This field is used in Output records to indicate that the output
46224          * is completely written to RAM.  This field should be read as '1'
46225          * to indicate that the output has been completely written.
46226          * When writing a command completion or response to an internal processor,
46227          * the order of writes has to be such that this field is written last.
46228          */
46229         uint8_t valid;
46230 } __rte_packed;
46231
46232 /***************************
46233  * hwrm_stat_ctx_eng_query *
46234  ***************************/
46235
46236
46237 /* hwrm_stat_ctx_eng_query_input (size:192b/24B) */
46238 struct hwrm_stat_ctx_eng_query_input {
46239         /* The HWRM command request type. */
46240         uint16_t        req_type;
46241         /*
46242          * The completion ring to send the completion event on. This should
46243          * be the NQ ID returned from the `nq_alloc` HWRM command.
46244          */
46245         uint16_t        cmpl_ring;
46246         /*
46247          * The sequence ID is used by the driver for tracking multiple
46248          * commands. This ID is treated as opaque data by the firmware and
46249          * the value is returned in the `hwrm_resp_hdr` upon completion.
46250          */
46251         uint16_t        seq_id;
46252         /*
46253          * The target ID of the command:
46254          * * 0x0-0xFFF8 - The function ID
46255          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46256          * * 0xFFFD - Reserved for user-space HWRM interface
46257          * * 0xFFFF - HWRM
46258          */
46259         uint16_t        target_id;
46260         /*
46261          * A physical address pointer pointing to a host buffer that the
46262          * command's response data will be written. This can be either a host
46263          * physical address (HPA) or a guest physical address (GPA) and must
46264          * point to a physically contiguous block of memory.
46265          */
46266         uint64_t        resp_addr;
46267         /* ID of the statistics context that is being queried. */
46268         uint32_t        stat_ctx_id;
46269         uint8_t unused_0[4];
46270 } __rte_packed;
46271
46272 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
46273 struct hwrm_stat_ctx_eng_query_output {
46274         /* The specific error status for the command. */
46275         uint16_t        error_code;
46276         /* The HWRM command request type. */
46277         uint16_t        req_type;
46278         /* The sequence ID from the original command. */
46279         uint16_t        seq_id;
46280         /* The length of the response data in number of bytes. */
46281         uint16_t        resp_len;
46282         /*
46283          * Count of data bytes into the Engine.
46284          * This includes any user supplied prefix,
46285          * but does not include any predefined
46286          * prefix data.
46287          */
46288         uint64_t        eng_bytes_in;
46289         /* Count of data bytes out of the Engine. */
46290         uint64_t        eng_bytes_out;
46291         /*
46292          * Count, in 4-byte (dword) units, of bytes
46293          * that are input as auxiliary data.
46294          * This includes the aux_cmd data.
46295          */
46296         uint64_t        aux_bytes_in;
46297         /*
46298          * Count, in 4-byte (dword) units, of bytes
46299          * that are output as auxiliary data.
46300          * This count is the buffer space for aux_data
46301          * output provided in the RQE, not the actual
46302          * aux_data written
46303          */
46304         uint64_t        aux_bytes_out;
46305         /* Count of number of commands executed. */
46306         uint64_t        commands;
46307         /*
46308          * Count of number of error commands.
46309          * These are the commands with a
46310          * non-zero status value.
46311          */
46312         uint64_t        error_commands;
46313         /*
46314          * Compression/Encryption Engine usage,
46315          * the unit is count of clock cycles
46316          */
46317         uint64_t        cce_engine_usage;
46318         /*
46319          * De-Compression/De-cryption Engine usage,
46320          * the unit is count of clock cycles
46321          */
46322         uint64_t        cdd_engine_usage;
46323         uint8_t unused_0[7];
46324         /*
46325          * This field is used in Output records to indicate that the output
46326          * is completely written to RAM.  This field should be read as '1'
46327          * to indicate that the output has been completely written.
46328          * When writing a command completion or response to an internal processor,
46329          * the order of writes has to be such that this field is written last.
46330          */
46331         uint8_t valid;
46332 } __rte_packed;
46333
46334 /***************************
46335  * hwrm_stat_ctx_clr_stats *
46336  ***************************/
46337
46338
46339 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
46340 struct hwrm_stat_ctx_clr_stats_input {
46341         /* The HWRM command request type. */
46342         uint16_t        req_type;
46343         /*
46344          * The completion ring to send the completion event on. This should
46345          * be the NQ ID returned from the `nq_alloc` HWRM command.
46346          */
46347         uint16_t        cmpl_ring;
46348         /*
46349          * The sequence ID is used by the driver for tracking multiple
46350          * commands. This ID is treated as opaque data by the firmware and
46351          * the value is returned in the `hwrm_resp_hdr` upon completion.
46352          */
46353         uint16_t        seq_id;
46354         /*
46355          * The target ID of the command:
46356          * * 0x0-0xFFF8 - The function ID
46357          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46358          * * 0xFFFD - Reserved for user-space HWRM interface
46359          * * 0xFFFF - HWRM
46360          */
46361         uint16_t        target_id;
46362         /*
46363          * A physical address pointer pointing to a host buffer that the
46364          * command's response data will be written. This can be either a host
46365          * physical address (HPA) or a guest physical address (GPA) and must
46366          * point to a physically contiguous block of memory.
46367          */
46368         uint64_t        resp_addr;
46369         /* ID of the statistics context that is being queried. */
46370         uint32_t        stat_ctx_id;
46371         uint8_t unused_0[4];
46372 } __rte_packed;
46373
46374 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
46375 struct hwrm_stat_ctx_clr_stats_output {
46376         /* The specific error status for the command. */
46377         uint16_t        error_code;
46378         /* The HWRM command request type. */
46379         uint16_t        req_type;
46380         /* The sequence ID from the original command. */
46381         uint16_t        seq_id;
46382         /* The length of the response data in number of bytes. */
46383         uint16_t        resp_len;
46384         uint8_t unused_0[7];
46385         /*
46386          * This field is used in Output records to indicate that the output
46387          * is completely written to RAM.  This field should be read as '1'
46388          * to indicate that the output has been completely written.
46389          * When writing a command completion or response to an internal processor,
46390          * the order of writes has to be such that this field is written last.
46391          */
46392         uint8_t valid;
46393 } __rte_packed;
46394
46395 /********************
46396  * hwrm_pcie_qstats *
46397  ********************/
46398
46399
46400 /* hwrm_pcie_qstats_input (size:256b/32B) */
46401 struct hwrm_pcie_qstats_input {
46402         /* The HWRM command request type. */
46403         uint16_t        req_type;
46404         /*
46405          * The completion ring to send the completion event on. This should
46406          * be the NQ ID returned from the `nq_alloc` HWRM command.
46407          */
46408         uint16_t        cmpl_ring;
46409         /*
46410          * The sequence ID is used by the driver for tracking multiple
46411          * commands. This ID is treated as opaque data by the firmware and
46412          * the value is returned in the `hwrm_resp_hdr` upon completion.
46413          */
46414         uint16_t        seq_id;
46415         /*
46416          * The target ID of the command:
46417          * * 0x0-0xFFF8 - The function ID
46418          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46419          * * 0xFFFD - Reserved for user-space HWRM interface
46420          * * 0xFFFF - HWRM
46421          */
46422         uint16_t        target_id;
46423         /*
46424          * A physical address pointer pointing to a host buffer that the
46425          * command's response data will be written. This can be either a host
46426          * physical address (HPA) or a guest physical address (GPA) and must
46427          * point to a physically contiguous block of memory.
46428          */
46429         uint64_t        resp_addr;
46430         /*
46431          * The size of PCIe statistics block in bytes.
46432          * Firmware will DMA the PCIe statistics to
46433          * the host with this field size in the response.
46434          */
46435         uint16_t        pcie_stat_size;
46436         uint8_t unused_0[6];
46437         /*
46438          * This is the host address where
46439          * PCIe statistics will be stored
46440          */
46441         uint64_t        pcie_stat_host_addr;
46442 } __rte_packed;
46443
46444 /* hwrm_pcie_qstats_output (size:128b/16B) */
46445 struct hwrm_pcie_qstats_output {
46446         /* The specific error status for the command. */
46447         uint16_t        error_code;
46448         /* The HWRM command request type. */
46449         uint16_t        req_type;
46450         /* The sequence ID from the original command. */
46451         uint16_t        seq_id;
46452         /* The length of the response data in number of bytes. */
46453         uint16_t        resp_len;
46454         /* The size of PCIe statistics block in bytes. */
46455         uint16_t        pcie_stat_size;
46456         uint8_t unused_0[5];
46457         /*
46458          * This field is used in Output records to indicate that the output
46459          * is completely written to RAM.  This field should be read as '1'
46460          * to indicate that the output has been completely written.
46461          * When writing a command completion or response to an internal processor,
46462          * the order of writes has to be such that this field is written last.
46463          */
46464         uint8_t valid;
46465 } __rte_packed;
46466
46467 /* PCIe Statistics Formats */
46468 /* pcie_ctx_hw_stats (size:768b/96B) */
46469 struct pcie_ctx_hw_stats {
46470         /* Number of physical layer receiver errors */
46471         uint64_t        pcie_pl_signal_integrity;
46472         /* Number of DLLP CRC errors detected by Data Link Layer */
46473         uint64_t        pcie_dl_signal_integrity;
46474         /*
46475          * Number of TLP LCRC and sequence number errors detected
46476          * by Data Link Layer
46477          */
46478         uint64_t        pcie_tl_signal_integrity;
46479         /* Number of times LTSSM entered Recovery state */
46480         uint64_t        pcie_link_integrity;
46481         /* Report number of TLP bits that have been transmitted in Mbps */
46482         uint64_t        pcie_tx_traffic_rate;
46483         /* Report number of TLP bits that have been received in Mbps */
46484         uint64_t        pcie_rx_traffic_rate;
46485         /* Number of DLLP bytes that have been transmitted */
46486         uint64_t        pcie_tx_dllp_statistics;
46487         /* Number of DLLP bytes that have been received */
46488         uint64_t        pcie_rx_dllp_statistics;
46489         /*
46490          * Number of times spent in each phase of gen3
46491          * equalization
46492          */
46493         uint64_t        pcie_equalization_time;
46494         /* Records the last 16 transitions of the LTSSM */
46495         uint32_t        pcie_ltssm_histogram[4];
46496         /*
46497          * Record the last 8 reasons on why LTSSM transitioned
46498          * to Recovery
46499          */
46500         uint64_t        pcie_recovery_histogram;
46501 } __rte_packed;
46502
46503 /**********************
46504  * hwrm_exec_fwd_resp *
46505  **********************/
46506
46507
46508 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
46509 struct hwrm_exec_fwd_resp_input {
46510         /* The HWRM command request type. */
46511         uint16_t        req_type;
46512         /*
46513          * The completion ring to send the completion event on. This should
46514          * be the NQ ID returned from the `nq_alloc` HWRM command.
46515          */
46516         uint16_t        cmpl_ring;
46517         /*
46518          * The sequence ID is used by the driver for tracking multiple
46519          * commands. This ID is treated as opaque data by the firmware and
46520          * the value is returned in the `hwrm_resp_hdr` upon completion.
46521          */
46522         uint16_t        seq_id;
46523         /*
46524          * The target ID of the command:
46525          * * 0x0-0xFFF8 - The function ID
46526          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46527          * * 0xFFFD - Reserved for user-space HWRM interface
46528          * * 0xFFFF - HWRM
46529          */
46530         uint16_t        target_id;
46531         /*
46532          * A physical address pointer pointing to a host buffer that the
46533          * command's response data will be written. This can be either a host
46534          * physical address (HPA) or a guest physical address (GPA) and must
46535          * point to a physically contiguous block of memory.
46536          */
46537         uint64_t        resp_addr;
46538         /*
46539          * This is an encapsulated request. This request should
46540          * be executed by the HWRM and the response should be
46541          * provided in the response buffer inside the encapsulated
46542          * request.
46543          */
46544         uint32_t        encap_request[26];
46545         /*
46546          * This value indicates the target id of the response to
46547          * the encapsulated request.
46548          * 0x0 - 0xFFF8 - Used for function ids
46549          * 0xFFF8 - 0xFFFE - Reserved for internal processors
46550          * 0xFFFF - HWRM
46551          */
46552         uint16_t        encap_resp_target_id;
46553         uint8_t unused_0[6];
46554 } __rte_packed;
46555
46556 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
46557 struct hwrm_exec_fwd_resp_output {
46558         /* The specific error status for the command. */
46559         uint16_t        error_code;
46560         /* The HWRM command request type. */
46561         uint16_t        req_type;
46562         /* The sequence ID from the original command. */
46563         uint16_t        seq_id;
46564         /* The length of the response data in number of bytes. */
46565         uint16_t        resp_len;
46566         uint8_t unused_0[7];
46567         /*
46568          * This field is used in Output records to indicate that the output
46569          * is completely written to RAM.  This field should be read as '1'
46570          * to indicate that the output has been completely written.
46571          * When writing a command completion or response to an internal processor,
46572          * the order of writes has to be such that this field is written last.
46573          */
46574         uint8_t valid;
46575 } __rte_packed;
46576
46577 /************************
46578  * hwrm_reject_fwd_resp *
46579  ************************/
46580
46581
46582 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
46583 struct hwrm_reject_fwd_resp_input {
46584         /* The HWRM command request type. */
46585         uint16_t        req_type;
46586         /*
46587          * The completion ring to send the completion event on. This should
46588          * be the NQ ID returned from the `nq_alloc` HWRM command.
46589          */
46590         uint16_t        cmpl_ring;
46591         /*
46592          * The sequence ID is used by the driver for tracking multiple
46593          * commands. This ID is treated as opaque data by the firmware and
46594          * the value is returned in the `hwrm_resp_hdr` upon completion.
46595          */
46596         uint16_t        seq_id;
46597         /*
46598          * The target ID of the command:
46599          * * 0x0-0xFFF8 - The function ID
46600          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46601          * * 0xFFFD - Reserved for user-space HWRM interface
46602          * * 0xFFFF - HWRM
46603          */
46604         uint16_t        target_id;
46605         /*
46606          * A physical address pointer pointing to a host buffer that the
46607          * command's response data will be written. This can be either a host
46608          * physical address (HPA) or a guest physical address (GPA) and must
46609          * point to a physically contiguous block of memory.
46610          */
46611         uint64_t        resp_addr;
46612         /*
46613          * This is an encapsulated request. This request should
46614          * be rejected by the HWRM and the error response should be
46615          * provided in the response buffer inside the encapsulated
46616          * request.
46617          */
46618         uint32_t        encap_request[26];
46619         /*
46620          * This value indicates the target id of the response to
46621          * the encapsulated request.
46622          * 0x0 - 0xFFF8 - Used for function ids
46623          * 0xFFF8 - 0xFFFE - Reserved for internal processors
46624          * 0xFFFF - HWRM
46625          */
46626         uint16_t        encap_resp_target_id;
46627         uint8_t unused_0[6];
46628 } __rte_packed;
46629
46630 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
46631 struct hwrm_reject_fwd_resp_output {
46632         /* The specific error status for the command. */
46633         uint16_t        error_code;
46634         /* The HWRM command request type. */
46635         uint16_t        req_type;
46636         /* The sequence ID from the original command. */
46637         uint16_t        seq_id;
46638         /* The length of the response data in number of bytes. */
46639         uint16_t        resp_len;
46640         uint8_t unused_0[7];
46641         /*
46642          * This field is used in Output records to indicate that the output
46643          * is completely written to RAM.  This field should be read as '1'
46644          * to indicate that the output has been completely written.
46645          * When writing a command completion or response to an internal processor,
46646          * the order of writes has to be such that this field is written last.
46647          */
46648         uint8_t valid;
46649 } __rte_packed;
46650
46651 /*****************
46652  * hwrm_fwd_resp *
46653  *****************/
46654
46655
46656 /* hwrm_fwd_resp_input (size:1024b/128B) */
46657 struct hwrm_fwd_resp_input {
46658         /* The HWRM command request type. */
46659         uint16_t        req_type;
46660         /*
46661          * The completion ring to send the completion event on. This should
46662          * be the NQ ID returned from the `nq_alloc` HWRM command.
46663          */
46664         uint16_t        cmpl_ring;
46665         /*
46666          * The sequence ID is used by the driver for tracking multiple
46667          * commands. This ID is treated as opaque data by the firmware and
46668          * the value is returned in the `hwrm_resp_hdr` upon completion.
46669          */
46670         uint16_t        seq_id;
46671         /*
46672          * The target ID of the command:
46673          * * 0x0-0xFFF8 - The function ID
46674          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46675          * * 0xFFFD - Reserved for user-space HWRM interface
46676          * * 0xFFFF - HWRM
46677          */
46678         uint16_t        target_id;
46679         /*
46680          * A physical address pointer pointing to a host buffer that the
46681          * command's response data will be written. This can be either a host
46682          * physical address (HPA) or a guest physical address (GPA) and must
46683          * point to a physically contiguous block of memory.
46684          */
46685         uint64_t        resp_addr;
46686         /*
46687          * This value indicates the target id of the encapsulated
46688          * response.
46689          * 0x0 - 0xFFF8 - Used for function ids
46690          * 0xFFF8 - 0xFFFE - Reserved for internal processors
46691          * 0xFFFF - HWRM
46692          */
46693         uint16_t        encap_resp_target_id;
46694         /*
46695          * This value indicates the completion ring the encapsulated
46696          * response will be optionally completed on.  If the value is
46697          * -1, then no CR completion shall be generated for the
46698          * encapsulated response. Any other value must be a
46699          * valid CR ring_id value. If a valid encap_resp_cmpl_ring
46700          * is provided, then a CR completion shall be generated for
46701          * the encapsulated response.
46702          */
46703         uint16_t        encap_resp_cmpl_ring;
46704         /* This field indicates the length of encapsulated response. */
46705         uint16_t        encap_resp_len;
46706         uint8_t unused_0;
46707         uint8_t unused_1;
46708         /*
46709          * This is the host address where the encapsulated response
46710          * will be written.
46711          * This area must be 16B aligned and must be cleared to zero
46712          * before the original request is made.
46713          */
46714         uint64_t        encap_resp_addr;
46715         /* This is an encapsulated response. */
46716         uint32_t        encap_resp[24];
46717 } __rte_packed;
46718
46719 /* hwrm_fwd_resp_output (size:128b/16B) */
46720 struct hwrm_fwd_resp_output {
46721         /* The specific error status for the command. */
46722         uint16_t        error_code;
46723         /* The HWRM command request type. */
46724         uint16_t        req_type;
46725         /* The sequence ID from the original command. */
46726         uint16_t        seq_id;
46727         /* The length of the response data in number of bytes. */
46728         uint16_t        resp_len;
46729         uint8_t unused_0[7];
46730         /*
46731          * This field is used in Output records to indicate that the output
46732          * is completely written to RAM.  This field should be read as '1'
46733          * to indicate that the output has been completely written.
46734          * When writing a command completion or response to an internal processor,
46735          * the order of writes has to be such that this field is written last.
46736          */
46737         uint8_t valid;
46738 } __rte_packed;
46739
46740 /*****************************
46741  * hwrm_fwd_async_event_cmpl *
46742  *****************************/
46743
46744
46745 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */
46746 struct hwrm_fwd_async_event_cmpl_input {
46747         /* The HWRM command request type. */
46748         uint16_t        req_type;
46749         /*
46750          * The completion ring to send the completion event on. This should
46751          * be the NQ ID returned from the `nq_alloc` HWRM command.
46752          */
46753         uint16_t        cmpl_ring;
46754         /*
46755          * The sequence ID is used by the driver for tracking multiple
46756          * commands. This ID is treated as opaque data by the firmware and
46757          * the value is returned in the `hwrm_resp_hdr` upon completion.
46758          */
46759         uint16_t        seq_id;
46760         /*
46761          * The target ID of the command:
46762          * * 0x0-0xFFF8 - The function ID
46763          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46764          * * 0xFFFD - Reserved for user-space HWRM interface
46765          * * 0xFFFF - HWRM
46766          */
46767         uint16_t        target_id;
46768         /*
46769          * A physical address pointer pointing to a host buffer that the
46770          * command's response data will be written. This can be either a host
46771          * physical address (HPA) or a guest physical address (GPA) and must
46772          * point to a physically contiguous block of memory.
46773          */
46774         uint64_t        resp_addr;
46775         /*
46776          * This value indicates the target id of the encapsulated
46777          * asynchronous event.
46778          * 0x0 - 0xFFF8 - Used for function ids
46779          * 0xFFF8 - 0xFFFE - Reserved for internal processors
46780          * 0xFFFF - Broadcast to all children VFs (only applicable when
46781          * a PF is the requester)
46782          */
46783         uint16_t        encap_async_event_target_id;
46784         uint8_t unused_0[6];
46785         /* This is an encapsulated asynchronous event completion. */
46786         uint32_t        encap_async_event_cmpl[4];
46787 } __rte_packed;
46788
46789 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
46790 struct hwrm_fwd_async_event_cmpl_output {
46791         /* The specific error status for the command. */
46792         uint16_t        error_code;
46793         /* The HWRM command request type. */
46794         uint16_t        req_type;
46795         /* The sequence ID from the original command. */
46796         uint16_t        seq_id;
46797         /* The length of the response data in number of bytes. */
46798         uint16_t        resp_len;
46799         uint8_t unused_0[7];
46800         /*
46801          * This field is used in Output records to indicate that the output
46802          * is completely written to RAM.  This field should be read as '1'
46803          * to indicate that the output has been completely written.
46804          * When writing a command completion or response to an internal processor,
46805          * the order of writes has to be such that this field is written last.
46806          */
46807         uint8_t valid;
46808 } __rte_packed;
46809
46810 /**************************
46811  * hwrm_nvm_raw_write_blk *
46812  **************************/
46813
46814
46815 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */
46816 struct hwrm_nvm_raw_write_blk_input {
46817         /* The HWRM command request type. */
46818         uint16_t        req_type;
46819         /*
46820          * The completion ring to send the completion event on. This should
46821          * be the NQ ID returned from the `nq_alloc` HWRM command.
46822          */
46823         uint16_t        cmpl_ring;
46824         /*
46825          * The sequence ID is used by the driver for tracking multiple
46826          * commands. This ID is treated as opaque data by the firmware and
46827          * the value is returned in the `hwrm_resp_hdr` upon completion.
46828          */
46829         uint16_t        seq_id;
46830         /*
46831          * The target ID of the command:
46832          * * 0x0-0xFFF8 - The function ID
46833          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46834          * * 0xFFFD - Reserved for user-space HWRM interface
46835          * * 0xFFFF - HWRM
46836          */
46837         uint16_t        target_id;
46838         /*
46839          * A physical address pointer pointing to a host buffer that the
46840          * command's response data will be written. This can be either a host
46841          * physical address (HPA) or a guest physical address (GPA) and must
46842          * point to a physically contiguous block of memory.
46843          */
46844         uint64_t        resp_addr;
46845         /*
46846          * 64-bit Host Source Address.
46847          * This is the location of the source data to be written.
46848          */
46849         uint64_t        host_src_addr;
46850         /*
46851          * 32-bit Destination Address.
46852          * This is the NVRAM byte-offset where the source data will be written to.
46853          */
46854         uint32_t        dest_addr;
46855         /* Length of data to be written, in bytes. */
46856         uint32_t        len;
46857 } __rte_packed;
46858
46859 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
46860 struct hwrm_nvm_raw_write_blk_output {
46861         /* The specific error status for the command. */
46862         uint16_t        error_code;
46863         /* The HWRM command request type. */
46864         uint16_t        req_type;
46865         /* The sequence ID from the original command. */
46866         uint16_t        seq_id;
46867         /* The length of the response data in number of bytes. */
46868         uint16_t        resp_len;
46869         uint8_t unused_0[7];
46870         /*
46871          * This field is used in Output records to indicate that the output
46872          * is completely written to RAM.  This field should be read as '1'
46873          * to indicate that the output has been completely written.
46874          * When writing a command completion or response to an internal processor,
46875          * the order of writes has to be such that this field is written last.
46876          */
46877         uint8_t valid;
46878 } __rte_packed;
46879
46880 /*****************
46881  * hwrm_nvm_read *
46882  *****************/
46883
46884
46885 /* hwrm_nvm_read_input (size:320b/40B) */
46886 struct hwrm_nvm_read_input {
46887         /* The HWRM command request type. */
46888         uint16_t        req_type;
46889         /*
46890          * The completion ring to send the completion event on. This should
46891          * be the NQ ID returned from the `nq_alloc` HWRM command.
46892          */
46893         uint16_t        cmpl_ring;
46894         /*
46895          * The sequence ID is used by the driver for tracking multiple
46896          * commands. This ID is treated as opaque data by the firmware and
46897          * the value is returned in the `hwrm_resp_hdr` upon completion.
46898          */
46899         uint16_t        seq_id;
46900         /*
46901          * The target ID of the command:
46902          * * 0x0-0xFFF8 - The function ID
46903          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46904          * * 0xFFFD - Reserved for user-space HWRM interface
46905          * * 0xFFFF - HWRM
46906          */
46907         uint16_t        target_id;
46908         /*
46909          * A physical address pointer pointing to a host buffer that the
46910          * command's response data will be written. This can be either a host
46911          * physical address (HPA) or a guest physical address (GPA) and must
46912          * point to a physically contiguous block of memory.
46913          */
46914         uint64_t        resp_addr;
46915         /*
46916          * 64-bit Host Destination Address.
46917          * This is the host address where the data will be written to.
46918          */
46919         uint64_t        host_dest_addr;
46920         /* The 0-based index of the directory entry. */
46921         uint16_t        dir_idx;
46922         uint8_t unused_0[2];
46923         /* The NVRAM byte-offset to read from. */
46924         uint32_t        offset;
46925         /* The length of the data to be read, in bytes. */
46926         uint32_t        len;
46927         uint8_t unused_1[4];
46928 } __rte_packed;
46929
46930 /* hwrm_nvm_read_output (size:128b/16B) */
46931 struct hwrm_nvm_read_output {
46932         /* The specific error status for the command. */
46933         uint16_t        error_code;
46934         /* The HWRM command request type. */
46935         uint16_t        req_type;
46936         /* The sequence ID from the original command. */
46937         uint16_t        seq_id;
46938         /* The length of the response data in number of bytes. */
46939         uint16_t        resp_len;
46940         uint8_t unused_0[7];
46941         /*
46942          * This field is used in Output records to indicate that the output
46943          * is completely written to RAM.  This field should be read as '1'
46944          * to indicate that the output has been completely written.
46945          * When writing a command completion or response to an internal processor,
46946          * the order of writes has to be such that this field is written last.
46947          */
46948         uint8_t valid;
46949 } __rte_packed;
46950
46951 /*********************
46952  * hwrm_nvm_raw_dump *
46953  *********************/
46954
46955
46956 /* hwrm_nvm_raw_dump_input (size:256b/32B) */
46957 struct hwrm_nvm_raw_dump_input {
46958         /* The HWRM command request type. */
46959         uint16_t        req_type;
46960         /*
46961          * The completion ring to send the completion event on. This should
46962          * be the NQ ID returned from the `nq_alloc` HWRM command.
46963          */
46964         uint16_t        cmpl_ring;
46965         /*
46966          * The sequence ID is used by the driver for tracking multiple
46967          * commands. This ID is treated as opaque data by the firmware and
46968          * the value is returned in the `hwrm_resp_hdr` upon completion.
46969          */
46970         uint16_t        seq_id;
46971         /*
46972          * The target ID of the command:
46973          * * 0x0-0xFFF8 - The function ID
46974          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
46975          * * 0xFFFD - Reserved for user-space HWRM interface
46976          * * 0xFFFF - HWRM
46977          */
46978         uint16_t        target_id;
46979         /*
46980          * A physical address pointer pointing to a host buffer that the
46981          * command's response data will be written. This can be either a host
46982          * physical address (HPA) or a guest physical address (GPA) and must
46983          * point to a physically contiguous block of memory.
46984          */
46985         uint64_t        resp_addr;
46986         /*
46987          * 64-bit Host Destination Address.
46988          * This is the host address where the data will be written to.
46989          */
46990         uint64_t        host_dest_addr;
46991         /* 32-bit NVRAM byte-offset to read from. */
46992         uint32_t        offset;
46993         /* Total length of NVRAM contents to be read, in bytes. */
46994         uint32_t        len;
46995 } __rte_packed;
46996
46997 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
46998 struct hwrm_nvm_raw_dump_output {
46999         /* The specific error status for the command. */
47000         uint16_t        error_code;
47001         /* The HWRM command request type. */
47002         uint16_t        req_type;
47003         /* The sequence ID from the original command. */
47004         uint16_t        seq_id;
47005         /* The length of the response data in number of bytes. */
47006         uint16_t        resp_len;
47007         uint8_t unused_0[7];
47008         /*
47009          * This field is used in Output records to indicate that the output
47010          * is completely written to RAM.  This field should be read as '1'
47011          * to indicate that the output has been completely written.
47012          * When writing a command completion or response to an internal processor,
47013          * the order of writes has to be such that this field is written last.
47014          */
47015         uint8_t valid;
47016 } __rte_packed;
47017
47018 /****************************
47019  * hwrm_nvm_get_dir_entries *
47020  ****************************/
47021
47022
47023 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
47024 struct hwrm_nvm_get_dir_entries_input {
47025         /* The HWRM command request type. */
47026         uint16_t        req_type;
47027         /*
47028          * The completion ring to send the completion event on. This should
47029          * be the NQ ID returned from the `nq_alloc` HWRM command.
47030          */
47031         uint16_t        cmpl_ring;
47032         /*
47033          * The sequence ID is used by the driver for tracking multiple
47034          * commands. This ID is treated as opaque data by the firmware and
47035          * the value is returned in the `hwrm_resp_hdr` upon completion.
47036          */
47037         uint16_t        seq_id;
47038         /*
47039          * The target ID of the command:
47040          * * 0x0-0xFFF8 - The function ID
47041          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47042          * * 0xFFFD - Reserved for user-space HWRM interface
47043          * * 0xFFFF - HWRM
47044          */
47045         uint16_t        target_id;
47046         /*
47047          * A physical address pointer pointing to a host buffer that the
47048          * command's response data will be written. This can be either a host
47049          * physical address (HPA) or a guest physical address (GPA) and must
47050          * point to a physically contiguous block of memory.
47051          */
47052         uint64_t        resp_addr;
47053         /*
47054          * 64-bit Host Destination Address.
47055          * This is the host address where the directory will be written.
47056          */
47057         uint64_t        host_dest_addr;
47058 } __rte_packed;
47059
47060 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
47061 struct hwrm_nvm_get_dir_entries_output {
47062         /* The specific error status for the command. */
47063         uint16_t        error_code;
47064         /* The HWRM command request type. */
47065         uint16_t        req_type;
47066         /* The sequence ID from the original command. */
47067         uint16_t        seq_id;
47068         /* The length of the response data in number of bytes. */
47069         uint16_t        resp_len;
47070         uint8_t unused_0[7];
47071         /*
47072          * This field is used in Output records to indicate that the output
47073          * is completely written to RAM.  This field should be read as '1'
47074          * to indicate that the output has been completely written.
47075          * When writing a command completion or response to an internal processor,
47076          * the order of writes has to be such that this field is written last.
47077          */
47078         uint8_t valid;
47079 } __rte_packed;
47080
47081 /*************************
47082  * hwrm_nvm_get_dir_info *
47083  *************************/
47084
47085
47086 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
47087 struct hwrm_nvm_get_dir_info_input {
47088         /* The HWRM command request type. */
47089         uint16_t        req_type;
47090         /*
47091          * The completion ring to send the completion event on. This should
47092          * be the NQ ID returned from the `nq_alloc` HWRM command.
47093          */
47094         uint16_t        cmpl_ring;
47095         /*
47096          * The sequence ID is used by the driver for tracking multiple
47097          * commands. This ID is treated as opaque data by the firmware and
47098          * the value is returned in the `hwrm_resp_hdr` upon completion.
47099          */
47100         uint16_t        seq_id;
47101         /*
47102          * The target ID of the command:
47103          * * 0x0-0xFFF8 - The function ID
47104          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47105          * * 0xFFFD - Reserved for user-space HWRM interface
47106          * * 0xFFFF - HWRM
47107          */
47108         uint16_t        target_id;
47109         /*
47110          * A physical address pointer pointing to a host buffer that the
47111          * command's response data will be written. This can be either a host
47112          * physical address (HPA) or a guest physical address (GPA) and must
47113          * point to a physically contiguous block of memory.
47114          */
47115         uint64_t        resp_addr;
47116 } __rte_packed;
47117
47118 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
47119 struct hwrm_nvm_get_dir_info_output {
47120         /* The specific error status for the command. */
47121         uint16_t        error_code;
47122         /* The HWRM command request type. */
47123         uint16_t        req_type;
47124         /* The sequence ID from the original command. */
47125         uint16_t        seq_id;
47126         /* The length of the response data in number of bytes. */
47127         uint16_t        resp_len;
47128         /* Number of directory entries in the directory. */
47129         uint32_t        entries;
47130         /* Size of each directory entry, in bytes. */
47131         uint32_t        entry_length;
47132         uint8_t unused_0[7];
47133         /*
47134          * This field is used in Output records to indicate that the output
47135          * is completely written to RAM.  This field should be read as '1'
47136          * to indicate that the output has been completely written.
47137          * When writing a command completion or response to an internal processor,
47138          * the order of writes has to be such that this field is written last.
47139          */
47140         uint8_t valid;
47141 } __rte_packed;
47142
47143 /******************
47144  * hwrm_nvm_write *
47145  ******************/
47146
47147
47148 /* hwrm_nvm_write_input (size:384b/48B) */
47149 struct hwrm_nvm_write_input {
47150         /* The HWRM command request type. */
47151         uint16_t        req_type;
47152         /*
47153          * The completion ring to send the completion event on. This should
47154          * be the NQ ID returned from the `nq_alloc` HWRM command.
47155          */
47156         uint16_t        cmpl_ring;
47157         /*
47158          * The sequence ID is used by the driver for tracking multiple
47159          * commands. This ID is treated as opaque data by the firmware and
47160          * the value is returned in the `hwrm_resp_hdr` upon completion.
47161          */
47162         uint16_t        seq_id;
47163         /*
47164          * The target ID of the command:
47165          * * 0x0-0xFFF8 - The function ID
47166          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47167          * * 0xFFFD - Reserved for user-space HWRM interface
47168          * * 0xFFFF - HWRM
47169          */
47170         uint16_t        target_id;
47171         /*
47172          * A physical address pointer pointing to a host buffer that the
47173          * command's response data will be written. This can be either a host
47174          * physical address (HPA) or a guest physical address (GPA) and must
47175          * point to a physically contiguous block of memory.
47176          */
47177         uint64_t        resp_addr;
47178         /*
47179          * 64-bit Host Source Address.
47180          * This is where the source data is.
47181          */
47182         uint64_t        host_src_addr;
47183         /*
47184          * The Directory Entry Type (valid values are defined in the
47185          * bnxnvm_directory_type enum defined in the file bnxnvm_defs.h).
47186          */
47187         uint16_t        dir_type;
47188         /*
47189          * Directory ordinal.
47190          * The 0-based instance of the combined Directory Entry Type and Extension.
47191          */
47192         uint16_t        dir_ordinal;
47193         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file bnxnvm_defs.h). */
47194         uint16_t        dir_ext;
47195         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file bnxnvm_defs.h). */
47196         uint16_t        dir_attr;
47197         /*
47198          * Length of data to write, in bytes.May be
47199          * less than or equal to the allocated size for the directory entry.
47200          * The data length stored in the directory entry will be updated to
47201          * reflect this value once the write is complete.
47202          */
47203         uint32_t        dir_data_length;
47204         /* Option. */
47205         uint16_t        option;
47206         uint16_t        flags;
47207         /*
47208          * When this bit is '1', the original active image
47209          * will not be removed. TBD: what purpose is this?
47210          */
47211         #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG \
47212                 UINT32_C(0x1)
47213         /*
47214          * The requested length of the allocated NVM for the item, in bytes.
47215          * This value may be greater than or equal to the specified data length (dir_data_length).
47216          * If this value is less than the specified data length, it will be ignored.
47217          * The response will contain the actual allocated item length, which may
47218          * be greater than the requested item length.
47219          * The purpose for allocating more than the required number of bytes for
47220          * an item's data is to pre-allocate extra storage (padding) to accommodate
47221          * the potential future growth of an item (e.g. upgraded firmware with
47222          * a size increase, log growth, expanded configuration data).
47223          */
47224         uint32_t        dir_item_length;
47225         uint32_t        unused_0;
47226 } __rte_packed;
47227
47228 /* hwrm_nvm_write_output (size:128b/16B) */
47229 struct hwrm_nvm_write_output {
47230         /* The specific error status for the command. */
47231         uint16_t        error_code;
47232         /* The HWRM command request type. */
47233         uint16_t        req_type;
47234         /* The sequence ID from the original command. */
47235         uint16_t        seq_id;
47236         /* The length of the response data in number of bytes. */
47237         uint16_t        resp_len;
47238         /*
47239          * Length of the allocated NVM for the item, in bytes. The value may be
47240          * greater than or equal to the specified data length or the requested item length.
47241          * The actual item length used when creating a new directory entry will
47242          * be a multiple of an NVM block size.
47243          */
47244         uint32_t        dir_item_length;
47245         /* The directory index of the created or modified item. */
47246         uint16_t        dir_idx;
47247         uint8_t unused_0;
47248         /*
47249          * This field is used in Output records to indicate that the output
47250          * is completely written to RAM.  This field should be read as '1'
47251          * to indicate that the output has been completely written.
47252          * When writing a command completion or response to an internal processor,
47253          * the order of writes has to be such that this field is written last.
47254          */
47255         uint8_t valid;
47256 } __rte_packed;
47257
47258 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
47259 struct hwrm_nvm_write_cmd_err {
47260         /*
47261          * command specific error codes that goes to
47262          * the cmd_err field in Common HWRM Error Response.
47263          */
47264         uint8_t code;
47265         /* Unknown error */
47266         #define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
47267         /* Unable to complete operation due to fragmentation */
47268         #define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
47269         /* nvm is completely full. */
47270         #define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
47271         #define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST \
47272                 HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
47273         uint8_t unused_0[7];
47274 } __rte_packed;
47275
47276 /*******************
47277  * hwrm_nvm_modify *
47278  *******************/
47279
47280
47281 /* hwrm_nvm_modify_input (size:320b/40B) */
47282 struct hwrm_nvm_modify_input {
47283         /* The HWRM command request type. */
47284         uint16_t        req_type;
47285         /*
47286          * The completion ring to send the completion event on. This should
47287          * be the NQ ID returned from the `nq_alloc` HWRM command.
47288          */
47289         uint16_t        cmpl_ring;
47290         /*
47291          * The sequence ID is used by the driver for tracking multiple
47292          * commands. This ID is treated as opaque data by the firmware and
47293          * the value is returned in the `hwrm_resp_hdr` upon completion.
47294          */
47295         uint16_t        seq_id;
47296         /*
47297          * The target ID of the command:
47298          * * 0x0-0xFFF8 - The function ID
47299          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47300          * * 0xFFFD - Reserved for user-space HWRM interface
47301          * * 0xFFFF - HWRM
47302          */
47303         uint16_t        target_id;
47304         /*
47305          * A physical address pointer pointing to a host buffer that the
47306          * command's response data will be written. This can be either a host
47307          * physical address (HPA) or a guest physical address (GPA) and must
47308          * point to a physically contiguous block of memory.
47309          */
47310         uint64_t        resp_addr;
47311         /*
47312          * 64-bit Host Source Address.
47313          * This is where the modified data is.
47314          */
47315         uint64_t        host_src_addr;
47316         /* 16-bit directory entry index. */
47317         uint16_t        dir_idx;
47318         uint16_t        flags;
47319         /*
47320          * This flag indicates the sender wants to modify a continuous NVRAM
47321          * area using a batch of this HWRM requests. The offset of a request
47322          * must be continuous to the end of previous request's. Firmware does
47323          * not update the directory entry until receiving the last request,
47324          * which is indicated by the batch_last flag.
47325          * This flag is set usually when a sender does not have a block of
47326          * memory that is big enough to hold the entire NVRAM data for send
47327          * at one time.
47328          */
47329         #define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_MODE     UINT32_C(0x1)
47330         /*
47331          * This flag can be used only when the batch_mode flag is set.
47332          * It indicates this request is the last of batch requests.
47333          */
47334         #define HWRM_NVM_MODIFY_INPUT_FLAGS_BATCH_LAST     UINT32_C(0x2)
47335         /* 32-bit NVRAM byte-offset to modify content from. */
47336         uint32_t        offset;
47337         /*
47338          * Length of data to be modified, in bytes. The length shall
47339          * be non-zero.
47340          */
47341         uint32_t        len;
47342         uint8_t unused_1[4];
47343 } __rte_packed;
47344
47345 /* hwrm_nvm_modify_output (size:128b/16B) */
47346 struct hwrm_nvm_modify_output {
47347         /* The specific error status for the command. */
47348         uint16_t        error_code;
47349         /* The HWRM command request type. */
47350         uint16_t        req_type;
47351         /* The sequence ID from the original command. */
47352         uint16_t        seq_id;
47353         /* The length of the response data in number of bytes. */
47354         uint16_t        resp_len;
47355         uint8_t unused_0[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 processor,
47361          * the order of writes has to be such that this field is written last.
47362          */
47363         uint8_t valid;
47364 } __rte_packed;
47365
47366 /***************************
47367  * hwrm_nvm_find_dir_entry *
47368  ***************************/
47369
47370
47371 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
47372 struct hwrm_nvm_find_dir_entry_input {
47373         /* The HWRM command request type. */
47374         uint16_t        req_type;
47375         /*
47376          * The completion ring to send the completion event on. This should
47377          * be the NQ ID returned from the `nq_alloc` HWRM command.
47378          */
47379         uint16_t        cmpl_ring;
47380         /*
47381          * The sequence ID is used by the driver for tracking multiple
47382          * commands. This ID is treated as opaque data by the firmware and
47383          * the value is returned in the `hwrm_resp_hdr` upon completion.
47384          */
47385         uint16_t        seq_id;
47386         /*
47387          * The target ID of the command:
47388          * * 0x0-0xFFF8 - The function ID
47389          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47390          * * 0xFFFD - Reserved for user-space HWRM interface
47391          * * 0xFFFF - HWRM
47392          */
47393         uint16_t        target_id;
47394         /*
47395          * A physical address pointer pointing to a host buffer that the
47396          * command's response data will be written. This can be either a host
47397          * physical address (HPA) or a guest physical address (GPA) and must
47398          * point to a physically contiguous block of memory.
47399          */
47400         uint64_t        resp_addr;
47401         uint32_t        enables;
47402         /*
47403          * This bit must be '1' for the dir_idx_valid field to be
47404          * configured.
47405          */
47406         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID \
47407                 UINT32_C(0x1)
47408         /* Directory Entry Index */
47409         uint16_t        dir_idx;
47410         /* Directory Entry (Image) Type */
47411         uint16_t        dir_type;
47412         /*
47413          * Directory ordinal.
47414          * The instance of this Directory Type
47415          */
47416         uint16_t        dir_ordinal;
47417         /* The Directory Entry Extension flags. */
47418         uint16_t        dir_ext;
47419         /* This value indicates the search option using dir_ordinal. */
47420         uint8_t opt_ordinal;
47421         /* This value indicates the search option using dir_ordinal. */
47422         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
47423         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
47424         /* Equal to specified ordinal value. */
47425         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ    UINT32_C(0x0)
47426         /* Greater than or equal to specified ordinal value */
47427         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE    UINT32_C(0x1)
47428         /* Greater than specified ordinal value */
47429         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT    UINT32_C(0x2)
47430         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST \
47431                 HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
47432         uint8_t unused_0[3];
47433 } __rte_packed;
47434
47435 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
47436 struct hwrm_nvm_find_dir_entry_output {
47437         /* The specific error status for the command. */
47438         uint16_t        error_code;
47439         /* The HWRM command request type. */
47440         uint16_t        req_type;
47441         /* The sequence ID from the original command. */
47442         uint16_t        seq_id;
47443         /* The length of the response data in number of bytes. */
47444         uint16_t        resp_len;
47445         /* Allocated NVRAM for this directory entry, in bytes. */
47446         uint32_t        dir_item_length;
47447         /* Size of the stored data for this directory entry, in bytes. */
47448         uint32_t        dir_data_length;
47449         /*
47450          * Firmware version.
47451          * Only valid if the directory entry is for embedded firmware stored in APE_BIN Format.
47452          */
47453         uint32_t        fw_ver;
47454         /* Directory ordinal. */
47455         uint16_t        dir_ordinal;
47456         /* Directory Entry Index */
47457         uint16_t        dir_idx;
47458         uint8_t unused_0[7];
47459         /*
47460          * This field is used in Output records to indicate that the output
47461          * is completely written to RAM.  This field should be read as '1'
47462          * to indicate that the output has been completely written.
47463          * When writing a command completion or response to an internal processor,
47464          * the order of writes has to be such that this field is written last.
47465          */
47466         uint8_t valid;
47467 } __rte_packed;
47468
47469 /****************************
47470  * hwrm_nvm_erase_dir_entry *
47471  ****************************/
47472
47473
47474 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
47475 struct hwrm_nvm_erase_dir_entry_input {
47476         /* The HWRM command request type. */
47477         uint16_t        req_type;
47478         /*
47479          * The completion ring to send the completion event on. This should
47480          * be the NQ ID returned from the `nq_alloc` HWRM command.
47481          */
47482         uint16_t        cmpl_ring;
47483         /*
47484          * The sequence ID is used by the driver for tracking multiple
47485          * commands. This ID is treated as opaque data by the firmware and
47486          * the value is returned in the `hwrm_resp_hdr` upon completion.
47487          */
47488         uint16_t        seq_id;
47489         /*
47490          * The target ID of the command:
47491          * * 0x0-0xFFF8 - The function ID
47492          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47493          * * 0xFFFD - Reserved for user-space HWRM interface
47494          * * 0xFFFF - HWRM
47495          */
47496         uint16_t        target_id;
47497         /*
47498          * A physical address pointer pointing to a host buffer that the
47499          * command's response data will be written. This can be either a host
47500          * physical address (HPA) or a guest physical address (GPA) and must
47501          * point to a physically contiguous block of memory.
47502          */
47503         uint64_t        resp_addr;
47504         /* Directory Entry Index */
47505         uint16_t        dir_idx;
47506         uint8_t unused_0[6];
47507 } __rte_packed;
47508
47509 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
47510 struct hwrm_nvm_erase_dir_entry_output {
47511         /* The specific error status for the command. */
47512         uint16_t        error_code;
47513         /* The HWRM command request type. */
47514         uint16_t        req_type;
47515         /* The sequence ID from the original command. */
47516         uint16_t        seq_id;
47517         /* The length of the response data in number of bytes. */
47518         uint16_t        resp_len;
47519         uint8_t unused_0[7];
47520         /*
47521          * This field is used in Output records to indicate that the output
47522          * is completely written to RAM.  This field should be read as '1'
47523          * to indicate that the output has been completely written.
47524          * When writing a command completion or response to an internal processor,
47525          * the order of writes has to be such that this field is written last.
47526          */
47527         uint8_t valid;
47528 } __rte_packed;
47529
47530 /*************************
47531  * hwrm_nvm_get_dev_info *
47532  *************************/
47533
47534
47535 /* hwrm_nvm_get_dev_info_input (size:128b/16B) */
47536 struct hwrm_nvm_get_dev_info_input {
47537         /* The HWRM command request type. */
47538         uint16_t        req_type;
47539         /*
47540          * The completion ring to send the completion event on. This should
47541          * be the NQ ID returned from the `nq_alloc` HWRM command.
47542          */
47543         uint16_t        cmpl_ring;
47544         /*
47545          * The sequence ID is used by the driver for tracking multiple
47546          * commands. This ID is treated as opaque data by the firmware and
47547          * the value is returned in the `hwrm_resp_hdr` upon completion.
47548          */
47549         uint16_t        seq_id;
47550         /*
47551          * The target ID of the command:
47552          * * 0x0-0xFFF8 - The function ID
47553          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47554          * * 0xFFFD - Reserved for user-space HWRM interface
47555          * * 0xFFFF - HWRM
47556          */
47557         uint16_t        target_id;
47558         /*
47559          * A physical address pointer pointing to a host buffer that the
47560          * command's response data will be written. This can be either a host
47561          * physical address (HPA) or a guest physical address (GPA) and must
47562          * point to a physically contiguous block of memory.
47563          */
47564         uint64_t        resp_addr;
47565 } __rte_packed;
47566
47567 /* hwrm_nvm_get_dev_info_output (size:640b/80B) */
47568 struct hwrm_nvm_get_dev_info_output {
47569         /* The specific error status for the command. */
47570         uint16_t        error_code;
47571         /* The HWRM command request type. */
47572         uint16_t        req_type;
47573         /* The sequence ID from the original command. */
47574         uint16_t        seq_id;
47575         /* The length of the response data in number of bytes. */
47576         uint16_t        resp_len;
47577         /* Manufacturer ID. */
47578         uint16_t        manufacturer_id;
47579         /* Device ID. */
47580         uint16_t        device_id;
47581         /* Sector size of the NVRAM device. */
47582         uint32_t        sector_size;
47583         /* Total size, in bytes of the NVRAM device. */
47584         uint32_t        nvram_size;
47585         uint32_t        reserved_size;
47586         /*
47587          * Available size that can be used, in bytes.  Available size is the
47588          * NVRAM size take away the used size and reserved size.
47589          */
47590         uint32_t        available_size;
47591         /* This field represents the major version of NVM cfg */
47592         uint8_t nvm_cfg_ver_maj;
47593         /* This field represents the minor version of NVM cfg */
47594         uint8_t nvm_cfg_ver_min;
47595         /* This field represents the update version of NVM cfg */
47596         uint8_t nvm_cfg_ver_upd;
47597         uint8_t flags;
47598         /*
47599          * If set to 1, firmware will provide various firmware version
47600          * information stored in the flash.
47601          */
47602         #define HWRM_NVM_GET_DEV_INFO_OUTPUT_FLAGS_FW_VER_VALID \
47603                 UINT32_C(0x1)
47604         /*
47605          * This field represents the board package name stored in the flash.
47606          * (ASCII chars with NULL at the end).
47607          */
47608         char    pkg_name[16];
47609         /*
47610          * This field represents the major version of HWRM firmware, stored in
47611          * the flash.
47612          */
47613         uint16_t        hwrm_fw_major;
47614         /*
47615          * This field represents the minor version of HWRM firmware, stored in
47616          * the flash.
47617          */
47618         uint16_t        hwrm_fw_minor;
47619         /*
47620          * This field represents the build version of HWRM firmware, stored in
47621          * the flash.
47622          */
47623         uint16_t        hwrm_fw_build;
47624         /*
47625          * This field can be used to represent firmware branches or customer
47626          * specific releases tied to a specific (major, minor, build) version
47627          * of the HWRM firmware.
47628          */
47629         uint16_t        hwrm_fw_patch;
47630         /*
47631          * This field represents the major version of mgmt firmware, stored in
47632          * the flash.
47633          */
47634         uint16_t        mgmt_fw_major;
47635         /*
47636          * This field represents the minor version of mgmt firmware, stored in
47637          * the flash.
47638          */
47639         uint16_t        mgmt_fw_minor;
47640         /*
47641          * This field represents the build version of mgmt firmware, stored in
47642          * the flash.
47643          */
47644         uint16_t        mgmt_fw_build;
47645         /*
47646          * This field can be used to represent firmware branches or customer
47647          * specific releases tied to a specific (major, minor, build) version
47648          * of the mgmt firmware.
47649          */
47650         uint16_t        mgmt_fw_patch;
47651         /*
47652          * This field represents the major version of roce firmware, stored in
47653          * the flash.
47654          */
47655         uint16_t        roce_fw_major;
47656         /*
47657          * This field represents the minor version of roce firmware, stored in
47658          * the flash.
47659          */
47660         uint16_t        roce_fw_minor;
47661         /*
47662          * This field represents the build version of roce firmware, stored in
47663          * the flash.
47664          */
47665         uint16_t        roce_fw_build;
47666         /*
47667          * This field can be used to represent firmware branches or customer
47668          * specific releases tied to a specific (major, minor, build) version
47669          * of the roce firmware.
47670          */
47671         uint16_t        roce_fw_patch;
47672         uint8_t unused_0[7];
47673         /*
47674          * This field is used in Output records to indicate that the output
47675          * is completely written to RAM.  This field should be read as '1'
47676          * to indicate that the output has been completely written.
47677          * When writing a command completion or response to an internal processor,
47678          * the order of writes has to be such that this field is written last.
47679          */
47680         uint8_t valid;
47681 } __rte_packed;
47682
47683 /**************************
47684  * hwrm_nvm_mod_dir_entry *
47685  **************************/
47686
47687
47688 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */
47689 struct hwrm_nvm_mod_dir_entry_input {
47690         /* The HWRM command request type. */
47691         uint16_t        req_type;
47692         /*
47693          * The completion ring to send the completion event on. This should
47694          * be the NQ ID returned from the `nq_alloc` HWRM command.
47695          */
47696         uint16_t        cmpl_ring;
47697         /*
47698          * The sequence ID is used by the driver for tracking multiple
47699          * commands. This ID is treated as opaque data by the firmware and
47700          * the value is returned in the `hwrm_resp_hdr` upon completion.
47701          */
47702         uint16_t        seq_id;
47703         /*
47704          * The target ID of the command:
47705          * * 0x0-0xFFF8 - The function ID
47706          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47707          * * 0xFFFD - Reserved for user-space HWRM interface
47708          * * 0xFFFF - HWRM
47709          */
47710         uint16_t        target_id;
47711         /*
47712          * A physical address pointer pointing to a host buffer that the
47713          * command's response data will be written. This can be either a host
47714          * physical address (HPA) or a guest physical address (GPA) and must
47715          * point to a physically contiguous block of memory.
47716          */
47717         uint64_t        resp_addr;
47718         uint32_t        enables;
47719         /*
47720          * This bit must be '1' for the checksum field to be
47721          * configured.
47722          */
47723         #define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM     UINT32_C(0x1)
47724         /* Directory Entry Index */
47725         uint16_t        dir_idx;
47726         /*
47727          * Directory ordinal.
47728          * The (0-based) instance of this Directory Type.
47729          */
47730         uint16_t        dir_ordinal;
47731         /*
47732          * The Directory Entry Extension flags (see BNX_DIR_EXT_* for
47733          * extension flag definitions).
47734          */
47735         uint16_t        dir_ext;
47736         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute flag definitions). */
47737         uint16_t        dir_attr;
47738         /*
47739          * If valid, then this field updates the checksum
47740          * value of the content in the directory entry.
47741          */
47742         uint32_t        checksum;
47743 } __rte_packed;
47744
47745 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
47746 struct hwrm_nvm_mod_dir_entry_output {
47747         /* The specific error status for the command. */
47748         uint16_t        error_code;
47749         /* The HWRM command request type. */
47750         uint16_t        req_type;
47751         /* The sequence ID from the original command. */
47752         uint16_t        seq_id;
47753         /* The length of the response data in number of bytes. */
47754         uint16_t        resp_len;
47755         uint8_t unused_0[7];
47756         /*
47757          * This field is used in Output records to indicate that the output
47758          * is completely written to RAM.  This field should be read as '1'
47759          * to indicate that the output has been completely written.
47760          * When writing a command completion or response to an internal processor,
47761          * the order of writes has to be such that this field is written last.
47762          */
47763         uint8_t valid;
47764 } __rte_packed;
47765
47766 /**************************
47767  * hwrm_nvm_verify_update *
47768  **************************/
47769
47770
47771 /* hwrm_nvm_verify_update_input (size:192b/24B) */
47772 struct hwrm_nvm_verify_update_input {
47773         /* The HWRM command request type. */
47774         uint16_t        req_type;
47775         /*
47776          * The completion ring to send the completion event on. This should
47777          * be the NQ ID returned from the `nq_alloc` HWRM command.
47778          */
47779         uint16_t        cmpl_ring;
47780         /*
47781          * The sequence ID is used by the driver for tracking multiple
47782          * commands. This ID is treated as opaque data by the firmware and
47783          * the value is returned in the `hwrm_resp_hdr` upon completion.
47784          */
47785         uint16_t        seq_id;
47786         /*
47787          * The target ID of the command:
47788          * * 0x0-0xFFF8 - The function ID
47789          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47790          * * 0xFFFD - Reserved for user-space HWRM interface
47791          * * 0xFFFF - HWRM
47792          */
47793         uint16_t        target_id;
47794         /*
47795          * A physical address pointer pointing to a host buffer that the
47796          * command's response data will be written. This can be either a host
47797          * physical address (HPA) or a guest physical address (GPA) and must
47798          * point to a physically contiguous block of memory.
47799          */
47800         uint64_t        resp_addr;
47801         /* Directory Entry Type, to be verified. */
47802         uint16_t        dir_type;
47803         /*
47804          * Directory ordinal.
47805          * The instance of the Directory Type to be verified.
47806          */
47807         uint16_t        dir_ordinal;
47808         /*
47809          * The Directory Entry Extension flags.
47810          * The "UPDATE" extension flag must be set in this value.
47811          * A corresponding directory entry with the same type and ordinal values but *without*
47812          * the "UPDATE" extension flag must also exist. The other flags of the extension must
47813          * be identical between the active and update entries.
47814          */
47815         uint16_t        dir_ext;
47816         uint8_t unused_0[2];
47817 } __rte_packed;
47818
47819 /* hwrm_nvm_verify_update_output (size:128b/16B) */
47820 struct hwrm_nvm_verify_update_output {
47821         /* The specific error status for the command. */
47822         uint16_t        error_code;
47823         /* The HWRM command request type. */
47824         uint16_t        req_type;
47825         /* The sequence ID from the original command. */
47826         uint16_t        seq_id;
47827         /* The length of the response data in number of bytes. */
47828         uint16_t        resp_len;
47829         uint8_t unused_0[7];
47830         /*
47831          * This field is used in Output records to indicate that the output
47832          * is completely written to RAM.  This field should be read as '1'
47833          * to indicate that the output has been completely written.
47834          * When writing a command completion or response to an internal processor,
47835          * the order of writes has to be such that this field is written last.
47836          */
47837         uint8_t valid;
47838 } __rte_packed;
47839
47840 /***************************
47841  * hwrm_nvm_install_update *
47842  ***************************/
47843
47844
47845 /* hwrm_nvm_install_update_input (size:192b/24B) */
47846 struct hwrm_nvm_install_update_input {
47847         /* The HWRM command request type. */
47848         uint16_t        req_type;
47849         /*
47850          * The completion ring to send the completion event on. This should
47851          * be the NQ ID returned from the `nq_alloc` HWRM command.
47852          */
47853         uint16_t        cmpl_ring;
47854         /*
47855          * The sequence ID is used by the driver for tracking multiple
47856          * commands. This ID is treated as opaque data by the firmware and
47857          * the value is returned in the `hwrm_resp_hdr` upon completion.
47858          */
47859         uint16_t        seq_id;
47860         /*
47861          * The target ID of the command:
47862          * * 0x0-0xFFF8 - The function ID
47863          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
47864          * * 0xFFFD - Reserved for user-space HWRM interface
47865          * * 0xFFFF - HWRM
47866          */
47867         uint16_t        target_id;
47868         /*
47869          * A physical address pointer pointing to a host buffer that the
47870          * command's response data will be written. This can be either a host
47871          * physical address (HPA) or a guest physical address (GPA) and must
47872          * point to a physically contiguous block of memory.
47873          */
47874         uint64_t        resp_addr;
47875         /*
47876          * Installation type. If the value 3 through 0xffff is used,
47877          * only packaged items with that type value will be installed and
47878          * conditional installation directives for those packaged items
47879          * will be over-ridden (i.e. 'create' or 'replace' will be treated
47880          * as 'install').
47881          */
47882         uint32_t        install_type;
47883         /*
47884          * Perform a normal package installation. Conditional installation
47885          * directives (e.g. 'create' and 'replace') of packaged items
47886          * will be followed.
47887          */
47888         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
47889         /*
47890          * Install all packaged items regardless of installation directive
47891          * (i.e. treat all packaged items as though they have an installation
47892          * directive of 'install').
47893          */
47894         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL \
47895                 UINT32_C(0xffffffff)
47896         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST \
47897                 HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL
47898         uint16_t        flags;
47899         /* If set to 1, then securely erase all unused locations in persistent storage. */
47900         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE \
47901                 UINT32_C(0x1)
47902         /*
47903          * If set to 1, then unspecified images, images not in the package file,
47904          * will be safely deleted.
47905          * When combined with erase_unused_space then unspecified images will be
47906          * securely erased.
47907          */
47908         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG \
47909                 UINT32_C(0x2)
47910         /*
47911          * If set to 1, FW will defragment the NVM if defragmentation is required for the update.
47912          * Allow additional time for this command to complete if this bit is set to 1.
47913          */
47914         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG \
47915                 UINT32_C(0x4)
47916         /*
47917          * If set to 1, FW will verify the package in the "UPDATE" NVM item
47918          * without installing it. This flag is for FW internal use only.
47919          * Users should not set this flag. The request will otherwise fail.
47920          */
47921         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_VERIFY_ONLY \
47922                 UINT32_C(0x8)
47923         uint8_t unused_0[2];
47924 } __rte_packed;
47925
47926 /* hwrm_nvm_install_update_output (size:192b/24B) */
47927 struct hwrm_nvm_install_update_output {
47928         /* The specific error status for the command. */
47929         uint16_t        error_code;
47930         /* The HWRM command request type. */
47931         uint16_t        req_type;
47932         /* The sequence ID from the original command. */
47933         uint16_t        seq_id;
47934         /* The length of the response data in number of bytes. */
47935         uint16_t        resp_len;
47936         /*
47937          * Bit-mask of successfully installed items.
47938          * Bit-0 corresponding to the first packaged item, Bit-1 for the second item, etc.
47939          * A value of 0 indicates that no items were successfully installed.
47940          */
47941         uint64_t        installed_items;
47942         /* result is 8 b */
47943         uint8_t result;
47944         /* There was no problem with the package installation. */
47945         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS UINT32_C(0x0)
47946         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST \
47947                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS
47948         /* problem_item is 8 b */
47949         uint8_t problem_item;
47950         /* There was no problem with any packaged items. */
47951         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE \
47952                 UINT32_C(0x0)
47953         /* There was a problem with the NVM package itself. */
47954         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE \
47955                 UINT32_C(0xff)
47956         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST \
47957                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE
47958         /* reset_required is 8 b */
47959         uint8_t reset_required;
47960         /*
47961          * No reset is required for installed/updated firmware or
47962          * microcode to take effect.
47963          */
47964         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE \
47965                 UINT32_C(0x0)
47966         /*
47967          * A PCIe reset (e.g. system reboot) is
47968          * required for newly installed/updated firmware or
47969          * microcode to take effect.
47970          */
47971         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI \
47972                 UINT32_C(0x1)
47973         /*
47974          * A controller power reset (e.g. system power-cycle) is
47975          * required for newly installed/updated firmware or
47976          * microcode to take effect. Some newly installed/updated
47977          * firmware or microcode may still take effect upon the
47978          * next PCIe reset.
47979          */
47980         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER \
47981                 UINT32_C(0x2)
47982         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST \
47983                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER
47984         uint8_t unused_0[4];
47985         /*
47986          * This field is used in Output records to indicate that the output
47987          * is completely written to RAM.  This field should be read as '1'
47988          * to indicate that the output has been completely written.
47989          * When writing a command completion or response to an internal processor,
47990          * the order of writes has to be such that this field is written last.
47991          */
47992         uint8_t valid;
47993 } __rte_packed;
47994
47995 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
47996 struct hwrm_nvm_install_update_cmd_err {
47997         /*
47998          * command specific error codes that goes to
47999          * the cmd_err field in Common HWRM Error Response.
48000          */
48001         uint8_t code;
48002         /* Unknown error */
48003         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
48004         /* Unable to complete operation due to fragmentation */
48005         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
48006         /* nvm is completely full. */
48007         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
48008         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST \
48009                 HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE
48010         uint8_t unused_0[7];
48011 } __rte_packed;
48012
48013 /******************
48014  * hwrm_nvm_flush *
48015  ******************/
48016
48017
48018 /* hwrm_nvm_flush_input (size:128b/16B) */
48019 struct hwrm_nvm_flush_input {
48020         /* The HWRM command request type. */
48021         uint16_t        req_type;
48022         /*
48023          * The completion ring to send the completion event on. This should
48024          * be the NQ ID returned from the `nq_alloc` HWRM command.
48025          */
48026         uint16_t        cmpl_ring;
48027         /*
48028          * The sequence ID is used by the driver for tracking multiple
48029          * commands. This ID is treated as opaque data by the firmware and
48030          * the value is returned in the `hwrm_resp_hdr` upon completion.
48031          */
48032         uint16_t        seq_id;
48033         /*
48034          * The target ID of the command:
48035          * * 0x0-0xFFF8 - The function ID
48036          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48037          * * 0xFFFD - Reserved for user-space HWRM interface
48038          * * 0xFFFF - HWRM
48039          */
48040         uint16_t        target_id;
48041         /*
48042          * A physical address pointer pointing to a host buffer that the
48043          * command's response data will be written. This can be either a host
48044          * physical address (HPA) or a guest physical address (GPA) and must
48045          * point to a physically contiguous block of memory.
48046          */
48047         uint64_t        resp_addr;
48048 } __rte_packed;
48049
48050 /* hwrm_nvm_flush_output (size:128b/16B) */
48051 struct hwrm_nvm_flush_output {
48052         /* The specific error status for the command. */
48053         uint16_t        error_code;
48054         /* The HWRM command request type. */
48055         uint16_t        req_type;
48056         /* The sequence ID from the original command. */
48057         uint16_t        seq_id;
48058         /* The length of the response data in number of bytes. */
48059         uint16_t        resp_len;
48060         uint8_t unused_0[7];
48061         /*
48062          * This field is used in Output records to indicate that the output
48063          * is completely written to RAM.  This field should be read as '1'
48064          * to indicate that the output has been completely written.
48065          * When writing a command completion or response to an internal processor,
48066          * the order of writes has to be such that this field is written last.
48067          */
48068         uint8_t valid;
48069 } __rte_packed;
48070
48071 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
48072 struct hwrm_nvm_flush_cmd_err {
48073         /*
48074          * command specific error codes that goes to
48075          * the cmd_err field in Common HWRM Error Response.
48076          */
48077         uint8_t code;
48078         /* Unknown error */
48079         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
48080         /* flush could not be performed */
48081         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL    UINT32_C(0x1)
48082         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST \
48083                 HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
48084         uint8_t unused_0[7];
48085 } __rte_packed;
48086
48087 /*************************
48088  * hwrm_nvm_get_variable *
48089  *************************/
48090
48091
48092 /* hwrm_nvm_get_variable_input (size:320b/40B) */
48093 struct hwrm_nvm_get_variable_input {
48094         /* The HWRM command request type. */
48095         uint16_t        req_type;
48096         /*
48097          * The completion ring to send the completion event on. This should
48098          * be the NQ ID returned from the `nq_alloc` HWRM command.
48099          */
48100         uint16_t        cmpl_ring;
48101         /*
48102          * The sequence ID is used by the driver for tracking multiple
48103          * commands. This ID is treated as opaque data by the firmware and
48104          * the value is returned in the `hwrm_resp_hdr` upon completion.
48105          */
48106         uint16_t        seq_id;
48107         /*
48108          * The target ID of the command:
48109          * * 0x0-0xFFF8 - The function ID
48110          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48111          * * 0xFFFD - Reserved for user-space HWRM interface
48112          * * 0xFFFF - HWRM
48113          */
48114         uint16_t        target_id;
48115         /*
48116          * A physical address pointer pointing to a host buffer that the
48117          * command's response data will be written. This can be either a host
48118          * physical address (HPA) or a guest physical address (GPA) and must
48119          * point to a physically contiguous block of memory.
48120          */
48121         uint64_t        resp_addr;
48122         /*
48123          * This is the host address where
48124          * nvm variable will be stored
48125          */
48126         uint64_t        dest_data_addr;
48127         /* size of data in bits */
48128         uint16_t        data_len;
48129         /* nvm cfg option number */
48130         uint16_t        option_num;
48131         /* reserved. */
48132         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
48133         /* reserved. */
48134         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
48135                 UINT32_C(0xffff)
48136         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST \
48137                 HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
48138         /*
48139          * Number of dimensions for this nvm configuration variable.
48140          * This value indicates how many of the indexN values to use.
48141          * A value of 0 means that none of the indexN values are valid.
48142          * A value of 1 requires at index0 is valued, a value of 2
48143          * requires that index0 and index1 are valid, and so forth
48144          */
48145         uint16_t        dimensions;
48146         /* index for the 1st dimensions */
48147         uint16_t        index_0;
48148         /* index for the 2nd dimensions */
48149         uint16_t        index_1;
48150         /* index for the 3rd dimensions */
48151         uint16_t        index_2;
48152         /* index for the 4th dimensions */
48153         uint16_t        index_3;
48154         uint8_t flags;
48155         /*
48156          * When this bit is set to 1, the factory default value will be returned,
48157          * 0 returns the operational value.
48158          */
48159         #define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT \
48160                 UINT32_C(0x1)
48161         uint8_t unused_0;
48162 } __rte_packed;
48163
48164 /* hwrm_nvm_get_variable_output (size:128b/16B) */
48165 struct hwrm_nvm_get_variable_output {
48166         /* The specific error status for the command. */
48167         uint16_t        error_code;
48168         /* The HWRM command request type. */
48169         uint16_t        req_type;
48170         /* The sequence ID from the original command. */
48171         uint16_t        seq_id;
48172         /* The length of the response data in number of bytes. */
48173         uint16_t        resp_len;
48174         /* size of data of the actual variable retrieved in bits */
48175         uint16_t        data_len;
48176         /*
48177          * option_num is the option number for the data retrieved.  It is possible in the
48178          * future that the option number returned would be different than requested.  This
48179          * condition could occur if an option is deprecated and a new option id is defined
48180          * with similar characteristics, but has a slightly different definition.  This
48181          * also makes it convenient for the caller to identify the variable result with
48182          * the option id from the response.
48183          */
48184         uint16_t        option_num;
48185         /* reserved. */
48186         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
48187         /* reserved. */
48188         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF \
48189                 UINT32_C(0xffff)
48190         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST \
48191                 HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF
48192         uint8_t unused_0[3];
48193         /*
48194          * This field is used in Output records to indicate that the output
48195          * is completely written to RAM.  This field should be read as '1'
48196          * to indicate that the output has been completely written.
48197          * When writing a command completion or response to an internal processor,
48198          * the order of writes has to be such that this field is written last.
48199          */
48200         uint8_t valid;
48201 } __rte_packed;
48202
48203 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
48204 struct hwrm_nvm_get_variable_cmd_err {
48205         /*
48206          * command specific error codes that goes to
48207          * the cmd_err field in Common HWRM Error Response.
48208          */
48209         uint8_t code;
48210         /* Unknown error */
48211         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
48212         /* variable does not exist */
48213         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
48214         /* configuration is corrupted and the variable cannot be saved */
48215         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
48216         /* length specified is too small */
48217         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3)
48218         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST \
48219                 HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
48220         uint8_t unused_0[7];
48221 } __rte_packed;
48222
48223 /*************************
48224  * hwrm_nvm_set_variable *
48225  *************************/
48226
48227
48228 /* hwrm_nvm_set_variable_input (size:320b/40B) */
48229 struct hwrm_nvm_set_variable_input {
48230         /* The HWRM command request type. */
48231         uint16_t        req_type;
48232         /*
48233          * The completion ring to send the completion event on. This should
48234          * be the NQ ID returned from the `nq_alloc` HWRM command.
48235          */
48236         uint16_t        cmpl_ring;
48237         /*
48238          * The sequence ID is used by the driver for tracking multiple
48239          * commands. This ID is treated as opaque data by the firmware and
48240          * the value is returned in the `hwrm_resp_hdr` upon completion.
48241          */
48242         uint16_t        seq_id;
48243         /*
48244          * The target ID of the command:
48245          * * 0x0-0xFFF8 - The function ID
48246          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48247          * * 0xFFFD - Reserved for user-space HWRM interface
48248          * * 0xFFFF - HWRM
48249          */
48250         uint16_t        target_id;
48251         /*
48252          * A physical address pointer pointing to a host buffer that the
48253          * command's response data will be written. This can be either a host
48254          * physical address (HPA) or a guest physical address (GPA) and must
48255          * point to a physically contiguous block of memory.
48256          */
48257         uint64_t        resp_addr;
48258         /*
48259          * This is the host address where
48260          * nvm variable will be copied from
48261          */
48262         uint64_t        src_data_addr;
48263         /* size of data in bits */
48264         uint16_t        data_len;
48265         /* nvm cfg option number */
48266         uint16_t        option_num;
48267         /* reserved. */
48268         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
48269         /* reserved. */
48270         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
48271                 UINT32_C(0xffff)
48272         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST \
48273                 HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
48274         /*
48275          * Number of dimensions for this nvm configuration variable.
48276          * This value indicates how many of the indexN values to use.
48277          * A value of 0 means that none of the indexN values are valid.
48278          * A value of 1 requires at index0 is valued, a value of 2
48279          * requires that index0 and index1 are valid, and so forth
48280          */
48281         uint16_t        dimensions;
48282         /* index for the 1st dimensions */
48283         uint16_t        index_0;
48284         /* index for the 2nd dimensions */
48285         uint16_t        index_1;
48286         /* index for the 3rd dimensions */
48287         uint16_t        index_2;
48288         /* index for the 4th dimensions */
48289         uint16_t        index_3;
48290         uint8_t flags;
48291         /*
48292          * When this bit is 1, flush internal cache after this write operation
48293          * (see hwrm_nvm_flush command.)
48294          */
48295         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH \
48296                 UINT32_C(0x1)
48297         /* encryption method */
48298         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK \
48299                 UINT32_C(0xe)
48300         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT           1
48301         /* No encryption. */
48302         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE \
48303                 (UINT32_C(0x0) << 1)
48304         /* one-way encryption. */
48305         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1 \
48306                 (UINT32_C(0x1) << 1)
48307         /* symmetric AES256 encryption. */
48308         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256 \
48309                 (UINT32_C(0x2) << 1)
48310         /* SHA1 digest appended to plaintext contents, for authentication */
48311         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH \
48312                 (UINT32_C(0x3) << 1)
48313         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST \
48314                 HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH
48315         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_MASK \
48316                 UINT32_C(0x70)
48317         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_SFT         4
48318         /* When this bit is 1, update the factory default region */
48319         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FACTORY_DEFAULT \
48320                 UINT32_C(0x80)
48321         uint8_t unused_0;
48322 } __rte_packed;
48323
48324 /* hwrm_nvm_set_variable_output (size:128b/16B) */
48325 struct hwrm_nvm_set_variable_output {
48326         /* The specific error status for the command. */
48327         uint16_t        error_code;
48328         /* The HWRM command request type. */
48329         uint16_t        req_type;
48330         /* The sequence ID from the original command. */
48331         uint16_t        seq_id;
48332         /* The length of the response data in number of bytes. */
48333         uint16_t        resp_len;
48334         uint8_t unused_0[7];
48335         /*
48336          * This field is used in Output records to indicate that the output
48337          * is completely written to RAM.  This field should be read as '1'
48338          * to indicate that the output has been completely written.
48339          * When writing a command completion or response to an internal processor,
48340          * the order of writes has to be such that this field is written last.
48341          */
48342         uint8_t valid;
48343 } __rte_packed;
48344
48345 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
48346 struct hwrm_nvm_set_variable_cmd_err {
48347         /*
48348          * command specific error codes that goes to
48349          * the cmd_err field in Common HWRM Error Response.
48350          */
48351         uint8_t code;
48352         /* Unknown error */
48353         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
48354         /* variable does not exist */
48355         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
48356         /* configuration is corrupted and the variable cannot be saved */
48357         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
48358         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST \
48359                 HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
48360         uint8_t unused_0[7];
48361 } __rte_packed;
48362
48363 /****************************
48364  * hwrm_nvm_validate_option *
48365  ****************************/
48366
48367
48368 /* hwrm_nvm_validate_option_input (size:320b/40B) */
48369 struct hwrm_nvm_validate_option_input {
48370         /* The HWRM command request type. */
48371         uint16_t        req_type;
48372         /*
48373          * The completion ring to send the completion event on. This should
48374          * be the NQ ID returned from the `nq_alloc` HWRM command.
48375          */
48376         uint16_t        cmpl_ring;
48377         /*
48378          * The sequence ID is used by the driver for tracking multiple
48379          * commands. This ID is treated as opaque data by the firmware and
48380          * the value is returned in the `hwrm_resp_hdr` upon completion.
48381          */
48382         uint16_t        seq_id;
48383         /*
48384          * The target ID of the command:
48385          * * 0x0-0xFFF8 - The function ID
48386          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48387          * * 0xFFFD - Reserved for user-space HWRM interface
48388          * * 0xFFFF - HWRM
48389          */
48390         uint16_t        target_id;
48391         /*
48392          * A physical address pointer pointing to a host buffer that the
48393          * command's response data will be written. This can be either a host
48394          * physical address (HPA) or a guest physical address (GPA) and must
48395          * point to a physically contiguous block of memory.
48396          */
48397         uint64_t        resp_addr;
48398         /*
48399          * This is the host address where
48400          * nvm variable will be copied from
48401          */
48402         uint64_t        src_data_addr;
48403         /* size of data in bits */
48404         uint16_t        data_len;
48405         /* nvm cfg option number */
48406         uint16_t        option_num;
48407         /* reserved. */
48408         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0 \
48409                 UINT32_C(0x0)
48410         /* reserved. */
48411         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF \
48412                 UINT32_C(0xffff)
48413         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST \
48414                 HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF
48415         /*
48416          * Number of dimensions for this nvm configuration variable.
48417          * This value indicates how many of the indexN values to use.
48418          * A value of 0 means that none of the indexN values are valid.
48419          * A value of 1 requires at index0 is valued, a value of 2
48420          * requires that index0 and index1 are valid, and so forth
48421          */
48422         uint16_t        dimensions;
48423         /* index for the 1st dimensions */
48424         uint16_t        index_0;
48425         /* index for the 2nd dimensions */
48426         uint16_t        index_1;
48427         /* index for the 3rd dimensions */
48428         uint16_t        index_2;
48429         /* index for the 4th dimensions */
48430         uint16_t        index_3;
48431         uint8_t unused_0[2];
48432 } __rte_packed;
48433
48434 /* hwrm_nvm_validate_option_output (size:128b/16B) */
48435 struct hwrm_nvm_validate_option_output {
48436         /* The specific error status for the command. */
48437         uint16_t        error_code;
48438         /* The HWRM command request type. */
48439         uint16_t        req_type;
48440         /* The sequence ID from the original command. */
48441         uint16_t        seq_id;
48442         /* The length of the response data in number of bytes. */
48443         uint16_t        resp_len;
48444         uint8_t result;
48445         /* indicates that the value provided for the option is not matching with the saved data. */
48446         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0)
48447         /* indicates that the value provided for the option is matching the saved data. */
48448         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH     UINT32_C(0x1)
48449         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST \
48450                 HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH
48451         uint8_t unused_0[6];
48452         /*
48453          * This field is used in Output records to indicate that the output
48454          * is completely written to RAM.  This field should be read as '1'
48455          * to indicate that the output has been completely written.
48456          * When writing a command completion or response to an internal processor,
48457          * the order of writes has to be such that this field is written last.
48458          */
48459         uint8_t valid;
48460 } __rte_packed;
48461
48462 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
48463 struct hwrm_nvm_validate_option_cmd_err {
48464         /*
48465          * command specific error codes that goes to
48466          * the cmd_err field in Common HWRM Error Response.
48467          */
48468         uint8_t code;
48469         /* Unknown error */
48470         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
48471         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST \
48472                 HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
48473         uint8_t unused_0[7];
48474 } __rte_packed;
48475
48476 /****************
48477  * hwrm_oem_cmd *
48478  ****************/
48479
48480
48481 /* hwrm_oem_cmd_input (size:1024b/128B) */
48482 struct hwrm_oem_cmd_input {
48483         /* The HWRM command request type. */
48484         uint16_t        req_type;
48485         /*
48486          * The completion ring to send the completion event on. This should
48487          * be the NQ ID returned from the `nq_alloc` HWRM command.
48488          */
48489         uint16_t        cmpl_ring;
48490         /*
48491          * The sequence ID is used by the driver for tracking multiple
48492          * commands. This ID is treated as opaque data by the firmware and
48493          * the value is returned in the `hwrm_resp_hdr` upon completion.
48494          */
48495         uint16_t        seq_id;
48496         /*
48497          * The target ID of the command:
48498          * * 0x0-0xFFF8 - The function ID
48499          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48500          * * 0xFFFD - Reserved for user-space HWRM interface
48501          * * 0xFFFF - HWRM
48502          */
48503         uint16_t        target_id;
48504         /*
48505          * A physical address pointer pointing to a host buffer that the
48506          * command's response data will be written. This can be either a host
48507          * physical address (HPA) or a guest physical address (GPA) and must
48508          * point to a physically contiguous block of memory.
48509          */
48510         uint64_t        resp_addr;
48511         uint32_t        IANA;
48512         uint32_t        unused_0;
48513         /* This field contains the vendor specific command data. */
48514         uint32_t        oem_data[26];
48515 } __rte_packed;
48516
48517 /* hwrm_oem_cmd_output (size:768b/96B) */
48518 struct hwrm_oem_cmd_output {
48519         /* The specific error status for the command. */
48520         uint16_t        error_code;
48521         /* The HWRM command request type. */
48522         uint16_t        req_type;
48523         /* The sequence ID from the original command. */
48524         uint16_t        seq_id;
48525         /* The length of the response data in number of bytes. */
48526         uint16_t        resp_len;
48527         uint32_t        IANA;
48528         uint32_t        unused_0;
48529         /* This field contains the vendor specific response data. */
48530         uint32_t        oem_data[18];
48531         uint8_t unused_1[7];
48532         /*
48533          * This field is used in Output records to indicate that the output
48534          * is completely written to RAM.  This field should be read as '1'
48535          * to indicate that the output has been completely written.
48536          * When writing a command completion or response to an internal processor,
48537          * the order of writes has to be such that this field is written last.
48538          */
48539         uint8_t valid;
48540 } __rte_packed;
48541
48542 /*****************
48543  * hwrm_fw_reset *
48544  ******************/
48545
48546
48547 /* hwrm_fw_reset_input (size:192b/24B) */
48548 struct hwrm_fw_reset_input {
48549         /* The HWRM command request type. */
48550         uint16_t        req_type;
48551         /*
48552          * The completion ring to send the completion event on. This should
48553          * be the NQ ID returned from the `nq_alloc` HWRM command.
48554          */
48555         uint16_t        cmpl_ring;
48556         /*
48557          * The sequence ID is used by the driver for tracking multiple
48558          * commands. This ID is treated as opaque data by the firmware and
48559          * the value is returned in the `hwrm_resp_hdr` upon completion.
48560          */
48561         uint16_t        seq_id;
48562         /*
48563          * The target ID of the command:
48564          * * 0x0-0xFFF8 - The function ID
48565          * * 0xFFF8-0xFFFE - Reserved for internal processors
48566          * * 0xFFFF - HWRM
48567          */
48568         uint16_t        target_id;
48569         /*
48570          * A physical address pointer pointing to a host buffer that the
48571          * command's response data will be written. This can be either a host
48572          * physical address (HPA) or a guest physical address (GPA) and must
48573          * point to a physically contiguous block of memory.
48574          */
48575         uint64_t        resp_addr;
48576         /* Type of embedded processor. */
48577         uint8_t embedded_proc_type;
48578         /* Boot Processor */
48579         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_BOOT \
48580                 UINT32_C(0x0)
48581         /* Management Processor */
48582         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_MGMT \
48583                 UINT32_C(0x1)
48584         /* Network control processor */
48585         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_NETCTRL \
48586                 UINT32_C(0x2)
48587         /* RoCE control processor */
48588         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_ROCE \
48589                 UINT32_C(0x3)
48590         /*
48591          * Host (in multi-host environment): This is only valid if requester is IPC.
48592          * Reinit host hardware resources and PCIe.
48593          */
48594         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST \
48595                 UINT32_C(0x4)
48596         /*
48597          * AP processor complex (in multi-host environment).
48598          * Use host_idx to control which core is reset
48599          */
48600         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_AP \
48601                 UINT32_C(0x5)
48602         /* Reset all blocks of the chip (including all processors) */
48603         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_CHIP \
48604                 UINT32_C(0x6)
48605         /*
48606          * Host (in multi-host environment): This is only valid if requester is IPC.
48607          * Reinit host hardware resources.
48608          */
48609         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT \
48610                 UINT32_C(0x7)
48611         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_LAST \
48612                 HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT
48613         /* Type of self reset. */
48614         uint8_t selfrst_status;
48615         /* No Self Reset */
48616         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTNONE \
48617                 UINT32_C(0x0)
48618         /* Self Reset as soon as possible to do so safely */
48619         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP \
48620                 UINT32_C(0x1)
48621         /* Self Reset on PCIe Reset */
48622         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTPCIERST \
48623                 UINT32_C(0x2)
48624         /* Self Reset immediately after notification to all clients. */
48625         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
48626                 UINT32_C(0x3)
48627         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_LAST \
48628                 HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
48629         /*
48630          * Indicate which host is being reset. 0 means first host.
48631          * Only valid when embedded_proc_type is host in multihost
48632          * environment
48633          */
48634         uint8_t host_idx;
48635         uint8_t flags;
48636         /*
48637          * When this bit is '1', then the core firmware initiates
48638          * the reset only after graceful shut down of all registered instances.
48639          * If not, the device will continue with the existing firmware.
48640          */
48641         #define HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL     UINT32_C(0x1)
48642         uint8_t unused_0[4];
48643 } __rte_packed;
48644
48645 /* hwrm_fw_reset_output (size:128b/16B) */
48646 struct hwrm_fw_reset_output {
48647         /* The specific error status for the command. */
48648         uint16_t        error_code;
48649         /* The HWRM command request type. */
48650         uint16_t        req_type;
48651         /* The sequence ID from the original command. */
48652         uint16_t        seq_id;
48653         /* The length of the response data in number of bytes. */
48654         uint16_t        resp_len;
48655         /* Type of self reset. */
48656         uint8_t selfrst_status;
48657         /* No Self Reset */
48658         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTNONE \
48659                 UINT32_C(0x0)
48660         /* Self Reset as soon as possible to do so safely */
48661         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTASAP \
48662                 UINT32_C(0x1)
48663         /* Self Reset on PCIe Reset */
48664         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST \
48665                 UINT32_C(0x2)
48666         /* Self Reset immediately after notification to all clients. */
48667         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
48668                 UINT32_C(0x3)
48669         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_LAST \
48670                 HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
48671         uint8_t unused_0[6];
48672         /*
48673          * This field is used in Output records to indicate that the output
48674          * is completely written to RAM.  This field should be read as '1'
48675          * to indicate that the output has been completely written.
48676          * When writing a command completion or response to an internal processor,
48677          * the order of writes has to be such that this field is written last.
48678          */
48679         uint8_t valid;
48680 } __rte_packed;
48681
48682 /**********************
48683  * hwrm_port_ts_query *
48684  ***********************/
48685
48686
48687 /* hwrm_port_ts_query_input (size:192b/24B) */
48688 struct hwrm_port_ts_query_input {
48689         /* The HWRM command request type. */
48690         uint16_t        req_type;
48691         /*
48692          * The completion ring to send the completion event on. This should
48693          * be the NQ ID returned from the `nq_alloc` HWRM command.
48694          */
48695         uint16_t        cmpl_ring;
48696         /*
48697          * The sequence ID is used by the driver for tracking multiple
48698          * commands. This ID is treated as opaque data by the firmware and
48699          * the value is returned in the `hwrm_resp_hdr` upon completion.
48700          */
48701         uint16_t        seq_id;
48702         /*
48703          * The target ID of the command:
48704          * * 0x0-0xFFF8 - The function ID
48705          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
48706          * * 0xFFFD - Reserved for user-space HWRM interface
48707          * * 0xFFFF - HWRM
48708          */
48709         uint16_t        target_id;
48710         /*
48711          * A physical address pointer pointing to a host buffer that the
48712          * command's response data will be written. This can be either a host
48713          * physical address (HPA) or a guest physical address (GPA) and must
48714          * point to a physically contiguous block of memory.
48715          */
48716         uint64_t        resp_addr;
48717         uint32_t        flags;
48718         /*
48719          * Enumeration denoting the RX, TX type of the resource.
48720          * This enumeration is used for resources that are similar for both
48721          * TX and RX paths of the chip.
48722          */
48723         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH             0x1UL
48724         /* tx path */
48725         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_TX          0x0UL
48726         /* rx path */
48727         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX          0x1UL
48728         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_LAST        \
48729                 HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX
48730         /*
48731          * If set, the response includes the current value of the free
48732          * running timer.
48733          */
48734         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_CURRENT_TIME     0x2UL
48735         /* Port ID of port that is being queried. */
48736         uint16_t        port_id;
48737         uint8_t         unused_0[2];
48738 } __rte_packed;
48739
48740 /* hwrm_port_ts_query_output (size:192b/24B) */
48741 struct hwrm_port_ts_query_output {
48742         /* The specific error status for the command. */
48743         uint16_t        error_code;
48744         /* The HWRM command request type. */
48745         uint16_t        req_type;
48746         /* The sequence ID from the original command. */
48747         uint16_t        seq_id;
48748         /* The length of the response data in number of bytes. */
48749         uint16_t        resp_len;
48750         /*
48751          * Timestamp value of PTP message captured, or current value of
48752          * free running timer.
48753          */
48754         uint32_t        ptp_msg_ts[2];
48755         /* Sequence ID of the PTP message captured. */
48756         uint16_t        ptp_msg_seqid;
48757         uint8_t         unused_0[5];
48758         /*
48759          * This field is used in Output records to indicate that the output
48760          * is completely written to RAM.  This field should be read as '1'
48761          * to indicate that the output has been completely written.
48762          * When writing a command completion or response to an internal processor,
48763          * the order of writes has to be such that this field is written last.
48764          */
48765         uint8_t         valid;
48766 } __rte_packed;
48767
48768 /*
48769  * This structure is fixed at the beginning of the ChiMP SRAM (GRC
48770  * offset: 0x31001F0). Host software is expected to read from this
48771  * location for a defined signature. If it exists, the software can
48772  * assume the presence of this structure and the validity of the
48773  * FW_STATUS location in the next field.
48774  */
48775 /* hcomm_status (size:64b/8B) */
48776 struct hcomm_status {
48777         uint32_t        sig_ver;
48778         /*
48779          * This field defines the version of the structure. The latest
48780          * version value is 1.
48781          */
48782         #define HCOMM_STATUS_VER_MASK           UINT32_C(0xff)
48783         #define HCOMM_STATUS_VER_SFT            0
48784         #define HCOMM_STATUS_VER_LATEST         UINT32_C(0x1)
48785         #define HCOMM_STATUS_VER_LAST           HCOMM_STATUS_VER_LATEST
48786         /*
48787          * This field is to store the signature value to indicate the
48788          * presence of the structure.
48789          */
48790         #define HCOMM_STATUS_SIGNATURE_MASK     UINT32_C(0xffffff00)
48791         #define HCOMM_STATUS_SIGNATURE_SFT      8
48792         #define HCOMM_STATUS_SIGNATURE_VAL      (UINT32_C(0x484353) << 8)
48793         #define HCOMM_STATUS_SIGNATURE_LAST     HCOMM_STATUS_SIGNATURE_VAL
48794         uint32_t        fw_status_loc;
48795         #define HCOMM_STATUS_TRUE_ADDR_SPACE_MASK       UINT32_C(0x3)
48796         #define HCOMM_STATUS_TRUE_ADDR_SPACE_SFT        0
48797         /* PCIE configuration space */
48798         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_PCIE_CFG  UINT32_C(0x0)
48799         /* GRC space */
48800         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_GRC       UINT32_C(0x1)
48801         /* BAR0 space */
48802         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR0      UINT32_C(0x2)
48803         /* BAR1 space */
48804         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1      UINT32_C(0x3)
48805         #define HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_LAST      \
48806                 HCOMM_STATUS_FW_STATUS_LOC_ADDR_SPACE_BAR1
48807         /*
48808          * This offset where the fw_status register is located. The value
48809          * is generally 4-byte aligned.
48810          */
48811         #define HCOMM_STATUS_TRUE_OFFSET_MASK           UINT32_C(0xfffffffc)
48812         #define HCOMM_STATUS_TRUE_OFFSET_SFT            2
48813 } __rte_packed;
48814 /* This is the GRC offset where the hcomm_status struct resides. */
48815 #define HCOMM_STATUS_STRUCT_LOC         0x31001F0UL
48816 #endif /* _HSI_STRUCT_DEF_DPDK_H_ */